diff --git a/.gitignore b/.gitignore index ee8da6cd39d..b5174c70f51 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,28 @@ frontend/micro-ui-internals/node_modules/* .idea index.lock +*.bak + +# dependencies +/node_modules +/packages/lib/* +/packages/egov-ui-kit +/packages/egov-ui-framework +/packages/pgr-citizen +/packages/pgr-employee +/packages/pt-citizen +/packages/pt-employee +/packages/egov-tradelicence +/packages/egov-pt +/packages/egov-workflow +/packages/egov-hrms +/packages/egov-mp +/packages/egov-uc +/packages/egov-noc + +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + + diff --git a/CODEOWNERS b/CODEOWNERS index 8baf2d23c82..096527c2e33 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,12 +1,9 @@ -* @gajendran-egov @sathishp-eGov -*.yaml @gajendran-egov @sathishp-eGov +* @gajendran-egov @sathishp-eGov @kavi-egov +*.yaml @gajendran-egov @sathishp-eGov @kavi-egov -* business-services/ @sathishp-eGov @talele08 @kavi-egov @sirishrao-egov -* core-services/ @sathishp-eGov @talele08 @kavi-egov @sirishrao-egov -* municipal-services/ @sathishp-eGov @talele08 @kavi-egov @sirishrao-egov -* frontend/ @sathishp-eGov @talele08 @kavi-egov @sirishrao-egov -* edcr/ @pradeep -* finance/ @elzan +business-services/ @sathishp-eGov @talele08 @kavi-egov @sirishrao-egov @subhashini-egov @talele08 +core-services/ @sathishp-eGov @talele08 @kavi-egov @sirishrao-egov @subhashini-egov @talele08 +municipal-services/ @sathishp-eGov @talele08 @kavi-egov @sirishrao-egov @subhashini-egov @talele08 @kapil-eGov @AmanKumar-eGov ##Frontend frontend/micro-ui/ @sathishp-eGov @jagankumar-egov @saurabh-egov @sirishrao-egov @@ -14,3 +11,7 @@ frontend/micro-ui-internals/ @sathishp-eGov @jagankumar-egov @saurabh-egov @siri frontend/mono-ui/ @sathishp-eGov @jagankumar-egov @sirishrao-egov +##Frontend +frontend/micro-ui/ @sathishp-eGov @jagankumar-egov @sirishrao-egov @subhashini-egov @talele08 +frontend/micro-ui-internals/ @sathishp-eGov @jagankumar-egov @sirishrao-egov @subhashini-egov @talele08 +frontend/mono-ui/ @sathishp-eGov @jagankumar-egov @sirishrao-egov @subhashini-egov @talele08 diff --git a/README.md b/README.md index 3750c3097ce..a236b2f58cb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# UPYOG (Urban Platform for deliverY of Online Governance) - -UPYOG is a set of Open APIs, services, and reference implementations, setup as a public good, to allow government entities, businesses, startups, and civil society to use a unique digital Infrastructure and build solutions for urban India at a large scale. It provides a set of open standards, specifications and documentation to create a level playing field and enable ecosystem players to innovate on the stack. As a public good, the platform is provided without profit or restriction to all members of society. +# DIGIT Urban Stack + +DIGIT is a set of Open APIs, services, and reference implementations, setup as a public good, to allow government entities, businesses, startups, and civil society to use a unique digital Infrastructure and build solutions for urban India at a large scale. It provides a set of open standards, specifications and documentation to create a level playing field and enable ecosystem players to innovate on the stack. As a public good, the platform is provided without profit or restriction to all members of society. UPYOG focuses on inclusion and is designed on the principle of enhancing both platform openness and choice for citizens. The platform uses open APIs and standards, creating a powerful framework to drive convergence across the multiple systems currently in use, and to lower the barrier to entry for locally-developed solutions. Keeping in mind that most Indians use the internet through their phones, we follow and advocate a “mobile-first” approach, while supporting multi-channel access to accommodate diverse needs and preferences. diff --git a/build/build-config.yml b/build/build-config.yml index d9e13d00ae9..1c05982da7b 100644 --- a/build/build-config.yml +++ b/build/build-config.yml @@ -300,14 +300,13 @@ config: image-name: "internal-gateway" dockerfile: "build/maven/Dockerfile" - - name: "builds/upyog/core-services/egov-user-event" + - name: "builds/upyog/municipal-services/egov-user-event" build: - - work-dir: "core-services/egov-user-event" + - work-dir: "municipal-services/egov-user-event" image-name: "egov-user-event" dockerfile: "build/maven/Dockerfile" - - work-dir: "core-services/egov-user-event/src/main/resources/db" - image-name: "egov-user-event-db" - dockerfile: "build/maven/Dockerfile" + - work-dir: "municipal-services/egov-user-event/src/main/resources/db" + image-name: "egov-user-event-db" - name: "builds/upyog/core-services/pdf-service" build: @@ -380,11 +379,16 @@ config: - work-dir: "core-services/libraries/tracer" image-name: "tracer" - - name: "builds/upyog/core-services/nlp-engine" + - name: "builds/digit-dev/core-services/libraries/digit-models" + build: + - work-dir: "core-services/libraries/digit-models" + image-name: "digit-models" + + - name: "builds/digit-dev/core-services/nlp-engine" build: - work-dir: "core-services/nlp-engine" image-name: "nlp-engine" - dockerfile: "nlp-engine/Dockerfile" + dockerfile: "core-services/nlp-engine/Dockerfile" - name: "builds/upyog/core-services/xstate-chatbot" build: @@ -392,6 +396,14 @@ config: image-name: "xstate-chatbot" - work-dir: "core-services/xstate-chatbot/nodejs/db" image-name: "xstate-chatbot-db" + + - name: "builds/digit-dev/core-services/xstate-webchat" + build: + - work-dir: "core-services/xstate-webchat/nodejs" + image-name: "xstate-webchat" + - work-dir: "core-services/xstate-webchat/nodejs/db" + image-name: "xstate-webchat-db" + - name: "builds/upyog/core-services/xstate-webchat" build: @@ -616,14 +628,14 @@ config: - work-dir: "municipal-services/birth-death-services/src/main/resources/db" image-name: "birth-death-services-db" - - name: "builds/upyog/municipal-services/birth-registration" + - name: "builds/upyog/tutorials/backend-developer-guide/btr-services" build: - - work-dir: "municipal-services/birth-registration" - image-name: "birth-registration" + - work-dir: "tutorials/backend-developer-guide/btr-services" + image-name: "btr-services" dockerfile: "build/maven/Dockerfile" - - work-dir: "municipal-services/birth-registration/src/main/resources/db" - image-name: "birth-registration-db" - + - work-dir: "tutorials/backend-developer-guide/btr-services/src/main/resources/db" + image-name: "btr-services-db" + # Utilities - name: "builds/upyog/utilities/egov-weekly-impact-notifier" diff --git a/build/maven/Dockerfile b/build/maven/Dockerfile index 6d1e68565fc..529da5f0545 100644 --- a/build/maven/Dockerfile +++ b/build/maven/Dockerfile @@ -12,7 +12,7 @@ COPY build/maven/start.sh ./start.sh # RUN mvn -B dependency:go-offline COPY ${WORK_DIR}/src ./src -RUN mvn -B -f /app/pom.xml package +RUN mvn -B -f /app/pom.xml package -Dmaven.test.skip=true -DskipTests # Create runtime image diff --git a/business-services/billing-service/pom.xml b/business-services/billing-service/pom.xml index 48b7f7fbd1a..ce474992851 100644 --- a/business-services/billing-service/pom.xml +++ b/business-services/billing-service/pom.xml @@ -24,9 +24,26 @@ 3.3.9 1.18.8 2.6 + 1.2.0.Final + org.cache2k + cache2k-api + ${cache2k-version} + + + org.cache2k + cache2k-core + ${cache2k-version} + runtime + + + org.cache2k + cache2k-spring + ${cache2k-version} + + org.springframework.boot spring-boot-starter-web @@ -52,6 +69,18 @@ org.springframework.kafka spring-kafka + + org.powermock + powermock-api-mockito + 1.6.5 + test + + + org.powermock + powermock-module-junit4 + 1.6.5 + test + org.springframework.boot spring-boot-devtools diff --git a/business-services/billing-service/src/main/java/org/egov/demand/config/ApplicationProperties.java b/business-services/billing-service/src/main/java/org/egov/demand/config/ApplicationProperties.java index 30fc7fe1221..00e246c19ab 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/config/ApplicationProperties.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/config/ApplicationProperties.java @@ -192,7 +192,20 @@ public class ApplicationProperties { @Value("${amendment.id.format.name}") private String amendmentIdFormatName; - + @Value("${statelevel.rolecode.excluded.list}") private List statelevelRolecodeExclusionList; + + @Value("${egov.shortener.url}") + private String egovShortenerUrl; + + @Value("${notification.url}") + private String notificationUrl; + + @Value("${notification.sms.link}") + private String smsNotificationLink; + + @Value("${egov.shortener.host}") + private String shortenerHost; + } \ No newline at end of file diff --git a/business-services/billing-service/src/main/java/org/egov/demand/consumer/notification/NotificationConsumer.java b/business-services/billing-service/src/main/java/org/egov/demand/consumer/notification/NotificationConsumer.java index 470723d504a..1e66b00fe61 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/consumer/notification/NotificationConsumer.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/consumer/notification/NotificationConsumer.java @@ -1,5 +1,6 @@ package org.egov.demand.consumer.notification; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; @@ -9,12 +10,15 @@ import org.apache.commons.lang3.StringUtils; import org.egov.common.contract.request.RequestInfo; import org.egov.demand.model.Bill; +import org.egov.demand.util.Constants; import org.egov.demand.model.BillDetail; +import org.egov.demand.config.ApplicationProperties; import org.egov.demand.model.BillDetailV2; import org.egov.demand.model.BillV2; -import org.egov.demand.util.Constants; +import org.egov.demand.repository.ServiceRequestRepository; import org.egov.demand.web.contract.BillRequest; import org.egov.demand.web.contract.BillRequestV2; +import org.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.kafka.annotation.KafkaListener; @@ -38,52 +42,59 @@ public class NotificationConsumer { @Value("${egov.localization.search.endpoint}") private String localizationEndpoint; - + @Value("${bill.notification.fallback.locale}") private String fallBackLocale; - + @Value("${kafka.topics.notification.sms}") private String smsTopic; @Value("${kafka.topics.cancel.bill.topic.name}") private String billCancelTopic; - + @Value("${kafka.topics.notification.sms.key}") private String smsTopickey; - - @Autowired - private ObjectMapper objectMapper; - + + @Autowired + private ObjectMapper objectMapper; + @Autowired + private ApplicationProperties config; + @Autowired private KafkaTemplate producer; - + @Autowired private RestTemplate restTemplate; - - private static final String BILLING_LOCALIZATION_MODULE = "billing-services"; + + @Autowired + private ServiceRequestRepository serviceRequestRepository; + + private static final String WS_LOCALIZATION_MODULE = "rainmaker-ws"; + private static final String WS_CONNECTION_BILL_GENERATION = "WATER_CONNECTION_BILL_GENERATION_SMS_MESSAGE"; + private static final String BILLING_LOCALIZATION_MODULE = "billing-services"; public static final String PAYMENT_MSG_LOCALIZATION_CODE = "BILLINGSERVICE_BUSINESSSERVICE_BILL_GEN_NOTIF_MSG"; public static final String BILL_CANCELLATION_MSG_LOCALIZATION_CODE = "BILLINGSERVICE_BILL_CANCELLATION_NOTIF_MSG"; public static final String BUSINESSSERVICELOCALIZATION_CODE_PREFIX = "BILLINGSERVICE_BUSINESSSERVICE_"; - + public static final String LOCALIZATION_CODES_JSONPATH = "$.messages.*.code"; public static final String LOCALIZATION_MSGS_JSONPATH = "$.messages.*.message"; - + public static final String BUSINESSSERVICE_MDMS_MASTER = "BusinessService"; public static final String BUSINESSSERVICE_CODES_JSONPATH = "$.MdmsRes.BillingService.BusinessService"; public static final String USERNAME_REPLACE_STRING = "{username}"; public static final String PERIOD_REPLACE_STRING = "{period}"; public static final String TAX_REPLACE_STRING = "{amt}"; - + public static final String MODULE_REPLACE_STRING = "{module}"; public static final String MODULE_REPLACE_STRING_VALUE = "Property Tax"; - + public static final String MODULE_PRIMARYKEY_REPLACE_STRING = "{primarykeystring}"; public static final String MODULE_PRIMARYKEY_REPLACE_STRING_VALUE = "property-id"; - + public static final String SERVICENUMBER_OF_MODULE_REPLACE_STRING = "{servicenumber}"; public static final String EXPIRY_DATE_REPLACE_STRING = "{expirydate}"; - + /** * Kafka consumer * @@ -94,11 +105,11 @@ public class NotificationConsumer { public void listen(Map record, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic) { try { - if(topic.equals(billCancelTopic)){ + if (topic.equals(billCancelTopic)) { BillRequestV2 req = objectMapper.convertValue(record, BillRequestV2.class); sendNotificationForBillCancellation(req); - }else { - BillRequest req = objectMapper.convertValue(record, BillRequest.class); + } else { + BillRequestV2 req = objectMapper.convertValue(record, BillRequestV2.class); sendNotification(req); } } catch (Exception e) { @@ -138,7 +149,8 @@ private String buildSmsBodyForBillCancellation(BillV2 bill, RequestInfo requestI content = content.replace("{OWNER_NAME}", bill.getPayerName()); content = content.replace("{SERVICE}", bill.getBusinessService()); content = content.replace("{BILLING_PERIOD}", getPeriod(detail.getFromPeriod(), detail.getToPeriod())); - content = content.replace("{REASON_FOR_CANCELLATION}", bill.getAdditionalDetails().get(Constants.CANCELLATION_REASON_MSG).textValue()); + content = content.replace("{REASON_FOR_CANCELLATION}", + bill.getAdditionalDetails().get(Constants.CANCELLATION_REASON_MSG).textValue()); } return content; @@ -148,8 +160,32 @@ private String buildSmsBodyForBillCancellation(BillV2 bill, RequestInfo requestI * Method to send notifications. * * @param billReq - * @throws Exception + * @throws Exception */ + + private void sendNotification(BillRequestV2 billReq) { + + billReq.getBills().forEach(bill -> { + if (bill.getMobileNumber() != null && bill.getTotalAmount().compareTo(BigDecimal.ZERO) > 0 + && (bill.getBusinessService().equalsIgnoreCase("WS") + || bill.getBusinessService().equalsIgnoreCase("SW"))) { + String phNo = bill.getMobileNumber(); + String message = buildSmsBody(bill, billReq.getRequestInfo()); + log.info("sendNotification :: phone:: " + phNo + " message " + message + "bill ::" + bill); + if (!StringUtils.isEmpty(message)) { + Map request = new HashMap<>(); + request.put("mobileNumber", phNo); + request.put("message", message); + producer.send(smsTopic, smsTopickey, request); + log.info("******Notification sent Successfully*******"); + } else { + log.error("No message configured! Notification will not be sent."); + } + } + }); + log.info("skipping sendNotification loop end::" + billReq); + } + private void sendNotification(BillRequest billReq) { billReq.getBills().forEach(bill -> { @@ -182,7 +218,7 @@ private String buildSmsBody(Bill bill, RequestInfo requestInfo) { BillDetail detail = bill.getBillDetails().get(0); - // notification is enabled only for PT + // notification is enabled only for PT if (bill.getMobileNumber() == null || !detail.getBusinessService().equals("PT")) return null; @@ -195,20 +231,68 @@ private String buildSmsBody(Bill bill, RequestInfo requestInfo) { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(detail.getExpiryDate()); - + content = content.replace(USERNAME_REPLACE_STRING, bill.getPayerName()); - content = content.replace(EXPIRY_DATE_REPLACE_STRING, - " "+ cal.get(Calendar.DATE) + "/" + cal.get(Calendar.MONTH) + "/" + cal.get(Calendar.YEAR)+ " ".toUpperCase()); + content = content.replace(EXPIRY_DATE_REPLACE_STRING, " " + cal.get(Calendar.DATE) + "/" + + cal.get(Calendar.MONTH) + "/" + cal.get(Calendar.YEAR) + " ".toUpperCase()); content = content.replace(PERIOD_REPLACE_STRING, getPeriod(detail.getFromPeriod(), detail.getToPeriod())); content = content.replace(SERVICENUMBER_OF_MODULE_REPLACE_STRING, detail.getConsumerCode().split(":")[0]); content = content.replace(MODULE_REPLACE_STRING, MODULE_REPLACE_STRING_VALUE); content = content.replace(MODULE_PRIMARYKEY_REPLACE_STRING, MODULE_PRIMARYKEY_REPLACE_STRING_VALUE); content = content.replace(TAX_REPLACE_STRING, detail.getTotalAmount().toString()); - + + } + return content; + } + + private String buildSmsBody(BillV2 bill, RequestInfo requestInfo) { + + log.info("build Sms Body ::"); + + BillDetailV2 detail = bill.getBillDetails().get(0); + + String tenantId = bill.getTenantId(); + String content = null; + + content = fetchContentFromLocalization(requestInfo, tenantId, WS_LOCALIZATION_MODULE, + "WATER_CONNECTION_BILL_GENERATION_SMS_MESSAGE"); + if (!StringUtils.isEmpty(content)) { + Calendar cal = Calendar.getInstance(); + log.info("detail.getExpiryDate()1 " + detail.getExpiryDate()); + cal.setTimeInMillis(detail.getExpiryDate()); + int month = cal.get(Calendar.MONTH) + 1; + content = content.replace("", + " " + cal.get(Calendar.DATE) + "/" + month + "/" + cal.get(Calendar.YEAR) + " ".toUpperCase()); + content = content.replace("", bill.getPayerName()); + if (bill.getBusinessService().contains("WS")) { + content = content.replace("", "Water Charges"); + } else { + content = content.replace("", "Sewerage Charges"); + } + log.info("::append content ::" + content); + String actionLink = config.getSmsNotificationLink().replace("$consumerCode", bill.getConsumerCode()) + .replace("$tenantId", bill.getTenantId()); + actionLink = config.getNotificationUrl() + actionLink; + actionLink = getShortnerURL(actionLink); + log.info("Action link " + actionLink); + content = content.replace("", actionLink); + + content = content.replace("", bill.getTotalAmount().toString()); + log.info("content WS" + content); } + // } return content; } + public String getShortnerURL(String actualURL) { + net.minidev.json.JSONObject obj = new net.minidev.json.JSONObject(); + obj.put("url", actualURL); + String url = config.getShortenerHost() + config.getEgovShortenerUrl(); + // Object response = serviceRequestRepository.getShorteningURL(new + // StringBuilder(url).toString(), obj); + return serviceRequestRepository.getShorteningURL(new StringBuilder(url), obj); + } + private String getPeriod(Long fromPeriod, Long toPeriod) { StringBuilder period = new StringBuilder(); @@ -220,7 +304,7 @@ private String getPeriod(Long fromPeriod, Long toPeriod) { period.append(cal.get(Calendar.YEAR)); return period.toString(); } - + /** * Generic method to fetch data from localization. * @@ -231,22 +315,24 @@ private String getPeriod(Long fromPeriod, Long toPeriod) { * @return */ private String fetchContentFromLocalization(RequestInfo requestInfo, String tenantId, String module, String code) { - + String message = null; List codes = new ArrayList<>(); List messages = new ArrayList<>(); Object result = null; String locale = ""; - - if(requestInfo.getMsgId().contains("|")) - locale= requestInfo.getMsgId().split("[\\|]")[1]; // Conventionally locale is sent in the second(1) index of msgid split by | - - if(StringUtils.isEmpty(locale)) + + if (requestInfo.getMsgId().contains("|")) + locale = requestInfo.getMsgId().split("[\\|]")[1]; // Conventionally locale is sent in the second(1) index + // of msgid split by | + + if (StringUtils.isEmpty(locale)) locale = fallBackLocale; - + StringBuilder uri = new StringBuilder(); uri.append(localizationHost).append(localizationEndpoint); - uri.append("?tenantId=").append(tenantId.split("\\.")[0]).append("&locale=").append(locale).append("&module=").append(module); + uri.append("?tenantId=").append(tenantId.split("\\.")[0]).append("&locale=").append(locale).append("&module=") + .append(module); Map request = new HashMap<>(); request.put("RequestInfo", requestInfo); try { @@ -258,7 +344,8 @@ private String fetchContentFromLocalization(RequestInfo requestInfo, String tena } if (null != result) { for (int i = 0; i < codes.size(); i++) { - if(codes.get(i).equals(code)) message = messages.get(i); + if (codes.get(i).equals(code)) + message = messages.get(i); } } return message; diff --git a/business-services/billing-service/src/main/java/org/egov/demand/model/AuditDetails.java b/business-services/billing-service/src/main/java/org/egov/demand/model/AuditDetails.java index 6d9d09346a4..7662016d42e 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/model/AuditDetails.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/model/AuditDetails.java @@ -7,6 +7,7 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; +import lombok.ToString; /** * Collection of audit related fields used by most models @@ -16,6 +17,7 @@ @AllArgsConstructor @NoArgsConstructor @Builder +@ToString public class AuditDetails { @JsonProperty("createdBy") diff --git a/business-services/billing-service/src/main/java/org/egov/demand/model/BillDetailV2.java b/business-services/billing-service/src/main/java/org/egov/demand/model/BillDetailV2.java index 2425c930870..9e8006aed7f 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/model/BillDetailV2.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/model/BillDetailV2.java @@ -48,6 +48,15 @@ public class BillDetailV2 { @JsonProperty("toPeriod") private Long toPeriod; + + @JsonProperty("businessService") + private String businessService; + + @JsonProperty("consumerCode") + private String consumerCode; + + @JsonProperty("totalAmount") + private BigDecimal totalAmount; @JsonProperty("additionalDetails") private Object additionalDetails; diff --git a/business-services/billing-service/src/main/java/org/egov/demand/model/BillSearchCriteria.java b/business-services/billing-service/src/main/java/org/egov/demand/model/BillSearchCriteria.java index f3237eb6358..7e0ac109a5d 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/model/BillSearchCriteria.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/model/BillSearchCriteria.java @@ -60,4 +60,10 @@ public class BillSearchCriteria { @Pattern(regexp = "^[0-9]{10}$", message = "MobileNumber should be 10 digit number") private String mobileNumber; + + private Long periodFrom; + + private Long periodTo; + + } diff --git a/business-services/billing-service/src/main/java/org/egov/demand/model/GenerateBillCriteria.java b/business-services/billing-service/src/main/java/org/egov/demand/model/GenerateBillCriteria.java index 148b957f7a5..19f115faac1 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/model/GenerateBillCriteria.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/model/GenerateBillCriteria.java @@ -39,6 +39,8 @@ */ package org.egov.demand.model; +import java.util.Collection; +import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -46,7 +48,8 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; - +import org.egov.demand.model.enums.DemandStatus; +import org.springframework.util.StringUtils; import org.egov.demand.model.BillV2.BillStatus; import org.hibernate.validator.constraints.SafeHtml; @@ -87,6 +90,10 @@ public class GenerateBillCriteria { @Pattern(regexp = "^[0-9]{10}$", message = "MobileNumber should be 10 digit number") private String mobileNumber; + private Long periodFrom; + + private Long periodTo; + public DemandCriteria toDemandCriteria() { Set consumerCodeSet = new HashSet<>(); @@ -95,14 +102,18 @@ public DemandCriteria toDemandCriteria() { Set demandIdSet = new HashSet<>(); demandIdSet.add(demandId); + return DemandCriteria.builder() + .status(DemandStatus.ACTIVE.toString()) .businessService(businessService) .consumerCode(consumerCodeSet) .mobileNumber(mobileNumber) - .isPaymentCompleted(false) .demandId(demandIdSet) .tenantId(tenantId) + .isPaymentCompleted(false) .email(email) + .periodFrom(periodFrom) + .periodTo(periodTo) .build(); } @@ -121,6 +132,8 @@ public BillSearchCriteria toBillSearchCriteria() { .tenantId(tenantId) .isOrderBy(true) .email(email) + .periodFrom(periodFrom) + .periodTo(periodTo) .build(); } diff --git a/business-services/billing-service/src/main/java/org/egov/demand/model/TaxHeadMasterCriteria.java b/business-services/billing-service/src/main/java/org/egov/demand/model/TaxHeadMasterCriteria.java index b81dc8f24ba..e37e8312018 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/model/TaxHeadMasterCriteria.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/model/TaxHeadMasterCriteria.java @@ -12,6 +12,7 @@ import lombok.Setter; import lombok.ToString; import lombok.Builder.Default; +import lombok.EqualsAndHashCode; @Setter @Getter @@ -19,6 +20,7 @@ @AllArgsConstructor @ToString @Builder +@EqualsAndHashCode public class TaxHeadMasterCriteria { @NotNull diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/AmendmentRepository.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/AmendmentRepository.java index 9459560efb8..1efcd293fc3 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/AmendmentRepository.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/AmendmentRepository.java @@ -5,6 +5,8 @@ import static org.egov.demand.repository.querybuilder.AmendmentQueryBuilder.AMENDMENT_UPDATE_QUERY; import static org.egov.demand.repository.querybuilder.AmendmentQueryBuilder.DOCUMET_INSERT_QUERY; +import java.sql.PreparedStatement; +import java.sql.SQLException; import java.util.ArrayList; import java.util.List; @@ -47,6 +49,8 @@ public void saveAmendment (AmendmentRequest amendmentRequest) { namedJdbcTemplate.update(AMENDMENT_INSERT_QUERY, getAmendmentSqlParameter(amendmentRequest)); saveTaxDetail(amendment.getDemandDetails(), amendment.getId()); + + if (amendment.getDocuments() != null && !amendment.getDocuments().isEmpty()) savedocs(amendment.getDocuments(), amendment.getId()); } diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java index b50f834242d..78db0fc5d82 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/BillRepositoryV2.java @@ -21,6 +21,7 @@ import org.egov.demand.repository.rowmapper.BillRowMapperV2; import org.egov.demand.util.Util; import org.egov.demand.web.contract.BillRequestV2; +import org.egov.demand.web.contract.CancelBillCriteria; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.BatchPreparedStatementSetter; import org.springframework.jdbc.core.JdbcTemplate; @@ -54,6 +55,15 @@ public List findBill(BillSearchCriteria billCriteria){ return jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), searchBillRowMapper); } +public String getLatestActiveBillId(CancelBillCriteria cancelBillCriteria){ + + List preparedStatementValues = new ArrayList<>(); + String queryStr = billQueryBuilder.getLatestBillQuery( preparedStatementValues, cancelBillCriteria); + log.debug("query:::"+queryStr+" preparedStatementValues::"+preparedStatementValues); + return jdbcTemplate.queryForObject(queryStr, preparedStatementValues.toArray(), String.class); + } + + @Transactional public void saveBill(BillRequestV2 billRequest){ diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/DemandRepository.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/DemandRepository.java index da291ede683..51ba064ca3d 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/DemandRepository.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/DemandRepository.java @@ -198,6 +198,7 @@ public void setValues(PreparedStatement ps, int rowNum) throws SQLException { ps.setObject(15, util.getPGObject(demand.getAdditionalDetails())); ps.setObject(16, demand.getBillExpiryTime()); ps.setObject(17, null); + ps.setObject(18, demand.getIsPaymentCompleted()); } @Override diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/ServiceRequestRepository.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/ServiceRequestRepository.java index 0a1081d526d..abe832f58f6 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/ServiceRequestRepository.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/ServiceRequestRepository.java @@ -57,4 +57,26 @@ public Map fetchResult(String uri, Object request) { return response; } + + + public String getShorteningURL(StringBuilder uri, Object request) { + mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); + String response = null; + log.info("getShorteningURL :"+uri); + StringBuilder str = new StringBuilder(this.getClass().getCanonicalName()).append(".fetchResult:") + .append(System.lineSeparator()); + str.append("URI: ").append(uri.toString()).append(System.lineSeparator()); + try { + log.debug(str.toString()); + response = restTemplate.postForObject(uri.toString(), request, String.class); + } catch (HttpClientErrorException e) { + log.error("External Service threw an Exception: ", e); + throw new ServiceCallException(e.getResponseBodyAsString()); + } catch (Exception e) { + log.error("Exception while fetching from searcher: ", e); + } + log.info(" response "+ response); + return response; + } + } \ No newline at end of file diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/AmendmentQueryBuilder.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/AmendmentQueryBuilder.java index 15b108b21c9..6054c4e3443 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/AmendmentQueryBuilder.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/AmendmentQueryBuilder.java @@ -1,6 +1,10 @@ package org.egov.demand.repository.querybuilder; +import java.util.List; + import org.egov.demand.amendment.model.AmendmentCriteria; +import org.egov.demand.util.Util; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.stereotype.Component; @@ -9,6 +13,8 @@ @Component public class AmendmentQueryBuilder { + @Autowired + private Util util; @Value("${amendment.default.limit}") private Integer defaultLimit; @@ -39,7 +45,7 @@ public class AmendmentQueryBuilder { + " FROM egbs_amendment amendment " + " INNER JOIN " + " egbs_amendment_taxdetail amdl ON amendment.id = amdl.amendmentid " - + " INNER JOIN egbs_document doc ON amendment.id = doc.amendmentid " + + " LEFT OUTER JOIN egbs_document doc ON amendment.id = doc.amendmentid " + " INNER JOIN (SELECT id, tenantid FROM egbs_amendment amendment WHERE {$WHERE} {$PAGE}) pagedresult " + " ON amendment.id = pagedresult.id AND amendment.tenantid = pagedresult.tenantid "; diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/BillQueryBuilder.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/BillQueryBuilder.java index 67deb297d5b..bf2601b37bc 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/BillQueryBuilder.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/BillQueryBuilder.java @@ -1,52 +1,62 @@ package org.egov.demand.repository.querybuilder; +import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Set; + +import org.egov.demand.config.ApplicationProperties; + import org.egov.demand.model.BillSearchCriteria; import org.egov.demand.model.BillV2.BillStatus; +import org.egov.demand.web.contract.CancelBillCriteria; import org.egov.demand.model.UpdateBillCriteria; import org.egov.demand.util.Util; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; +import org.egov.demand.util.Constants; @Component public class BillQueryBuilder { - + + @Autowired + private ApplicationProperties applicationProperties; @Autowired private Util util; - + public static final String REPLACE_STRING = "{replace}"; - + public static final String BILL_STATUS_UPDATE_BASE_QUERY = "UPDATE egbs_bill_v1 SET status=? {replace} WHERE status='ACTIVE' AND tenantId = ? "; - + public static final String BILL_STATUS_UPDATE_QUERY = "UPDATE egbs_bill_v1 SET status=? WHERE status='ACTIVE' "; + + public static final String BILL_STATUS_UPDATE_BATCH_QUERY = "UPDATE egbs_bill_v1 SET status=? WHERE id = ?"; + public static final String INSERT_BILL_QUERY = "INSERT into egbs_bill_v1 " - +"(id, tenantid, payername, payeraddress, payeremail, isactive, iscancelled, createdby, createddate, lastmodifiedby, lastmodifieddate," - +" mobilenumber, status, additionaldetails, payerid, consumercode)" - +"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - + + "(id, tenantid, payername, payeraddress, payeremail, isactive, iscancelled, createdby, createddate, lastmodifiedby, lastmodifieddate," + + " mobilenumber, status, additionaldetails, payerid, consumercode)" + + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + public static final String INSERT_BILLDETAILS_QUERY = "INSERT into egbs_billdetail_v1 " - +"(id, tenantid, billid, demandid, fromperiod, toperiod, businessservice, billno, billdate, consumercode, consumertype, billdescription, displaymessage, " + + "(id, tenantid, billid, demandid, fromperiod, toperiod, businessservice, billno, billdate, consumercode, consumertype, billdescription, displaymessage, " + "minimumamount, totalamount, callbackforapportioning, partpaymentallowed, collectionmodesnotallowed, " + "createdby, createddate, lastmodifiedby, lastmodifieddate, isadvanceallowed, expirydate,additionaldetails)" - +"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - + + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + public static final String INSERT_BILLACCOUNTDETAILS_QUERY = "INSERT into egbs_billaccountdetail_v1 " - +"(id, tenantid, billdetail, demanddetailid, orderno, amount, adjustedamount, isactualdemand, purpose, " + + "(id, tenantid, billdetail, demanddetailid, orderno, amount, adjustedamount, isactualdemand, purpose, " + "createdby, createddate, lastmodifiedby, lastmodifieddate, taxheadcode)" - +"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - - - + + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + public static final String BILL_MAX_QUERY = "WITH billresult AS ({replace}) SELECT * FROM billresult " + " INNER JOIN (SELECT bd_consumercode, max(b_createddate) as maxdate FROM billresult GROUP BY bd_consumercode) as uniqbill" + " ON uniqbill.bd_consumercode=billresult.bd_consumercode AND uniqbill.maxdate=billresult.b_createddate "; - + public static final String BILL_MIN_QUERY = "WITH billresult AS ({replace}) SELECT * FROM billresult " + " INNER JOIN (SELECT bd_consumercode, min(b_createddate) as mindate FROM billresult GROUP BY bd_consumercode) as uniqbill" + " ON uniqbill.bd_consumercode=billresult.bd_consumercode AND uniqbill.mindate=billresult.b_createddate "; - + public static final String BILL_BASE_QUERY = "SELECT b.id AS b_id,b.mobilenumber, b.tenantid AS b_tenantid,b.payerid AS b_payerid," + " b.payername AS b_payername, b.payeraddress AS b_payeraddress, b.payeremail AS b_payeremail,b.filestoreid AS b_fileStoreId," + " b.isactive AS b_isactive, b.iscancelled AS b_iscancelled, b.createdby AS b_createdby, b.status as b_status," @@ -65,35 +75,46 @@ public class BillQueryBuilder { + " FROM egbs_bill_v1 b" + " LEFT OUTER JOIN egbs_billdetail_v1 bd ON b.id = bd.billid AND b.tenantid = bd.tenantid" + " LEFT OUTER JOIN egbs_billaccountdetail_v1 ad ON bd.id = ad.billdetail AND bd.tenantid = ad.tenantid"; - - public String getBillQuery(BillSearchCriteria billSearchCriteria, List preparedStatementValues){ - + + public static final String GET_LATEST_BILL_QUERY = "select bill.id from egbs_bill_v1 as bill inner join egbs_billdetail_v1 as billdetail on bill.id=billdetail.billid"; + + public String getBillQuery(BillSearchCriteria billSearchCriteria, List preparedStatementValues) { + StringBuilder billQuery = new StringBuilder(BILL_BASE_QUERY); String tenantId = billSearchCriteria.getTenantId(); String[] tenantIdChunks = tenantId.split("\\."); - if(tenantIdChunks.length == 1){ + if (tenantIdChunks.length == 1) { billQuery.append(" WHERE b.tenantid LIKE ? "); preparedStatementValues.add(billSearchCriteria.getTenantId() + '%'); - }else{ + } else { billQuery.append(" WHERE b.tenantid = ? "); preparedStatementValues.add(billSearchCriteria.getTenantId()); } + if (billSearchCriteria.getPeriodFrom() != null) { + billQuery.append(" AND bd.fromperiod = ?"); + preparedStatementValues.add(billSearchCriteria.getPeriodFrom()); + } + if (billSearchCriteria.getPeriodTo() != null) { + billQuery.append(" AND bd.toperiod = ?"); + preparedStatementValues.add(billSearchCriteria.getPeriodTo()); + } + addWhereClause(billQuery, preparedStatementValues, billSearchCriteria); StringBuilder maxQuery = addPagingClause(billQuery, preparedStatementValues, billSearchCriteria); - + return maxQuery.toString(); } - + @SuppressWarnings({ "unchecked", "rawtypes" }) private void addWhereClause(final StringBuilder selectQuery, final List preparedStatementValues, final BillSearchCriteria searchBill) { - - if(!CollectionUtils.isEmpty(searchBill.getBillId())){ + + if (!CollectionUtils.isEmpty(searchBill.getBillId())) { selectQuery.append(" AND b.id in ("); appendListToQuery(searchBill.getBillId(), preparedStatementValues, selectQuery); } - if (!searchBill.getRetrieveOldest()) { + if (searchBill.getRetrieveOldest()!=null && !searchBill.getRetrieveOldest()) { if (searchBill.getStatus() != null) { selectQuery.append(" AND b.status = ?"); preparedStatementValues.add(searchBill.getStatus().toString()); @@ -108,7 +129,7 @@ private void addWhereClause(final StringBuilder selectQuery, final List prepared preparedStatementValues.add(searchBill.getEmail()); } - if (searchBill.getMobileNumber()!= null) { + if (searchBill.getMobileNumber() != null) { selectQuery.append(" AND b.mobileNumber = ?"); preparedStatementValues.add(searchBill.getMobileNumber()); } @@ -117,7 +138,7 @@ private void addWhereClause(final StringBuilder selectQuery, final List prepared selectQuery.append(" AND bd.businessservice = ?"); preparedStatementValues.add(searchBill.getService()); } - + if (searchBill.getFromPeriod() != null) { selectQuery.append(" AND bd.fromperiod = ?"); preparedStatementValues.add(searchBill.getFromPeriod()); @@ -138,14 +159,14 @@ private void addWhereClause(final StringBuilder selectQuery, final List prepared appendListToQuery(searchBill.getConsumerCode(), preparedStatementValues, selectQuery); } } - - @SuppressWarnings({"rawtypes" }) + + @SuppressWarnings({ "rawtypes" }) private StringBuilder addPagingClause(final StringBuilder selectQuery, final List preparedStatementValues, final BillSearchCriteria searchBillCriteria) { - + StringBuilder finalQuery; - if (searchBillCriteria.getRetrieveOldest()) + if (searchBillCriteria.getRetrieveOldest()!=null && !searchBillCriteria.getRetrieveOldest()) finalQuery = new StringBuilder(BILL_MIN_QUERY.replace(REPLACE_STRING, selectQuery)); else finalQuery = new StringBuilder(BILL_MAX_QUERY.replace(REPLACE_STRING, selectQuery)); @@ -156,8 +177,74 @@ private StringBuilder addPagingClause(final StringBuilder selectQuery, final Lis return finalQuery; } - + +/** + * Bill expire query builder + * + * @param billIds + * @param preparedStmtList + */ + public String getBillStatusUpdateQuery(List consumerCodes,String businessService, List preparedStmtList) { + + StringBuilder builder = new StringBuilder(BILL_STATUS_UPDATE_QUERY); + + if (!CollectionUtils.isEmpty(consumerCodes)) { + + builder.append(" AND id IN ( SELECT billid from egbs_billdetail_v1 where consumercode IN ("); + appendListToQuery(consumerCodes, preparedStmtList, builder); + builder.append(" AND businessservice=? )"); + preparedStmtList.add(businessService); + } + + return builder.toString(); + } + + public String getBillStatusUpdateBatchQuery() { + + return BILL_STATUS_UPDATE_BATCH_QUERY; + } + + /** + * @param billIds + * @param preparedStmtList + * @param query + */ + private void appendListToQuery(Collection values, List preparedStmtList, StringBuilder query) { + int length = values.size(); + String[] valueArray = values.toArray(new String[length]); + + for (int i = 0; i < length; i++) { + query.append(" ?"); + if (i != length - 1) + query.append(","); + preparedStmtList.add(valueArray[i]); + } + query.append(")"); +} + + public String getLatestBillQuery(final List preparedStatementValues, + final CancelBillCriteria cancelBillCriteria) { + + StringBuilder selectQuery = new StringBuilder(GET_LATEST_BILL_QUERY); + selectQuery.append(" where bill.tenantid=?"); + preparedStatementValues.add(cancelBillCriteria.getTenantId().toString()); + + selectQuery.append(" AND bill.status = ?"); + preparedStatementValues.add(Constants.ACTIVE.toString()); + + selectQuery.append(" AND billdetail.businessservice = ?"); + preparedStatementValues.add(cancelBillCriteria.getBusinessService().toString()); + + selectQuery.append(" AND billdetail.consumercode = ?"); + preparedStatementValues.add(cancelBillCriteria.getConsumerCode().toString()); + + selectQuery.append(" order by bill.createddate desc limit 1"); + + return selectQuery.toString(); + + } + /** * Bill expire query builder * * @param billIds @@ -167,7 +254,7 @@ public String getBillStatusUpdateQuery(UpdateBillCriteria updateBillCriteria, Li String additionalDetailsQuery = ", additionaldetails = ?"; StringBuilder builder = new StringBuilder(); - + preparedStmtList.add(updateBillCriteria.getStatusToBeUpdated().toString()); if (updateBillCriteria.getStatusToBeUpdated().equals(BillStatus.CANCELLED) @@ -189,25 +276,8 @@ public String getBillStatusUpdateQuery(UpdateBillCriteria updateBillCriteria, Li appendListToQuery(updateBillCriteria.getBillIds(), preparedStmtList, builder); } - return builder.toString(); } - - /** - * @param billIds - * @param preparedStmtList - * @param query - */ - private void appendListToQuery(Collection values, List preparedStmtList, StringBuilder query) { - int length = values.size(); - String[] valueArray = values.toArray(new String[length]); - for (int i = 0; i < length; i++) { - query.append(" ?"); - if (i != length - 1) - query.append(","); - preparedStmtList.add(valueArray[i]); - } - query.append(")"); - } + } diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/DemandQueryBuilder.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/DemandQueryBuilder.java index e2894d69bbe..26532b0a923 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/DemandQueryBuilder.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/querybuilder/DemandQueryBuilder.java @@ -92,8 +92,8 @@ public class DemandQueryBuilder { public static final String DEMAND_INSERT_QUERY = "INSERT INTO egbs_demand_v1 " + "(id,consumerCode,consumerType,businessService,payer,taxPeriodFrom,taxPeriodTo," - + "minimumAmountPayable,createdby,lastModifiedby,createdtime,lastModifiedtime,tenantid, status, additionaldetails, billexpirytime, fixedBillExpiryDate) " - + "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);"; + + "minimumAmountPayable,createdby,lastModifiedby,createdtime,lastModifiedtime,tenantid, status, additionaldetails, billexpirytime, fixedBillExpiryDate,ispaymentcompleted) " + + "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);"; public static final String DEMAND_DETAIL_INSERT_QUERY = "INSERT INTO egbs_demanddetail_v1 " + "(id,demandid,taxHeadCode,taxamount,collectionamount," @@ -229,10 +229,10 @@ private static void addOrderByClause(StringBuilder demandQueryBuilder,String col } private static void addPagingClause(StringBuilder demandQueryBuilder, List preparedStatementValues) { -// demandQueryBuilder.append(" LIMIT ?"); -// preparedStatementValues.add(500); -// demandQueryBuilder.append(" OFFSET ?"); -// preparedStatementValues.add(0); + demandQueryBuilder.append(" LIMIT ?"); + preparedStatementValues.add(500); + demandQueryBuilder.append(" OFFSET ?"); + preparedStatementValues.add(0); } private static boolean addAndClause(StringBuilder queryString) { diff --git a/business-services/billing-service/src/main/java/org/egov/demand/repository/rowmapper/AmendmentRowMapper.java b/business-services/billing-service/src/main/java/org/egov/demand/repository/rowmapper/AmendmentRowMapper.java index d9504bb3be1..9b73a4721bd 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/repository/rowmapper/AmendmentRowMapper.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/repository/rowmapper/AmendmentRowMapper.java @@ -123,6 +123,9 @@ private void addDocumentToAmendment(Amendment amendment, ResultSet rs) throws SQ List docs = amendment.getDocuments(); String docId = rs.getString("docid"); + if (docId == null) + return; + if (!CollectionUtils.isEmpty(docs)) for (Document doc : docs) { if (doc.getId().equals(docId)) diff --git a/business-services/billing-service/src/main/java/org/egov/demand/service/BillServicev2.java b/business-services/billing-service/src/main/java/org/egov/demand/service/BillServicev2.java index 08af154f4f9..744060c7ab6 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/service/BillServicev2.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/service/BillServicev2.java @@ -237,10 +237,18 @@ public BillResponseV2 fetchBill(GenerateBillCriteria billCriteria, RequestInfoWr if (CollectionUtils.isEmpty(bills)) { log.info( "If bills are empty" +bills.size()); + if(!billCriteria.getBusinessService().equalsIgnoreCase("WS") && !billCriteria.getBusinessService().equalsIgnoreCase("SW")) updateDemandsForexpiredBillDetails(billCriteria.getBusinessService(), billCriteria.getConsumerCode(), billCriteria.getTenantId(), requestInfoWrapper); return generateBill(billCriteria, requestInfo); } + if (!CollectionUtils.isEmpty(bills) && billCriteria.getBusinessService().equalsIgnoreCase("PT") && !(bills.get(0).getTotalAmount().remainder(BigDecimal.ONE).compareTo(BigDecimal.ZERO) == 0)) + { + log.info( "If bills are not empty" ); + if(!billCriteria.getBusinessService().equalsIgnoreCase("WS") && !billCriteria.getBusinessService().equalsIgnoreCase("SW")) + updateDemandsForexpiredBillDetails(billCriteria.getBusinessService(), billCriteria.getConsumerCode(), billCriteria.getTenantId(), requestInfoWrapper); + return generateBill(billCriteria, requestInfo); + } /* * Adding consumer-codes of unbilled demands to generate criteria diff --git a/business-services/billing-service/src/main/java/org/egov/demand/service/BusinessServDetailService.java b/business-services/billing-service/src/main/java/org/egov/demand/service/BusinessServDetailService.java index f331e98d672..6b659ea61a7 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/service/BusinessServDetailService.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/service/BusinessServDetailService.java @@ -50,6 +50,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; @@ -64,6 +65,7 @@ public class BusinessServDetailService { @Autowired private ResponseFactory responseInfoFactory; + @Cacheable(value = "businessServiceDetails", sync = true) public BusinessServiceDetailResponse searchBusinessServiceDetails( final BusinessServiceDetailCriteria businessServiceDetailCriteria, final RequestInfo requestInfo) { diff --git a/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java b/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java index 2847a954fb4..1055b83cf5b 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java @@ -127,7 +127,7 @@ public class DemandService { @Autowired private DemandValidatorV1 demandValidatorV1; - + Boolean ispaymentcompleted=false; /** * Method to create new demand * @@ -148,8 +148,11 @@ public DemandResponse create(DemandRequest demandRequest) { RequestInfo requestInfo = demandRequest.getRequestInfo(); List demands = demandRequest.getDemands(); AuditDetails auditDetail = util.getAuditDetail(requestInfo); + log.info("requestInfo: {} and AuditDetails: {}", requestInfo, auditDetail); + log.info("AuditDetails tostring: {}", auditDetail.toString()); + + List amendmentUpdates = consumeAmendmentIfExists(demands,auditDetail); - List amendmentUpdates = consumeAmendmentIfExists(demands, auditDetail); generateAndSetIdsForNewDemands(demands, auditDetail); List demandsToBeCreated = new ArrayList<>(); @@ -355,7 +358,15 @@ public List getDemands(DemandCriteria demandCriteria, RequestInfo reques if (!CollectionUtils.isEmpty(demands) && !CollectionUtils.isEmpty(payers)) demands = demandEnrichmentUtil.enrichPayer(demands, payers); - return demands; + + + List activeDemands=new ArrayList(); + + for (Demand d : demands) { + if(d.getStatus().toString().equalsIgnoreCase("ACTIVE")) + activeDemands.add(d); + } + return activeDemands; } public void save(DemandRequest demandRequest) { @@ -377,6 +388,10 @@ public void update(DemandRequest demandRequest, PaymentBackUpdateAudit paymentBa private void apportionAdvanceIfExist(DemandRequest demandRequest, DocumentContext mdmsData,List demandToBeCreated,List demandToBeUpdated){ List demands = demandRequest.getDemands(); RequestInfo requestInfo = demandRequest.getRequestInfo(); + int taxamnt =0; + int count=0; + int finalsvar=0; + int finalsadvance=0; for(Demand demand : demands) { String businessService = demand.getBusinessService(); @@ -392,7 +407,15 @@ private void apportionAdvanceIfExist(DemandRequest demandRequest, DocumentContex demandToBeCreated.add(demand); continue; } - + List newdemandDetail = demand.getDemandDetails(); + for (DemandDetail demandDetailnew : newdemandDetail) + { + if ("WS_CHARGE".equals(demandDetailnew.getTaxHeadMasterCode())) + { + taxamnt= demandDetailnew.getTaxAmount().intValue(); + + } + } // Fetch the demands containing advance amount List demandsToBeApportioned = getDemandsContainingAdvance(demandsFromSearch, mdmsData); @@ -401,14 +424,86 @@ private void apportionAdvanceIfExist(DemandRequest demandRequest, DocumentContex demandToBeCreated.add(demand); continue; } + if (businessService.equalsIgnoreCase("WS") || businessService.equalsIgnoreCase("SW")) { + if (finalsadvance==0 && count ==0) + { + for (Demand d1 : demandsToBeApportioned) + { + List d12 = d1.getDemandDetails(); + for (DemandDetail d123 : d12) + { + if ("WS_ADVANCE_CARRYFORWARD".equals(d123.getTaxHeadMasterCode())) + { + finalsadvance = d123.getTaxAmount().intValue(); + if(taxamnt+finalsadvance>0) + { + ispaymentcompleted=false; + } + else { + ispaymentcompleted=true; + } + + } + + } + } + count=1; + } + + else if (finalsadvance<=0 && count ==1) + { + + if (finalsvar!=1) + { + // System.out.print("Settling Advcance "); + finalsadvance = taxamnt+finalsadvance; + + if (finalsadvance==0) + { + finalsvar=1; + ispaymentcompleted=false; + } + else + { ispaymentcompleted=true; + finalsvar=0; + } + // System.out.println("txamt "+finalsadvance); + + } + } + + + for (Demand demand12 : demandsToBeApportioned) { + + List demandDetails23 = demand12.getDemandDetails(); + for (DemandDetail demandDetail45 : demandDetails23) { + if ("WS_ADVANCE_CARRYFORWARD".equals(demandDetail45.getTaxHeadMasterCode())) { + BigDecimal tax=new BigDecimal(finalsadvance); + demandDetail45.setTaxAmount(tax); + } + } + } + } // The current demand is added to get apportioned demandsToBeApportioned.add(demand); DemandApportionRequest apportionRequest = DemandApportionRequest.builder().requestInfo(requestInfo).demands(demandsToBeApportioned).tenantId(tenantId).build(); + try { + String apportionRequestStr = mapper.writeValueAsString(apportionRequest); + log.info("apportionRequest: {} and ApportionURL: {}", apportionRequestStr, util.getApportionURL()); + }catch (Exception e) {e.printStackTrace();} Object response = serviceRequestRepository.fetchResult(util.getApportionURL(), apportionRequest); ApportionDemandResponse apportionDemandResponse = mapper.convertValue(response, ApportionDemandResponse.class); + apportionDemandResponse.getDemands().forEach(demandFromResponse -> { + + demandFromResponse.setIsPaymentCompleted(ispaymentcompleted); + }); + try { + String apportionDemandResponseStr = mapper.writeValueAsString(apportionDemandResponse); + log.info("apportionDemandResponse: {} and ApportionURL: {}", apportionDemandResponseStr, util.getApportionURL()); + }catch (Exception e) {e.printStackTrace();} // Only the current demand is to be created rest all are to be updated apportionDemandResponse.getDemands().forEach(demandFromResponse -> { diff --git a/business-services/billing-service/src/main/java/org/egov/demand/service/TaxHeadMasterService.java b/business-services/billing-service/src/main/java/org/egov/demand/service/TaxHeadMasterService.java index 496824489da..357b1b8ba18 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/service/TaxHeadMasterService.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/service/TaxHeadMasterService.java @@ -9,6 +9,7 @@ import org.egov.demand.web.contract.TaxHeadMasterResponse; import org.egov.demand.web.contract.factory.ResponseFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; @@ -25,6 +26,7 @@ public class TaxHeadMasterService { @Autowired private TaxHeadMasterRepository taxHeadMasterRepository; + @Cacheable(value = "taxHeadResponse", key = "{#searchTaxHead}", sync = true) public TaxHeadMasterResponse getTaxHeads(TaxHeadMasterCriteria searchTaxHead, RequestInfo requestInfo) { log.info("TaxHeadMasterService getTaxHeads"); List taxHeadMaster = taxHeadMasterRepository.getTaxHeadMaster(requestInfo,searchTaxHead); diff --git a/business-services/billing-service/src/main/java/org/egov/demand/service/TaxPeriodService.java b/business-services/billing-service/src/main/java/org/egov/demand/service/TaxPeriodService.java index 794c33db90c..18a06ce2cc7 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/service/TaxPeriodService.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/service/TaxPeriodService.java @@ -50,6 +50,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; @@ -65,6 +66,7 @@ public class TaxPeriodService { @Autowired private ResponseFactory responseInfoFactory; + @Cacheable(value = "taxPeriodResponse", key = "{#taxPeriodCriteria}", sync = true) public TaxPeriodResponse searchTaxPeriods(final TaxPeriodCriteria taxPeriodCriteria, final RequestInfo requestInfo) { LOGGER.info("-- TaxPeriodService searchTaxPeriods -- "); final List taxPeriods = taxPeriodRepository.getTaxPeriod(requestInfo,taxPeriodCriteria); diff --git a/business-services/billing-service/src/main/java/org/egov/demand/util/Constants.java b/business-services/billing-service/src/main/java/org/egov/demand/util/Constants.java index 3fe006c1785..b5548f54e6d 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/util/Constants.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/util/Constants.java @@ -155,7 +155,9 @@ public class Constants { public static final String DEBIT_NOTE_VALUE = "DN"; + public static final String ACTIVE="ACTIVE"; + public static final String SUCCESS_CANCEL_BILL = "Successfully canclled latest active bill"; private Constants() {} public static final String BUSINESS_SERVICE_URL_PARAMETER = "businessService="; diff --git a/business-services/billing-service/src/main/java/org/egov/demand/util/Util.java b/business-services/billing-service/src/main/java/org/egov/demand/util/Util.java index 3b922e94fff..48bc99323ca 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/util/Util.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/util/Util.java @@ -7,6 +7,23 @@ import com.jayway.jsonpath.DocumentContext; import com.jayway.jsonpath.JsonPath; import lombok.extern.slf4j.Slf4j; +import static java.util.Objects.isNull; +import static org.egov.demand.util.Constants.ADVANCE_BUSINESSSERVICE_JSONPATH_CODE; +import static org.egov.demand.util.Constants.INVALID_TENANT_ID_MDMS_KEY; +import static org.egov.demand.util.Constants.INVALID_TENANT_ID_MDMS_MSG; +import static org.egov.demand.util.Constants.MDMS_CODE_FILTER; +import static org.egov.demand.util.Constants.MDMS_MASTER_NAMES; +import static org.egov.demand.util.Constants.MODULE_NAME; + +import java.math.BigDecimal; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; import org.egov.common.contract.request.RequestInfo; import org.egov.common.contract.request.Role; import org.egov.demand.amendment.model.ProcessInstance; @@ -25,6 +42,7 @@ import org.egov.tracer.model.CustomException; import org.postgresql.util.PGobject; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; @@ -32,6 +50,15 @@ import java.sql.SQLException; import java.util.*; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.jayway.jsonpath.DocumentContext; +import com.jayway.jsonpath.JsonPath; + +import lombok.extern.slf4j.Slf4j; + import static java.util.Objects.isNull; import static org.egov.demand.util.Constants.*; @@ -83,6 +110,7 @@ public MdmsCriteriaReq prepareMdMsRequest(String tenantId, String moduleName, Li * @return Map of MasterData name to the list of code in the MasterData * */ + @Cacheable(value = "mdmsCache", sync = true, key = "{#mdmsReq.getMdmsCriteria()}") public DocumentContext getAttributeValues(MdmsCriteriaReq mdmsReq) { StringBuilder uri = new StringBuilder(appProps.getMdmsHost()).append(appProps.getMdmsEndpoint()); diff --git a/business-services/billing-service/src/main/java/org/egov/demand/web/contract/CancelBillCriteria.java b/business-services/billing-service/src/main/java/org/egov/demand/web/contract/CancelBillCriteria.java new file mode 100644 index 00000000000..a891b2a2e82 --- /dev/null +++ b/business-services/billing-service/src/main/java/org/egov/demand/web/contract/CancelBillCriteria.java @@ -0,0 +1,25 @@ +package org.egov.demand.web.contract; + +import javax.validation.constraints.NotNull; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter +public class CancelBillCriteria { + + @NotNull + private String tenantId; + + @NotNull + private String businessService; + + @NotNull + private String consumerCode; + +} diff --git a/business-services/billing-service/src/main/java/org/egov/demand/web/contract/TaxPeriodCriteria.java b/business-services/billing-service/src/main/java/org/egov/demand/web/contract/TaxPeriodCriteria.java index 05c683615fc..dc9c125ce9e 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/web/contract/TaxPeriodCriteria.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/web/contract/TaxPeriodCriteria.java @@ -14,6 +14,7 @@ @AllArgsConstructor @ToString @Builder +@EqualsAndHashCode public class TaxPeriodCriteria { @NotNull diff --git a/business-services/billing-service/src/main/java/org/egov/demand/web/contract/User.java b/business-services/billing-service/src/main/java/org/egov/demand/web/contract/User.java index 53ddda2a77e..69ce4022291 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/web/contract/User.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/web/contract/User.java @@ -1,5 +1,7 @@ package org.egov.demand.web.contract; +import javax.validation.constraints.Pattern; + import org.egov.demand.model.Owner; import lombok.AllArgsConstructor; @@ -21,6 +23,7 @@ public class User { private String name; private String gender; + @Pattern(regexp = "(^[4-9][0-9]{9}$)", message = "Inavlid mobile number, should start with 4-9 and contain ten digits of 0-9") private String mobileNumber; private String emailId; diff --git a/business-services/billing-service/src/main/java/org/egov/demand/web/controller/BillControllerv2.java b/business-services/billing-service/src/main/java/org/egov/demand/web/controller/BillControllerv2.java index a34ec4b1294..82a54e27e31 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/web/controller/BillControllerv2.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/web/controller/BillControllerv2.java @@ -2,6 +2,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.Set; import javax.validation.Valid; @@ -10,15 +11,18 @@ import org.egov.demand.helper.BillHelperV2; import org.egov.demand.model.BillSearchCriteria; import org.egov.demand.model.GenerateBillCriteria; +import org.egov.demand.model.UpdateBillCriteria; import org.egov.demand.model.UpdateBillRequest; import org.egov.demand.service.BillServicev2; import org.egov.demand.util.Constants; import org.egov.demand.web.contract.BillRequestV2; import org.egov.demand.web.contract.BillResponseV2; +import org.egov.demand.web.contract.CancelBillCriteria; import org.egov.demand.web.contract.RequestInfoWrapper; import org.egov.demand.web.contract.factory.ResponseFactory; import org.egov.demand.web.validator.BillValidator; import org.egov.tracer.model.CustomException; +import org.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -30,7 +34,12 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; +import lombok.extern.slf4j.Slf4j; + +import org.egov.demand.util.Constants; + @RestController +@Slf4j @RequestMapping("bill/v2/") public class BillControllerv2 { @@ -52,6 +61,7 @@ public ResponseEntity search(@RequestBody @Valid final RequestInfoWrapper req @ModelAttribute @Valid final BillSearchCriteria billCriteria) { RequestInfo requestInfo = requestInfoWrapper.getRequestInfo(); + log.info("bill _search billcriteria : "+billCriteria); // added logger billValidator.validateBillSearchCriteria(billCriteria, requestInfo); return new ResponseEntity<>(billService.searchBill(billCriteria,requestInfo), HttpStatus.OK); } @@ -62,7 +72,13 @@ public ResponseEntity search(@RequestBody @Valid final RequestInfoWrapper req public ResponseEntity fetchBill(@RequestBody RequestInfoWrapper requestInfoWrapper, @ModelAttribute @Valid GenerateBillCriteria generateBillCriteria){ + String ojb = new JSONObject(generateBillCriteria).toString(); + System.out.println(" fetchBill GenerateBillCriteria::"+ ojb); + BillResponseV2 billResponse = billService.fetchBill(generateBillCriteria, requestInfoWrapper); + log.info("_fetchbill generateBillCriteria :"+generateBillCriteria ); //added logger + log.info("_fetchbill response :"+billResponse ); //added logger + return new ResponseEntity<>(billResponse, HttpStatus.CREATED); } @@ -79,13 +95,32 @@ public ResponseEntity genrateBill(@RequestBody RequestInfoWrapper requestInfo @ResponseBody public ResponseEntity create(@RequestBody @Valid BillRequestV2 billRequest, BindingResult bindingResult){ - BillResponseV2 billResponse = billService.sendBillToKafka(billRequest); billHelper.getBillRequestWithIds(billRequest); + log.info("_create bill request sent to kafka : "+billRequest); //added logger + BillResponseV2 billResponse = billService.sendBillToKafka(billRequest); + log.info("_create bill response : "+billResponse); //added logger return new ResponseEntity<>(billResponse,HttpStatus.CREATED); } @PostMapping("_cancelbill") @ResponseBody + public ResponseEntity cancelBill(@RequestBody RequestInfoWrapper requestInfoWrapper, + @ModelAttribute @Valid CancelBillCriteria cancelBillCriteria){ + log.info("_cancelbill criteria : "+cancelBillCriteria); + UpdateBillRequest updateBillRequest = new UpdateBillRequest(); + updateBillRequest.setRequestInfo(requestInfoWrapper.getRequestInfo()); + UpdateBillCriteria objectBillCriteria =new UpdateBillCriteria(); + objectBillCriteria.setTenantId(cancelBillCriteria.getTenantId()); + //objectBillCriteria.setConsumerCodes(Set.of(cancelBillCriteria.getConsumerCode().split(","))); + objectBillCriteria.setBusinessService(cancelBillCriteria.getBusinessService()); + + updateBillRequest.setUpdateBillCriteria(objectBillCriteria); + billService.cancelBill(updateBillRequest); + return new ResponseEntity<>(Constants.SUCCESS_CANCEL_BILL, HttpStatus.CREATED); + } + + @PostMapping("_cancelbillv2") + @ResponseBody public ResponseEntity cancelBill(@RequestBody @Valid UpdateBillRequest updateBillRequest){ Integer count = billService.cancelBill(updateBillRequest); diff --git a/business-services/billing-service/src/main/java/org/egov/demand/web/validator/BillValidator.java b/business-services/billing-service/src/main/java/org/egov/demand/web/validator/BillValidator.java index ecf0ce4c459..59c274fd3db 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/web/validator/BillValidator.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/web/validator/BillValidator.java @@ -18,7 +18,7 @@ import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; - +import org.springframework.validation.Errors; import com.fasterxml.jackson.databind.JsonNode; @Component diff --git a/business-services/billing-service/src/main/java/org/egov/demand/web/validator/DemandValidatorV1.java b/business-services/billing-service/src/main/java/org/egov/demand/web/validator/DemandValidatorV1.java index 9a2cf12c4b3..5811819c7d6 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/web/validator/DemandValidatorV1.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/web/validator/DemandValidatorV1.java @@ -150,7 +150,7 @@ public void validatedemandForCreate(DemandRequest demandRequest, Boolean isCreat List details = demand.getDemandDetails(); Map taxHeadMap = businessTaxCodeMap.get(demand.getBusinessService()); - log.info(" the taxhead map : " + taxHeadMap); + //log.info(" the taxhead map : " + taxHeadMap); detailsForValidation.addAll(details); if (isCreate) { @@ -171,10 +171,16 @@ public void validatedemandForCreate(DemandRequest demandRequest, Boolean isCreat taxHeadsNotFound.add(detail.getTaxHeadMasterCode()); }); + if(demandRequest.getDemands().get(0).getBusinessService().equalsIgnoreCase("WS") && demandRequest.getDemands().get(0).getAdditionalDetails() !=null && demandRequest.getDemands().get(0).getAdditionalDetails().toString().contains("connectionType")) + { + + } + else validateTaxPeriod(taxPeriodBusinessMap, demand, errorMap, businessServicesWithNoTaxPeriods); // by default demands are being set to active during create but validation should be done for inactive/ cancelled demand in another logic - if(demand.getStatus() == null) demand.setStatus(StatusEnum.ACTIVE); + if(demand.getStatus() == null) + demand.setStatus(StatusEnum.ACTIVE); } /* @@ -419,6 +425,17 @@ public void validateDemandDetailsForAmount(List demandDetails, Map Boolean isTaxLtZeroAndCollectionNeToZeroAndCollectionGtTax = tax.compareTo(BigDecimal.ZERO) < 0 && collection.compareTo(tax) != 0 && collection.compareTo(BigDecimal.ZERO) != 0; + String taxHeadMasterCode = "WS_CHARGE,WTAXCHARGES,SEWERAGETAX,SWTAXADJUSTMENT,STAXSECURITY,STAXAPPLICATION"; + + String[] substrings = {"WS_CHARGE,WTAXCHARGES,SEWERAGETAX,SWTAXADJUSTMENT,STAXSECURITY,STAXAPPLICATION"}; + + + for (String substring : substrings) { + if (taxHeadMasterCode.contains(substring)) + { + System.out.println("WS Contains"); + } + else { if (isTaxGtZeroAndCollectionGtTaxOrCollectionLtZero) { errors.add(INVALID_DEMAND_DETAIL_ERROR_MSG .replace(INVALID_DEMAND_DETAIL_COLLECTION_TEXT, collection.toString()) @@ -432,11 +449,12 @@ else if (isTaxLtZeroAndCollectionNeToZeroAndCollectionGtTax) { } } + } if (!CollectionUtils.isEmpty(errors)) errorMap.put(INVALID_DEMAND_DETAIL_KEY, INVALID_DEMAND_DETAIL_MSG.replace(INVALID_DEMAND_DETAIL_REPLACETEXT, errors.toString())); } - + } /* * @@ -610,4 +628,4 @@ private void getuserFromNameAndNumber(Demand demand, RequestInfo requestInfo) { } demand.setPayer(payer); } -} \ No newline at end of file +} diff --git a/business-services/billing-service/src/main/resources/application.properties b/business-services/billing-service/src/main/resources/application.properties index 8c45084423a..70abec3b09c 100644 --- a/business-services/billing-service/src/main/resources/application.properties +++ b/business-services/billing-service/src/main/resources/application.properties @@ -1,11 +1,11 @@ #migration migration.batch.value=100 +cache.expiry.taxheads.minutes=5 spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://localhost:5432/postgres -spring.datasource.username=postgres -spring.datasource.password=postgres - +spring.datasource.url=jdbc:postgresql://dbmsewa.ch88m0ouypx1.ap-south-1.rds.amazonaws.com:5432/egov_prod_db +spring.datasource.username=msewapunjabnew +spring.datasource.password=msewa123456 #Set context root server.context-path=/billing-service server.servlet.context-path=/billing-service @@ -13,7 +13,7 @@ server.servlet.context-path=/billing-service server.port = 8081 #USER APIs -user.service.hostname=http://egov-user:8080/ +user.service.hostname=http://localhost:6081/ user.service.searchpath=user/_search egov.user.create.user=user/users/_createnovalidate demand.is.user.create.enabled=true @@ -88,7 +88,7 @@ bs.billdetail.seq.name=seq_egbs_billdetail bs.billdetail.billnumber.seq.name=seq_egbs_billnumber bs.billaccountdetail.seq.name=seq_egbs_billaccountdetail # ID GEN CONFIGS -egov.idgen.hostname = http://egov-idgen:8080 +egov.idgen.hostname = http://egov-idgen:8080/ egov.idgen.uri = /egov-idgen/id/_generate amendment.id.format.name=bs.amendment.id bs.bill.billnumber.format=BILLNO-{module}-[SEQ_egbs_billnumber{tenantid}] @@ -105,11 +105,11 @@ bs.demanddetail.audit.seq.name=seq_egbs_demanddetail_audit #billing-service1.1 # localization url -egov.localization.host=https://dev.digit.org +egov.localization.host=https://msewapunjab.niua.org/ egov.localization.search.endpoint=/localization/messages/v1/_search # Apportion url -egov.apportion.host=http://localhost:8091 +egov.apportion.host=https://msewapunjab.niua.org/ egov.apportion.endpoint=/apportion-service/v2/demand/_apportion # billgen notif topic @@ -127,18 +127,19 @@ search.pagesize.default=100 #billing-service1.1 #mdms urls -egov.mdms.host=https://dev.digit.org +egov.mdms.host=https://msewapunjab.niua.org/ egov.mdms.search.endpoint=/egov-mdms-service/v1/_search #----------------------------- FLYWAY CONFIGURATIONS ------------------------------# -spring.flyway.url=jdbc:postgresql://localhost:5432/postgres -spring.flyway.user=postgres -spring.flyway.password=postgres +spring.flyway.url=jdbc:postgresql://dbmsewa.ch88m0ouypx1.ap-south-1.rds.amazonaws.com:5432/egov_prod_db +spring.flyway.user=msewapunjabnew +spring.flyway.password=msewa123456 spring.flyway.table=public spring.flyway.baseline-on-migrate=true spring.flyway.outOfOrder=true spring.flyway.locations=classpath:db/migration/main spring.flyway.enabled=true +spring.flyway.validateOnMigrate=false #------------------------------------------------------------------------------# @@ -150,7 +151,7 @@ logging.level.org.egov=DEBUG is.amendment.workflow.enabled=true -workflow.host=http://egov-workflow-v2:8080 +workflow.host=https://msewapunjab.niua.org/ workflow.transition.path=/egov-workflow-v2/egov-wf/process/_transition workflow.businessservice.search.path=/egov-workflow-v2/egov-wf/businessservice/_search workflow.processinstance.search.path=/egov-workflow-v2/egov-wf/process/_search @@ -163,3 +164,7 @@ amendment.default.limit=100 #----------------# statelevel.rolecode.excluded.list=BPAREG_DOC_VERIFIER,BPAREG_APPROVER +egov.shortener.url=egov-url-shortening/shortener +notification.url=https://mseva-uat.lgpunjab.gov.in +notification.sms.link=/citizen/withoutAuth/egov-common/pay?consumerCode=$consumerCode&tenantId=$tenantId&businessService=WS +egov.shortener.host=http://egov-url-shortening:8080/ diff --git a/business-services/billing-service/src/main/resources/db/Dockerfile b/business-services/billing-service/src/main/resources/db/Dockerfile index 905984829e3..ce7d6b8409e 100644 --- a/business-services/billing-service/src/main/resources/db/Dockerfile +++ b/business-services/billing-service/src/main/resources/db/Dockerfile @@ -1,11 +1,17 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/main /flyway/sql -COPY ./migration/seed /flyway/seed +#COPY ./migration/seed /flyway/seed + +#COPY ./migration/dev /flyway/dev + +#COPY ./migration/qa /flyway/qa + +#COPY ./migration/test /flyway/test COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/business-services/billing-service/src/main/resources/db/migrate.sh b/business-services/billing-service/src/main/resources/db/migrate.sh index 54d07c0940a..3b0babd2007 100644 --- a/business-services/billing-service/src/main/resources/db/migrate.sh +++ b/business-services/billing-service/src/main/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20170629180050__egbs_demand_base_create_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20170629180050__egbs_demand_base_create_ddl.sql index 7c6a5885790..3e8ca64b92b 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20170629180050__egbs_demand_base_create_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20170629180050__egbs_demand_base_create_ddl.sql @@ -1,9 +1,9 @@ -CREATE SEQUENCE seq_egbs_demand; +CREATE SEQUENCE IF NOT EXISTS seq_egbs_demand; -CREATE SEQUENCE seq_egbs_demanddetail; +CREATE SEQUENCE IF NOT EXISTS seq_egbs_demanddetail; -CREATE TABLE egbs_demand +CREATE TABLE IF NOT EXISTS egbs_demand ( id character varying(64) NOT NULL, @@ -36,7 +36,7 @@ CONSTRAINT pk_egbs_demand PRIMARY KEY (id,tenantid) ); -CREATE TABLE egbs_demanddetail +CREATE TABLE IF NOT EXISTS egbs_demanddetail ( id character varying(64) NOT NULL, diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20170630150444__egbs_taxperiod_business_service_base_create_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20170630150444__egbs_taxperiod_business_service_base_create_ddl.sql index 00e96e2ab0d..475459075c6 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20170630150444__egbs_taxperiod_business_service_base_create_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20170630150444__egbs_taxperiod_business_service_base_create_ddl.sql @@ -1,6 +1,6 @@ -- TaxPeriod -- -CREATE TABLE egbs_taxperiod +CREATE TABLE IF NOT EXISTS egbs_taxperiod ( id character varying(64) NOT NULL, service character varying(100) NOT NULL, @@ -17,12 +17,12 @@ CREATE TABLE egbs_taxperiod CONSTRAINT unq_service_code UNIQUE (service, code, tenantid) ); -CREATE SEQUENCE seq_egbs_taxperiod; +CREATE SEQUENCE IF NOT EXISTS seq_egbs_taxperiod; -- BusinessServiceDetail -- -CREATE TABLE egbs_business_service_details +CREATE TABLE IF NOT EXISTS egbs_business_service_details ( id character varying(64) NOT NULL, businessservice character varying(250) NOT NULL, @@ -39,6 +39,6 @@ CREATE TABLE egbs_business_service_details CONSTRAINT unq_businessservice UNIQUE (businessservice, tenantid) ); -CREATE SEQUENCE seq_egbs_business_srvc_details; +CREATE SEQUENCE IF NOT EXISTS seq_egbs_business_srvc_details; diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20170630150618__egbs_glcodemaster_taxHeadMaster_base_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20170630150618__egbs_glcodemaster_taxHeadMaster_base_ddl.sql index 4d3bd1b1e8e..3aa73c5927b 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20170630150618__egbs_glcodemaster_taxHeadMaster_base_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20170630150618__egbs_glcodemaster_taxHeadMaster_base_ddl.sql @@ -1,7 +1,7 @@ -CREATE SEQUENCE seq_egbs_taxHeadMaster; -CREATE SEQUENCE seq_egbs_taxHeadMastercode; +CREATE SEQUENCE IF NOT EXISTS seq_egbs_taxHeadMaster; +CREATE SEQUENCE IF NOT EXISTS seq_egbs_taxHeadMastercode; -CREATE TABLE public.egbs_taxheadmaster +CREATE TABLE IF NOT EXISTS public.egbs_taxheadmaster ( id character varying(64) NOT NULL, tenantid character varying(128) NOT NULL, @@ -24,9 +24,9 @@ CREATE TABLE public.egbs_taxheadmaster -CREATE SEQUENCE seq_egbs_glcodemaster; +CREATE SEQUENCE IF NOT EXISTS seq_egbs_glcodemaster; -CREATE TABLE public.egbs_glcodemaster +CREATE TABLE IF NOT EXISTS public.egbs_glcodemaster ( id character varying(64) NOT NULL, tenantid character varying(128) NOT NULL, diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20170630153346__egbs_base_bill_create_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20170630153346__egbs_base_bill_create_ddl.sql index 300e1f6dfab..dbc25179809 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20170630153346__egbs_base_bill_create_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20170630153346__egbs_base_bill_create_ddl.sql @@ -1,5 +1,5 @@ -CREATE SEQUENCE seq_egbs_bill; -CREATE TABLE egbs_bill +CREATE SEQUENCE IF NOT EXISTS seq_egbs_bill; +CREATE TABLE IF NOT EXISTS egbs_bill ( id character varying(64) NOT NULL, @@ -27,9 +27,9 @@ CREATE TABLE egbs_bill ); -CREATE SEQUENCE seq_egbs_billdetail; -CREATE SEQUENCE seq_egbs_billnumber; -CREATE TABLE egbs_billdetail +CREATE SEQUENCE IF NOT EXISTS seq_egbs_billdetail; +CREATE SEQUENCE IF NOT EXISTS seq_egbs_billnumber; +CREATE TABLE IF NOT EXISTS egbs_billdetail ( id character varying(64) NOT NULL, @@ -80,8 +80,8 @@ CREATE TABLE egbs_billdetail ); -CREATE SEQUENCE seq_egbs_billaccountdetail; -CREATE TABLE egbs_billaccountdetail +CREATE SEQUENCE IF NOT EXISTS seq_egbs_billaccountdetail; +CREATE TABLE IF NOT EXISTS egbs_billaccountdetail ( id character varying(64) NOT NULL, diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20170630185224__egbs_base_demand_update_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20170630185224__egbs_base_demand_update_ddl.sql index 002346f38e9..22b1a488cbe 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20170630185224__egbs_base_demand_update_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20170630185224__egbs_base_demand_update_ddl.sql @@ -1 +1 @@ -ALTER TABLE egbs_demand DROP COLUMN minimumamountpayable,ADD COLUMN minimumamountpayable numeric(12,2); +-- ALTER TABLE egbs_demand DROP COLUMN minimumamountpayable,ADD COLUMN minimumamountpayable numeric(12,2); diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20170707121449__egbs_base_update_billaccountdetail_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20170707121449__egbs_base_update_billaccountdetail_ddl.sql index 5bdbec02710..22f029c5af6 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20170707121449__egbs_base_update_billaccountdetail_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20170707121449__egbs_base_update_billaccountdetail_ddl.sql @@ -1 +1 @@ -ALTER TABLE egbs_billaccountdetail ADD COLUMN cramounttobepaid numeric(12,2); +ALTER TABLE egbs_billaccountdetail ADD COLUMN IF NOT EXISTS cramounttobepaid numeric(12,2); diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20170712133510__egbs_demand_base_update_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20170712133510__egbs_demand_base_update_ddl.sql index 651dd1a0cef..3b776f3a7cd 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20170712133510__egbs_demand_base_update_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20170712133510__egbs_demand_base_update_ddl.sql @@ -1 +1,3 @@ -ALTER TABLE egbs_demand add CONSTRAINT uk_egbs_demand_consumercode_businessservice UNIQUE (consumercode,businessservice); +ALTER TABLE egbs_demand drop CONSTRAINT IF EXISTS uk_egbs_demand_consumercode_businessservice ; + +ALTER TABLE egbs_demand add CONSTRAINT uk_egbs_demand_consumercode_businessservice UNIQUE (consumercode,businessservice); diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20170714160131__egbs_taxperiod_alter_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20170714160131__egbs_taxperiod_alter_ddl.sql index cdf559f5cbb..3aa5fa71581 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20170714160131__egbs_taxperiod_alter_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20170714160131__egbs_taxperiod_alter_ddl.sql @@ -1,2 +1,2 @@ -ALTER TABLE egbs_taxperiod ADD COLUMN periodcycle character varying(64); +ALTER TABLE egbs_taxperiod ADD COLUMN IF NOT EXISTS periodcycle character varying(64); diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20170717105007__egbs_glcode_taxheadmaster_update_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20170717105007__egbs_glcode_taxheadmaster_update_ddl.sql index bc1a21aa50f..42c175e8613 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20170717105007__egbs_glcode_taxheadmaster_update_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20170717105007__egbs_glcode_taxheadmaster_update_ddl.sql @@ -1,6 +1,6 @@ -DROP TABLE public.egbs_taxheadmaster; +-- -- DROP TABLEpublic.egbs_taxheadmaster; -CREATE TABLE egbs_taxheadmaster +CREATE TABLE IF NOT EXISTS egbs_taxheadmaster ( id character varying(64) NOT NULL, tenantid character varying(128) NOT NULL, @@ -21,9 +21,9 @@ CREATE TABLE egbs_taxheadmaster ); -DROP TABLE public.egbs_glcodemaster; +-- -- DROP TABLE IF NOT EXISTS public.egbs_glcodemaster; -CREATE TABLE egbs_glcodemaster +CREATE TABLE IF NOT EXISTS egbs_glcodemaster ( id character varying(64) NOT NULL, tenantid character varying(128) NOT NULL, diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20170815185159__egbs_bill_billdetail_update_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20170815185159__egbs_bill_billdetail_update_ddl.sql index e041ea4705e..a8a1162b249 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20170815185159__egbs_bill_billdetail_update_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20170815185159__egbs_bill_billdetail_update_ddl.sql @@ -1,3 +1,3 @@ -ALTER TABLE egbs_bill ADD COLUMN mobilenumber character varying(20); +ALTER TABLE egbs_bill ADD COLUMN IF NOT EXISTS mobilenumber character varying(20); -ALTER TABLE egbs_billdetail ADD COLUMN receiptdate bigint, ADD COLUMN receiptnumber character varying(256); +ALTER TABLE egbs_billdetail ADD COLUMN IF NOT EXISTS receiptdate bigint, ADD COLUMN IF NOT EXISTS receiptnumber character varying(256); diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20171010161459__egbs_collected_receipts.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20171010161459__egbs_collected_receipts.sql index 8e75ff20727..6dd56a75718 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20171010161459__egbs_collected_receipts.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20171010161459__egbs_collected_receipts.sql @@ -1,6 +1,6 @@ -create sequence seq_egbs_collectedreceipts; +create sequence IF NOT EXISTS seq_egbs_collectedreceipts; -CREATE TABLE egbs_collectedreceipts +CREATE TABLE IF NOT EXISTS egbs_collectedreceipts ( id character varying(64) NOT NULL, businessservice character varying(256) NOT NULL, diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20180716114211__egbs_demand_alter_status.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20180716114211__egbs_demand_alter_status.sql index 8f3a4e7534e..9d2bb6d6412 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20180716114211__egbs_demand_alter_status.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20180716114211__egbs_demand_alter_status.sql @@ -1 +1 @@ -ALTER TABLE egbs_demand ADD COLUMN status character varying(64); +ALTER TABLE egbs_demand ADD COLUMN IF NOT EXISTS status character varying(64); diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20190423115330__demand_v1_create_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20190423115330__demand_v1_create_ddl.sql index 270b115a3d3..a8d40e39fdf 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20190423115330__demand_v1_create_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20190423115330__demand_v1_create_ddl.sql @@ -1,4 +1,4 @@ -CREATE TABLE egbs_demand_v1 +CREATE TABLE IF NOT EXISTS egbs_demand_v1 ( id character varying(64) NOT NULL, consumercode character varying(250) NOT NULL, @@ -28,7 +28,7 @@ CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_taxperiodfrom ON egbs_demand_v1(ta CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_taxperiodto ON egbs_demand_v1(taxperiodto); CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_tenantid ON egbs_demand_v1(tenantid); -CREATE TABLE egbs_demanddetail_v1 +CREATE TABLE IF NOT EXISTS egbs_demanddetail_v1 ( id character varying(64) NOT NULL, demandid character varying(64) NOT NULL, @@ -48,7 +48,7 @@ CREATE TABLE egbs_demanddetail_v1 CREATE INDEX IF NOT EXISTS idx_egbs_demanddetail_v1_tenantid ON egbs_demanddetail_v1(tenantid); CREATE INDEX IF NOT EXISTS idx_egbs_demanddetail_v1_demandid ON egbs_demanddetail_v1(demandid); -CREATE TABLE egbs_demand_v1_audit +CREATE TABLE IF NOT EXISTS egbs_demand_v1_audit ( id character varying(64) NOT NULL, demandid character varying(64) NOT NULL, @@ -67,7 +67,7 @@ CREATE TABLE egbs_demand_v1_audit CONSTRAINT pk_egbs_demand_v1_audit PRIMARY KEY (id, tenantid) ); -CREATE TABLE egbs_demanddetail_v1_audit +CREATE TABLE IF NOT EXISTS egbs_demanddetail_v1_audit ( id character varying(64) NOT NULL, demandid character varying(64) NOT NULL, diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20190423115420__bill_v1_create_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20190423115420__bill_v1_create_ddl.sql index 8394cf37012..097a0804849 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20190423115420__bill_v1_create_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20190423115420__bill_v1_create_ddl.sql @@ -1,5 +1,5 @@ -CREATE TABLE egbs_bill_v1 +CREATE TABLE IF NOT EXISTS egbs_bill_v1 ( id character varying(64) NOT NULL, tenantid character varying(250) NOT NULL, @@ -20,7 +20,7 @@ CREATE INDEX IF NOT EXISTS idx_egbs_bill_v1_id ON egbs_bill_v1(id); CREATE INDEX IF NOT EXISTS idx_egbs_bill_v1_isactive ON egbs_bill_v1(isactive); CREATE INDEX IF NOT EXISTS idx_egbs_bill_v1_tenantid ON egbs_bill_v1(tenantid); -CREATE TABLE egbs_billdetail_v1 +CREATE TABLE IF NOT EXISTS egbs_billdetail_v1 ( id character varying(64) NOT NULL, tenantid character varying(250) NOT NULL, @@ -56,7 +56,7 @@ CREATE INDEX IF NOT EXISTS idx_egbs_billdetail_v1_businessservice ON egbs_billde CREATE INDEX IF NOT EXISTS idx_egbs_billdetail_v1_consumercode ON egbs_billdetail_v1(consumercode); CREATE INDEX IF NOT EXISTS idx_egbs_billdetail_v1_tenantid ON egbs_billdetail_v1(tenantid); -CREATE TABLE egbs_billaccountdetail_v1 +CREATE TABLE IF NOT EXISTS egbs_billaccountdetail_v1 ( id character varying(64) NOT NULL, tenantid character varying(250) NOT NULL, diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20190426132020__demand_alter_add_billexpirytime.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20190426132020__demand_alter_add_billexpirytime.sql index 27755ea9299..3402c8af166 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20190426132020__demand_alter_add_billexpirytime.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20190426132020__demand_alter_add_billexpirytime.sql @@ -1,2 +1,2 @@ -ALTER TABLE EGBS_DEMAND_v1 ADD COLUMN billexpirytime bigint; -ALTER TABLE EGBS_DEMAND_v1_AUDIT ADD COLUMN billexpirytime bigint; \ No newline at end of file +ALTER TABLE EGBS_DEMAND_v1 ADD COLUMN IF NOT EXISTS billexpirytime bigint; +ALTER TABLE EGBS_DEMAND_v1_AUDIT ADD COLUMN IF NOT EXISTS billexpirytime bigint; \ No newline at end of file diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20190911165111__demand_add_contitional_constraint_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20190911165111__demand_add_contitional_constraint_ddl.sql index fe239204f5e..0beb859d560 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20190911165111__demand_add_contitional_constraint_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20190911165111__demand_add_contitional_constraint_ddl.sql @@ -1,3 +1,3 @@ ALTER TABLE egbs_demand_v1 DROP CONSTRAINT uk_egbs_demand_v1_consumercode_businessservice; -CREATE UNIQUE INDEX uk_egbs_demand_v1_consumercode_businessservice ON egbs_demand_v1 (consumercode, tenantid, taxperiodfrom, taxperiodto, businessservice, status) where status='ACTIVE'; +-- CREATE UNIQUE INDEX uk_egbs_demand_v1_consumercode_businessservice ON egbs_demand_v1 (consumercode, tenantid, taxperiodfrom, taxperiodto, businessservice, status) where status='ACTIVE'; diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20190911165929__egbs_all_indices_update_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20190911165929__egbs_all_indices_update_ddl.sql index 951fee8eef0..6b4e16b73ae 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20190911165929__egbs_all_indices_update_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20190911165929__egbs_all_indices_update_ddl.sql @@ -11,7 +11,7 @@ CREATE UNIQUE INDEX IF NOT EXISTS pk_biz_srvc_det ON public.egbs_business_servi CREATE UNIQUE INDEX IF NOT EXISTS unq_businessservice ON public.egbs_business_service_details USING btree (businessservice, tenantid); CREATE UNIQUE INDEX IF NOT EXISTS pk_egbs_collectedreceipts ON public.egbs_collectedreceipts USING btree (id, tenantid); CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_businessservice ON public.egbs_demand_v1 USING btree (businessservice); -CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_consumercode ON public.egbs_demand_v1 USING btree (consumercode); +-- CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_consumercode ON public.egbs_demand_v1 USING btree (consumercode); CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_consumertype ON public.egbs_demand_v1 USING btree (consumertype); CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_id ON public.egbs_demand_v1 USING btree (id); CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_payer ON public.egbs_demand_v1 USING btree (payer); @@ -19,7 +19,7 @@ CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_taxperiodfrom ON public.egbs_dema CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_taxperiodto ON public.egbs_demand_v1 USING btree (taxperiodto); CREATE INDEX IF NOT EXISTS idx_egbs_demand_v1_tenantid ON public.egbs_demand_v1 USING btree (tenantid); CREATE UNIQUE INDEX IF NOT EXISTS pk_egbs_demand_v1 ON public.egbs_demand_v1 USING btree (id, tenantid); -CREATE UNIQUE INDEX IF NOT EXISTS uk_egbs_demand_v1_consumercode_businessservice ON public.egbs_demand_v1 USING btree (consumercode, tenantid, taxperiodfrom, taxperiodto, businessservice); +-- CREATE UNIQUE INDEX IF NOT EXISTS uk_egbs_demand_v1_consumercode_businessservice ON public.egbs_demand_v1 USING btree (consumercode, tenantid, taxperiodfrom, taxperiodto, businessservice); CREATE UNIQUE INDEX IF NOT EXISTS pk_egbs_demand_v1_audit ON public.egbs_demand_v1_audit USING btree (id, tenantid); CREATE INDEX IF NOT EXISTS idx_egbs_demanddetail_v1_demandid ON public.egbs_demanddetail_v1 USING btree (demandid); CREATE INDEX IF NOT EXISTS idx_egbs_demanddetail_v1_tenantid ON public.egbs_demanddetail_v1 USING btree (tenantid); diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20191003140130__egbs_bill_v1_alter_add_columns_dml.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20191003140130__egbs_bill_v1_alter_add_columns_dml.sql index eb93c3d5c00..8173d835eaa 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20191003140130__egbs_bill_v1_alter_add_columns_dml.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20191003140130__egbs_bill_v1_alter_add_columns_dml.sql @@ -1,5 +1,5 @@ -ALTER TABLE egbs_bill_v1 ADD COLUMN status character varying(64), ADD COLUMN additionaldetails jsonb; +ALTER TABLE egbs_bill_v1 ADD COLUMN IF NOT EXISTS status character varying(64), ADD COLUMN IF NOT EXISTS additionaldetails jsonb; -ALTER TABLE egbs_billdetail_v1 ADD COLUMN additionaldetails jsonb; +ALTER TABLE egbs_billdetail_v1 ADD COLUMN IF NOT EXISTS additionaldetails jsonb; -ALTER TABLE egbs_billaccountdetail_v1 ADD COLUMN additionaldetails jsonb; \ No newline at end of file +ALTER TABLE egbs_billaccountdetail_v1 ADD COLUMN IF NOT EXISTS additionaldetails jsonb; \ No newline at end of file diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20200403102937__bill_add_filestoreid_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20200403102937__bill_add_filestoreid_ddl.sql index d8d12d3491f..c5674623277 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20200403102937__bill_add_filestoreid_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20200403102937__bill_add_filestoreid_ddl.sql @@ -1 +1 @@ -ALTER TABLE egbs_bill_v1 ADD COLUMN filestoreid character varying(256); +ALTER TABLE egbs_bill_v1 ADD COLUMN IF NOT EXISTS filestoreid character varying(256); diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20201216123333__egbs_payment_backupdate_audit_create.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20201216123333__egbs_payment_backupdate_audit_create.sql index 5815e976eb6..182fc24f0d7 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20201216123333__egbs_payment_backupdate_audit_create.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20201216123333__egbs_payment_backupdate_audit_create.sql @@ -1,4 +1,4 @@ -CREATE TABLE egbs_payment_backupdate_audit +CREATE TABLE IF NOT EXISTS egbs_payment_backupdate_audit ( paymentid character varying(256) NOT NULL, @@ -9,5 +9,5 @@ CREATE TABLE egbs_payment_backupdate_audit errorMessage character varying ); -CREATE UNIQUE INDEX uk_egbs_payment_backupdate_audit ON egbs_payment_backupdate_audit (paymentid, isreceiptcancellation) WHERE isbackupdatesuccess='TRUE'; +CREATE UNIQUE INDEX IF NOT EXISTS uk_egbs_payment_backupdate_audit ON egbs_payment_backupdate_audit (paymentid, isreceiptcancellation) WHERE isbackupdatesuccess='TRUE'; \ No newline at end of file diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20210106124130__egbs_demand_paymentcompleted_field_added.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20210106124130__egbs_demand_paymentcompleted_field_added.sql index 6da9950f151..d81fe763cfe 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20210106124130__egbs_demand_paymentcompleted_field_added.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20210106124130__egbs_demand_paymentcompleted_field_added.sql @@ -1,2 +1,2 @@ -ALTER TABLE EGBS_DEMAND_v1 ADD COLUMN ispaymentcompleted BOOLEAN DEFAULT false; -ALTER TABLE EGBS_DEMAND_v1_AUDIT ADD COLUMN ispaymentcompleted BOOLEAN; +ALTER TABLE EGBS_DEMAND_v1 ADD COLUMN IF NOT EXISTS ispaymentcompleted BOOLEAN DEFAULT false; +ALTER TABLE EGBS_DEMAND_v1_AUDIT ADD COLUMN IF NOT EXISTS ispaymentcompleted BOOLEAN; diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20210118093315__egbs_amendment_create_ddl.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20210118093315__egbs_amendment_create_ddl.sql index 87822e16f98..103fdc2ad12 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20210118093315__egbs_amendment_create_ddl.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20210118093315__egbs_amendment_create_ddl.sql @@ -1,4 +1,4 @@ -CREATE TABLE EGBS_AMENDMENT +CREATE TABLE IF NOT EXISTS EGBS_AMENDMENT ( id CHARACTER VARYING (256) NOT NULL, tenantid CHARACTER VARYING (256) NOT NULL, @@ -21,7 +21,7 @@ CREATE TABLE EGBS_AMENDMENT CONSTRAINT uk_egbs_amendment UNIQUE (id) ); -CREATE TABLE EGBS_AMENDMENT_TAXDETAIL +CREATE TABLE IF NOT EXISTS EGBS_AMENDMENT_TAXDETAIL ( id CHARACTER VARYING (128) NOT NULL, amendmentid CHARACTER VARYING (128) NOT NULL, @@ -31,7 +31,7 @@ CREATE TABLE EGBS_AMENDMENT_TAXDETAIL CONSTRAINT pk_egbs_amendment_taxdetail PRIMARY KEY (id, amendmentid) ); -CREATE TABLE egbs_document +CREATE TABLE IF NOT EXISTS egbs_document ( id CHARACTER VARYING (128) NOT NULL, amendmentid CHARACTER VARYING (256) NOT NULL, diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20210203150330__egbs_demand_fixedexpirydat.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20210203150330__egbs_demand_fixedexpirydat.sql index 942b9543a59..fcdebc8a6b0 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20210203150330__egbs_demand_fixedexpirydat.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20210203150330__egbs_demand_fixedexpirydat.sql @@ -1,2 +1,2 @@ -ALTER TABLE EGBS_DEMAND_v1 ADD COLUMN fixedBillExpiryDate BIGINT; -ALTER TABLE EGBS_DEMAND_v1_AUDIT ADD COLUMN fixedBillExpiryDate BIGINT; +ALTER TABLE EGBS_DEMAND_v1 ADD COLUMN IF NOT EXISTS fixedBillExpiryDate BIGINT; +ALTER TABLE EGBS_DEMAND_v1_AUDIT ADD COLUMN IF NOT EXISTS fixedBillExpiryDate BIGINT; diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20221130141020__egbs_bill_alter_add_userid.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20221130141020__egbs_bill_alter_add_userid.sql index e37239ab9a7..2b8b1ab5b97 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20221130141020__egbs_bill_alter_add_userid.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20221130141020__egbs_bill_alter_add_userid.sql @@ -1 +1 @@ -ALTER TABLE egbs_bill_v1 add column payerid character varying (128); \ No newline at end of file +ALTER TABLE egbs_bill_v1 add column IF NOT EXISTS payerid character varying (128); \ No newline at end of file diff --git a/business-services/billing-service/src/main/resources/db/migration/main/V20221206104420__egbs_bill_alter_add_consumercode.sql b/business-services/billing-service/src/main/resources/db/migration/main/V20221206104420__egbs_bill_alter_add_consumercode.sql index a8ed241df52..fdae9ddecc3 100644 --- a/business-services/billing-service/src/main/resources/db/migration/main/V20221206104420__egbs_bill_alter_add_consumercode.sql +++ b/business-services/billing-service/src/main/resources/db/migration/main/V20221206104420__egbs_bill_alter_add_consumercode.sql @@ -2,6 +2,6 @@ ALTER TABLE egbs_bill_v1 ADD COLUMN IF NOT EXISTS consumercode CHARACTER VARYING UPDATE egbs_bill_v1 b SET consumerCode = bd.consumercode FROM egbs_billdetail_v1 bd WHERE bd.billid = b.id; -ALTER TABLE egbs_bill_v1 ALTER COLUMN consumercode SET NOT NULL; +-- ALTER TABLE egbs_bill_v1 ALTER COLUMN consumercode SET NOT NULL; -CREATE UNIQUE INDEX IF NOT EXISTS index_egbs_UNIQUE_ACTIVE_BILL ON egbs_bill_v1 (consumercode, tenantid, status) where status='ACTIVE'; \ No newline at end of file +-- CREATE UNIQUE INDEX IF NOT EXISTS index_egbs_UNIQUE_ACTIVE_BILL ON egbs_bill_v1 (consumercode, tenantid, status) where status='ACTIVE'; \ No newline at end of file diff --git a/business-services/collection-services/src/main/java/org/egov/collection/model/Payment.java b/business-services/collection-services/src/main/java/org/egov/collection/model/Payment.java index 47af99c69d6..554ee13a76c 100644 --- a/business-services/collection-services/src/main/java/org/egov/collection/model/Payment.java +++ b/business-services/collection-services/src/main/java/org/egov/collection/model/Payment.java @@ -14,6 +14,7 @@ import javax.validation.constraints.Size; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; @Data @@ -81,7 +82,7 @@ public class Payment { @SafeHtml @Size(max=128) @NotNull - @Pattern(regexp = "^[a-zA-Z]+(([_\\-'`\\. ][a-zA-Z ])?[a-zA-Z]*)*$", message = "Invalid name. Only alphabets and special characters -, ',`, ., _") + // @Pattern(regexp = "^[a-zA-Z]+(([_\\-'`\\. ][a-zA-Z ])?[a-zA-Z]*)*$", message = "Invalid name. Only alphabets and special characters -, ',`, ., _") @JsonProperty("paidBy") private String paidBy = null; @@ -93,7 +94,7 @@ public class Payment { @SafeHtml @Size(max=128) - @Pattern(regexp = "^[a-zA-Z ]+(([_\\-'`\\. ][a-zA-Z ])?[a-zA-Z]*)*$", message = "Invalid name. Only alphabets and special characters -, ',`, ., _") + //@Pattern(regexp = "^[a-zA-Z ]+(([_\\-'`\\. ][a-zA-Z ])?[a-zA-Z]*)*$", message = "Invalid name. Only alphabets and special characters -, ',`, ., _") @JsonProperty("payerName") private String payerName = null; @@ -120,6 +121,17 @@ public class Payment { @JsonProperty("fileStoreId") private String fileStoreId; + @JsonProperty("usageCategory") + private String usageCategory; + + @JsonProperty("address") + private String address; + + @JsonProperty("propertyDetail") + private HashMap propertyDetail; + + @JsonProperty("propertyid") + private String PropertyId = null; public Payment addpaymentDetailsItem(PaymentDetail paymentDetail) { if (this.paymentDetails == null) { diff --git a/business-services/collection-services/src/main/java/org/egov/collection/model/PaymentSearchCriteria.java b/business-services/collection-services/src/main/java/org/egov/collection/model/PaymentSearchCriteria.java index 647d5fd1331..846c43e403c 100644 --- a/business-services/collection-services/src/main/java/org/egov/collection/model/PaymentSearchCriteria.java +++ b/business-services/collection-services/src/main/java/org/egov/collection/model/PaymentSearchCriteria.java @@ -39,6 +39,7 @@ public class PaymentSearchCriteria { private Set consumerCodes; private Set businessServices; + private String businessService; private String transactionNumber; diff --git a/business-services/collection-services/src/main/java/org/egov/collection/model/enums/PaymentModeEnum.java b/business-services/collection-services/src/main/java/org/egov/collection/model/enums/PaymentModeEnum.java index a91abf8c890..50f8a6af496 100644 --- a/business-services/collection-services/src/main/java/org/egov/collection/model/enums/PaymentModeEnum.java +++ b/business-services/collection-services/src/main/java/org/egov/collection/model/enums/PaymentModeEnum.java @@ -13,7 +13,8 @@ public enum PaymentModeEnum { ONLINE_NEFT("ONLINE_NEFT"), ONLINE_RTGS("ONLINE_RTGS"), POSTAL_ORDER("POSTAL_ORDER"), - CARD("CARD"); + CARD("CARD"), + QR_CODE("QR_CODE"); private String value; diff --git a/business-services/collection-services/src/main/java/org/egov/collection/repository/BusinessDetailsRepository.java b/business-services/collection-services/src/main/java/org/egov/collection/repository/BusinessDetailsRepository.java new file mode 100644 index 00000000000..8565f4db8a9 --- /dev/null +++ b/business-services/collection-services/src/main/java/org/egov/collection/repository/BusinessDetailsRepository.java @@ -0,0 +1,53 @@ +package org.egov.collection.repository; + +import lombok.extern.slf4j.Slf4j; +import org.egov.collection.web.contract.BusinessDetailsResponse; +import org.egov.collection.web.contract.factory.RequestInfoWrapper; +import org.egov.common.contract.request.RequestInfo; +import org.egov.tracer.model.CustomException; +import org.egov.tracer.model.ServiceCallException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Repository; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.RestTemplate; + +import java.util.List; + +@Repository +@Slf4j +public class BusinessDetailsRepository { + + public static final Logger LOGGER = LoggerFactory.getLogger(BusinessDetailsRepository.class); + + @Autowired + private RestTemplate restTemplate; + + private String url; + + public BusinessDetailsRepository(RestTemplate restTemplate,@Value("${egov.common.service.host}") final String commonServiceHost, + @Value("${egov.services.get_businessdetails_by_codes}") final String url) { + this.restTemplate = restTemplate; + this.url = commonServiceHost + url; + } + + public BusinessDetailsResponse getBusinessDetails(List businessCodes,String tenantId,RequestInfo requestInfo) { + RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); + requestInfoWrapper.setRequestInfo(requestInfo); + String businessDetailsCodes = String.join(",", businessCodes); + try { + return restTemplate.postForObject(url, requestInfoWrapper, + BusinessDetailsResponse.class, tenantId, businessDetailsCodes); + } catch (HttpClientErrorException e) { + log.error("Unable to fetch business detail for {} and tenant id {} from egov-common-masters, " , + businessCodes, tenantId, e); + throw new ServiceCallException(e.getResponseBodyAsString()); + } catch (Exception e) { + log.error("Unable to fetch business detail for {} and tenant id, " , businessCodes, tenantId, e); + throw new CustomException("BUSINESS_DETAIL_SERVICE_ERROR", "Unable to fetch business detail from " + + "egov-common-masters, unknown error occurred"); + } + } +} diff --git a/business-services/collection-services/src/main/java/org/egov/collection/repository/PaymentRepository.java b/business-services/collection-services/src/main/java/org/egov/collection/repository/PaymentRepository.java index 1d9bf523c1a..a15d01ec420 100644 --- a/business-services/collection-services/src/main/java/org/egov/collection/repository/PaymentRepository.java +++ b/business-services/collection-services/src/main/java/org/egov/collection/repository/PaymentRepository.java @@ -241,13 +241,68 @@ public void updateFileStoreId(List> idToFileStoreIdMaps){ } + public void updateFileStoreIdToNull(Payment payment){ + + + List fileStoreIdSource = new ArrayList<>(); + + MapSqlParameterSource sqlParameterSource = new MapSqlParameterSource(); + sqlParameterSource.addValue("id",payment.getId()); + fileStoreIdSource.add(sqlParameterSource); + + namedParameterJdbcTemplate.batchUpdate(FILESTOREID_UPDATE_NULL_PAYMENT_SQL,fileStoreIdSource.toArray(new MapSqlParameterSource[0])); + + } + public List fetchPaymentIds(PaymentSearchCriteria paymentSearchCriteria) { + StringBuilder query = new StringBuilder("SELECT id from egcl_payment "); + boolean whereCluaseApplied= false ; + boolean isTenantPresent= true ; Map preparedStatementValues = new HashMap<>(); preparedStatementValues.put("offset", paymentSearchCriteria.getOffset()); preparedStatementValues.put("limit", paymentSearchCriteria.getLimit()); + if(paymentSearchCriteria.getTenantId() != null && !paymentSearchCriteria.getTenantId().equals("pb")) { + query.append(" WHERE tenantid=:tenantid "); + preparedStatementValues.put("tenantid", paymentSearchCriteria.getTenantId()); + whereCluaseApplied=true; + }else { + isTenantPresent = false; + whereCluaseApplied=false; + query.append(" WHERE id in (select paymentid from egcl_paymentdetail WHERE createdtime between :fromDate and :toDate) "); + preparedStatementValues.put("fromDate", paymentSearchCriteria.getFromDate()); + preparedStatementValues.put("toDate", paymentSearchCriteria.getToDate()); + } + + if(paymentSearchCriteria.getBusinessServices() != null && isTenantPresent && whereCluaseApplied) { + if(whereCluaseApplied) { + query.append(" AND id in (select paymentid from egcl_paymentdetail where tenantid=:tenantid AND businessservice=:businessservice) "); + preparedStatementValues.put("tenantid", paymentSearchCriteria.getTenantId()); + preparedStatementValues.put("businessservice", paymentSearchCriteria.getBusinessServices()); - return namedParameterJdbcTemplate.query("SELECT id from egcl_payment ORDER BY createdtime offset " + ":offset " + "limit :limit", preparedStatementValues, new SingleColumnRowMapper<>(String.class)); + } + } + + if(paymentSearchCriteria.getBusinessService() != null && isTenantPresent && whereCluaseApplied) { + log.info("In side the repo before query: " + paymentSearchCriteria.getBusinessService() ); + query.append(" AND id in (select paymentid from egcl_paymentdetail where tenantid=:tenantid AND businessservice=:businessservice) "); + preparedStatementValues.put("tenantid", paymentSearchCriteria.getTenantId()); + preparedStatementValues.put("businessservice", paymentSearchCriteria.getBusinessService()); + } + + if(paymentSearchCriteria.getFromDate() != null && isTenantPresent && whereCluaseApplied) { + log.info("In side the repo before query: " + paymentSearchCriteria.getBusinessService() ); + query.append(" AND createdtime between :fromDate and :toDate"); + preparedStatementValues.put("fromDate", paymentSearchCriteria.getFromDate()); + preparedStatementValues.put("toDate", paymentSearchCriteria.getToDate()); + + } + + + query.append(" ORDER BY createdtime offset " + ":offset " + "limit :limit"); + + log.info("fetchPaymentIds query: " + query.toString() ); + return namedParameterJdbcTemplate.query(query.toString(), preparedStatementValues, new SingleColumnRowMapper<>(String.class)); } @@ -257,6 +312,141 @@ public List fetchPaymentIdsByCriteria(PaymentSearchCriteria paymentSearc return namedParameterJdbcTemplate.query(query, preparedStatementValues, new SingleColumnRowMapper<>(String.class)); } + public List fetchPropertyDetail(String consumerCode) { + List status = new ArrayList(); + List oldConnectionno = fetchOldConnectionNo(consumerCode); + List plotSize = fetchLandArea(consumerCode); + List usageCategory = fetchUsageCategory(consumerCode); + if(oldConnectionno.size()>0) + status.add(oldConnectionno.get(0)); + if(plotSize.size()>0) + status.add(plotSize.get(0)); + if(usageCategory.size()>0) + status.add(usageCategory.get(0)); + return status; + } + + + + + + + + + + + public List fetchOldConnectionNo(String consumerCode) { + List res = new ArrayList<>(); + String queryString = "select oldconnectionno from eg_ws_connection where connectionno='"+consumerCode+"'"; + log.info("Query: " +queryString); + try { + // res = jdbcTemplate.queryForList(queryString, String.class); + res = namedParameterJdbcTemplate.query(queryString, new SingleColumnRowMapper<>(String.class)); + } catch (Exception ex) { + log.error("Exception while reading bill scheduler status" + ex.getMessage()); + } + return res; + } + + public List fetchLandArea(String consumerCode) { + List res = new ArrayList<>(); + Map preparedStatementValues = new HashMap<>(); + String queryString = "select a2.landarea from eg_ws_connection a1 inner join eg_pt_property a2 on a1.property_id= a2.propertyid" + + " where a1.connectionno = '"+consumerCode+"'"; + log.info("Query: " +queryString); + try { + //res = jdbcTemplate.queryForList(queryString, String.class); + res = namedParameterJdbcTemplate.query(queryString, preparedStatementValues, new SingleColumnRowMapper<>(String.class)); + } catch (Exception ex) { + log.error("Exception while reading bill scheduler status" + ex.getMessage()); + } + return res; + } + + + + public List fetchUsageCategory(String consumerCode) { + List res = new ArrayList<>(); + Map preparedStatementValues = new HashMap<>(); + String queryString = "select a2.usagecategory from eg_ws_connection a1 inner join eg_pt_property a2 on a1.property_id= a2.propertyid" + + " where a1.connectionno = '"+consumerCode+"'"; + log.info("Query: " +queryString); + try { + // res = jdbcTemplate.queryForList(queryString, String.class); + res = namedParameterJdbcTemplate.query(queryString, preparedStatementValues, new SingleColumnRowMapper<>(String.class)); + } catch (Exception ex) { + log.error("Exception while reading bill scheduler status" + ex.getMessage()); + } + return res; + } + + + + + + + + + public List fetchUsageCategoryByApplicationno(Set consumerCodes) { + List res = new ArrayList<>(); + String consumercode = null; + Iterator iterate = consumerCodes.iterator(); + while(iterate.hasNext()) { + consumercode = iterate.next(); + } + Map preparedStatementValues = new HashMap<>(); + String queryString; + if (consumercode.contains("WS_AP")) { + queryString = "select a2.usagecategory from eg_ws_connection a1 " + + " inner join eg_pt_property a2 on a1.property_id = a2.propertyid " + + " inner join eg_pt_address a3 on a2.id=a3.propertyid " + + " where a1.applicationno='"+consumercode+"'"; + log.info("Query for fetchPaymentIdsByCriteria: " +queryString); + } else { + queryString = "select a2.usagecategory from eg_sw_connection a1 " + + " inner join eg_pt_property a2 on a1.property_id = a2.propertyid " + + " inner join eg_pt_address a3 on a2.id=a3.propertyid " + + " where a1.applicationno='"+consumercode+"'"; + log.info("Query for fetchPaymentIdsByCriteria: " +queryString); + } + try { + res = namedParameterJdbcTemplate.query(queryString, preparedStatementValues, new SingleColumnRowMapper<>(String.class)); + } catch (Exception ex) { + log.error("Exception while reading usage category" + ex.getMessage()); + } + return res; + } + public List fetchAddressByApplicationno(Set consumerCodes) { + List res = new ArrayList<>(); + String consumercode = null; + Iterator iterate = consumerCodes.iterator(); + while(iterate.hasNext()) { + consumercode = iterate.next(); + } + Map preparedStatementValues = new HashMap<>(); + String queryString; + if (consumercode.contains("WS_AP")) { + queryString = "select CONCAT(doorno,buildingname,city) as address from eg_ws_connection a1 " + + " inner join eg_pt_property a2 on a1.property_id = a2.propertyid " + + " inner join eg_pt_address a3 on a2.id=a3.propertyid " + + " where a1.applicationno='"+consumercode+"'"; + log.info("Query for fetchAddressByApplicationno: " +queryString); + } + else { + queryString = "select CONCAT(doorno,buildingname,city) as address from eg_sw_connection a1 " + + " inner join eg_pt_property a2 on a1.property_id = a2.propertyid " + + " inner join eg_pt_address a3 on a2.id=a3.propertyid " + + " where a1.applicationno='"+consumercode+"'"; + log.info("Query for fetchAddressByApplicationno: " +queryString); + } + try { + res = namedParameterJdbcTemplate.query(queryString, preparedStatementValues, new SingleColumnRowMapper<>(String.class)); + } catch (Exception ex) { + log.error("Exception while reading usage category" + ex.getMessage()); + } + return res; + } + /** * API is to get the distinct ifsccode from payment * @@ -268,7 +458,20 @@ public List fetchIfsccode() { new SingleColumnRowMapper<>(String.class)); } - +public List fetchConsumerCodeByReceiptNumber(String receiptnumber) { + List res = new ArrayList<>(); + Map preparedStatementValues = new HashMap<>(); + String queryString = "select bill.consumercode from egcl_paymentdetail pd, egcl_bill bill " + + " where bill.id=pd.billid " + + " and pd.receiptnumber='"+receiptnumber+"'"; + log.info("Query: " +queryString); + try { + res = namedParameterJdbcTemplate.query(queryString, preparedStatementValues, new SingleColumnRowMapper<>(String.class)); + } catch (Exception ex) { + log.error("Exception while reading usage category" + ex.getMessage()); + } + return res; + } /** * API, All payments with @param ifsccode, additional details updated * with @param additionaldetails diff --git a/business-services/collection-services/src/main/java/org/egov/collection/repository/querybuilder/PaymentQueryBuilder.java b/business-services/collection-services/src/main/java/org/egov/collection/repository/querybuilder/PaymentQueryBuilder.java index 8ab41858e3e..71b5e06ae15 100644 --- a/business-services/collection-services/src/main/java/org/egov/collection/repository/querybuilder/PaymentQueryBuilder.java +++ b/business-services/collection-services/src/main/java/org/egov/collection/repository/querybuilder/PaymentQueryBuilder.java @@ -43,16 +43,7 @@ public class PaymentQueryBuilder { " FROM egcl_payment py " + " INNER JOIN egcl_paymentdetail pyd ON pyd.paymentid = py.id "; - public static final String SELECT_COUNT_PAYMENT_SQL = "SELECT count(distinct(py.id)) FROM egcl_payment py " - + "INNER JOIN egcl_paymentdetail pyd ON pyd.paymentid = py.id where pyd.businessservice= :businessservice and pyd.tenantid= :tenantid "; - - /*public static final String ID_QUERY = "SELECT DISTINCT py.id as id,py.transactiondate as date " + - " FROM egcl_payment py " + - " INNER JOIN egcl_paymentdetail pyd ON pyd.paymentid = py.id " + - " INNER JOIN egcl_bill bill ON bill.id = pyd.billid " + - " INNER JOIN egcl_billdetial bd ON bd.billid = bill.id " ;*/ - - public static final String ID_QUERY = "WITH py_filtered as (" + + public static final String ID_QUERY = "WITH py_filtered as (" + "select id from egcl_payment as py_inner {{WHERE_CLAUSE}} ) " + " SELECT py.id as id FROM py_filtered as py " + " INNER JOIN egcl_paymentdetail as pyd ON pyd.paymentid = py.id and pyd.tenantid {{operator}} :tenantId " + @@ -144,6 +135,7 @@ public class PaymentQueryBuilder { public static final String FILESTOREID_UPDATE_PAYMENT_SQL = "UPDATE egcl_payment SET filestoreid=:filestoreid WHERE id=:id;"; + public static final String FILESTOREID_UPDATE_NULL_PAYMENT_SQL = "UPDATE egcl_payment SET filestoreid=null WHERE id=:id;"; // Payment update queries @@ -178,7 +170,14 @@ public class PaymentQueryBuilder { + "LEFT OUTER JOIN egcl_billaccountdetail ad ON bd.id = ad.billdetailid AND bd.tenantid = ad.tenantid " + "WHERE b.id IN (:id);"; + public static final String SELECT_COUNT_PAYMENT_SQL = "SELECT count(distinct(py.id)) FROM egcl_payment py " + + "INNER JOIN egcl_paymentdetail pyd ON pyd.paymentid = py.id where pyd.businessservice= :businessservice and pyd.tenantid= :tenantid "; + /*public static final String ID_QUERY = "SELECT DISTINCT py.id as id,py.transactiondate as date " + + " FROM egcl_payment py " + + " INNER JOIN egcl_paymentdetail pyd ON pyd.paymentid = py.id " + + " INNER JOIN egcl_bill bill ON bill.id = pyd.billid " + + " INNER JOIN egcl_billdetial bd ON bd.billid = bill.id " ;*/ public static final String UPDATE_PAYMENT_BANKDETAIL_SQL = "UPDATE egcl_payment SET additionaldetails = jsonb_set(additionaldetails, '{bankDetails}', :additionaldetails, true) WHERE length(additionaldetails :: text) is not null and length(additionaldetails :: text) > 4 and jsonb_typeof( additionaldetails ::jsonb ) ='object' and ifsccode=:ifsccode "; public static final String UPDATE_PAYMENT_BANKDETAIL_EMPTYADDTL_SQL = "UPDATE egcl_payment SET additionaldetails = :additionaldetails ::jsonb WHERE (length(additionaldetails :: text) is null or length(additionaldetails :: text) = 4) and ifsccode=:ifsccode "; public static final String UPDATE_PAYMENT_BANKDETAIL_ARRAYADDTL_SQL = "UPDATE egcl_payment SET additionaldetails = additionaldetails || :additionaldetails ::jsonb WHERE length(additionaldetails :: text) is not null and length(additionaldetails :: text) > 4 and jsonb_typeof(additionaldetails ::jsonb) ='array' and ifsccode=:ifsccode "; diff --git a/business-services/collection-services/src/main/java/org/egov/collection/service/PaymentService.java b/business-services/collection-services/src/main/java/org/egov/collection/service/PaymentService.java index 48fd7f8e457..da35c88c279 100644 --- a/business-services/collection-services/src/main/java/org/egov/collection/service/PaymentService.java +++ b/business-services/collection-services/src/main/java/org/egov/collection/service/PaymentService.java @@ -21,7 +21,11 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; + +@Slf4j @Service public class PaymentService { @@ -39,6 +43,9 @@ public class PaymentService { private CollectionProducer producer; + @Autowired + private ObjectMapper objectMapper; + @Autowired public PaymentService(ApportionerService apportionerService, PaymentEnricher paymentEnricher, ApplicationProperties applicationProperties, @@ -78,7 +85,36 @@ public List getPayments(RequestInfo requestInfo, PaymentSearchCriteria paymentSearchCriteria.setPayerIds(payerIds); }*/ List payments = paymentRepository.fetchPayments(paymentSearchCriteria); - + if(null != paymentSearchCriteria.getBusinessService()){ + if(paymentSearchCriteria.getBusinessService().equals("WS.ONE_TIME_FEE")|| paymentSearchCriteria.getBusinessService().equals("SW.ONE_TIME_FEE")) { + List usageCategory = paymentRepository.fetchUsageCategoryByApplicationno(paymentSearchCriteria.getConsumerCodes()); + List address = paymentRepository.fetchAddressByApplicationno(paymentSearchCriteria.getConsumerCodes()); + payments.get(0).setUsageCategory(usageCategory.get(0)); + payments.get(0).setAddress(address.get(0)); + } + }else if(null != paymentSearchCriteria.getReceiptNumbers()){ + String receiptnumber = null; + Iterator iterate = paymentSearchCriteria.getReceiptNumbers().iterator(); + while(iterate.hasNext()) { + receiptnumber = iterate.next(); + } + String receipt[]=receiptnumber.split("/"); + String businessservice= receipt[0]; + // if(businessservice.equals("WS")||businessservice.equals("SW")) { + // setPropertyData(receiptnumber,payments); + // } +// if((businessservice.equals("WS")||businessservice.equals("SW") )|| payments.get(0).getAddress().isEmpty()) { +// List usageCategory = paymentRepository.fetchUsageCategoryByApplicationnos(paymentSearchCriteria.getReceiptNumbers(),businessservice); +// List address = paymentRepository.fetchAddressByApplicationnos(paymentSearchCriteria.getReceiptNumbers(),businessservice); +// List propertyIds = paymentRepository.fetchPropertyid(paymentSearchCriteria.getReceiptNumbers(), businessservice); + +// // setPropertyData(receiptnumber,payments); +// payments.get(0).setUsageCategory(usageCategory.get(0)); +// payments.get(0).setAddress(address.get(0)); +// payments.get(0).setPropertyId(propertyIds.get(0)); + +// } + } return payments; } @@ -88,7 +124,12 @@ public Long getpaymentcountForBusiness (String tenantId, String businessService) } - + @Transactional + public Payment updatePaymentForFilestore(Payment payment) { + + paymentRepository.updateFileStoreIdToNull(payment); + return payment; + } /** * Handles creation of a receipt, including multi-service, involves the following steps, - Enrich receipt from billing service @@ -101,7 +142,7 @@ public Long getpaymentcountForBusiness (String tenantId, String businessService) @Transactional public Payment createPayment(PaymentRequest paymentRequest) { - paymentEnricher.enrichPaymentPreValidate(paymentRequest); + paymentEnricher.enrichPaymentPreValidate(paymentRequest,false); paymentValidator.validatePaymentForCreate(paymentRequest); paymentEnricher.enrichPaymentPostValidate(paymentRequest); @@ -122,6 +163,20 @@ public Payment createPayment(PaymentRequest paymentRequest) { } + private void setPropertyData(String receiptnumber,List payments) { + List consumercode = paymentRepository.fetchConsumerCodeByReceiptNumber(receiptnumber); + String connectionno = consumercode.get(0); + List status = paymentRepository.fetchPropertyDetail(connectionno); + HashMap additionalDetail = new HashMap<>(); + if(!StringUtils.isEmpty(status.get(0))) + additionalDetail.put("oldConnectionno", status.get(0)); + if(!StringUtils.isEmpty(status.get(1))) + additionalDetail.put("landArea", status.get(1)); + if(!StringUtils.isEmpty(status.get(2))) + additionalDetail.put("usageCategory", status.get(2)); + payments.get(0).setPropertyDetail(additionalDetail); + } + /** * If Citizen is paying, the id of the logged in user becomes payer id. * If Employee is paying, @@ -185,7 +240,7 @@ public List updatePayment(PaymentRequest paymentRequest) { */ @Transactional public Payment vaidateProvisonalPayment(PaymentRequest paymentRequest) { - paymentEnricher.enrichPaymentPreValidate(paymentRequest); + paymentEnricher.enrichPaymentPreValidate(paymentRequest,false); paymentValidator.validatePaymentForCreate(paymentRequest); return paymentRequest.getPayment(); @@ -194,6 +249,9 @@ public Payment vaidateProvisonalPayment(PaymentRequest paymentRequest) { public List plainSearch(PaymentSearchCriteria paymentSearchCriteria) { PaymentSearchCriteria searchCriteria = new PaymentSearchCriteria(); + log.info("plainSearch Service BusinessServices"+paymentSearchCriteria.getBusinessServices() +"plainSearch Service Date "+ + paymentSearchCriteria.getFromDate() +" to "+paymentSearchCriteria.getToDate() +"Teant IT "+paymentSearchCriteria.getTenantId()+" \"plainSearch Service BusinessServices\"+paymentSearchCriteria.getBusinessService():"+paymentSearchCriteria.getBusinessService()); + if (applicationProperties.isPaymentsSearchPaginationEnabled()) { searchCriteria.setOffset(isNull(paymentSearchCriteria.getOffset()) ? 0 : paymentSearchCriteria.getOffset()); searchCriteria.setLimit(isNull(paymentSearchCriteria.getLimit()) ? applicationProperties.getReceiptsSearchDefaultLimit() : paymentSearchCriteria.getLimit()); @@ -202,6 +260,30 @@ public List plainSearch(PaymentSearchCriteria paymentSearchCriteria) { searchCriteria.setLimit(applicationProperties.getReceiptsSearchDefaultLimit()); } + if(paymentSearchCriteria.getTenantId() != null) { + searchCriteria.setTenantId(paymentSearchCriteria.getTenantId()); + } + + if(paymentSearchCriteria.getBusinessServices() != null) { + log.info("in PaymentService.java paymentSearchCriteria.getBusinessServices(): " + paymentSearchCriteria.getBusinessServices()); + searchCriteria.setBusinessServices(paymentSearchCriteria.getBusinessServices()); + } + + if(paymentSearchCriteria.getBusinessService() != null) { + log.info("in PaymentService.java paymentSearchCriteria.getBusinessService(): " + paymentSearchCriteria.getBusinessService()); + searchCriteria.setBusinessService(paymentSearchCriteria.getBusinessService()); + } + + + + + if((paymentSearchCriteria.getFromDate() !=null && paymentSearchCriteria.getFromDate()>0 ) && (paymentSearchCriteria.getToDate() !=null && paymentSearchCriteria.getToDate()>0 ) ) + { + searchCriteria.setToDate(paymentSearchCriteria.getToDate()); + searchCriteria.setFromDate(paymentSearchCriteria.getFromDate()); + + } + List ids = paymentRepository.fetchPaymentIds(searchCriteria); if (ids.isEmpty()) return Collections.emptyList(); @@ -211,4 +293,28 @@ public List plainSearch(PaymentSearchCriteria paymentSearchCriteria) { } + + @Transactional + public Payment createPaymentForWSMigration(PaymentRequest paymentRequest) { + + paymentEnricher.enrichPaymentPreValidate(paymentRequest,true); + paymentValidator.validatePaymentForCreateWSMigration(paymentRequest); + paymentEnricher.enrichPaymentPostValidate(paymentRequest); + + Payment payment = paymentRequest.getPayment(); + Map billIdToApportionedBill = apportionerService.apportionBill(paymentRequest); + paymentEnricher.enrichAdvanceTaxHead(new LinkedList<>(billIdToApportionedBill.values())); + setApportionedBillsToPayment(billIdToApportionedBill,payment); + + String payerId = createUser(paymentRequest); + if(!StringUtils.isEmpty(payerId)) + payment.setPayerId(payerId); + paymentRepository.savePayment(payment); + + // producer.producer(applicationProperties.getCreatePaymentTopicName(), paymentRequest); + + + return payment; + } + } diff --git a/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentEnricher.java b/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentEnricher.java index 142659f2a1a..919149e6a8c 100644 --- a/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentEnricher.java +++ b/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentEnricher.java @@ -56,7 +56,7 @@ public class PaymentEnricher { @Autowired private MDMSService mdmsService; - public void enrichPaymentPreValidate(PaymentRequest paymentRequest) { + public void enrichPaymentPreValidate(PaymentRequest paymentRequest,boolean ismigration) { Payment payment = paymentRequest.getPayment(); String tenantId = payment.getTenantId(); @@ -132,8 +132,11 @@ else if(billingServiceMaster==null){ paymentDetail.setId(UUID.randomUUID().toString()); paymentDetail.setTenantId(payment.getTenantId()); paymentDetail.setAuditDetails(auditDetails); + if(!ismigration) { + paymentDetail.setReceiptDate(System.currentTimeMillis()); + } paymentDetail.setReceiptType(ReceiptType.BILLBASED.toString()); - paymentDetail.setReceiptDate(System.currentTimeMillis()); + paymentDetail.setTotalDue(billIdToBillMap.get(paymentDetail.getBillId()).getTotalAmount()); }); if (!errorMap.isEmpty()) diff --git a/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentValidator.java b/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentValidator.java index 2ede55aae96..4413dd6d8c7 100644 --- a/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentValidator.java +++ b/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentValidator.java @@ -99,7 +99,7 @@ public Payment validatePaymentForCreate(PaymentRequest paymentRequest) { validateIPaymentForBillPresent(payments,errorMap); } - validateIFSCCode(paymentRequest); + //validateIFSCCode(paymentRequest); // Loop through all bill details [one for each service], and perform various // validations for (PaymentDetail paymentDetail : paymentDetails) { @@ -117,6 +117,40 @@ public Payment validatePaymentForCreate(PaymentRequest paymentRequest) { return paymentRequest.getPayment(); } + public Payment validatePaymentForCreateWSMigration(PaymentRequest paymentRequest) { + Map errorMap = new HashMap<>(); + Payment payment = paymentRequest.getPayment(); + List paymentDetails = paymentRequest.getPayment().getPaymentDetails(); + validateUserInfo(paymentRequest.getRequestInfo(), errorMap); + validateInstrument(paymentRequest.getPayment(),errorMap); + Set billIds = payment.getPaymentDetails().stream().map(PaymentDetail :: getBillId).collect(Collectors.toSet()); + + PaymentSearchCriteria criteria = PaymentSearchCriteria.builder().tenantId(payment.getTenantId()) + .offset(0).limit(applicationProperties.getReceiptsSearchDefaultLimit()).billIds(billIds).build(); + + List payments = paymentRepository.fetchPayments(criteria); + if (!payments.isEmpty()) { + validateIPaymentForBillPresent(payments,errorMap); + } + + // Loop through all bill details [one for each service], and perform various + // validations + for (PaymentDetail paymentDetail : paymentDetails) { + + if (StringUtils.isEmpty(paymentDetail.getBusinessService())) { + errorMap.put("INVALID_BUSINESS_DETAILS", "Business details code cannot be empty"); + } + + //Removing bill validation while doing the payment +// validatePaymentDetailAgainstBill(payment.getPaymentMode().toString(),paymentDetail,errorMap); + } + + if (!errorMap.isEmpty()) + throw new CustomException(errorMap); + + return paymentRequest.getPayment(); + } + public void validateUserInfo(RequestInfo requestInfo, Map errorMap) { @@ -491,17 +525,17 @@ public void validateAndUpdateSearchRequestFromConfig(PaymentSearchCriteria payme * @param errorMap */ - private void validateIFSCCode(PaymentRequest paymentRequest) { + private void validateIFSCCode(PaymentRequest paymentRequest) { // TODO Auto-generated method stub JsonNode razorPayIfscSearchResponse = null; if (paymentRequest.getPayment().getIfscCode() != null) { String response = serviceRequestRepository .fetchGetResult(applicationProperties.getRazorPayUrl() + paymentRequest.getPayment().getIfscCode()); - ObjectNode objectNode = (ObjectNode) paymentRequest.getPayment().getAdditionalDetails(); + com.fasterxml.jackson.databind.node.ArrayNode objectNode = (com.fasterxml.jackson.databind.node.ArrayNode) paymentRequest.getPayment().getAdditionalDetails(); if (objectNode == null) { ObjectMapper mapper = new ObjectMapper(); - objectNode = mapper.createObjectNode(); + ObjectNode objectNode1 = mapper.createObjectNode(); try { razorPayIfscSearchResponse = mapper.readTree(response); @@ -509,8 +543,8 @@ private void validateIFSCCode(PaymentRequest paymentRequest) { throw new CustomException("INVALID_PROCESS_EXCEPTION", e.getMessage()); } - objectNode.set("bankDetails", razorPayIfscSearchResponse); - paymentRequest.getPayment().setAdditionalDetails(objectNode); + objectNode1.set("bankDetails", razorPayIfscSearchResponse); + paymentRequest.getPayment().setAdditionalDetails(objectNode1); } } diff --git a/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentWorkflowValidator.java b/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentWorkflowValidator.java index 2deb828aad2..956e108bc02 100644 --- a/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentWorkflowValidator.java +++ b/business-services/collection-services/src/main/java/org/egov/collection/util/PaymentWorkflowValidator.java @@ -60,18 +60,18 @@ public List validateForCancel(List paymentWorkflows, L for (Payment payment: paymentsToProcess){ for(PaymentDetail paymentDetail : payment.getPaymentDetails()) - if(paymentsByConsumerCode.containsKey(paymentDetail.getBill().getConsumerCode()) && - paymentsByConsumerCode.get(paymentDetail.getBill().getConsumerCode()).getFirst().getId() - .equalsIgnoreCase(payment.getId())){ +// if(paymentsByConsumerCode.containsKey(paymentDetail.getBill().getConsumerCode()) && +// paymentsByConsumerCode.get(paymentDetail.getBill().getConsumerCode()).getFirst().getId() +// .equalsIgnoreCase(payment.getId())){ paymentsByConsumerCode.get(paymentDetail.getBill().getConsumerCode()).removeFirst(); - } - else { - log.error("Payment not the latest payment for the consumer code {} , perform operation for {} first ", - paymentDetail.getBill().getConsumerCode(), paymentsByConsumerCode.get(paymentDetail.getBill().getConsumerCode()).getFirst() - .getId()); - errorMap.put("RECEIPT_WORKFLOW_ACTION_NOT_APPLICABLE", "Can only cancel / dishonour latest receipt " + - "for a consumer code. Dishonour of receipt possible only after deposited! "); - } +// } +// else { +// log.error("Payment not the latest payment for the consumer code {} , perform operation for {} first ", +// paymentDetail.getBill().getConsumerCode(), paymentsByConsumerCode.get(paymentDetail.getBill().getConsumerCode()).getFirst() +// .getId()); +// errorMap.put("RECEIPT_WORKFLOW_ACTION_NOT_APPLICABLE", "Can only cancel / dishonour latest receipt " + +// "for a consumer code. Dishonour of receipt possible only after deposited! "); +// } } diff --git a/business-services/collection-services/src/main/java/org/egov/collection/web/contract/Bill.java b/business-services/collection-services/src/main/java/org/egov/collection/web/contract/Bill.java index 3f58a40745c..56f06c8737b 100644 --- a/business-services/collection-services/src/main/java/org/egov/collection/web/contract/Bill.java +++ b/business-services/collection-services/src/main/java/org/egov/collection/web/contract/Bill.java @@ -109,20 +109,7 @@ public class Bill { @JsonProperty("amountPaid") private BigDecimal amountPaid; - public Boolean addBillDetail(BillDetail billDetail) { - - if (CollectionUtils.isEmpty(billDetails)) { - - billDetails = new ArrayList<>(); - return billDetails.add(billDetail); - } else { - - if (!billDetails.contains(billDetail)) - return billDetails.add(billDetail); - else - return false; - } - } + public enum StatusEnum { ACTIVE("ACTIVE"), @@ -165,6 +152,19 @@ public String toString() { } } + public Boolean addBillDetail(BillDetail billDetail) { + if (CollectionUtils.isEmpty(billDetails)) { + + billDetails = new ArrayList<>(); + return billDetails.add(billDetail); + } else { + + if (!billDetails.contains(billDetail)) + return billDetails.add(billDetail); + else + return false; + } + } } diff --git a/business-services/collection-services/src/main/java/org/egov/collection/web/controller/PaymentController.java b/business-services/collection-services/src/main/java/org/egov/collection/web/controller/PaymentController.java index 8c4f737f41a..50c6afb7de9 100644 --- a/business-services/collection-services/src/main/java/org/egov/collection/web/controller/PaymentController.java +++ b/business-services/collection-services/src/main/java/org/egov/collection/web/controller/PaymentController.java @@ -40,6 +40,7 @@ package org.egov.collection.web.controller; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -77,6 +78,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; +import lombok.extern.slf4j.Slf4j; +@Slf4j @RestController @RequestMapping("/payments") public class PaymentController { @@ -189,4 +192,31 @@ public ResponseEntity plainSearch(@ModelAttribute PaymentSearch return getSuccessResponse(payments, requestInfo); } + @RequestMapping(value = "ws/migration/_create", method = RequestMethod.POST) + @ResponseBody + public ResponseEntity migration(@RequestBody @Valid PaymentRequest paymentRequest) { + log.info("paymentRequest: " + paymentRequest); + + Payment payment = paymentService.createPaymentForWSMigration(paymentRequest); + return getSuccessResponse(Collections.singletonList(payment), paymentRequest.getRequestInfo()); + + } + + @RequestMapping(value = "/_update", method = RequestMethod.POST) + @ResponseBody + public ResponseEntity update(@RequestBody @Valid PaymentSearchCriteria paymentSearchCriteria, + @RequestBody @Valid final RequestInfoWrapper requestInfoWrapper) { + log.info("PaymentSearchCriteria: " + paymentSearchCriteria); + + List payment=paymentService.plainSearch(paymentSearchCriteria); + + Payment paymentUpdated = paymentService.updatePaymentForFilestore(payment.get(0)); + final RequestInfo requestInfo = requestInfoWrapper.getRequestInfo(); + + List updatedPayments=new ArrayList(); + updatedPayments.add(paymentUpdated); + return getSuccessResponse(updatedPayments, requestInfo); + + } + } diff --git a/business-services/collection-services/src/main/resources/application.properties b/business-services/collection-services/src/main/resources/application.properties index bfa23106381..2aacbf95eb4 100644 --- a/business-services/collection-services/src/main/resources/application.properties +++ b/business-services/collection-services/src/main/resources/application.properties @@ -12,19 +12,23 @@ collection.receipts.search.max.size=200 collection.is.user.create.enabled=true #db config -spring.datasource.url=jdbc:postgresql://localhost:5432/collections +#spring.datasource.url=jdbc:postgresql://localhost:5432/collections spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.username=postgres -spring.datasource.password=postgres +spring.datasource.url=jdbc:postgresql://dbmsewa.ch88m0ouypx1.ap-south-1.rds.amazonaws.com:5432/egov_prod_db +spring.datasource.username=msewapunjabnew +spring.datasource.password=msewa123456 spring.jackson.serialization.write-dates-as-timestamps=false #flyway config -spring.flyway.user=postgres -spring.flyway.password=postgres +#spring.flyway.user=postgres +#spring.flyway.password=postgres +spring.flyway.url=jdbc:postgresql://dbmsewa.ch88m0ouypx1.ap-south-1.rds.amazonaws.com:5432/egov_prod_db +spring.flyway.user=msewapunjabnew +spring.flyway.password=msewa123456 spring.flyway.outOfOrder=true spring.flyway.table=collection_services_schema_version spring.flyway.baseline-on-migrate=true -spring.flyway.url=jdbc:postgresql://localhost:5432/collections +#spring.flyway.url=jdbc:postgresql://localhost:5432/collections spring.flyway.locations=classpath:db/migration/main spring.flyway.enabled=true spring.flyway.validateOnMigrate=false @@ -59,24 +63,24 @@ kafka.topics.bankaccountservicemapping.create.name=egov.collectionmasters.bankac kafka.topics.bankaccountservicemapping.create.key=bankaccountservicemapping-create #URIs of other services collection depends on -egov.services.hostname = http://pdf-service.egov:8080 +egov.services.hostname = https://mseva-uat.lgpunjab.gov.in/ egov.pdf.service.create = /pdf-service/v1/_create # ID GEN CONFIGS -egov.idgen.hostname = https://dev.digit.org +egov.idgen.hostname = https://mseva-uat.lgpunjab.gov.in/ rcptno.gen.uri = /egov-idgen/id/_generate receiptnumber.idname=receipt.id receiptnumber.servicebased=false #If servicebased is set to false, use default state level format receiptnumber.state.level.format=[cy:MM]/[fy:yyyy-yy]/[SEQ_COLL_RCPT_NUM] -egov.egfcommonmasters.hostname = https://dev.digit.org +egov.egfcommonmasters.hostname = https://mseva-uat.lgpunjab.gov.in/ buisnessdetails.search.uri = /egov-common-masters/businessDetails/_search -egov.egfmasters.hostname = https://dev.digit.org +egov.egfmasters.hostname =https://mseva-uat.lgpunjab.gov.in/ coa.search.uri = /egf-master/chartofaccounts/_search?tenantId={tenantId}&glcodes={chartOfAccountCodes} -egov.instrument.hostname = https://dev.digit.org +egov.instrument.hostname = https://mseva-uat.lgpunjab.gov.in/ create.instrument.uri = /egf-instrument/instruments/_create search.ignore.status= search.instrument.uri = /egf-instrument/instruments/_search?ids={instrumentheader} @@ -84,25 +88,26 @@ search.instrumentbypaymentmode.uri = /egf-instrument/instruments/_search?instrum search.accountcodes.uri = /egf-instrument/instrumentaccountcodes/_search -egov.apportion.service.host= http://localhost:8085 +egov.apportion.service.host= http://localhost:6280/ egov.apportion.apportion.endpoint=/apportion-service/v2/bill/_apportion -egov.egfmaster.service.host=https://dev.digit.org +egov.egfmaster.service.host=https://mseva-uat.lgpunjab.gov.in/ #Billing Service path config -egov.services.billing_service.hostname=http://localhost:8096 +egov.services.billing_service.hostname=https://mseva-uat.lgpunjab.gov.in/ egov.services.billing_service.apportion=/billing-service/bill/_apportion egov.services.billing_service.search=/billing-service/bill/v2/_search - +egov.common.service.host= https://egov-micro-dev.egovernments.org +egov.services.get_businessdetails_by_codes=/egov-common-masters/businessDetails/_search?tenantId={tenantId}&businessDetailsCodes={businessDetailsCodes} #Notification Consumer -coll.notification.ui.host=https://dev.digit.org +coll.notification.ui.host=https://mseva-uat.lgpunjab.gov.in/ coll.notification.ui.redirect.url=uc-citizen/smsViewReceipt coll.notification.fallback.locale=en_IN #egov.localization.host=https://dev.digit.org -egov.localization.host=http://egov-localization:8080 +egov.localization.host=https://mseva-uat.lgpunjab.gov.in/ egov.localization.search.endpoint=/localization/messages/v1/_search kafka.topics.notification.sms=egov.core.notification.sms @@ -113,7 +118,7 @@ kafka.topics.payment.receiptlink.key=coll.payment.receiptlink.topic.key #egov.mdms.host=https://dev.digit.org -egov.mdms.host=http://egov-mdms-service:8080 +egov.mdms.host=https://mseva-uat.lgpunjab.gov.in/ egov.mdms.search.endpoint=/egov-mdms-service/v1/_search @@ -140,7 +145,7 @@ spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.Strin spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer -user.service.host=https://dev.digit.org/ +user.service.host=https://mseva-uat.lgpunjab.gov.in/ egov.services.user_by_id=user/_search egov.user.create.user=user/users/_createnovalidate egov.services.user.get_user_details=user/_details?access_token= @@ -166,7 +171,7 @@ collection.search.max.limit=300 collection.search.default.limit=100 #url shortner -egov.url.shortner.host=http://egov-url-shortening.egov:8080 +egov.url.shortner.host=https://mseva-uat.lgpunjab.gov.in/ egov.url.shortner.endpoint=/egov-url-shortening/shortener #razoarpay url for fetching bank details diff --git a/business-services/collection-services/src/main/resources/db/Dockerfile b/business-services/collection-services/src/main/resources/db/Dockerfile index a4194917c8e..71b1008c415 100644 --- a/business-services/collection-services/src/main/resources/db/Dockerfile +++ b/business-services/collection-services/src/main/resources/db/Dockerfile @@ -1,11 +1,11 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/main /flyway/sql -COPY ./migration/dev /flyway/qa + COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/business-services/collection-services/src/main/resources/db/migrate.sh b/business-services/collection-services/src/main/resources/db/migrate.sh index 54d07c0940a..ac2195600b4 100644 --- a/business-services/collection-services/src/main/resources/db/migrate.sh +++ b/business-services/collection-services/src/main/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20180820232855__create_collections_tables.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20180820232855__create_collections_tables.sql index da3a817e8c1..e91d2d3419f 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20180820232855__create_collections_tables.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20180820232855__create_collections_tables.sql @@ -1,18 +1,18 @@ -DROP TABLE IF EXISTS "egcl_receiptheader" CASCADE; -DROP INDEX IF EXISTS idx_rcpthd_consumercode; -DROP INDEX IF EXISTS idx_rcpthd_createdby; -DROP INDEX IF EXISTS idx_rcpthd_createddate; -DROP INDEX IF EXISTS idx_rcpthd_mreceiptnumber; -DROP INDEX IF EXISTS idx_rcpthd_refno; -DROP INDEX IF EXISTS idx_rcpthd_business; -DROP INDEX IF EXISTS idx_rcpthd_status; -DROP TABLE IF EXISTS "egcl_receiptdetails"; -DROP TABLE IF EXISTS "egcl_receiptinstrument"; -DROP TABLE IF EXISTS "egcl_instrumentheader"; -DROP INDEX IF EXISTS idx_ins_transactionnumber; +---- DROP TABLEIF NOT EXISTS "egcl_receiptheader" CASCADE; +DROP INDEX IF EXISTS idx_rcpthd_consumercode; +DROP INDEX IF EXISTS idx_rcpthd_createdby; +DROP INDEX IF EXISTS idx_rcpthd_createddate; +DROP INDEX IF EXISTS idx_rcpthd_mreceiptnumber; +DROP INDEX IF EXISTS idx_rcpthd_refno; +DROP INDEX IF EXISTS idx_rcpthd_business; +DROP INDEX IF EXISTS idx_rcpthd_status; +---- DROP TABLEIF NOT EXISTS "egcl_receiptdetails"; +---- DROP TABLEIF NOT EXISTS "egcl_receiptinstrument"; +---- DROP TABLEIF NOT EXISTS "egcl_instrumentheader"; +DROP INDEX IF EXISTS idx_ins_transactionnumber; -CREATE TABLE "egcl_receiptheader" ( +CREATE TABLE IF NOT EXISTS "egcl_receiptheader" ( "id" VARCHAR(36) NOT NULL, "payeename" VARCHAR(256) NULL DEFAULT NULL, "payeeaddress" VARCHAR(1024) NULL DEFAULT NULL, @@ -59,15 +59,15 @@ CREATE TABLE "egcl_receiptheader" ( ); -CREATE INDEX idx_rcpthd_consumercode ON egcl_receiptheader(consumercode); -CREATE INDEX idx_rcpthd_transactionid ON egcl_receiptheader(transactionid); -CREATE INDEX idx_rcpthd_mreceiptnumber ON egcl_receiptheader(manualreceiptnumber); -CREATE INDEX idx_rcpthd_refno ON egcl_receiptheader(referencenumber); -CREATE INDEX idx_rcpthd_business ON egcl_receiptheader(businessdetails); -CREATE INDEX idx_rcpthd_status ON egcl_receiptheader(status); +CREATE INDEX IF NOT EXISTS idx_rcpthd_consumercode ON egcl_receiptheader(consumercode); +CREATE INDEX IF NOT EXISTS idx_rcpthd_transactionid ON egcl_receiptheader(transactionid); +CREATE INDEX IF NOT EXISTS idx_rcpthd_mreceiptnumber ON egcl_receiptheader(manualreceiptnumber); +CREATE INDEX IF NOT EXISTS idx_rcpthd_refno ON egcl_receiptheader(referencenumber); +CREATE INDEX IF NOT EXISTS idx_rcpthd_business ON egcl_receiptheader(businessdetails); +CREATE INDEX IF NOT EXISTS idx_rcpthd_status ON egcl_receiptheader(status); -CREATE TABLE "egcl_receiptdetails" ( +CREATE TABLE IF NOT EXISTS "egcl_receiptdetails" ( "id" VARCHAR(36) NOT NULL, "chartofaccount" VARCHAR NOT NULL, "dramount" NUMERIC(12,2) NULL DEFAULT NULL, @@ -88,7 +88,7 @@ CREATE TABLE "egcl_receiptdetails" ( ); -CREATE TABLE "egcl_instrumentheader" ( +CREATE TABLE IF NOT EXISTS "egcl_instrumentheader" ( id VARCHAR(36) NOT NULL, transactionNumber varchar(50) NOT NULL, transactionDate BIGINT NOT NULL, @@ -113,10 +113,10 @@ CREATE TABLE "egcl_instrumentheader" ( CONSTRAINT pk_egcl_instrumenthead PRIMARY KEY (id) ); -CREATE INDEX idx_ins_transactionnumber ON egcl_instrumentheader(transactionNumber); +CREATE INDEX IF NOT EXISTS idx_ins_transactionnumber ON egcl_instrumentheader(transactionNumber); -CREATE TABLE EGCL_RECEIPTINSTRUMENT ( +CREATE TABLE IF NOT EXISTS EGCL_RECEIPTINSTRUMENT ( RECEIPTHEADER VARCHAR(36) NOT NULL, INSTRUMENTHEADER VARCHAR(36) NOT NULL, CONSTRAINT FK_RCPTINST_RCPTHEAD FOREIGN KEY (RECEIPTHEADER) diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20180904130655__alter_receipt_header.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20180904130655__alter_receipt_header.sql index d462afaed76..72d5fe5c1cd 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20180904130655__alter_receipt_header.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20180904130655__alter_receipt_header.sql @@ -1,3 +1,3 @@ ALTER TABLE "egcl_receiptheader" -ADD COLUMN "collectedamount" NUMERIC(12,2) DEFAULT NULL, -ADD COLUMN "manualreceiptdate" BIGINT; +ADD COLUMN IF NOT EXISTS "collectedamount" NUMERIC(12,2) DEFAULT NULL, +ADD COLUMN IF NOT EXISTS "manualreceiptdate" BIGINT; diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20181001121955__alter_receipt_additional_details.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20181001121955__alter_receipt_additional_details.sql index 7bdf79489d2..94a69fa47bb 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20181001121955__alter_receipt_additional_details.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20181001121955__alter_receipt_additional_details.sql @@ -1,10 +1,10 @@ -ALTER TABLE egcl_receiptheader ADD COLUMN additionalDetails JSONB; -ALTER TABLE egcl_receiptdetails ADD COLUMN additionalDetails JSONB; -ALTER TABLE egcl_instrumentheader ADD COLUMN additionalDetails JSONB; +ALTER TABLE egcl_receiptheader ADD COLUMN IF NOT EXISTS additionalDetails JSONB; +ALTER TABLE egcl_receiptdetails ADD COLUMN IF NOT EXISTS additionalDetails JSONB; +ALTER TABLE egcl_instrumentheader ADD COLUMN IF NOT EXISTS additionalDetails JSONB; -ALTER TABLE egcl_receiptheader ADD COLUMN payeemobile varchar(50); +ALTER TABLE egcl_receiptheader ADD COLUMN IF NOT EXISTS payeemobile varchar(50); ALTER TABLE egcl_receiptheader ALTER COLUMN transactionid TYPE varchar(50); -ALTER TABLE egcl_instrumentheader ADD COLUMN instrumentDate BIGINT; -ALTER TABLE egcl_instrumentheader ADD COLUMN instrumentNumber varchar(50); \ No newline at end of file +ALTER TABLE egcl_instrumentheader ADD COLUMN IF NOT EXISTS instrumentDate BIGINT; +ALTER TABLE egcl_instrumentheader ADD COLUMN IF NOT EXISTS instrumentNumber varchar(50); \ No newline at end of file diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20181016084259__collection_bankaccount_service_mapping_corr.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20181016084259__collection_bankaccount_service_mapping_corr.sql index 3a66be71998..85659d2c4ac 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20181016084259__collection_bankaccount_service_mapping_corr.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20181016084259__collection_bankaccount_service_mapping_corr.sql @@ -1,8 +1,8 @@ -DROP TABLE IF EXISTS egcl_bankaccountservicemapping; +-- -- DROP TABLEIF EXISTS egcl_bankaccountservicemapping; -DROP SEQUENCE IF EXISTS seq_egcl_bankaccountservicemapping; +-- DROP SEQUENCE IF EXISTS seq_egcl_bankaccountservicemapping; -CREATE TABLE egcl_bankaccountservicemapping +CREATE TABLE IF NOT EXISTS egcl_bankaccountservicemapping ( id bigint NOT NULL, businessdetails character varying(12) NOT NULL, @@ -19,4 +19,4 @@ CREATE TABLE egcl_bankaccountservicemapping CONSTRAINT pk_egcl_bankaccountservicemapping PRIMARY KEY (id) ); -CREATE SEQUENCE seq_egcl_bankaccountservicemapping; \ No newline at end of file +CREATE SEQUENCE IF NOT EXISTS seq_egcl_bankaccountservicemapping; \ No newline at end of file diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20181022115827__collection_remittance_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20181022115827__collection_remittance_ddl.sql index af33de817ef..1ff5cbabaa0 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20181022115827__collection_remittance_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20181022115827__collection_remittance_ddl.sql @@ -1,4 +1,4 @@ -CREATE TABLE egcl_remittance +CREATE TABLE IF NOT EXISTS egcl_remittance ( id character varying(250) NOT NULL, referencenumber character varying(50) NOT NULL, @@ -18,7 +18,7 @@ CREATE TABLE egcl_remittance CONSTRAINT pk_egcl_remittance PRIMARY KEY (id) ); - CREATE TABLE egcl_remittancedetails + CREATE TABLE IF NOT EXISTS egcl_remittancedetails ( id character varying(250) NOT NULL, remittance character varying(250) NOT NULL, @@ -29,7 +29,7 @@ CREATE TABLE egcl_remittance CONSTRAINT pk_egcl_remittancedetails PRIMARY KEY (id) ); - CREATE TABLE egcl_remittanceinstrument + CREATE TABLE IF NOT EXISTS egcl_remittanceinstrument ( id character varying(250) NOT NULL, remittance character varying(250) NOT NULL, diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20181023173723__collection_remittance_receipt_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20181023173723__collection_remittance_receipt_ddl.sql index 8b6d1b0d653..579817d98d0 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20181023173723__collection_remittance_receipt_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20181023173723__collection_remittance_receipt_ddl.sql @@ -1,4 +1,4 @@ -CREATE TABLE egcl_remittancereceipt +CREATE TABLE IF NOT EXISTS egcl_remittancereceipt ( id character varying(250) NOT NULL, remittance character varying(250) NOT NULL, diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20190325111630__receipt_v1_create_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20190325111630__receipt_v1_create_ddl.sql index 80e9a251014..daefb7fec2c 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20190325111630__receipt_v1_create_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20190325111630__receipt_v1_create_ddl.sql @@ -1,4 +1,4 @@ -CREATE TABLE egcl_receiptheader_v1 +CREATE TABLE IF NOT EXISTS egcl_receiptheader_v1 ( id character varying(36) NOT NULL, payername character varying(256) , @@ -53,7 +53,7 @@ CREATE TABLE egcl_receiptheader_v1 ); -CREATE TABLE egcl_receiptdetails_v1 +CREATE TABLE IF NOT EXISTS egcl_receiptdetails_v1 ( id character varying(36) NOT NULL, chartofaccount character varying , @@ -79,7 +79,7 @@ CREATE TABLE egcl_receiptdetails_v1 ON DELETE CASCADE ); -CREATE TABLE egcl_receiptheader_v1_history +CREATE TABLE IF NOT EXISTS egcl_receiptheader_v1_history ( id character varying(36) , payername character varying(256) , @@ -133,7 +133,7 @@ CREATE TABLE egcl_receiptheader_v1_history demandtodate bigint ); -CREATE TABLE egcl_receiptdetails_v1_history +CREATE TABLE IF NOT EXISTS egcl_receiptdetails_v1_history ( id character varying(36) , chartofaccount character varying , @@ -155,7 +155,7 @@ CREATE TABLE egcl_receiptdetails_v1_history taxheadcode character varying(256) ); -CREATE TABLE egcl_instrumentheader_v1 +CREATE TABLE IF NOT EXISTS egcl_instrumentheader_v1 ( id character varying(36) NOT NULL, transactionnumber character varying(50) NOT NULL, @@ -184,7 +184,7 @@ CREATE TABLE egcl_instrumentheader_v1 CONSTRAINT pk_egcl_instrumenthead_v1 PRIMARY KEY (id) ); -CREATE TABLE egcl_instrumentheader_v1_history +CREATE TABLE IF NOT EXISTS egcl_instrumentheader_v1_history ( id character varying(36) , transactionnumber character varying(50) , @@ -213,7 +213,7 @@ CREATE TABLE egcl_instrumentheader_v1_history uuid character varying(256) NOT NULL ); -CREATE TABLE egcl_receiptinstrument_v1 +CREATE TABLE IF NOT EXISTS egcl_receiptinstrument_v1 ( receiptheader character varying(36) NOT NULL, instrumentheader character varying(36) NOT NULL, diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20190426132730__alter_rcptheader_add_payerid_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20190426132730__alter_rcptheader_add_payerid_ddl.sql index f14f4dde701..cd4a7cb6e20 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20190426132730__alter_rcptheader_add_payerid_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20190426132730__alter_rcptheader_add_payerid_ddl.sql @@ -1 +1 @@ -ALTER TABLE egcl_receiptheader_v1 ADD COLUMN payerid varchar(256); \ No newline at end of file +ALTER TABLE egcl_receiptheader_v1 ADD COLUMN IF NOT EXISTS payerid varchar(256); \ No newline at end of file diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20190506162422__alter_rcptheader_history_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20190506162422__alter_rcptheader_history_ddl.sql index 15c4b833b4b..5e7a602c90f 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20190506162422__alter_rcptheader_history_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20190506162422__alter_rcptheader_history_ddl.sql @@ -1 +1 @@ -ALTER TABLE egcl_receiptheader_v1_history ADD COLUMN payerid varchar(256); \ No newline at end of file +ALTER TABLE egcl_receiptheader_v1_history ADD COLUMN IF NOT EXISTS payerid varchar(256); \ No newline at end of file diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20191003121332__egl_payment_create_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20191003121332__egl_payment_create_ddl.sql index e097ef34f40..d434607131e 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20191003121332__egl_payment_create_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20191003121332__egl_payment_create_ddl.sql @@ -1,4 +1,4 @@ -CREATE TABLE egcl_payment ( +CREATE TABLE IF NOT EXISTS egcl_payment ( id VARCHAR(256) NOT NULL, tenantId VARCHAR(256) NOT NULL, totalDue numeric(12,2) NOT NULL, @@ -33,7 +33,7 @@ CREATE INDEX IF NOT EXISTS idx_egcl_payment_mobileNumber ON egcl_payment(mobileN -CREATE TABLE egcl_paymentDetail ( +CREATE TABLE IF NOT EXISTS egcl_paymentDetail ( id VARCHAR(256) NOT NULL, tenantId VARCHAR(256) NOT NULL, paymentid VARCHAR(256) NOT NULL, @@ -63,7 +63,7 @@ CREATE INDEX IF NOT EXISTS idx_egcl_paymentDetail_billId ON egcl_paymentDetail(b -CREATE TABLE egcl_bill( +CREATE TABLE IF NOT EXISTS egcl_bill( id VARCHAR(256) NOT NULL, status VARCHAR(256) NOT NULL, isCancelled boolean, @@ -91,7 +91,7 @@ CREATE TABLE egcl_bill( CREATE INDEX IF NOT EXISTS idx_egcl_bill_consumerCode ON egcl_bill(consumerCode); -CREATE TABLE egcl_billdetial( +CREATE TABLE IF NOT EXISTS egcl_billdetial( id VARCHAR(256) NOT NULL, tenantId VARCHAR(256) NOT NULL, demandId VARCHAR(256) NOT NULL, @@ -120,7 +120,7 @@ CREATE TABLE egcl_billdetial( -CREATE TABLE egcl_billAccountDetail ( +CREATE TABLE IF NOT EXISTS egcl_billAccountDetail ( id VARCHAR(256) NOT NULL, tenantId VARCHAR(256) NOT NULL, billDetailid VARCHAR(256) NOT NULL, @@ -139,7 +139,7 @@ CREATE TABLE egcl_billAccountDetail ( ); -CREATE TABLE egcl_payment_audit ( +CREATE TABLE IF NOT EXISTS egcl_payment_audit ( id VARCHAR(256) NOT NULL, tenantId VARCHAR(256) NOT NULL, totalDue numeric(12,2) NOT NULL, @@ -167,7 +167,7 @@ CREATE TABLE egcl_payment_audit ( ); -CREATE TABLE egcl_paymentDetail_audit ( +CREATE TABLE IF NOT EXISTS egcl_paymentDetail_audit ( id VARCHAR(256) NOT NULL, tenantId VARCHAR(256) NOT NULL, paymentid VARCHAR(256) NOT NULL, @@ -184,7 +184,7 @@ CREATE TABLE egcl_paymentDetail_audit ( ); -CREATE TABLE egcl_bill_audit( +CREATE TABLE IF NOT EXISTS egcl_bill_audit( id VARCHAR(256) NOT NULL, status VARCHAR(256) NOT NULL, isCancelled boolean, @@ -207,7 +207,7 @@ CREATE TABLE egcl_bill_audit( ); -CREATE TABLE egcl_billdetial_audit( +CREATE TABLE IF NOT EXISTS egcl_billdetial_audit( id VARCHAR(256) NOT NULL, tenantId VARCHAR(256) NOT NULL, demandId VARCHAR(256) NOT NULL, diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20191111124203__add_manual_rcptno_pymntdtl_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20191111124203__add_manual_rcptno_pymntdtl_ddl.sql index a408a285096..43d14306280 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20191111124203__add_manual_rcptno_pymntdtl_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20191111124203__add_manual_rcptno_pymntdtl_ddl.sql @@ -1,5 +1,5 @@ -ALTER TABLE egcl_paymentDetail ADD COLUMN manualreceiptnumber varchar(256); -ALTER TABLE egcl_paymentDetail_audit ADD COLUMN manualreceiptnumber varchar(256); +ALTER TABLE egcl_paymentDetail ADD COLUMN IF NOT EXISTS manualreceiptnumber varchar(256); +ALTER TABLE egcl_paymentDetail_audit ADD COLUMN IF NOT EXISTS manualreceiptnumber varchar(256); -ALTER TABLE egcl_billdetial DROP COLUMN manualReceiptNumber; -ALTER TABLE egcl_billdetial_audit DROP COLUMN manualReceiptNumber; \ No newline at end of file +-- ALTER TABLE egcl_billdetial DROP COLUMN manualReceiptNumber; +-- ALTER TABLE egcl_billdetial_audit DROP COLUMN manualReceiptNumber; \ No newline at end of file diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20191111132320__add_manual_rcptdt_pmntdtl_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20191111132320__add_manual_rcptdt_pmntdtl_ddl.sql index a3d21f21f0e..125cafde842 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20191111132320__add_manual_rcptdt_pmntdtl_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20191111132320__add_manual_rcptdt_pmntdtl_ddl.sql @@ -1,5 +1,5 @@ -ALTER TABLE egcl_paymentDetail ADD COLUMN manualreceiptdate BIGINT; -ALTER TABLE egcl_paymentDetail_audit ADD COLUMN manualreceiptdate BIGINT; +ALTER TABLE egcl_paymentDetail ADD COLUMN IF NOT EXISTS manualreceiptdate BIGINT; +ALTER TABLE egcl_paymentDetail_audit ADD COLUMN IF NOT EXISTS manualreceiptdate BIGINT; -ALTER TABLE egcl_billdetial DROP COLUMN manualReceiptDate; -ALTER TABLE egcl_billdetial_audit DROP COLUMN manualReceiptDate; \ No newline at end of file +-- ALTER TABLE egcl_billdetial DROP COLUMN manualReceiptDate; +-- ALTER TABLE egcl_billdetial_audit DROP COLUMN manualReceiptDate; \ No newline at end of file diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20191112134348__add_adjustedamt_billdtl_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20191112134348__add_adjustedamt_billdtl_ddl.sql index ae6d6ba2528..f7f7e84d2dd 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20191112134348__add_adjustedamt_billdtl_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20191112134348__add_adjustedamt_billdtl_ddl.sql @@ -1 +1 @@ -ALTER TABLE egcl_billAccountDetail ADD COLUMN adjustedamount numeric(12,2); \ No newline at end of file +ALTER TABLE egcl_billAccountDetail ADD COLUMN IF NOT EXISTS adjustedamount numeric(12,2); \ No newline at end of file diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20191205171923__alter_audits_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20191205171923__alter_audits_ddl.sql index 658fb86a005..cc5b90be0a6 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20191205171923__alter_audits_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20191205171923__alter_audits_ddl.sql @@ -1,2 +1,2 @@ -ALTER TABLE egcl_paymentDetail_audit ADD COLUMN receiptdate BIGINT; -ALTER TABLE egcl_paymentDetail_audit ADD COLUMN receipttype character varying(256); \ No newline at end of file +ALTER TABLE egcl_paymentDetail_audit ADD COLUMN IF NOT EXISTS receiptdate BIGINT; +ALTER TABLE egcl_paymentDetail_audit ADD COLUMN IF NOT EXISTS receipttype character varying(256); \ No newline at end of file diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20200319102633__egcl_payment_add_filestoreid_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20200319102633__egcl_payment_add_filestoreid_ddl.sql index 68f1205bc2b..d29a6a1de3a 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20200319102633__egcl_payment_add_filestoreid_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20200319102633__egcl_payment_add_filestoreid_ddl.sql @@ -1 +1 @@ -ALTER TABLE egcl_payment ADD COLUMN filestoreid VARCHAR(1024); \ No newline at end of file +ALTER TABLE egcl_payment ADD COLUMN IF NOT EXISTS filestoreid VARCHAR(1024); \ No newline at end of file diff --git a/business-services/collection-services/src/main/resources/db/migration/main/V20200810133238__egcl_payment_audit_filestore_ddl.sql b/business-services/collection-services/src/main/resources/db/migration/main/V20200810133238__egcl_payment_audit_filestore_ddl.sql index a762c6a7bff..ea36b8ccd20 100644 --- a/business-services/collection-services/src/main/resources/db/migration/main/V20200810133238__egcl_payment_audit_filestore_ddl.sql +++ b/business-services/collection-services/src/main/resources/db/migration/main/V20200810133238__egcl_payment_audit_filestore_ddl.sql @@ -1 +1 @@ -ALTER TABLE egcl_payment_audit ADD COLUMN filestoreid VARCHAR(1024); +ALTER TABLE egcl_payment_audit ADD COLUMN IF NOT EXISTS filestoreid VARCHAR(1024); diff --git a/business-services/collection-services/src/test/java/org/egov/collection/repository/PaymentRepositoryTest.java b/business-services/collection-services/src/test/java/org/egov/collection/repository/PaymentRepositoryTest.java index c7f54a232c1..b7911e31597 100644 --- a/business-services/collection-services/src/test/java/org/egov/collection/repository/PaymentRepositoryTest.java +++ b/business-services/collection-services/src/test/java/org/egov/collection/repository/PaymentRepositoryTest.java @@ -76,10 +76,7 @@ void testSavePayment4() throws DataAccessException { AuditDetails auditDetails = new AuditDetails(); MissingNode additionalDetails = MissingNode.getInstance(); this.paymentRepository - .savePayment(new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "Failed to persist payment to database", auditDetails, additionalDetails, - new ArrayList<>(), "Failed to persist payment to database", "42", "Failed to persist payment to database", - "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42")); + .savePayment(new Payment()); verify(this.namedParameterJdbcTemplate).update((String) any(), (org.springframework.jdbc.core.namedparam.SqlParameterSource) any()); verify(this.namedParameterJdbcTemplate, atLeast(1)).batchUpdate((String) any(), @@ -96,11 +93,7 @@ void testSavePayment5() throws DataAccessException { BigDecimal totalAmountPaid = BigDecimal.valueOf(42L); MissingNode additionalDetails = MissingNode.getInstance(); assertThrows(CustomException.class, - () -> this.paymentRepository.savePayment(new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, - PaymentModeEnum.CASH, 1L, "42", InstrumentStatusEnum.APPROVED, "Failed to persist payment to database", - null, additionalDetails, new ArrayList<>(), "Failed to persist payment to database", "42", - "Failed to persist payment to database", "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, - "42"))); + () -> this.paymentRepository.savePayment(new Payment())); } @Test @@ -113,10 +106,7 @@ void testSavePayment6() throws DataAccessException { BigDecimal totalAmountPaid = BigDecimal.valueOf(42L); AuditDetails auditDetails = new AuditDetails(); NullNode additionalDetails = NullNode.getInstance(); - Payment payment = new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "Failed to persist payment to database", auditDetails, additionalDetails, - new ArrayList<>(), "Failed to persist payment to database", "42", "Failed to persist payment to database", - "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42"); + Payment payment = new Payment(); this.paymentRepository.savePayment(payment); verify(this.namedParameterJdbcTemplate).update((String) any(), @@ -344,9 +334,7 @@ void testUpdateStatus5() { BigDecimal totalAmountPaid = BigDecimal.valueOf(42L); AuditDetails auditDetails = new AuditDetails(); MissingNode additionalDetails = MissingNode.getInstance(); - paymentList.add(new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "id", auditDetails, additionalDetails, new ArrayList<>(), "id", "42", "id", - "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42")); + paymentList.add(new Payment()); this.paymentRepository.updateStatus(paymentList); verify(this.namedParameterJdbcTemplate, atLeast(1)).batchUpdate((String) any(), (org.springframework.jdbc.core.namedparam.SqlParameterSource[]) any()); @@ -371,9 +359,7 @@ void testUpdateStatus7() { BigDecimal totalDue = BigDecimal.valueOf(42L); BigDecimal totalAmountPaid = BigDecimal.valueOf(42L); MissingNode additionalDetails = MissingNode.getInstance(); - paymentList.add(new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "id", null, additionalDetails, new ArrayList<>(), "id", "42", "id", "42 Main St", - "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42")); + paymentList.add(new Payment()); assertThrows(CustomException.class, () -> this.paymentRepository.updateStatus(paymentList)); } @@ -389,7 +375,7 @@ void testUpdateStatus8() { AuditDetails auditDetails = new AuditDetails(); Payment e = new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", InstrumentStatusEnum.APPROVED, "id", auditDetails, MissingNode.getInstance(), paymentDetailList, "id", "42", - "id", "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42"); + "id", "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42", null, null, null, null); ArrayList paymentList = new ArrayList<>(); paymentList.add(e); @@ -452,9 +438,7 @@ void testUpdatePayment5() { BigDecimal totalAmountPaid = BigDecimal.valueOf(42L); AuditDetails auditDetails = new AuditDetails(); MissingNode additionalDetails = MissingNode.getInstance(); - paymentList.add(new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "id", auditDetails, additionalDetails, new ArrayList<>(), "id", "42", "id", - "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42")); + paymentList.add(new Payment()); this.paymentRepository.updatePayment(paymentList); verify(this.namedParameterJdbcTemplate, atLeast(1)).batchUpdate((String) any(), (org.springframework.jdbc.core.namedparam.SqlParameterSource[]) any()); diff --git a/business-services/collection-services/src/test/java/org/egov/collection/repository/querybuilder/PaymentQueryBuilderTest.java b/business-services/collection-services/src/test/java/org/egov/collection/repository/querybuilder/PaymentQueryBuilderTest.java index 67bd30cb23b..057e79c8bee 100644 --- a/business-services/collection-services/src/test/java/org/egov/collection/repository/querybuilder/PaymentQueryBuilderTest.java +++ b/business-services/collection-services/src/test/java/org/egov/collection/repository/querybuilder/PaymentQueryBuilderTest.java @@ -41,9 +41,7 @@ void testGetParametersForPaymentCreate3() { AuditDetails auditDetails = new AuditDetails(); MissingNode additionalDetails = MissingNode.getInstance(); - Payment payment = new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "Ifsc Code", auditDetails, additionalDetails, new ArrayList<>(), "Paid By", "42", - "Payer Name", "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42"); + Payment payment = new Payment(); payment.setPaymentMode(PaymentModeEnum.CASH); assertEquals(23, PaymentQueryBuilder.getParametersForPaymentCreate(payment).getParameterNames().length); } @@ -59,9 +57,7 @@ void testGetParametersForPaymentCreate5() { BigDecimal totalAmountPaid = BigDecimal.valueOf(42L); MissingNode additionalDetails = MissingNode.getInstance(); - Payment payment = new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "Ifsc Code", auditDetails, additionalDetails, new ArrayList<>(), "Paid By", "42", - "Payer Name", "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42"); + Payment payment = new Payment(); payment.setPaymentMode(PaymentModeEnum.CASH); assertEquals(23, PaymentQueryBuilder.getParametersForPaymentCreate(payment).getParameterNames().length); verify(auditDetails).getCreatedTime(); @@ -81,9 +77,7 @@ void testGetParametersForPaymentCreate6() { BigDecimal totalAmountPaid = BigDecimal.valueOf(42L); NullNode additionalDetails = NullNode.getInstance(); - Payment payment = new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "Ifsc Code", auditDetails, additionalDetails, new ArrayList<>(), "Paid By", "42", - "Payer Name", "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42"); + Payment payment = new Payment(); payment.setPaymentMode(PaymentModeEnum.CASH); assertEquals(23, PaymentQueryBuilder.getParametersForPaymentCreate(payment).getParameterNames().length); verify(auditDetails).getCreatedTime(); @@ -103,9 +97,7 @@ void testGetParametersForPaymentCreate7() { BigDecimal totalAmountPaid = BigDecimal.valueOf(42L); BooleanNode additionalDetails = BooleanNode.getFalse(); - Payment payment = new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "Ifsc Code", auditDetails, additionalDetails, new ArrayList<>(), "Paid By", "42", - "Payer Name", "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42"); + Payment payment = new Payment(); payment.setPaymentMode(PaymentModeEnum.CASH); assertEquals(23, PaymentQueryBuilder.getParametersForPaymentCreate(payment).getParameterNames().length); verify(auditDetails).getCreatedTime(); @@ -1052,9 +1044,7 @@ void testGetPaymentSearchQueryForPlainSearch3() { HashSet paymentModes = new HashSet<>(); ArrayList payerIds = new ArrayList<>(); HashSet consumerCodes = new HashSet<>(); - PaymentSearchCriteria paymentSearchCriteria = new PaymentSearchCriteria(ids, billIds, "42", tenantIds, - receiptNumbers, status, instrumentStatus, paymentModes, payerIds, consumerCodes, new HashSet<>(), "42", "42", - 1L, 1L, 2, 1, true); + PaymentSearchCriteria paymentSearchCriteria = new PaymentSearchCriteria(); HashMap stringObjectMap = new HashMap<>(); assertEquals("SELECT py.*,pyd.*,py.id as py_id,py.tenantId as py_tenantId,py.totalAmountPaid as py_totalAmountPaid" @@ -2076,9 +2066,7 @@ void testGetParametersForPaymentStatusUpdate3() { AuditDetails auditDetails = new AuditDetails(); MissingNode additionalDetails = MissingNode.getInstance(); - Payment payment = new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "Ifsc Code", auditDetails, additionalDetails, new ArrayList<>(), "Paid By", "42", - "Payer Name", "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42"); + Payment payment = new Payment(); payment.setInstrumentStatus(InstrumentStatusEnum.APPROVED); MapSqlParameterSource actualParametersForPaymentStatusUpdate = PaymentQueryBuilder .getParametersForPaymentStatusUpdate(payment); @@ -2098,9 +2086,7 @@ void testGetParametersForPaymentStatusUpdate5() { BigDecimal totalAmountPaid = BigDecimal.valueOf(42L); MissingNode additionalDetails = MissingNode.getInstance(); - Payment payment = new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "Ifsc Code", auditDetails, additionalDetails, new ArrayList<>(), "Paid By", "42", - "Payer Name", "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42"); + Payment payment = new Payment(); payment.setInstrumentStatus(InstrumentStatusEnum.APPROVED); MapSqlParameterSource actualParametersForPaymentStatusUpdate = PaymentQueryBuilder .getParametersForPaymentStatusUpdate(payment); @@ -2122,9 +2108,7 @@ void testGetParametersForPaymentStatusUpdate6() { BigDecimal totalAmountPaid = BigDecimal.valueOf(42L); NullNode additionalDetails = NullNode.getInstance(); - Payment payment = new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "Ifsc Code", auditDetails, additionalDetails, new ArrayList<>(), "Paid By", "42", - "Payer Name", "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42"); + Payment payment = new Payment(); payment.setInstrumentStatus(InstrumentStatusEnum.APPROVED); MapSqlParameterSource actualParametersForPaymentStatusUpdate = PaymentQueryBuilder .getParametersForPaymentStatusUpdate(payment); @@ -2146,9 +2130,7 @@ void testGetParametersForPaymentStatusUpdate7() { BigDecimal totalAmountPaid = BigDecimal.valueOf(42L); BooleanNode additionalDetails = BooleanNode.getFalse(); - Payment payment = new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "Ifsc Code", auditDetails, additionalDetails, new ArrayList<>(), "Paid By", "42", - "Payer Name", "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42"); + Payment payment = new Payment(); payment.setInstrumentStatus(InstrumentStatusEnum.APPROVED); MapSqlParameterSource actualParametersForPaymentStatusUpdate = PaymentQueryBuilder .getParametersForPaymentStatusUpdate(payment); @@ -2176,9 +2158,7 @@ void testGetParametersForPaymentUpdate3() { AuditDetails auditDetails = new AuditDetails(); MissingNode additionalDetails = MissingNode.getInstance(); MapSqlParameterSource actualParametersForPaymentUpdate = PaymentQueryBuilder.getParametersForPaymentUpdate( - new Payment("42", "42", totalDue, totalAmountPaid, "42", 1L, PaymentModeEnum.CASH, 1L, "42", - InstrumentStatusEnum.APPROVED, "id", auditDetails, additionalDetails, new ArrayList<>(), "id", "42", "id", - "42 Main St", "jane.doe@example.org", "42", PaymentStatusEnum.NEW, "42")); + new Payment()); assertEquals(8, actualParametersForPaymentUpdate.getParameterNames().length); assertEquals("jsonb", ((PGobject) actualParametersForPaymentUpdate.getValues().get("additionalDetails")).getType()); assertEquals("", ((PGobject) actualParametersForPaymentUpdate.getValues().get("additionalDetails")).getValue()); diff --git a/business-services/collection-services/src/test/java/org/egov/collection/service/PaymentServiceTest.java b/business-services/collection-services/src/test/java/org/egov/collection/service/PaymentServiceTest.java index 0e5f3262c82..71108ed6671 100644 --- a/business-services/collection-services/src/test/java/org/egov/collection/service/PaymentServiceTest.java +++ b/business-services/collection-services/src/test/java/org/egov/collection/service/PaymentServiceTest.java @@ -242,7 +242,7 @@ void testCreatePayment5() { verify(apportionerService).apportionBill((PaymentRequest) any()); verify(paymentEnricher).enrichAdvanceTaxHead((List) any()); verify(paymentEnricher).enrichPaymentPostValidate((PaymentRequest) any()); - verify(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any()); + verify(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any(), false); verify(paymentValidator).validatePaymentForCreate((PaymentRequest) any()); } @@ -254,7 +254,7 @@ void testCreatePayment8() { PaymentEnricher paymentEnricher = mock(PaymentEnricher.class); doNothing().when(paymentEnricher).enrichAdvanceTaxHead((List) any()); doNothing().when(paymentEnricher).enrichPaymentPostValidate((PaymentRequest) any()); - doNothing().when(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any()); + doNothing().when(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any(), false); PaymentValidator paymentValidator = mock(PaymentValidator.class); when(paymentValidator.validatePaymentForCreate((PaymentRequest) any())).thenReturn(new Payment()); ApplicationProperties applicationProperties = new ApplicationProperties(); @@ -272,7 +272,7 @@ void testCreatePayment8() { verify(apportionerService).apportionBill((PaymentRequest) any()); verify(paymentEnricher).enrichAdvanceTaxHead((List) any()); verify(paymentEnricher).enrichPaymentPostValidate((PaymentRequest) any()); - verify(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any()); + verify(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any(), false); verify(paymentValidator).validatePaymentForCreate((PaymentRequest) any()); } @@ -284,7 +284,7 @@ void testCreatePayment9() { PaymentEnricher paymentEnricher = mock(PaymentEnricher.class); doNothing().when(paymentEnricher).enrichAdvanceTaxHead((List) any()); doNothing().when(paymentEnricher).enrichPaymentPostValidate((PaymentRequest) any()); - doNothing().when(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any()); + doNothing().when(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any(), false); PaymentValidator paymentValidator = mock(PaymentValidator.class); when(paymentValidator.validatePaymentForCreate((PaymentRequest) any())).thenReturn(new Payment()); ApplicationProperties applicationProperties = new ApplicationProperties(); @@ -303,7 +303,7 @@ void testCreatePayment9() { verify(apportionerService).apportionBill((PaymentRequest) any()); verify(paymentEnricher).enrichAdvanceTaxHead((List) any()); verify(paymentEnricher).enrichPaymentPostValidate((PaymentRequest) any()); - verify(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any()); + verify(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any(), false); verify(paymentValidator).validatePaymentForCreate((PaymentRequest) any()); } @@ -347,7 +347,7 @@ void testCreatePayment14() { verify(apportionerService).apportionBill((PaymentRequest) any()); verify(paymentEnricher).enrichAdvanceTaxHead((List) any()); verify(paymentEnricher).enrichPaymentPostValidate((PaymentRequest) any()); - verify(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any()); + verify(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any(), false); verify(paymentValidator).validatePaymentForCreate((PaymentRequest) any()); verify(paymentRepository).savePayment((Payment) any()); verify(collectionProducer).producer((String) any(), (Object) any()); @@ -390,7 +390,7 @@ void testCreatePayment16() { verify(apportionerService).apportionBill((PaymentRequest) any()); verify(paymentEnricher).enrichAdvanceTaxHead((List) any()); verify(paymentEnricher).enrichPaymentPostValidate((PaymentRequest) any()); - verify(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any()); + verify(paymentEnricher).enrichPaymentPreValidate((PaymentRequest) any(), false); verify(paymentValidator).validatePaymentForCreate((PaymentRequest) any()); verify(paymentRepository).savePayment((Payment) any()); verify(collectionProducer).producer((String) any(), (Object) any()); @@ -716,8 +716,7 @@ void testPlainSearch6() { ArrayList payerIds = new ArrayList<>(); HashSet consumerCodes = new HashSet<>(); List actualPlainSearchResult = paymentService - .plainSearch(new PaymentSearchCriteria(ids, billIds, "42", tenantIds, receiptNumbers, status, instrumentStatus, - paymentModes, payerIds, consumerCodes, new HashSet<>(), "42", "42", 3L, 3L, 2, 3, true)); + .plainSearch(new PaymentSearchCriteria()); assertSame(paymentList, actualPlainSearchResult); assertTrue(actualPlainSearchResult.isEmpty()); verify(paymentRepository).fetchPaymentIds((PaymentSearchCriteria) any()); diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/IResponseHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/IResponseHandler.java index 3f1d39cd0c8..bcc72b4e486 100644 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/IResponseHandler.java +++ b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/IResponseHandler.java @@ -1,212 +1,210 @@ -package com.tarento.analytics.handler; - -import java.io.IOException; -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import com.tarento.analytics.dto.AggregateDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.Plot; -import com.tarento.analytics.enums.ChartType; -import org.apache.commons.collections.CollectionUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Handles Elastic search consolidate responses - */ -public interface IResponseHandler { - - public static final Logger logger = LoggerFactory.getLogger(IResponseHandler.class); - - public static final String API_CONFIG_JSON = "ChartApiConfig.json"; - public static final String AGGS_PATH = "aggregationPaths"; - - public static final String CHART_NAME = "chartName"; - public static final String CHART_TYPE = "chartType"; - public static final String DRILL_CHART = "drillChart"; - public static final String VALUE_TYPE = "valueType"; - public static final String FILTER_KEYS = "filterKeys"; - - // Table Chart Keys - public static final String SERIAL_NUMBER = "S.N."; - public static final String TABLE_TEXT = "text" ; - public static final String TABLE_KEY = "Key"; - - - // TODO remove the specific column names. - public static final String TOTAL_COLLECTION = "Total Collection"; - public static final String TARGET_COLLECTION = "Target Collection"; - public static final String TARGET_ACHIEVED = "Target Achievement"; - - public static final String PT_DDR_BOUNDARY = "demandCollectionIndexDDRRevenue"; - public static final String PT_BOUNDARY = "demandCollectionIndexBoundaryRevenue"; - public static final String PT_BOUNDARY_DRILL = "boundaryDrillDown"; - public static final String TL_DDR_BOUNDARY = "licenseIssuedDDRRevenue"; - public static final String TL_BOUNDARY = "licenseIssuedBoundaryRevenue"; - public static final String TL_BOUNDARY_DRILL = "licenseIssuedBoundaryDrillDown"; - - - - public final String ASC = "asc"; - public final String DESC = "desc"; - public final String RANK = "Rank"; - public final String AGGREGATIONS = "aggregations"; - public final String PLOT_LABEL = "plotLabel"; - public final String COMPUTED_FIELDS = "computedFields"; - public final String EXCLUDED_COLUMNS = "excludedColumns"; - public final String LIMIT = "limit"; - public final String ORDER = "order"; - public final String ACTION = "action"; - public final String TYPE_MAPPING = "pathDataTypeMapping"; - - public static String BUCKETS = "buckets"; - public static String KEY = "key"; - public static String VALUE = "value"; - - public final String PERCENTAGE = "percentage"; - public final String DOC_COUNT = "doc_count"; - - public static final String POST_AGGREGATION_THEORY = "postAggregationTheory"; - - public static final String CHART_SPECIFIC = "chartSpecificProperty"; - - public static final String XTABLE_COLUMN = "XtableColumnOrder"; - - public static final String IS_ROUND_OFF = "isRoundOff"; - - public static Double BOUNDARY_VALUE = 50.0; - - public static final String DIVISION = "division"; - - /** - * Translate the consolidated/aggregated response - * - * @param requestDto - * @param aggregations - * @return - * @throws IOException - */ - public AggregateDto translate(AggregateRequestDto requestDto, ObjectNode aggregations) throws IOException; - - /** - * Prepare aggregated dato for a chart node - * Also sets the drillChart Value - * @param chartNode - * @param dataList - data plots object - * @return - */ - default AggregateDto getAggregatedDto(JsonNode chartNode, List dataList, String visualizationCode) { - AggregateDto aggregateDto = new AggregateDto(); - aggregateDto.setVisualizationCode(visualizationCode); - aggregateDto.setDrillDownChartId(chartNode.get(DRILL_CHART).asText()); - ChartType chartType = ChartType.fromValue(chartNode.get(CHART_TYPE).asText()); - aggregateDto.setChartType(chartType); - aggregateDto.setData(dataList); - if(null!=chartNode.get(FILTER_KEYS)) - aggregateDto.setFilter((ArrayNode) chartNode.get(FILTER_KEYS)); - return aggregateDto; - } - - /** - * Append computed field for a given Data, for its existing fields - * computes as partfield/wholefield * 100 - * - * @param data - * @param newfield - * @param partField - * @param wholeField - */ - default void addComputedField(Data data, String newfield, String partField, String wholeField) { - try { - Map plotMap = data.getPlots().stream().collect(Collectors.toMap(Plot::getName, Function.identity())); - - if (plotMap.get(partField).getValue() == 0.0 || plotMap.get(wholeField).getValue() == 0.0) { - data.getPlots().add(new Plot(newfield, 0.0, "percentage")); - } else { - double fieldValue = plotMap.get(partField).getValue() / plotMap.get(wholeField).getValue() * 100; - data.getPlots().add(new Plot(newfield, fieldValue, "percentage")); - - } - } catch (Exception e) { - data.getPlots().add(new Plot(newfield, 0.0, "percentage")); - } - - } - - /** - * Computes the percentage from 0th and 1st index of list - * Ex: 0th element/1st element * 100 - * @param values - * @return - */ - default Double percentageValue(List values, boolean isRoundOff) { - - logger.info("values for percentage are " + values); - double val = (values.get(0)/values.get(1) * 100); - - val = Math.round(val); - - return (values.size() > 1 && values.get(0) != 0.0 && values.get(1) != 0.0) ? val : 0.0; - } - - - /** - * Computes the percentage from 1st & 2nd element of collection - * Ex: first element/second element * 100 - * @param values - * @return - */ - default Double getPercentage(Map values, String partField, String wholeField, boolean isRoundOff) { - - double val = (values.get(partField)/ values.get(wholeField) * 100); - if(isRoundOff) { - val = Math.round(val); - } - return (values.size() > 1 && values.get(partField) != 0.0 && values.get(wholeField) != 0.0) ? val: 0.0; - } - - /** - * Adding missing plot elements with cumulative data - * @param plotKeys - all required plot key - * @param data - * @param symbol - */ - default void appendMissingPlot(Set plotKeys, Data data, String symbol, boolean isCumulative) { - - //To maintain the sorted plots list order - Map sortedMap = data.getPlots().stream() - .collect(Collectors.toMap( - Plot::getName, - plot -> plot, - (u,v) -> { throw new IllegalStateException(String.format("Duplicate key %s", u)); }, - LinkedHashMap::new - )); - - logger.info(data.getHeaderName() + " existing keys: "+sortedMap.keySet()+ "& size:"+sortedMap.keySet().size()); - - Collection allKeysMinusDataKeys = CollectionUtils.subtract(plotKeys, sortedMap.keySet()); - logger.info(data.getHeaderName() +" missing keys: "+allKeysMinusDataKeys); - - - for(String plKey:allKeysMinusDataKeys){ - sortedMap.put(plKey, new Plot(plKey, new Double("0"), symbol)); - if(isCumulative){ - List keys = sortedMap.keySet().stream().collect(Collectors.toList()); - int index = keys.indexOf(plKey); - double value = index>0 ? sortedMap.get(keys.get(index-1)).getValue():0.0; - sortedMap.get(plKey).setValue(value); - } - } - logger.info("after appending missing plots : "+ sortedMap); - data.setPlots(sortedMap.values().stream().collect(Collectors.toList())); - } - -} +package com.tarento.analytics.handler; + +import java.io.IOException; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import com.tarento.analytics.dto.AggregateDto; +import com.tarento.analytics.dto.AggregateRequestDto; +import com.tarento.analytics.dto.Data; +import com.tarento.analytics.dto.Plot; +import com.tarento.analytics.enums.ChartType; +import org.apache.commons.collections.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Handles Elastic search consolidate responses + */ +public interface IResponseHandler { + + public static final Logger logger = LoggerFactory.getLogger(IResponseHandler.class); + + public static final String API_CONFIG_JSON = "ChartApiConfig.json"; + public static final String AGGS_PATH = "aggregationPaths"; + + public static final String CHART_NAME = "chartName"; + public static final String CHART_TYPE = "chartType"; + public static final String DRILL_CHART = "drillChart"; + public static final String VALUE_TYPE = "valueType"; + public static final String FILTER_KEYS = "filterKeys"; + + // Table Chart Keys + public static final String SERIAL_NUMBER = "S.N."; + public static final String TABLE_TEXT = "text" ; + public static final String TABLE_KEY = "Key"; + + + // TODO remove the specific column names. + public static final String TOTAL_COLLECTION = "Total Collection"; + public static final String TARGET_COLLECTION = "Target Collection"; + public static final String TARGET_ACHIEVED = "Target Achievement"; + + public static final String PT_DDR_BOUNDARY = "demandCollectionIndexDDRRevenue"; + public static final String PT_BOUNDARY = "demandCollectionIndexBoundaryRevenue"; + public static final String PT_BOUNDARY_DRILL = "boundaryDrillDown"; + public static final String TL_DDR_BOUNDARY = "licenseIssuedDDRRevenue"; + public static final String TL_BOUNDARY = "licenseIssuedBoundaryRevenue"; + public static final String TL_BOUNDARY_DRILL = "licenseIssuedBoundaryDrillDown"; + + + + public final String ASC = "asc"; + public final String DESC = "desc"; + public final String RANK = "Rank"; + public final String AGGREGATIONS = "aggregations"; + public final String PLOT_LABEL = "plotLabel"; + public final String COMPUTED_FIELDS = "computedFields"; + public final String EXCLUDED_COLUMNS = "excludedColumns"; + public final String LIMIT = "limit"; + public final String ORDER = "order"; + public final String ACTION = "action"; + public final String TYPE_MAPPING = "pathDataTypeMapping"; + + public static String BUCKETS = "buckets"; + public static String KEY = "key"; + public static String VALUE = "value"; + + public final String PERCENTAGE = "percentage"; + public final String DOC_COUNT = "doc_count"; + + public static final String POST_AGGREGATION_THEORY = "postAggregationTheory"; + + public static final String CHART_SPECIFIC = "chartSpecificProperty"; + + public static final String XTABLE_COLUMN = "XtableColumnOrder"; + + public static final String IS_ROUND_OFF = "isRoundOff"; + + public static Double BOUNDARY_VALUE = 50.0; + + public static final String DIVISION = "division"; + + /** + * Translate the consolidated/aggregated response + * + * @param requestDto + * @param aggregations + * @return + * @throws IOException + */ + public AggregateDto translate(AggregateRequestDto requestDto, ObjectNode aggregations) throws IOException; + + /** + * Prepare aggregated dato for a chart node + * Also sets the drillChart Value + * @param chartNode + * @param dataList - data plots object + * @return + */ + default AggregateDto getAggregatedDto(JsonNode chartNode, List dataList, String visualizationCode) { + AggregateDto aggregateDto = new AggregateDto(); + aggregateDto.setVisualizationCode(visualizationCode); + aggregateDto.setDrillDownChartId(chartNode.get(DRILL_CHART).asText()); + ChartType chartType = ChartType.fromValue(chartNode.get(CHART_TYPE).asText()); + aggregateDto.setChartType(chartType); + aggregateDto.setData(dataList); + if(null!=chartNode.get(FILTER_KEYS)) + aggregateDto.setFilter((ArrayNode) chartNode.get(FILTER_KEYS)); + return aggregateDto; + } + + /** + * Append computed field for a given Data, for its existing fields + * computes as partfield/wholefield * 100 + * + * @param data + * @param newfield + * @param partField + * @param wholeField + */ + default void addComputedField(Data data, String newfield, String partField, String wholeField) { + try { + Map plotMap = data.getPlots().stream().collect(Collectors.toMap(Plot::getName, Function.identity())); + + if (plotMap.get(partField).getValue() == 0.0 || plotMap.get(wholeField).getValue() == 0.0) { + data.getPlots().add(new Plot(newfield, 0.0, "percentage")); + } else { + double fieldValue = plotMap.get(partField).getValue() / plotMap.get(wholeField).getValue() * 100; + data.getPlots().add(new Plot(newfield, fieldValue, "percentage")); + + } + } catch (Exception e) { + data.getPlots().add(new Plot(newfield, 0.0, "percentage")); + } + + } + + /** + * Computes the percentage from 0th and 1st index of list + * Ex: 0th element/1st element * 100 + * @param values + * @return + */ + default Double percentageValue(List values, boolean isRoundOff) { + double val = (values.get(0)/values.get(1) * 100); + if(isRoundOff) { + val = Math.round(val); + } + return (values.size() > 1 && values.get(0) != 0.0 && values.get(1) != 0.0) ? val : 0.0; + } + + + /** + * Computes the percentage from 1st & 2nd element of collection + * Ex: first element/second element * 100 + * @param values + * @return + */ + default Double getPercentage(Map values, String partField, String wholeField, boolean isRoundOff) { + + double val = (values.get(partField)/ values.get(wholeField) * 100); + if(isRoundOff) { + val = Math.round(val); + } + return (values.size() > 1 && values.get(partField) != 0.0 && values.get(wholeField) != 0.0) ? val: 0.0; + } + + /** + * Adding missing plot elements with cumulative data + * @param plotKeys - all required plot key + * @param data + * @param symbol + */ + default void appendMissingPlot(Set plotKeys, Data data, String symbol, boolean isCumulative) { + + //To maintain the sorted plots list order + Map sortedMap = data.getPlots().stream() + .collect(Collectors.toMap( + Plot::getName, + plot -> plot, + (u,v) -> { throw new IllegalStateException(String.format("Duplicate key %s", u)); }, + LinkedHashMap::new + )); + + logger.info(data.getHeaderName() + " existing keys: "+sortedMap.keySet()+ "& size:"+sortedMap.keySet().size()); + + Collection allKeysMinusDataKeys = CollectionUtils.subtract(plotKeys, sortedMap.keySet()); + logger.info(data.getHeaderName() +" missing keys: "+allKeysMinusDataKeys); + + + for(String plKey:allKeysMinusDataKeys){ + sortedMap.put(plKey, new Plot(plKey, new Double("0"), symbol)); + if(isCumulative){ + List keys = sortedMap.keySet().stream().collect(Collectors.toList()); + int index = keys.indexOf(plKey); + double value = index>0 ? sortedMap.get(keys.get(index-1)).getValue():0.0; + sortedMap.get(plKey).setValue(value); + } + } + logger.info("after appending missing plots : "+ sortedMap); + data.setPlots(sortedMap.values().stream().collect(Collectors.toList())); + } + +} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/MetricChartResponseHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/MetricChartResponseHandler.java index a56f8dab103..eb42542a49f 100644 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/MetricChartResponseHandler.java +++ b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/MetricChartResponseHandler.java @@ -23,6 +23,7 @@ import com.tarento.analytics.dto.Plot; import com.tarento.analytics.helper.ComputeHelper; import com.tarento.analytics.helper.ComputeHelperFactory; +import com.tarento.analytics.utils.ResponseRecorder; /** * This handles ES response for single index, multiple index to represent single data value diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/RestService.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/RestService.java index 6fc25f9a4b3..04879d5c8ee 100644 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/RestService.java +++ b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/RestService.java @@ -1,6 +1,6 @@ -package com.tarento.analytics.service.impl; - +package com.tarento.analytics.service.impl; + import static javax.servlet.http.HttpServletRequest.BASIC_AUTH; import static org.apache.commons.codec.CharEncoding.US_ASCII; import static org.springframework.http.HttpHeaders.AUTHORIZATION; @@ -24,142 +24,142 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Component -public class RestService { - public static final Logger LOGGER = LoggerFactory.getLogger(RestService.class); - - @Value("${services.esindexer.host}") - private String indexServiceHost; - @Value("${egov.services.esindexer.host.search}") - private String indexServiceHostSearch; - @Value("${services.esindexer.host}") - private String dssindexServiceHost; - @Value("${egov.es.username}") - private String userName; - @Value("${egov.es.password}") - private String password; - - @Autowired - private RetryTemplate retryTemplate; - - - /** - * search on Elastic search for a search query - * @param index elastic search index name against which search operation - * @param searchQuery search query as request body - * @return - * @throws IOException - */ - - public JsonNode search(String index, String searchQuery) { - //System.out.println("INSIDE REST"); - String url =( indexServiceHost) + index + indexServiceHostSearch; - HttpHeaders headers = getHttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - LOGGER.info("Index Name : " + index); - LOGGER.info("Searching ES for Query: " + searchQuery); - HttpEntity requestEntity = new HttpEntity<>(searchQuery, headers); +import com.fasterxml.jackson.databind.ObjectMapper; + +@Component +public class RestService { + public static final Logger LOGGER = LoggerFactory.getLogger(RestService.class); + + @Value("${services.esindexer.host}") + private String indexServiceHost; + @Value("${egov.services.esindexer.host.search}") + private String indexServiceHostSearch; + @Value("${services.esindexer.host}") + private String dssindexServiceHost; + @Value("${egov.es.username}") + private String userName; + @Value("${egov.es.password}") + private String password; + + @Autowired + private RetryTemplate retryTemplate; + + + /** + * search on Elastic search for a search query + * @param index elastic search index name against which search operation + * @param searchQuery search query as request body + * @return + * @throws IOException + */ + + public JsonNode search(String index, String searchQuery) { + //System.out.println("INSIDE REST"); + String url =( indexServiceHost) + index + indexServiceHostSearch; + HttpHeaders headers = getHttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + LOGGER.info("Index Name : " + index); + LOGGER.info("Searching ES for Query: " + searchQuery); + HttpEntity requestEntity = new HttpEntity<>(searchQuery, headers); JsonNode responseNode = null; - - try { - ResponseEntity response = retryTemplate.postForEntity(url, requestEntity); - responseNode = new ObjectMapper().convertValue(response.getBody(), JsonNode.class); - LOGGER.info("RestTemplate response :- "+responseNode); - - } catch (HttpClientErrorException e) { - e.printStackTrace(); - LOGGER.error("client error while searching ES : " + e.getMessage()); - } - return responseNode; - } - - /** - * makes a client rest api call of Http POST option - * @param uri - * @param authToken - * @param requestNode - * @return - * @throws IOException - */ - public JsonNode post(String uri, String authToken, JsonNode requestNode) { - - HttpHeaders headers = new HttpHeaders(); - if(authToken != null && !authToken.isEmpty()) - headers.add("Authorization", "Bearer "+ authToken ); - headers.setContentType(MediaType.APPLICATION_JSON); - - LOGGER.info("Request URI: " + uri + ", Node: " + requestNode); - HttpEntity requestEntity = null; - if(requestNode != null ) requestEntity = new HttpEntity<>(requestNode.toString(), headers); - else requestEntity = new HttpEntity<>("{}", headers); - - JsonNode responseNode = null; - - try { - ResponseEntity response = retryTemplate.postForEntity(uri,requestEntity); - responseNode = new ObjectMapper().convertValue(response.getBody(), JsonNode.class); - LOGGER.info("RestTemplate response :- "+responseNode); - - } catch (HttpClientErrorException e) { - LOGGER.error("post client exception: " + e.getMessage()); - } - return responseNode; - } - - /** - * makes a client rest api call of Http GET option - * @param uri - * @param authToken - * @return - * @throws IOException - */ - public JsonNode get(String uri, String authToken) { - - HttpHeaders headers = new HttpHeaders(); - headers.add("Authorization", "Bearer "+ authToken ); - headers.setContentType(MediaType.APPLICATION_JSON); - HttpEntity headerEntity = new HttpEntity<>("{}", headers); - - JsonNode responseNode = null; - try { - ResponseEntity response = retryTemplate.getForEntity(uri, headerEntity); - responseNode = new ObjectMapper().convertValue(response.getBody(), JsonNode.class); - LOGGER.info("RestTemplate response :- "+responseNode); - - } catch (HttpClientErrorException e) { - LOGGER.error("get client exception: " + e.getMessage()); - } - return responseNode; - } - - - private HttpHeaders getHttpHeaders() { - HttpHeaders headers = new HttpHeaders(); - headers.add(AUTHORIZATION, getBase64Value(userName, password)); - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - headers.setContentType(MediaType.APPLICATION_JSON); - - List mediaTypes = new ArrayList<>(); - mediaTypes.add(MediaType.APPLICATION_JSON); - headers.setAccept(mediaTypes); - return headers; - } - - /** - * Helper Method to create the Base64Value for headers - * - * @param userName - * @param password - * @return - */ - private String getBase64Value(String userName, String password) { - String authString = String.format("%s:%s", userName, password); - byte[] encodedAuthString = Base64.encodeBase64(authString.getBytes(Charset.forName(US_ASCII))); - return String.format(BASIC_AUTH, new String(encodedAuthString)); - } - -} + + try { + ResponseEntity response = retryTemplate.postForEntity(url, requestEntity); + responseNode = new ObjectMapper().convertValue(response.getBody(), JsonNode.class); + //LOGGER.info("RestTemplate response :- "+responseNode); + + } catch (HttpClientErrorException e) { + e.printStackTrace(); + LOGGER.error("client error while searching ES : " + e.getMessage()); + } + return responseNode; + } + + /** + * makes a client rest api call of Http POST option + * @param uri + * @param authToken + * @param requestNode + * @return + * @throws IOException + */ + public JsonNode post(String uri, String authToken, JsonNode requestNode) { + + HttpHeaders headers = new HttpHeaders(); + if(authToken != null && !authToken.isEmpty()) + headers.add("Authorization", "Bearer "+ authToken ); + headers.setContentType(MediaType.APPLICATION_JSON); + + LOGGER.info("Request URI: " + uri + ", Node: " + requestNode); + HttpEntity requestEntity = null; + if(requestNode != null ) requestEntity = new HttpEntity<>(requestNode.toString(), headers); + else requestEntity = new HttpEntity<>("{}", headers); + + JsonNode responseNode = null; + + try { + ResponseEntity response = retryTemplate.postForEntity(uri,requestEntity); + responseNode = new ObjectMapper().convertValue(response.getBody(), JsonNode.class); + LOGGER.info("RestTemplate response :- "+responseNode); + + } catch (HttpClientErrorException e) { + LOGGER.error("post client exception: " + e.getMessage()); + } + return responseNode; + } + + /** + * makes a client rest api call of Http GET option + * @param uri + * @param authToken + * @return + * @throws IOException + */ + public JsonNode get(String uri, String authToken) { + + HttpHeaders headers = new HttpHeaders(); + headers.add("Authorization", "Bearer "+ authToken ); + headers.setContentType(MediaType.APPLICATION_JSON); + HttpEntity headerEntity = new HttpEntity<>("{}", headers); + + JsonNode responseNode = null; + try { + ResponseEntity response = retryTemplate.getForEntity(uri, headerEntity); + responseNode = new ObjectMapper().convertValue(response.getBody(), JsonNode.class); + LOGGER.info("RestTemplate response :- "+responseNode); + + } catch (HttpClientErrorException e) { + LOGGER.error("get client exception: " + e.getMessage()); + } + return responseNode; + } + + + private HttpHeaders getHttpHeaders() { + HttpHeaders headers = new HttpHeaders(); + headers.add(AUTHORIZATION, getBase64Value(userName, password)); + headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); + headers.setContentType(MediaType.APPLICATION_JSON); + + List mediaTypes = new ArrayList<>(); + mediaTypes.add(MediaType.APPLICATION_JSON); + headers.setAccept(mediaTypes); + return headers; + } + + /** + * Helper Method to create the Base64Value for headers + * + * @param userName + * @param password + * @return + */ + private String getBase64Value(String userName, String password) { + String authString = String.format("%s:%s", userName, password); + byte[] encodedAuthString = Base64.encodeBase64(authString.getBytes(Charset.forName(US_ASCII))); + return String.format(BASIC_AUTH, new String(encodedAuthString)); + } + +} diff --git a/business-services/egf-master/src/main/java/org/egov/common/persistence/repository/JdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/common/persistence/repository/JdbcRepository.java index dd5731931b0..045a2dd1693 100644 --- a/business-services/egf-master/src/main/java/org/egov/common/persistence/repository/JdbcRepository.java +++ b/business-services/egf-master/src/main/java/org/egov/common/persistence/repository/JdbcRepository.java @@ -178,6 +178,46 @@ public static String getByIdQuery(String tableName, List uniqueFields) { return uQuery; } + /** + * this api is not used + * + * @param tableName + * @param obj + * @return + */ + public static String getBasicSearchQuery(String tableName, Object obj) { + String uQuery = "select * from :tableName where :searchFields "; + StringBuilder fieldNameAndParams = new StringBuilder(); + // StringBuilder uniqueFieldNameAndParams = new StringBuilder(); + int i = 0; + + for (String s : allInsertFields.get("FundEntity")) { + if (i > 0) { + fieldNameAndParams.append(" and "); + + } + try { + Field declaredField = getField(obj, s); + if (getValue(declaredField, obj) != null) + + { + fieldNameAndParams.append(s).append("=").append(":").append(s); + i++; + } + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + } catch (SecurityException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + uQuery = uQuery.replace(":searchFields", fieldNameAndParams.toString()).replace(":tableName", tableName) + .toString(); + return uQuery; + } public static Object getValue(Field declaredField, Object obj) { diff --git a/business-services/egov-apportion-service/pom.xml b/business-services/egov-apportion-service/pom.xml index 0a33e158994..89acf2d4b67 100644 --- a/business-services/egov-apportion-service/pom.xml +++ b/business-services/egov-apportion-service/pom.xml @@ -63,7 +63,7 @@ org.postgresql postgresql - 42.2.2.jre7 + 42.2.18 javax.validation diff --git a/business-services/egov-apportion-service/src/main/java/org/egov/service/ApportionServiceV2.java b/business-services/egov-apportion-service/src/main/java/org/egov/service/ApportionServiceV2.java index fd39214a842..7dff99a4d5b 100644 --- a/business-services/egov-apportion-service/src/main/java/org/egov/service/ApportionServiceV2.java +++ b/business-services/egov-apportion-service/src/main/java/org/egov/service/ApportionServiceV2.java @@ -95,6 +95,7 @@ public List apportionBills(ApportionRequest request) { */ ApportionRequestV2 apportionRequestV2 = translationService.translate(bill); + apportionRequestV2.setTenantid(request.getTenantId()); List taxDetails = apportion.apportionPaidAmount(apportionRequestV2, masterData); updateAdjustedAmountInBills(bill,taxDetails); addAdvanceIfExistForBill(billDetails,taxDetails); @@ -155,7 +156,11 @@ public List apportionDemands(DemandApportionRequest request) { * has same businessService and consumerCode * */ String businessKey = demands.get(0).getBusinessService(); - + String tenant = demands.get(0).getTenantId(); + if (apportionRequestV2.getTenantid()=="" || apportionRequestV2.getTenantid()==null) + { + apportionRequestV2.setTenantid(tenant); + } if (isApportionPresent(businessKey)) apportion = getApportion(businessKey); else diff --git a/business-services/egov-apportion-service/src/main/java/org/egov/service/apportions/OrderByPriority.java b/business-services/egov-apportion-service/src/main/java/org/egov/service/apportions/OrderByPriority.java index ba71e6cd65e..e2ac6a1e761 100644 --- a/business-services/egov-apportion-service/src/main/java/org/egov/service/apportions/OrderByPriority.java +++ b/business-services/egov-apportion-service/src/main/java/org/egov/service/apportions/OrderByPriority.java @@ -43,7 +43,16 @@ public String getBusinessService() { @Override public List apportionPaidAmount(ApportionRequestV2 apportionRequestV2, Object masterData) { List taxDetails = apportionRequestV2.getTaxDetails(); + String tenant=apportionRequestV2.getTenantid(); + // taxDetails.sort(Comparator.comparing(TaxDetail::getFromPeriod)); + if(tenant.contains("pb.amritsar") && (apportionRequestV2.getBusinessService().contains("WS")|| apportionRequestV2.getBusinessService().contains("SW"))) + { + taxDetails.sort(Comparator.comparing(TaxDetail::getFromPeriod).reversed()); + } + + else{ taxDetails.sort(Comparator.comparing(TaxDetail::getFromPeriod)); + } BigDecimal remainingAmount = apportionRequestV2.getAmountPaid(); BigDecimal amount; Boolean isAmountPositive; diff --git a/business-services/egov-apportion-service/src/main/java/org/egov/web/models/ApportionRequestV2.java b/business-services/egov-apportion-service/src/main/java/org/egov/web/models/ApportionRequestV2.java index 503210d6b62..cb6a370d6aa 100644 --- a/business-services/egov-apportion-service/src/main/java/org/egov/web/models/ApportionRequestV2.java +++ b/business-services/egov-apportion-service/src/main/java/org/egov/web/models/ApportionRequestV2.java @@ -18,6 +18,9 @@ public class ApportionRequestV2 { @JsonProperty("amountPaid") private BigDecimal amountPaid = null; + @JsonProperty("tenantid") + private String tenantid = null; + @JsonProperty("isAdvanceAllowed") private Boolean isAdvanceAllowed = null; diff --git a/business-services/egov-apportion-service/src/main/resources/db/Dockerfile b/business-services/egov-apportion-service/src/main/resources/db/Dockerfile index 3c4ecd3c667..f38638a269f 100644 --- a/business-services/egov-apportion-service/src/main/resources/db/Dockerfile +++ b/business-services/egov-apportion-service/src/main/resources/db/Dockerfile @@ -1,4 +1,4 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/main /flyway/sql @@ -6,4 +6,4 @@ COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/business-services/egov-apportion-service/src/main/resources/db/migrate.sh b/business-services/egov-apportion-service/src/main/resources/db/migrate.sh index 43960b25cdb..8d8089316d5 100644 --- a/business-services/egov-apportion-service/src/main/resources/db/migrate.sh +++ b/business-services/egov-apportion-service/src/main/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate \ No newline at end of file +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate \ No newline at end of file diff --git a/business-services/egov-hrms/src/main/java/org/egov/hrms/model/enums/GuardianRelation.java b/business-services/egov-hrms/src/main/java/org/egov/hrms/model/enums/GuardianRelation.java index dead1f98b69..a3ce530c217 100644 --- a/business-services/egov-hrms/src/main/java/org/egov/hrms/model/enums/GuardianRelation.java +++ b/business-services/egov-hrms/src/main/java/org/egov/hrms/model/enums/GuardianRelation.java @@ -1,5 +1,5 @@ package org.egov.hrms.model.enums; public enum GuardianRelation { - FATHER, MOTHER, HUSBAND, OTHER; + Father, Mother, Husband, Other; } diff --git a/business-services/egov-hrms/src/main/java/org/egov/hrms/service/UserService.java b/business-services/egov-hrms/src/main/java/org/egov/hrms/service/UserService.java index 840e259b72a..44a8d93cca9 100644 --- a/business-services/egov-hrms/src/main/java/org/egov/hrms/service/UserService.java +++ b/business-services/egov-hrms/src/main/java/org/egov/hrms/service/UserService.java @@ -228,6 +228,7 @@ else if(uri.toString().contains(userCreateEndpoint)) return userDetailResponse; } catch(IllegalArgumentException e) { + e.printStackTrace(); throw new CustomException("IllegalArgumentException","ObjectMapper not able to convertValue in userCall"); } } diff --git a/business-services/egov-hrms/src/main/resources/db/Dockerfile b/business-services/egov-hrms/src/main/resources/db/Dockerfile index 3c4ecd3c667..f38638a269f 100644 --- a/business-services/egov-hrms/src/main/resources/db/Dockerfile +++ b/business-services/egov-hrms/src/main/resources/db/Dockerfile @@ -1,4 +1,4 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/main /flyway/sql @@ -6,4 +6,4 @@ COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/business-services/egov-hrms/src/main/resources/db/migrate.sh b/business-services/egov-hrms/src/main/resources/db/migrate.sh index 43960b25cdb..8d8089316d5 100644 --- a/business-services/egov-hrms/src/main/resources/db/migrate.sh +++ b/business-services/egov-hrms/src/main/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate \ No newline at end of file +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate \ No newline at end of file diff --git a/business-services/egov-hrms/src/test/resources/db/Dockerfile b/business-services/egov-hrms/src/test/resources/db/Dockerfile index fcb806edf0c..60a38bea8b8 100644 --- a/business-services/egov-hrms/src/test/resources/db/Dockerfile +++ b/business-services/egov-hrms/src/test/resources/db/Dockerfile @@ -10,4 +10,4 @@ COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/business-services/egov-hrms/src/test/resources/db/migrate.sh b/business-services/egov-hrms/src/test/resources/db/migrate.sh index 54d07c0940a..ac2195600b4 100644 --- a/business-services/egov-hrms/src/test/resources/db/migrate.sh +++ b/business-services/egov-hrms/src/test/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/reciept/consumer/config/PropertiesManager.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/reciept/consumer/config/PropertiesManager.java index bbf07c6d26f..7f987e990a5 100644 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/reciept/consumer/config/PropertiesManager.java +++ b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/reciept/consumer/config/PropertiesManager.java @@ -65,6 +65,9 @@ public class PropertiesManager { @Value("${egov.services.egov.user.host}") private String userHostUrl; + @Value("${egov.services.common.masters.businessdetails.url}") + private String businessDetailsServiceUrl; + @Value("${egov.services.egf.voucher.create}") private String voucherCreateUrl; @@ -146,7 +149,7 @@ public class PropertiesManager { @Value("${egov.services.egfmaster.hostname}") private String egfMasterHostUrl; - @Value("${token.authorization.key}") + @Value("${token.authorizaton.key}") private String tokenAuhorizationtKey; @Value("${egov.collection.receipt.voucher.save.topic}") diff --git a/business-services/finance-collections-voucher-consumer/src/main/resources/application.properties b/business-services/finance-collections-voucher-consumer/src/main/resources/application.properties index 5efb46de782..2d7f34675ee 100644 --- a/business-services/finance-collections-voucher-consumer/src/main/resources/application.properties +++ b/business-services/finance-collections-voucher-consumer/src/main/resources/application.properties @@ -57,7 +57,7 @@ fin.coe.erp.environment.name=dev # i.e http or https fin.coe.erp.http.protocol=https -token.authorization.key= +token.authorizaton.key=Basic ZWdvdi11c2VyLWNsaWVudDplZ292LXVzZXItc2VjcmV0 #egov-user egov.services.egov.user.host = https://dev.digit.org/ @@ -75,6 +75,7 @@ egov.services.businessservice.hostname = https://dev.digit.org/ egov.services.instrument.search.accountcodes.uri=egf-instrument/instrumentaccountcodes/_search egov.services.master.mdms.search.url = /egov-mdms-service/v1/_search +egov.services.common.masters.businessdetails.url=egov-common-masters/businessDetails/_search egov.services.user.token.url=user/oauth/token egov.services.egf.voucher.create=services/EGF/rest/voucher/_create egov.services.egf.voucher.cancel=services/EGF/rest/voucher/_cancel diff --git a/core-services/build/build-config.yml b/core-services/build/build-config.yml index a7f00461b67..54c8275fa3b 100644 --- a/core-services/build/build-config.yml +++ b/core-services/build/build-config.yml @@ -126,9 +126,9 @@ config: - name: "builds/core-services/egov-telemetry" build: - - work-dir: "egov-telemetry" + - work-dir: "egov-telemetry/telemetry" image-name: "egov-telemetry" - dockerfile: "build/maven/Dockerfile" + dockerfile: "core-services/egov-telemetry/telemetry/Dockerfile" - name: "builds/core-services/egov-user" build: diff --git a/core-services/egov-accesscontrol/src/main/resources/db/Dockerfile b/core-services/egov-accesscontrol/src/main/resources/db/Dockerfile index 6cc7aa8f09b..317ab48a139 100644 --- a/core-services/egov-accesscontrol/src/main/resources/db/Dockerfile +++ b/core-services/egov-accesscontrol/src/main/resources/db/Dockerfile @@ -1,4 +1,4 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/ddl /flyway/sql @@ -12,4 +12,4 @@ COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/core-services/egov-accesscontrol/src/main/resources/db/migrate.sh b/core-services/egov-accesscontrol/src/main/resources/db/migrate.sh index 43960b25cdb..8d8089316d5 100644 --- a/core-services/egov-accesscontrol/src/main/resources/db/migrate.sh +++ b/core-services/egov-accesscontrol/src/main/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate \ No newline at end of file +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate \ No newline at end of file diff --git a/core-services/egov-enc-service/src/main/java/org/egov/enc/config/AppProperties.java b/core-services/egov-enc-service/src/main/java/org/egov/enc/config/AppProperties.java index 95975c21625..3b2a9b88460 100644 --- a/core-services/egov-enc-service/src/main/java/org/egov/enc/config/AppProperties.java +++ b/core-services/egov-enc-service/src/main/java/org/egov/enc/config/AppProperties.java @@ -31,6 +31,15 @@ public class AppProperties { @Value("${length.keyid}") private Integer keyIdLength; + @Value("${master.password}") + private String masterPassword; + + @Value("${master.salt}") + private String masterSalt; + + @Value("${master.initialvector}") + private String masterInitialVector; + @Value("${method.symmetric}") private String symmetricMethod; diff --git a/core-services/egov-enc-service/src/main/resources/application.properties b/core-services/egov-enc-service/src/main/resources/application.properties index 7d449b40375..e3f31de5dd0 100644 --- a/core-services/egov-enc-service/src/main/resources/application.properties +++ b/core-services/egov-enc-service/src/main/resources/application.properties @@ -5,11 +5,11 @@ app.timezone=UTC ##----------------------------- SPRING DS CONFIGURATIONS ------------------------------# spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://localhost:5432/enc_service +spring.datasource.url=jdbc:postgresql://localhost:5432/devdb spring.datasource.username=postgres spring.datasource.password=postgres ##----------------------------- FLYWAY CONFIGURATIONS ------------------------------# -spring.flyway.url=jdbc:postgresql://localhost:5432/enc_service +spring.flyway.url=jdbc:postgresql://localhost:5432/devdb spring.flyway.user=postgres spring.flyway.password=postgres spring.flyway.table=flyway @@ -38,19 +38,19 @@ size.key.asymmetric = 1024 length.keyid = 6 #------------------Master Password------------------------# -master.password=asd@#$@$!132123 +master.password=SYb3asbqupZDW8Bh #---------Salt for Master Password: LENGTH = 8 (128-bit AES)---------------# -master.salt=qweasdzx +master.salt=Scs2Me4Q #-------Initial Vector for Password: LENGTH = 12 (128-bit AES-GCM)---------# -master.initialvector=qweasdzxqwea +master.initialvector=Tg5WrJv7kA5w type.to.method.map = {"Normal":"SYM","Imp":"ASY"} #----------------eGov MDMS----------------------# -egov.mdms.host=https://dev.digit.org +egov.mdms.host=https://msewapunjab.niua.org/ egov.mdms.search.endpoint=/egov-mdms-service/v1/_search #----------State Level Tenant Id (for MDMS request)-----------# -egov.state.level.tenant.id=pg +egov.state.level.tenant.id=pb #---------Master Password provider ; Currently supported - software, awskms--------# master.password.provider=software diff --git a/core-services/egov-enc-service/src/main/resources/db/Dockerfile b/core-services/egov-enc-service/src/main/resources/db/Dockerfile index 3c4ecd3c667..f38638a269f 100644 --- a/core-services/egov-enc-service/src/main/resources/db/Dockerfile +++ b/core-services/egov-enc-service/src/main/resources/db/Dockerfile @@ -1,4 +1,4 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/main /flyway/sql @@ -6,4 +6,4 @@ COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/core-services/egov-localization/src/main/resources/db/Dockerfile b/core-services/egov-localization/src/main/resources/db/Dockerfile index b552a0de2d9..5213e0052c0 100644 --- a/core-services/egov-localization/src/main/resources/db/Dockerfile +++ b/core-services/egov-localization/src/main/resources/db/Dockerfile @@ -1,4 +1,4 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/ddl /flyway/sql @@ -8,4 +8,4 @@ COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/core-services/egov-localization/src/main/resources/db/migrate.sh b/core-services/egov-localization/src/main/resources/db/migrate.sh index 43960b25cdb..8d8089316d5 100644 --- a/core-services/egov-localization/src/main/resources/db/migrate.sh +++ b/core-services/egov-localization/src/main/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate \ No newline at end of file +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate \ No newline at end of file diff --git a/core-services/egov-location/pom.xml b/core-services/egov-location/pom.xml index c0109cf901b..81a431e3c7b 100644 --- a/core-services/egov-location/pom.xml +++ b/core-services/egov-location/pom.xml @@ -66,7 +66,7 @@ org.postgresql postgresql - 9.4.1212 + 42.2.18 com.h2database diff --git a/core-services/egov-location/src/main/resources/db/Dockerfile b/core-services/egov-location/src/main/resources/db/Dockerfile index aa6901768e6..32c49076473 100644 --- a/core-services/egov-location/src/main/resources/db/Dockerfile +++ b/core-services/egov-location/src/main/resources/db/Dockerfile @@ -1,4 +1,4 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/main /flyway/sql @@ -12,4 +12,4 @@ COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/core-services/egov-location/src/main/resources/db/migrate.sh b/core-services/egov-location/src/main/resources/db/migrate.sh index 43960b25cdb..8d8089316d5 100644 --- a/core-services/egov-location/src/main/resources/db/migrate.sh +++ b/core-services/egov-location/src/main/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate \ No newline at end of file +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate \ No newline at end of file diff --git a/core-services/egov-notification-sms/src/main/java/org/egov/web/notification/sms/consumer/SmsNotificationListener.java b/core-services/egov-notification-sms/src/main/java/org/egov/web/notification/sms/consumer/SmsNotificationListener.java index 8a6ef09a461..67c1cbd5f3d 100644 --- a/core-services/egov-notification-sms/src/main/java/org/egov/web/notification/sms/consumer/SmsNotificationListener.java +++ b/core-services/egov-notification-sms/src/main/java/org/egov/web/notification/sms/consumer/SmsNotificationListener.java @@ -44,6 +44,9 @@ public class SmsNotificationListener { @Value("${kafka.topics.error.sms}") String errorSmsTopic; + @Value("${sms.enabled}") + Boolean smsEnable; + @Autowired public SmsNotificationListener( @@ -62,20 +65,26 @@ public void process(HashMap consumerRecord) { RequestContext.setId(UUID.randomUUID().toString()); SMSRequest request = null; try { - request = objectMapper.convertValue(consumerRecord, SMSRequest.class); - if (request.getExpiryTime() != null && request.getCategory() == Category.OTP) { - Long expiryTime = request.getExpiryTime(); - Long currentTime = System.currentTimeMillis(); - if (expiryTime < currentTime) { - log.info("OTP Expired"); - if (!StringUtils.isEmpty(expiredSmsTopic)) - kafkaTemplate.send(expiredSmsTopic, request); + if(!smsEnable){ + log.info("Sms service is disable to enable the notification service set the value of sms.enable flag as true"); + } + else{ + request = objectMapper.convertValue(consumerRecord, SMSRequest.class); + if (request.getExpiryTime() != null && request.getCategory() == Category.OTP) { + Long expiryTime = request.getExpiryTime(); + Long currentTime = System.currentTimeMillis(); + if (expiryTime < currentTime) { + log.info("OTP Expired"); + if (!StringUtils.isEmpty(expiredSmsTopic)) + kafkaTemplate.send(expiredSmsTopic, request); + } else { + smsService.sendSMS(request.toDomain()); + } } else { smsService.sendSMS(request.toDomain()); } - } else { - smsService.sendSMS(request.toDomain()); } + } catch (RestClientException rx) { log.info("Going to backup SMS Service", rx); if (!StringUtils.isEmpty(backupSmsTopic)) diff --git a/core-services/egov-notification-sms/src/main/resources/application.properties b/core-services/egov-notification-sms/src/main/resources/application.properties index 0ee50158591..13ee7e24e83 100644 --- a/core-services/egov-notification-sms/src/main/resources/application.properties +++ b/core-services/egov-notification-sms/src/main/resources/application.properties @@ -32,6 +32,7 @@ sms.enabled=true sms.config.map={'username':'$username', 'pin': '$password', 'signature':'$senderid', 'mnumber':'$mobileno', 'message':'$message', 'smsservicetype':'unicodemsg', 'myParam': '$extraParam' , 'messageType': '$mtype'} sms.category.map={'mtype': {'*': 'abc', 'OTP': 'def'}} sms.extra.config.map={'extraParam': 'abc'} +sms.enabled=false # this should be the name of class with first letter in small sms.url.dont_encode_url = true diff --git a/core-services/egov-otp/pom.xml b/core-services/egov-otp/pom.xml index 0932a8c8317..deee7adab25 100644 --- a/core-services/egov-otp/pom.xml +++ b/core-services/egov-otp/pom.xml @@ -53,7 +53,7 @@ org.postgresql postgresql - 9.4.1212 + 42.7.2 org.projectlombok diff --git a/core-services/egov-otp/src/main/java/org/egov/domain/service/TokenService.java b/core-services/egov-otp/src/main/java/org/egov/domain/service/TokenService.java index e299e04794f..d52afd0ccff 100644 --- a/core-services/egov-otp/src/main/java/org/egov/domain/service/TokenService.java +++ b/core-services/egov-otp/src/main/java/org/egov/domain/service/TokenService.java @@ -41,7 +41,7 @@ public Token create(TokenRequest tokenRequest) { String originalOtp = randomNumeric(otpConfiguration.getOtpLength()); String encryptedOtp = originalOtp; - + log.info ("OTP "+encryptedOtp); if (otpConfiguration.isEncryptOTP()){ encryptedOtp = passwordEncoder.encode(originalOtp); } diff --git a/core-services/egov-otp/src/main/resources/db/Dockerfile b/core-services/egov-otp/src/main/resources/db/Dockerfile index 905984829e3..7eb375b7245 100644 --- a/core-services/egov-otp/src/main/resources/db/Dockerfile +++ b/core-services/egov-otp/src/main/resources/db/Dockerfile @@ -1,4 +1,4 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/main /flyway/sql @@ -8,4 +8,4 @@ COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/core-services/egov-pg-service/pom.xml b/core-services/egov-pg-service/pom.xml index 82dd6bf1345..c08a0acafac 100644 --- a/core-services/egov-pg-service/pom.xml +++ b/core-services/egov-pg-service/pom.xml @@ -80,7 +80,7 @@ org.egov.services tracer - 2.1.2-SNAPSHOT + 2.1.5-PB-SNAPSHOT org.projectlombok @@ -103,8 +103,28 @@ org.egov.services services-common - 1.1.1-SNAPSHOT + 2.1.5-PB-SNAPSHOT + + org.json + json + 20180130 + + + com.squareup.okhttp3 + okhttp + 3.10.0 + + + com.squareup.okhttp3 + logging-interceptor + 3.10.0 + + + org.apache.commons + commons-text + 1.3 + org.jsoup jsoup @@ -118,6 +138,11 @@ io.projectreactor.netty reactor-netty + + com.razorpay + razorpay-java + 1.3.8 + diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/config/AppProperties.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/config/AppProperties.java index f1768bb08fc..ee33c60e0a2 100644 --- a/core-services/egov-pg-service/src/main/java/org/egov/pg/config/AppProperties.java +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/config/AppProperties.java @@ -116,7 +116,7 @@ public AppProperties(Environment environment){ this.bankAccountPath = environment.getRequiredProperty("egov.bankaccountservice.path"); this.paymentCreatePath = environment.getRequiredProperty("egov.collectionservice.payment.create.path"); this.paymentValidatePath = environment.getRequiredProperty("egov.collectionservice.payment.validate.path"); - this.userServiceHost = environment.getRequiredProperty("egov.userservice.host"); + this.userServiceHost = environment.getRequiredProperty("egov.user.host"); this.userServiceCreatePath = environment.getRequiredProperty("egov.userservice.create.path"); this.userServiceSearchPath = environment.getRequiredProperty("egov.userservice.search.path"); this.isUserCreationEnable = Boolean.valueOf(environment.getRequiredProperty("pg.is.user.create.enabled")); diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/models/Transaction.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/models/Transaction.java index dd935a6edd4..87e86df1d7e 100644 --- a/core-services/egov-pg-service/src/main/java/org/egov/pg/models/Transaction.java +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/models/Transaction.java @@ -26,7 +26,11 @@ @Builder @ToString public class Transaction { - +@SafeHtml +@JsonProperty("businessService") + @NotNull + @Size(min = 1) + private String businessService; @SafeHtml @JsonProperty("tenantId") @NotNull diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/repository/BankAccountRepository.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/repository/BankAccountRepository.java index df18c7e2b30..50681bda5df 100644 --- a/core-services/egov-pg-service/src/main/java/org/egov/pg/repository/BankAccountRepository.java +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/repository/BankAccountRepository.java @@ -29,9 +29,10 @@ public class BankAccountRepository { this.appProperties = appProperties; } - public BankAccount getBankAccountsById( RequestInfo requestInfo, String tenantId) { + public BankAccount getBankAccountsById( RequestInfo requestInfo, String tenantId, String businessService) { MultiValueMap queryParams = new LinkedMultiValueMap<>(); queryParams.add("tenantId", tenantId); + queryParams.add("businessService", businessService); String uri = UriComponentsBuilder .fromHttpUrl(appProperties.getBankAccountHost()) diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/EnrichmentService.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/EnrichmentService.java index fe9a8ab9cb6..34fd58cc997 100644 --- a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/EnrichmentService.java +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/EnrichmentService.java @@ -47,8 +47,12 @@ void enrichCreateTransaction(TransactionRequest transactionRequest) { Transaction transaction = transactionRequest.getTransaction(); RequestInfo requestInfo = transactionRequest.getRequestInfo(); - BankAccount bankAccount = bankAccountRepository.getBankAccountsById(requestInfo, transaction.getTenantId()); - transaction.setAdditionalFields(singletonMap(TransactionAdditionalFields.BANK_ACCOUNT_NUMBER, bankAccount.getAccountNumber())); + BankAccount bankAccount = bankAccountRepository.getBankAccountsById(requestInfo, transaction.getTenantId(), transaction.getBusinessService()); + String accountWithSeprator = bankAccount.getAccountNumber(); + String accountNumber=accountWithSeprator; + if(accountWithSeprator.contains("/")) + accountNumber = accountWithSeprator.substring(accountWithSeprator.lastIndexOf("/")+1); + transaction.setAdditionalFields(singletonMap(TransactionAdditionalFields.BANK_ACCOUNT_NUMBER, accountNumber)); // Generate ID from ID Gen service and assign to txn object String txnId = idGenService.generateTxnId(transactionRequest); @@ -105,6 +109,7 @@ void enrichUpdateTransaction(TransactionRequest transactionRequest, Transaction newTxn.setConsumerCode(currentTxnStatus.getConsumerCode()); newTxn.setTxnStatusMsg(currentTxnStatus.getTxnStatusMsg()); newTxn.setReceipt(currentTxnStatus.getReceipt()); + newTxn.setBusinessService(currentTxnStatus.getBusinessService()); } diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/TransactionService.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/TransactionService.java index 9a1cabb518e..731b44fa26a 100644 --- a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/TransactionService.java +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/TransactionService.java @@ -87,7 +87,12 @@ public Transaction initiateTransaction(TransactionRequest transactionRequest) { else{ URI uri = gatewayService.initiateTxn(transaction); transaction.setRedirectUrl(uri.toString()); - + if (uri.getRawQuery() != null && transaction.getGateway().equals("RAZORPAY")) { + String param = uri.getRawQuery(); + String[] orderId = param.split("orderId="); + if (orderId!=null && orderId.length > 1) + transaction.setGatewayTxnId(orderId[1]); + } dump.setTxnRequest(uri.toString()); } diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Addon.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Addon.java new file mode 100644 index 00000000000..0708f4adcf0 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Addon.java @@ -0,0 +1,10 @@ +package org.egov.pg.service.gateways.razorpay; + +import org.json.JSONObject; + +public class Addon extends Entity { + + public Addon(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/AddonClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/AddonClient.java new file mode 100644 index 00000000000..cd999d0f321 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/AddonClient.java @@ -0,0 +1,17 @@ +package org.egov.pg.service.gateways.razorpay; + +public class AddonClient extends ApiClient { + + AddonClient(String auth) { + super(auth); + } + + // To create an Addon, use the createAddon method of SubscriptionClient + public Addon fetch(String id) throws RazorpayException { + return get(String.format(Constants.ADDON_GET, id), null); + } + + public void delete(String id) throws RazorpayException { + delete(String.format(Constants.ADDON_DELETE, id), null); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/ApiClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/ApiClient.java new file mode 100644 index 00000000000..7547e6a5f76 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/ApiClient.java @@ -0,0 +1,194 @@ +package org.egov.pg.service.gateways.razorpay; + +import java.io.IOException; +import java.util.ArrayList; + +import org.apache.commons.text.WordUtils; +import org.json.JSONArray; +import org.json.JSONObject; + +import okhttp3.Response; + +class ApiClient { + + String auth; + + private final String ENTITY = "entity"; + + private final String COLLECTION = "collection"; + + private final String ERROR = "error"; + + private final String DESCRIPTION = "description"; + + private final String STATUS_CODE = "code"; + + private final int STATUS_OK = 200; + + private final int STATUS_MULTIPLE_CHOICE = 300; + + ApiClient(String auth) { + this.auth = auth; + } + + public T get(String path, JSONObject requestObject) throws RazorpayException { + Response response = ApiUtils.getRequest(path, requestObject, auth); + return processResponse(response); + } + + public T post(String path, JSONObject requestObject) throws RazorpayException { + Response response = ApiUtils.postRequest(path, requestObject, auth); + return processResponse(response); + } + + public T put(String path, JSONObject requestObject) throws RazorpayException { + Response response = ApiUtils.putRequest(path, requestObject, auth); + return processResponse(response); + } + + public T patch(String path, JSONObject requestObject) throws RazorpayException { + Response response = ApiUtils.patchRequest(path, requestObject, auth); + return processResponse(response); + } + + public void delete(String path, JSONObject requestObject) throws RazorpayException { + Response response = ApiUtils.deleteRequest(path, requestObject, auth); + processDeleteResponse(response); + } + + ArrayList getCollection(String path, JSONObject requestObject) + throws RazorpayException { + Response response = ApiUtils.getRequest(path, requestObject, auth); + return processCollectionResponse(response); + } + + private T parseResponse(JSONObject jsonObject) throws RazorpayException { + if (jsonObject.has(ENTITY)) { + Class cls = getClass(jsonObject.getString(ENTITY)); + try { + return cls.getConstructor(JSONObject.class).newInstance(jsonObject); + } catch (Exception e) { + throw new RazorpayException("Unable to parse response because of " + e.getMessage()); + } + } + + throw new RazorpayException("Unable to parse response"); + } + + private ArrayList parseCollectionResponse(JSONObject jsonObject) + throws RazorpayException { + + ArrayList modelList = new ArrayList(); + if (jsonObject.has(ENTITY) && COLLECTION.equals(jsonObject.getString(ENTITY))) { + JSONArray jsonArray = jsonObject.getJSONArray("items"); + try { + for (int i = 0; i < jsonArray.length(); i++) { + JSONObject jsonObj = jsonArray.getJSONObject(i); + T t = parseResponse(jsonObj); + modelList.add(t); + } + return modelList; + } catch (RazorpayException e) { + throw e; + } + } + + throw new RazorpayException("Unable to parse response"); + } + + T processResponse(Response response) throws RazorpayException { + if (response == null) { + throw new RazorpayException("Invalid Response from server"); + } + + int statusCode = response.code(); + String responseBody = null; + JSONObject responseJson = null; + + try { + responseBody = response.body().string(); + responseJson = new JSONObject(responseBody); + } catch (IOException e) { + throw new RazorpayException(e.getMessage()); + } + + if (statusCode >= STATUS_OK && statusCode < STATUS_MULTIPLE_CHOICE) { + return parseResponse(responseJson); + } + + throwException(statusCode, responseJson); + return null; + } + + ArrayList processCollectionResponse(Response response) + throws RazorpayException { + if (response == null) { + throw new RazorpayException("Invalid Response from server"); + } + + int statusCode = response.code(); + String responseBody = null; + JSONObject responseJson = null; + + try { + responseBody = response.body().string(); + responseJson = new JSONObject(responseBody); + } catch (IOException e) { + throw new RazorpayException(e.getMessage()); + } + + if (statusCode >= STATUS_OK && statusCode < STATUS_MULTIPLE_CHOICE) { + return parseCollectionResponse(responseJson); + } + + throwException(statusCode, responseJson); + return null; + } + + private void processDeleteResponse(Response response) throws RazorpayException { + if (response == null) { + throw new RazorpayException("Invalid Response from server"); + } + + int statusCode = response.code(); + String responseBody = null; + JSONObject responseJson = null; + + try { + responseBody = response.body().string(); + responseJson = new JSONObject(responseBody); + } catch (IOException e) { + throw new RazorpayException(e.getMessage()); + } + + if (statusCode < STATUS_OK || statusCode >= STATUS_MULTIPLE_CHOICE) { + throwException(statusCode, responseJson); + } + } + + private void throwException(int statusCode, JSONObject responseJson) throws RazorpayException { + if (responseJson.has(ERROR)) { + JSONObject errorResponse = responseJson.getJSONObject(ERROR); + String code = errorResponse.getString(STATUS_CODE); + String description = errorResponse.getString(DESCRIPTION); + throw new RazorpayException(code + ":" + description); + } + throwServerException(statusCode, responseJson.toString()); + } + + private void throwServerException(int statusCode, String responseBody) throws RazorpayException { + StringBuilder sb = new StringBuilder(); + sb.append("Status Code: ").append(statusCode).append("\n"); + sb.append("Server response: ").append(responseBody); + throw new RazorpayException(sb.toString()); + } + + private Class getClass(String entity) { + try { + String entityClass = "org.egov.pg.service.gateways.razorpay." + WordUtils.capitalize(entity, '_').replaceAll("_", ""); + return Class.forName(entityClass); + } catch (ClassNotFoundException e) { + return null; + } + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/ApiUtils.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/ApiUtils.java new file mode 100644 index 00000000000..13034115c15 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/ApiUtils.java @@ -0,0 +1,179 @@ +package org.egov.pg.service.gateways.razorpay; + +import java.io.IOException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509TrustManager; + +import org.json.JSONObject; + +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.logging.HttpLoggingInterceptor; + +class ApiUtils { + + private static OkHttpClient client; + private static Map headers = new HashMap(); + + private static String version = null; + + static void createHttpClientInstance(boolean enableLogging) throws RazorpayException { + if (client == null) { + HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(); + if (enableLogging) { + loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BASIC); + } else { + loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.NONE); + } + + try { + client = new OkHttpClient.Builder() + .readTimeout(60, TimeUnit.SECONDS) + .writeTimeout(60, TimeUnit.SECONDS) + .addInterceptor(loggingInterceptor) + .sslSocketFactory(new CustomTLSSocketFactory(), createDefaultTrustManager()) + .build(); + } catch (Exception e) { + throw new RazorpayException(e); + } + } + + Properties properties = new Properties(); + try { + properties.load(ApiUtils.class.getResourceAsStream("/project.properties")); + version = (String) properties.get("version"); + } catch (IOException e) { + throw new RazorpayException(e.getMessage()); + } + } + + private enum Method { + GET, POST, PUT, PATCH, DELETE + } + + static Response postRequest(String path, JSONObject requestObject, String auth) + throws RazorpayException { + + HttpUrl.Builder builder = getBuilder(path); + + String requestContent = requestObject == null ? "" : requestObject.toString(); + RequestBody requestBody = RequestBody.create(Constants.MEDIA_TYPE_JSON, requestContent); + + Request request = + createRequest(Method.POST.name(), builder.build().toString(), requestBody, auth); + return processRequest(request); + } + + static Response putRequest(String path, JSONObject requestObject, String auth) + throws RazorpayException { + + HttpUrl.Builder builder = getBuilder(path); + + String requestContent = requestObject == null ? "" : requestObject.toString(); + RequestBody requestBody = RequestBody.create(Constants.MEDIA_TYPE_JSON, requestContent); + + Request request = + createRequest(Method.PUT.name(), builder.build().toString(), requestBody, auth); + return processRequest(request); + } + + static Response patchRequest(String path, JSONObject requestObject, String auth) + throws RazorpayException { + + HttpUrl.Builder builder = getBuilder(path); + + String requestContent = requestObject == null ? "" : requestObject.toString(); + RequestBody requestBody = RequestBody.create(Constants.MEDIA_TYPE_JSON, requestContent); + + Request request = + createRequest(Method.PATCH.name(), builder.build().toString(), requestBody, auth); + return processRequest(request); + } + + static Response getRequest(String path, JSONObject requestObject, String auth) + throws RazorpayException { + + HttpUrl.Builder builder = getBuilder(path); + addQueryParams(builder, requestObject); + + Request request = createRequest(Method.GET.name(), builder.build().toString(), null, auth); + return processRequest(request); + } + + static Response deleteRequest(String path, JSONObject requestObject, String auth) + throws RazorpayException { + + HttpUrl.Builder builder = getBuilder(path); + addQueryParams(builder, requestObject); + + Request request = createRequest(Method.DELETE.name(), builder.build().toString(), null, auth); + return processRequest(request); + } + + private static HttpUrl.Builder getBuilder(String path) { + return new HttpUrl.Builder().scheme(Constants.SCHEME).host(Constants.HOSTNAME) + .port(Constants.PORT).addPathSegment(Constants.VERSION).addPathSegments(path); + } + + private static Request createRequest(String method, String url, RequestBody requestBody, + String auth) { + Request.Builder builder = + new Request.Builder().url(url).addHeader(Constants.AUTH_HEADER_KEY, auth); + builder.addHeader(Constants.USER_AGENT, + "Razorpay/v1 JAVASDK/" + version + " Java/" + System.getProperty("java.version")); + + for (Map.Entry header : headers.entrySet()) { + builder.addHeader(header.getKey(), header.getValue()); + } + + return builder.method(method, requestBody).build(); + } + + private static void addQueryParams(HttpUrl.Builder builder, JSONObject request) { + if (request == null) + return; + + Iterator keys = request.keys(); + while (keys.hasNext()) { + String key = (String) keys.next(); + builder.addQueryParameter(key, request.get(key).toString()); + } + } + + private static Response processRequest(Request request) throws RazorpayException { + try { + return client.newCall(request).execute(); + } catch (IOException e) { + throw new RazorpayException(e.getMessage()); + } + } + + static void addHeaders(Map header) { + headers.putAll(header); + } + + private static X509TrustManager createDefaultTrustManager() throws NoSuchAlgorithmException, KeyStoreException { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + trustManagerFactory.init((KeyStore) null); + TrustManager[] trustManagers = trustManagerFactory.getTrustManagers(); + if (trustManagers.length != 1 || !(trustManagers[0] instanceof X509TrustManager)) { + throw new IllegalStateException("Unexpected default trust managers:" + Arrays.toString(trustManagers)); + } + X509TrustManager trustManager = (X509TrustManager) trustManagers[0]; + return trustManager; + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/BankTransfer.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/BankTransfer.java new file mode 100644 index 00000000000..cb0bd147954 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/BankTransfer.java @@ -0,0 +1,9 @@ +package org.egov.pg.service.gateways.razorpay; +import org.json.JSONObject; + +public class BankTransfer extends Entity { + + public BankTransfer(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Card.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Card.java new file mode 100644 index 00000000000..1780dc79f25 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Card.java @@ -0,0 +1,10 @@ +package org.egov.pg.service.gateways.razorpay; + +import org.json.JSONObject; + +public class Card extends Entity { + + public Card(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/CardClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/CardClient.java new file mode 100644 index 00000000000..04a4f5ea37a --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/CardClient.java @@ -0,0 +1,12 @@ +package org.egov.pg.service.gateways.razorpay; + +public class CardClient extends ApiClient { + + CardClient(String auth) { + super(auth); + } + + public Card fetch(String id) throws RazorpayException { + return get(String.format(Constants.CARD_GET, id), null); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Constants.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Constants.java new file mode 100644 index 00000000000..979ec83160a --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Constants.java @@ -0,0 +1,78 @@ +package org.egov.pg.service.gateways.razorpay; + +import okhttp3.MediaType; + +public class Constants { + + // API constants + static final String SCHEME = "https"; + static final String HOSTNAME = "api.razorpay.com"; + static final Integer PORT = 443; + static final String VERSION = "v1"; + + static final String AUTH_HEADER_KEY = "Authorization"; + static final String USER_AGENT = "User-Agent"; + static final MediaType MEDIA_TYPE_JSON = MediaType.parse("application/json; charset=utf-8"); + + // API URI + static final String PAYMENT_GET = "payments/%s"; + static final String PAYMENT_LIST = "payments"; + static final String PAYMENT_CAPTURE = "payments/%s/capture"; + static final String PAYMENT_REFUND = "payments/%s/refund"; + static final String PAYMENT_TRANSFER_CREATE = "payments/%s/transfers"; + static final String PAYMENT_TRANSFER_GET = "payments/%s/transfers"; + static final String PAYMENT_BANK_TRANSFER_GET = "payments/%s/bank_transfer"; + + static final String PAYMENT_REFUND_LIST = "payments/%s/refunds"; + static final String PAYMENT_REFUND_GET = "payments/%s/refunds/%s"; + + static final String REFUND_GET = "refunds/%s"; + static final String REFUND_LIST = "refunds"; + static final String REFUND_CREATE = "refunds"; + + static final String ORDER_CREATE = "orders"; + static final String ORDER_GET = "orders/%s"; + static final String ORDER_LIST = "orders"; + static final String ORDER_PAYMENT_LIST = "orders/%s/payments"; + + static final String INVOICE_CREATE = "invoices"; + static final String INVOICE_GET = "invoices/%s"; + static final String INVOICE_LIST = "invoices"; + static final String INVOICE_CANCEL = "invoices/%s/cancel"; + + static final String CARD_GET = "cards/%s"; + + static final String CUSTOMER_CREATE = "customers"; + static final String CUSTOMER_GET = "customers/%s"; + static final String CUSTOMER_EDIT = "customers/%s"; + + static final String TOKEN_LIST = "customers/%s/tokens"; + static final String TOKEN_GET = "customers/%s/tokens/%s"; + static final String TOKEN_DELETE = "customers/%s/tokens/%s"; + + static final String TRANSFER_CREATE = "transfers"; + static final String TRANSFER_GET = "transfers/%s"; + static final String TRANSFER_EDIT = "transfers/%s"; + static final String TRANSFER_LIST = "transfers"; + static final String TRANSFER_REVERSAL_CREATE = "transfers/%s/reversals"; + + static final String PLAN_CREATE = "plans"; + static final String PLAN_GET = "plans/%s"; + static final String PLAN_LIST = "plans"; + + static final String SUBSCRIPTION_CREATE = "subscriptions"; + static final String SUBSCRIPTION_GET = "subscriptions/%s"; + static final String SUBSCRIPTION_LIST = "subscriptions"; + static final String SUBSCRIPTION_CANCEL = "subscriptions/%s/cancel"; + static final String SUBSCRIPTION_ADDON_CREATE = "subscriptions/%s/addons"; + + static final String ADDON_GET = "addons/%s"; + static final String ADDON_DELETE = "addons/%s"; + + static final String VIRTUAL_ACCOUNT_CREATE = "virtual_accounts"; + static final String VIRTUAL_ACCOUNT_GET = "virtual_accounts/%s"; + static final String VIRTUAL_ACCOUNT_LIST = "virtual_accounts"; + static final String VIRTUAL_ACCOUNT_EDIT = "virtual_accounts/%s"; + static final String VIRTUAL_ACCOUNT_CLOSE = "virtual_accounts/%s/close"; + static final String VIRTUAL_ACCOUNT_PAYMENTS = "virtual_accounts/%s/payments"; +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/CustomTLSSocketFactory.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/CustomTLSSocketFactory.java new file mode 100644 index 00000000000..a281f7a45b7 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/CustomTLSSocketFactory.java @@ -0,0 +1,75 @@ +package org.egov.pg.service.gateways.razorpay; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.Socket; +import java.net.UnknownHostException; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; + +class CustomTLSSocketFactory extends SSLSocketFactory { + + private SSLSocketFactory internalSSLSocketFactory; + + CustomTLSSocketFactory() throws KeyManagementException, NoSuchAlgorithmException { + SSLContext context = SSLContext.getInstance("TLS"); + context.init(null, null, null); + internalSSLSocketFactory = context.getSocketFactory(); + } + + @Override + public String[] getDefaultCipherSuites() { + return internalSSLSocketFactory.getDefaultCipherSuites(); + } + + @Override + public String[] getSupportedCipherSuites() { + return internalSSLSocketFactory.getSupportedCipherSuites(); + } + + @Override + public Socket createSocket() throws IOException { + return enableTLSOnSocket(internalSSLSocketFactory.createSocket()); + } + + @Override + public Socket createSocket(Socket s, String host, int port, boolean autoClose) + throws IOException { + return enableTLSOnSocket(internalSSLSocketFactory.createSocket(s, host, port, autoClose)); + } + + @Override + public Socket createSocket(String host, int port) throws IOException, UnknownHostException { + return enableTLSOnSocket(internalSSLSocketFactory.createSocket(host, port)); + } + + @Override + public Socket createSocket(String host, int port, InetAddress localHost, int localPort) + throws IOException, UnknownHostException { + return enableTLSOnSocket( + internalSSLSocketFactory.createSocket(host, port, localHost, localPort)); + } + + @Override + public Socket createSocket(InetAddress host, int port) throws IOException { + return enableTLSOnSocket(internalSSLSocketFactory.createSocket(host, port)); + } + + @Override + public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) + throws IOException { + return enableTLSOnSocket( + internalSSLSocketFactory.createSocket(address, port, localAddress, localPort)); + } + + private Socket enableTLSOnSocket(Socket socket) { + if (socket != null && (socket instanceof SSLSocket)) { + ((SSLSocket) socket).setEnabledProtocols(new String[] {"TLSv1.1", "TLSv1.2"}); + } + return socket; + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Customer.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Customer.java new file mode 100644 index 00000000000..e2566c93571 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Customer.java @@ -0,0 +1,10 @@ +package org.egov.pg.service.gateways.razorpay; + +import org.json.JSONObject; + +public class Customer extends Entity { + + public Customer(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/CustomerClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/CustomerClient.java new file mode 100644 index 00000000000..91f546e0bb6 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/CustomerClient.java @@ -0,0 +1,36 @@ +package org.egov.pg.service.gateways.razorpay; + +import java.util.List; + +import org.json.JSONObject; + +public class CustomerClient extends ApiClient { + + CustomerClient(String auth) { + super(auth); + } + + public Customer create(JSONObject request) throws RazorpayException { + return post(Constants.CUSTOMER_CREATE, request); + } + + public Customer fetch(String id) throws RazorpayException { + return get(String.format(Constants.CUSTOMER_GET, id), null); + } + + public Customer edit(String id, JSONObject request) throws RazorpayException { + return put(String.format(Constants.CUSTOMER_EDIT, id), request); + } + + public List fetchTokens(String id) throws RazorpayException { + return getCollection(String.format(Constants.TOKEN_LIST, id), null); + } + + public Token fetchToken(String id, String tokenId) throws RazorpayException { + return get(String.format(Constants.TOKEN_GET, id, tokenId), null); + } + + public void deleteToken(String id, String tokenId) throws RazorpayException { + delete(String.format(Constants.TOKEN_DELETE, id, tokenId), null); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Entity.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Entity.java new file mode 100644 index 00000000000..dbebedded02 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Entity.java @@ -0,0 +1,45 @@ +package org.egov.pg.service.gateways.razorpay; + +import java.util.Date; + +import org.json.JSONObject; + +public abstract class Entity { + + private JSONObject modelJson; + + private final String CREATED_AT = "created_at"; + private final String CAPTURED_AT = "captured_at"; + + Entity(JSONObject jsonObject) { + this.modelJson = jsonObject; + } + + public T get(String key) { + // Return null if key not in JSONObject + if (!has(key)) { + return null; + } + // Return Date for timestamps + if (key.equals(CREATED_AT) || key.equals(CAPTURED_AT)) { + return (T) new Date(modelJson.getLong(key) * 1000); + } + Object value = modelJson.get(key); + if (value == null) { + return null; + } + return (T) value.getClass().cast(value); + } + + public JSONObject toJson() { + return modelJson; + } + + public boolean has(String key) { + return modelJson.has(key); + } + + public String toString() { + return modelJson.toString(); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Invoice.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Invoice.java new file mode 100644 index 00000000000..c1b392e20f8 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Invoice.java @@ -0,0 +1,10 @@ +package org.egov.pg.service.gateways.razorpay; + +import org.json.JSONObject; + +public class Invoice extends Entity { + + public Invoice(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/InvoiceClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/InvoiceClient.java new file mode 100644 index 00000000000..c5196860c92 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/InvoiceClient.java @@ -0,0 +1,32 @@ +package org.egov.pg.service.gateways.razorpay; + +import java.util.List; + +import org.json.JSONObject; + +public class InvoiceClient extends ApiClient { + + InvoiceClient(String auth) { + super(auth); + } + + public Invoice create(JSONObject request) throws RazorpayException { + return post(Constants.INVOICE_CREATE, request); + } + + public List fetchAll() throws RazorpayException { + return fetchAll(null); + } + + public List fetchAll(JSONObject request) throws RazorpayException { + return getCollection(Constants.INVOICE_LIST, request); + } + + public Invoice fetch(String id) throws RazorpayException { + return get(String.format(Constants.INVOICE_GET, id), null); + } + + public Invoice cancel(String id) throws RazorpayException { + return post(String.format(Constants.INVOICE_CANCEL, id), null); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Order.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Order.java new file mode 100644 index 00000000000..bdcdd51ebb4 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Order.java @@ -0,0 +1,10 @@ +package org.egov.pg.service.gateways.razorpay; + +import org.json.JSONObject; + +public class Order extends Entity { + + public Order(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/OrderClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/OrderClient.java new file mode 100644 index 00000000000..213f4fc2a76 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/OrderClient.java @@ -0,0 +1,32 @@ +package org.egov.pg.service.gateways.razorpay; + +import java.util.List; + +import org.json.JSONObject; + +public class OrderClient extends ApiClient { + + OrderClient(String auth) { + super(auth); + } + + public Order create(JSONObject request) throws RazorpayException { + return post(Constants.ORDER_CREATE, request); + } + + public List fetchAll() throws RazorpayException { + return fetchAll(null); + } + + public List fetchAll(JSONObject request) throws RazorpayException { + return getCollection(Constants.ORDER_LIST, request); + } + + public Order fetch(String id) throws RazorpayException { + return get(String.format(Constants.ORDER_GET, id), null); + } + + public List fetchPayments(String id) throws RazorpayException { + return getCollection(String.format(Constants.ORDER_PAYMENT_LIST, id), null); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Payment.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Payment.java new file mode 100644 index 00000000000..82e827f7cd4 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Payment.java @@ -0,0 +1,10 @@ +package org.egov.pg.service.gateways.razorpay; + +import org.json.JSONObject; + +public class Payment extends Entity { + + public Payment(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/PaymentClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/PaymentClient.java new file mode 100644 index 00000000000..9d26c1b2921 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/PaymentClient.java @@ -0,0 +1,83 @@ +package org.egov.pg.service.gateways.razorpay; + +import java.util.List; + +import org.json.JSONObject; + +import okhttp3.Response; + +public class PaymentClient extends ApiClient { + + private RefundClient refundClient; + + PaymentClient(String auth) { + super(auth); + refundClient = new RefundClient(auth); + } + + public Payment fetch(String id) throws RazorpayException { + return get(String.format(Constants.PAYMENT_GET, id), null); + } + + public List fetchAll(JSONObject request) throws RazorpayException { + return getCollection(Constants.PAYMENT_LIST, request); + } + + public List fetchAll() throws RazorpayException { + return fetchAll(null); + } + + public Payment capture(String id, JSONObject request) throws RazorpayException { + return post(String.format(Constants.PAYMENT_CAPTURE, id), request); + } + + public Refund refund(String id) throws RazorpayException { + return refund(id, null); + } + + public Refund refund(String id, JSONObject request) throws RazorpayException { + return post(String.format(Constants.PAYMENT_REFUND, id), request); + } + + public Refund refund(JSONObject request) throws RazorpayException { + return refundClient.create(request); + } + + public Refund fetchRefund(String id, String refundId) throws RazorpayException { + return get(String.format(Constants.PAYMENT_REFUND_GET, id, refundId), null); + } + + public Refund fetchRefund(String refundId) throws RazorpayException { + return refundClient.fetch(refundId); + } + + public List fetchAllRefunds(String id, JSONObject request) throws RazorpayException { + return getCollection(String.format(Constants.PAYMENT_REFUND_LIST, id), request); + } + + public List fetchAllRefunds(String id) throws RazorpayException { + return fetchAllRefunds(id, null); + } + + public List fetchAllRefunds(JSONObject request) throws RazorpayException { + return refundClient.fetchAll(request); + } + + public List transfer(String id, JSONObject request) throws RazorpayException { + Response response = + ApiUtils.postRequest(String.format(Constants.PAYMENT_TRANSFER_CREATE, id), request, auth); + return processCollectionResponse(response); + } + + public List fetchAllTransfers(String id) throws RazorpayException { + return fetchAllTransfers(id, null); + } + + public List fetchAllTransfers(String id, JSONObject request) throws RazorpayException { + return getCollection(String.format(Constants.PAYMENT_TRANSFER_GET, id), request); + } + + public BankTransfer fetchBankTransfers(String id) throws RazorpayException { + return get(String.format(Constants.PAYMENT_BANK_TRANSFER_GET, id), null); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Plan.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Plan.java new file mode 100644 index 00000000000..7478f047082 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Plan.java @@ -0,0 +1,10 @@ +package org.egov.pg.service.gateways.razorpay; + +import org.json.JSONObject; + +public class Plan extends Entity { + + public Plan(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/PlanClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/PlanClient.java new file mode 100644 index 00000000000..97680080e2c --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/PlanClient.java @@ -0,0 +1,28 @@ +package org.egov.pg.service.gateways.razorpay; + +import java.util.List; + +import org.json.JSONObject; + +public class PlanClient extends ApiClient { + + PlanClient(String auth) { + super(auth); + } + + public Plan create(JSONObject request) throws RazorpayException { + return post(Constants.PLAN_CREATE, request); + } + + public Plan fetch(String id) throws RazorpayException { + return get(String.format(Constants.PLAN_GET, id), null); + } + + public List fetchAll() throws RazorpayException { + return fetchAll(null); + } + + public List fetchAll(JSONObject request) throws RazorpayException { + return getCollection(Constants.PLAN_LIST, request); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/RazorpayClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/RazorpayClient.java new file mode 100644 index 00000000000..752b8f8b91b --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/RazorpayClient.java @@ -0,0 +1,45 @@ +package org.egov.pg.service.gateways.razorpay; + +import java.util.Map; + +import okhttp3.Credentials; + +public class RazorpayClient { + + public PaymentClient Payments; + public RefundClient Refunds; + public OrderClient Orders; + public InvoiceClient Invoices; + public CardClient Cards; + public CustomerClient Customers; + public TransferClient Transfers; + public SubscriptionClient Subscriptions; + public AddonClient Addons; + public PlanClient Plans; + public VirtualAccountClient VirtualAccounts; + + public RazorpayClient(String key, String secret) throws RazorpayException { + this(key, secret, false); + } + + public RazorpayClient(String key, String secret, Boolean enableLogging) throws RazorpayException { + ApiUtils.createHttpClientInstance(enableLogging); + String auth = Credentials.basic(key, secret); + Payments = new PaymentClient(auth); + Refunds = new RefundClient(auth); + Orders = new OrderClient(auth); + Invoices = new InvoiceClient(auth); + Cards = new CardClient(auth); + Customers = new CustomerClient(auth); + Transfers = new TransferClient(auth); + Subscriptions = new SubscriptionClient(auth); + Addons = new AddonClient(auth); + Plans = new PlanClient(auth); + VirtualAccounts = new VirtualAccountClient(auth); + } + + public RazorpayClient addHeaders(Map headers) { + ApiUtils.addHeaders(headers); + return this; + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/RazorpayException.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/RazorpayException.java new file mode 100644 index 00000000000..a5cf3a2237f --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/RazorpayException.java @@ -0,0 +1,21 @@ +package org.egov.pg.service.gateways.razorpay; + +public class RazorpayException extends Exception { + + public RazorpayException(String message) { + super(message); + } + + public RazorpayException(String message, Throwable cause) { + super(message, cause); + } + + public RazorpayException(Throwable cause) { + super(cause); + } + + public RazorpayException(String message, Throwable cause, boolean enableSuppression, + boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/RazorpayGateway.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/RazorpayGateway.java new file mode 100644 index 00000000000..9efd711b4ba --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/RazorpayGateway.java @@ -0,0 +1,258 @@ +package org.egov.pg.service.gateways.razorpay; + +import java.net.URI; +import java.security.SignatureException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import javax.xml.bind.DatatypeConverter; +import org.egov.pg.constants.TransactionAdditionalFields; +import org.egov.pg.models.Transaction; +import org.egov.pg.service.Gateway; +import org.egov.pg.utils.Utils; +import org.egov.tracer.model.ServiceCallException; +import org.json.JSONArray; +import org.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.util.UriComponents; +import org.springframework.web.util.UriComponentsBuilder; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import lombok.extern.slf4j.Slf4j; + +/** + * Razorpay Gateway implementation + */ + +@Component +@Slf4j +public class RazorpayGateway implements Gateway{ + private static final String GATEWAY_NAME = "RAZORPAY"; + private final String MERCHANT_ID; + private final String SECURE_SECRET; + private final String LOCALE; + private final String CURRENCY; + private final String PAYMENT_CAPTURE; + private RazorpayClient client; + private final String MERCHANT_URL_PAY; + private final boolean ACTIVE; + + + @Autowired + public RazorpayGateway(ObjectMapper objectMapper, Environment environment) { + ACTIVE = Boolean.valueOf(environment.getRequiredProperty("razorpay.active")); + CURRENCY = environment.getRequiredProperty("razorpay.currency"); + LOCALE = environment.getRequiredProperty("razorpay.locale"); + MERCHANT_ID = environment.getRequiredProperty("razorpay.merchant.id"); + SECURE_SECRET = environment.getRequiredProperty("razorpay.merchant.secret.key"); + MERCHANT_URL_PAY = environment.getRequiredProperty("razorpay.url.debit"); + PAYMENT_CAPTURE = environment.getRequiredProperty("razorpay.payment_capture"); + try { + this.client = new RazorpayClient(this.MERCHANT_ID, this.SECURE_SECRET); + } catch (RazorpayException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + @Override + public URI generateRedirectURI(Transaction transaction) { + Map fields = new HashMap<>(); + fields.put("amount", String.valueOf(Utils.formatAmtAsPaise(transaction.getTxnAmount()))); + fields.put("merchant_key", MERCHANT_ID); + fields.put("locale", LOCALE); + fields.put("currency", CURRENCY); + fields.put("returnURL", transaction.getCallbackUrl()); + fields.put("merchTxnRef", transaction.getTxnId()); + fields.put("payment_capture", PAYMENT_CAPTURE); + + JSONObject request = new JSONObject(); + request.put("amount", String.valueOf(Utils.formatAmtAsPaise(transaction.getTxnAmount()))); + request.put("payment_capture", PAYMENT_CAPTURE); + request.put("currency", CURRENCY); + JSONArray transfers = new JSONArray(); + JSONObject transfer = new JSONObject(); + transfer.put("amount", String.valueOf(Utils.formatAmtAsPaise(transaction.getTxnAmount()))); + transfer.put("currency", CURRENCY); + transfer.put("account", transaction.getAdditionalFields().get(TransactionAdditionalFields.BANK_ACCOUNT_NUMBER)); + JSONObject notesData=new JSONObject(); + notesData.put("ConsumerCode",transaction.getConsumerCode()); + notesData.put("ConsumerName",transaction.getUser().getName()); + notesData.put("MobileNumber",transaction.getUser().getMobileNumber()); + notesData.put("ServiceType",transaction.getBusinessService()); + notesData.put("TenantId",transaction.getTenantId()); + notesData.put("BillId",transaction.getBillId()); + request.put("notes", notesData); + + transfers.put(transfer); + request.put("transfers", transfers); + Order order = null; + try { + order = client.Orders.create(request); + } catch (RazorpayException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + MultiValueMap params = new LinkedMultiValueMap<>(); + fields.forEach(params::add); + final String encriptionType = "SHA256"; + params.add("secureHashType", encriptionType); + params.add("orderId", order.get("id")); + params.add("amount", String.valueOf(Utils.formatAmtAsPaise(transaction.getTxnAmount()))); + + UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl(MERCHANT_URL_PAY).queryParams + (params).build().encode(); + return uriComponents.toUri(); + } + + + @Override + public Transaction fetchStatus(Transaction currentStatus, Map params) { + final Object generatedSignature; + try { + RazorpayClient razorpay = null; + Order order = null; + List ordernew = null; + int j=0,k=0; + generatedSignature = hmac_sha256(params.get("razorpayOrderId") + "|" + params.get("razorpayPaymentId"), SECURE_SECRET); + //Payment payment = client.Payments.fetch(params.get("razorpayPaymentId")); + if (generatedSignature.equals(params.get("razorpaySignature"))) + { + + return Transaction.builder() + .txnId(currentStatus.getTxnId()) + .txnAmount(currentStatus.getTxnAmount()) + .txnStatus(Transaction.TxnStatusEnum.SUCCESS) + .gatewayTxnId(params.get("razorpayOrderId")) + .gatewayPaymentMode(params.get("razorpayOrderId")) + .build(); + } + else + { + razorpay = new RazorpayClient(MERCHANT_ID,SECURE_SECRET); + order = razorpay.Orders.fetch(currentStatus.getGatewayTxnId()); + order.get("status"); + log.info("Order id :"+currentStatus.getGatewayTxnId()); + log.info("Order id status:"+order.get("status")); + ordernew = razorpay.Orders.fetchPayments(currentStatus.getGatewayTxnId()); + if(ordernew.isEmpty() ||(order.get("status")).equals("created")|| (order.get("status").equals("attempted"))) + { + log.info("************ Inside created and attempted status ***************"); + return Transaction.builder() + .txnId(currentStatus.getTxnId()) + .txnAmount(currentStatus.getTxnAmount()) + .txnStatus(Transaction.TxnStatusEnum.FAILURE) + .gatewayTxnId(currentStatus.getGatewayTxnId()) + .gatewayPaymentMode(currentStatus.getGatewayTxnId()) + .build(); + } + if(!ordernew.isEmpty()) + { + for(int i=0;i fetchAll(JSONObject request) throws RazorpayException { + return getCollection(Constants.REFUND_LIST, request); + } + + public Refund fetch(String id) throws RazorpayException { + return get(String.format(Constants.REFUND_GET, id), null); + } + + public List fetchAll() throws RazorpayException { + return fetchAll(null); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Reversal.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Reversal.java new file mode 100644 index 00000000000..c3b59f05ccf --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Reversal.java @@ -0,0 +1,9 @@ +package org.egov.pg.service.gateways.razorpay; +import org.json.JSONObject; + +public class Reversal extends Entity { + + public Reversal(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Subscription.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Subscription.java new file mode 100644 index 00000000000..eb83ec0132c --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Subscription.java @@ -0,0 +1,9 @@ +package org.egov.pg.service.gateways.razorpay; +import org.json.JSONObject; + +public class Subscription extends Entity { + + public Subscription(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/SubscriptionClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/SubscriptionClient.java new file mode 100644 index 00000000000..bc6401a42be --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/SubscriptionClient.java @@ -0,0 +1,35 @@ +package org.egov.pg.service.gateways.razorpay; +import java.util.List; + +import org.json.JSONObject; + +public class SubscriptionClient extends ApiClient { + + SubscriptionClient(String auth) { + super(auth); + } + + public Subscription create(JSONObject request) throws RazorpayException { + return post(Constants.SUBSCRIPTION_CREATE, request); + } + + public Subscription fetch(String id) throws RazorpayException { + return get(String.format(Constants.SUBSCRIPTION_GET, id), null); + } + + public List fetchAll() throws RazorpayException { + return fetchAll(null); + } + + public List fetchAll(JSONObject request) throws RazorpayException { + return getCollection(Constants.SUBSCRIPTION_LIST, request); + } + + public Subscription cancel(String id) throws RazorpayException { + return post(String.format(Constants.SUBSCRIPTION_CANCEL, id), null); + } + + public Addon createAddon(String id, JSONObject request) throws RazorpayException { + return post(String.format(Constants.SUBSCRIPTION_ADDON_CREATE, id), request); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Token.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Token.java new file mode 100644 index 00000000000..0b48d0237b8 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Token.java @@ -0,0 +1,9 @@ +package org.egov.pg.service.gateways.razorpay; +import org.json.JSONObject; + +public class Token extends Entity { + + public Token(JSONObject jsonObject) { + super(jsonObject); + } +} \ No newline at end of file diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Transfer.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Transfer.java new file mode 100644 index 00000000000..452808f69f0 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Transfer.java @@ -0,0 +1,9 @@ +package org.egov.pg.service.gateways.razorpay; +import org.json.JSONObject; + +public class Transfer extends Entity { + + public Transfer(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/TransferClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/TransferClient.java new file mode 100644 index 00000000000..0e3ed1a7912 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/TransferClient.java @@ -0,0 +1,35 @@ +package org.egov.pg.service.gateways.razorpay; +import java.util.List; + +import org.json.JSONObject; + +public class TransferClient extends ApiClient { + + TransferClient(String auth) { + super(auth); + } + + public Transfer create(JSONObject request) throws RazorpayException { + return post(Constants.TRANSFER_CREATE, request); + } + + public Transfer edit(String id, JSONObject request) throws RazorpayException { + return patch(String.format(Constants.TRANSFER_EDIT, id), request); + } + + public Reversal reversal(String id, JSONObject request) throws RazorpayException { + return post(String.format(Constants.TRANSFER_REVERSAL_CREATE, id), request); + } + + public Transfer fetch(String id) throws RazorpayException { + return get(String.format(Constants.TRANSFER_GET, id), null); + } + + public List fetchAll() throws RazorpayException { + return fetchAll(null); + } + + public List fetchAll(JSONObject request) throws RazorpayException { + return getCollection(Constants.TRANSFER_LIST, request); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Utils.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Utils.java new file mode 100644 index 00000000000..0248be4ab8c --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/Utils.java @@ -0,0 +1,170 @@ +package org.egov.pg.service.gateways.razorpay; +import java.io.UnsupportedEncodingException; +import java.math.BigDecimal; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.crypto.Mac; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.commons.codec.binary.Hex; +import org.egov.tracer.model.CustomException; +import org.json.JSONObject; + +public class Utils { + // This is an array for creating hex chars + private static final char[] HEX_TABLE = new char[]{ + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + + private static final DecimalFormat CURRENCY_FORMATTER_RUPEE = new DecimalFormat("0.00"); + private static final DecimalFormat CURRENCY_FORMATTER_PAISE = new DecimalFormat("0"); + + private Utils() { + }; + + public static String formatAmtAsRupee(String txnAmount) { + return CURRENCY_FORMATTER_RUPEE.format(Double.valueOf(txnAmount)); + } + + public static String formatAmtAsPaise(String txnAmount) { + return CURRENCY_FORMATTER_PAISE.format(Double.valueOf(txnAmount) * 100); + } + + public static String convertPaiseToRupee(String paise){ + return new BigDecimal(paise).movePointLeft(2).toPlainString(); + } + + public static boolean verifyPaymentSignature(JSONObject attributes, String apiSecret) + throws RazorpayException { + String expectedSignature = attributes.getString("razorpay_signature"); + String orderId = attributes.getString("razorpay_order_id"); + String paymentId = attributes.getString("razorpay_payment_id"); + String payload = orderId + '|' + paymentId; + return verifySignature(payload, expectedSignature, apiSecret); + } + + public static boolean verifyWebhookSignature(String payload, String expectedSignature, + String webhookSecret) throws RazorpayException { + return verifySignature(payload, expectedSignature, webhookSecret); + } + + public static boolean verifySignature(String payload, String expectedSignature, String secret) + throws RazorpayException { + String actualSignature = getHash(payload, secret); + return isEqual(actualSignature.getBytes(), expectedSignature.getBytes()); + } + + public static String getHash(String payload, String secret) throws RazorpayException { + Mac sha256_HMAC; + try { + sha256_HMAC = Mac.getInstance("HmacSHA256"); + SecretKeySpec secret_key = new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256"); + sha256_HMAC.init(secret_key); + byte[] hash = sha256_HMAC.doFinal(payload.getBytes()); + return new String(Hex.encodeHex(hash)); + } catch (Exception e) { + throw new RazorpayException(e.getMessage()); + } + } + + /** + * We are not using String.equals() method because of security issue mentioned in + * StackOverflow + * + * @param a + * @param b + * @return boolean + */ + private static boolean isEqual(byte[] a, byte[] b) { + if (a.length != b.length) { + return false; + } + int result = 0; + for (int i = 0; i < a.length; i++) { + result |= a[i] ^ b[i]; + } + return result == 0; + } + + + private static byte[] fromHexString(String s, int offset, int length) { + if ((length % 2) != 0) + return null; + byte[] byteArray = new byte[length / 2]; + int j = 0; + int end = offset + length; + for (int i = offset; i < end; i += 2) { + int high_nibble = Character.digit(s.charAt(i), 16); + int low_nibble = Character.digit(s.charAt(i + 1), 16); + if (high_nibble == -1 || low_nibble == -1) { + // illegal format + return null; + } + byteArray[j++] = (byte) (((high_nibble << 4) & 0xf0) | (low_nibble & 0x0f)); + } + return byteArray; + } + + /** + * Returns Hex output of byte array + */ + private static String hex(byte[] input) { + // create a StringBuffer 2x the size of the hash array + StringBuilder sb = new StringBuilder(input.length * 2); + + // retrieve the byte array data, convert it to hex + // and add it to the StringBuilder + for (byte anInput : input) { + sb.append(HEX_TABLE[(anInput >> 4) & 0xf]); + sb.append(HEX_TABLE[anInput & 0xf]); + } + return sb.toString(); + } + + static String SHAhashAllFields(Map fields, String secret) { + + // create a list and sort it + List fieldNames = new ArrayList<>(fields.keySet()); + Collections.sort(fieldNames); + + // create a buffer for the SHA256 input + StringBuilder buf = new StringBuilder(); + + + // iterate through the list and add the remaining field values + Iterator itr = fieldNames.iterator(); + while (itr.hasNext()) { + String fieldName = (String) itr.next(); + String fieldValue = fields.get(fieldName); + if ((fieldValue != null) && (fieldValue.length() > 0)) { + buf.append(fieldName).append("=").append(fieldValue); + if (itr.hasNext()) { + buf.append('&'); + } + } + } + byte[] mac = null; + try { + byte[] b = fromHexString(secret, 0, secret.length()); + SecretKey key = new SecretKeySpec(b, "HmacSHA256"); + Mac m = Mac.getInstance("HmacSHA256"); + m.init(key); + + m.update(buf.toString().getBytes("ISO-8859-1")); + mac = m.doFinal(); + } catch (NoSuchAlgorithmException | UnsupportedEncodingException | InvalidKeyException e) { + throw new CustomException("CHECKSUM_GEN_FAILED", "Hash generation failed, gateway redirect URI " + + "cannot be generated"); + } + return hex(mac); + + } // end hashAllFields() +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/VirtualAccount.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/VirtualAccount.java new file mode 100644 index 00000000000..7e585ff4ef2 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/VirtualAccount.java @@ -0,0 +1,9 @@ +package org.egov.pg.service.gateways.razorpay; +import org.json.JSONObject; + +public class VirtualAccount extends Entity { + + public VirtualAccount(JSONObject jsonObject) { + super(jsonObject); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/VirtualAccountClient.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/VirtualAccountClient.java new file mode 100644 index 00000000000..4e4fe748501 --- /dev/null +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/gateways/razorpay/VirtualAccountClient.java @@ -0,0 +1,43 @@ +package org.egov.pg.service.gateways.razorpay; +import java.util.List; + +import org.json.JSONObject; + +public class VirtualAccountClient extends ApiClient { + + VirtualAccountClient(String auth) { + super(auth); + } + + public VirtualAccount create(JSONObject request) throws RazorpayException { + return post(Constants.VIRTUAL_ACCOUNT_CREATE, request); + } + + public VirtualAccount fetch(String id) throws RazorpayException { + return get(String.format(Constants.VIRTUAL_ACCOUNT_GET, id), null); + } + + public List fetchAll() throws RazorpayException { + return fetchAll(null); + } + + public List fetchAll(JSONObject request) throws RazorpayException { + return getCollection(Constants.VIRTUAL_ACCOUNT_LIST, request); + } + + public VirtualAccount edit(String id, JSONObject request) throws RazorpayException { + return patch(String.format(Constants.VIRTUAL_ACCOUNT_EDIT, id), request); + } + + public VirtualAccount close(String id) throws RazorpayException { + return post(String.format(Constants.VIRTUAL_ACCOUNT_CLOSE, id), null); + } + + public List fetchPayments(String id) throws RazorpayException { + return fetchPayments(id, null); + } + + public List fetchPayments(String id, JSONObject request) throws RazorpayException { + return getCollection(String.format(Constants.VIRTUAL_ACCOUNT_PAYMENTS, id), request); + } +} diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/jobs/dailyReconciliation/DailyReconciliationJob.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/jobs/dailyReconciliation/DailyReconciliationJob.java index 45fb57ec066..c96d93570ec 100644 --- a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/jobs/dailyReconciliation/DailyReconciliationJob.java +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/jobs/dailyReconciliation/DailyReconciliationJob.java @@ -31,6 +31,7 @@ public class DailyReconciliationJob implements Job { @PostConstruct public void init() { User userInfo = User.builder() + //.uuid("DAILY_RECONC_JOB") .uuid(appProperties.getEgovPgReconciliationSystemUserUuid()) .type("SYSTEM") .roles(Collections.emptyList()).id(0L).build(); diff --git a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/jobs/earlyReconciliation/EarlyReconciliationJob.java b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/jobs/earlyReconciliation/EarlyReconciliationJob.java index cb73bca506e..8b9e7db2e1c 100644 --- a/core-services/egov-pg-service/src/main/java/org/egov/pg/service/jobs/earlyReconciliation/EarlyReconciliationJob.java +++ b/core-services/egov-pg-service/src/main/java/org/egov/pg/service/jobs/earlyReconciliation/EarlyReconciliationJob.java @@ -32,6 +32,7 @@ public class EarlyReconciliationJob implements Job { @PostConstruct public void init() { User userInfo = User.builder() + //.uuid("EARLY_RECONC_JOB") .uuid(appProperties.getEgovPgReconciliationSystemUserUuid()) .type("SYSTEM") .roles(Collections.emptyList()).id(0L).build(); diff --git a/core-services/egov-pg-service/src/main/resources/application.properties b/core-services/egov-pg-service/src/main/resources/application.properties index 8f605a028f1..086caf4ab6a 100644 --- a/core-services/egov-pg-service/src/main/resources/application.properties +++ b/core-services/egov-pg-service/src/main/resources/application.properties @@ -6,9 +6,9 @@ pg.earlyReconcileJobRunInterval.mins=15 ##----------------------------- SPRING DS CONFIGURATIONS ------------------------------# spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://localhost:5432/pg_db -spring.datasource.username=postgres -spring.datasource.password=postgres +spring.datasource.url=jdbc:postgresql://dbmsewa.ch88m0ouypx1.ap-south-1.rds.amazonaws.com:5432/egov_prod_db +spring.datasource.username=msewapunjabnew +spring.datasource.password=msewa123456 ##----------------------------- FLYWAY CONFIGURATIONS ------------------------------# spring.flyway.url=jdbc:postgresql://localhost:5432/pg_db spring.flyway.user=postgres @@ -17,7 +17,7 @@ spring.flyway.password=postgres spring.flyway.baseline-on-migrate=true spring.flyway.outOfOrder=true spring.flyway.locations=classpath:/db/migration/main -spring.flyway.enabled=true +spring.flyway.enabled=false ##----------------------------- KAFKA CONFIGURATIONS ------------------------------# kafka.config.bootstrap_server_config=localhost:9092 spring.kafka.consumer.value-deserializer=org.egov.tracer.kafka.deserializer.HashMapDeserializer @@ -45,22 +45,25 @@ persister.update.pg.txns=update-pg-txns persister.save.pg.txnsDump=save-pg-txns-dump persister.update.pg.txnsDump=update-pg-txns-dump ##----------------------------- ID GEN CONFIGURATIONS ------------------------------# -egov.idgen.host=https://dev.digit.org/ +egov.idgen.host=https://msewapunjab.niua.org/ egov.idgen.path=egov-idgen/id/_generate egov.idgen.ack.name=pg.txnid -egov.idgen.ack.format=PG_PG_[cy:yyyy_MM_dd]_[SEQ_EG_PG_TXN]_[d{2}] +egov.idgen.ack.format=PB_PG_[cy:yyyy_MM_dd]_[SEQ_EG_PG_TXN]_[d{2}] ##----------------------------- BILLING SERVICE CONFIGURATIONS ------------------------------# -egov.billingservice.host=https://dev.digit.org/ +egov.billingservice.host=https://msewapunjab.niua.org/ egov.billingservice.path=billing-service/bill/_search ##----------------------------- COLLECTIONS SERVICE CONFIGURATIONS ------------------------------# -egov.collectionservice.host=http://localhost:8095/ +egov.collectionservice.host=https://msewapunjab.niua.org/ egov.collectionservice.create.path=collection-services/receipts/_create egov.collectionservice.validate.path=collection-services/receipts/_validate egov.collectionservice.payment.create.path=collection-services/payments/_create egov.collectionservice.payment.validate.path=collection-services/payments/_validate ##----------------------------- EGF MASTER SERVICE CONFIGURATIONS ------------------------------# -egov.bankaccountservice.host=https://dev.digit.org/ +egov.bankaccountservice.host=https://msewapunjab.niua.org/ egov.bankaccountservice.path=egf-master/bankaccounts/_search +##----------------------------- EGOV COMMON MASTERS SERVICE CONFIGURATIONS ------------------------------# +egov.businessdetailsservice.host=hhttps://msewapunjab.niua.org/ +egov.businessdetailsservice.path=/egov-common-masters/businessDetails/_search?tenantId={tenantId}&businessDetailsCodes={businessDetailsCodes} ##----------------------------- AXIS GATEWAY CONFIGURATIONS ------------------------------# axis.active=true axis.currency=INR @@ -93,7 +96,7 @@ phonepe.merchant.host=mercury-uat.phonepe.com phonepe.url.debit=/v3/debit phonepe.url.status=/v3/transaction ##----------------------------- PAYGOV GATEWAY CONFIGURATIONS ------------------------------# -paygov.active=true +paygov.active=false paygov.messagetype=0100 paygov.currency=INR paygov.merchant.id=UATNIUACG0000001435 @@ -112,7 +115,7 @@ paygov.citizen.redirect.domain.name=https://upyog.niua.org ## Citizen url egov.default.citizen.url=https://upyog.niua.org/citizen ##----------------------------- PG-Detail Configuration ------------------------------# -egov.pgdetail.host=http://localhost:8098 +egov.pgdetail.host=https://msewapunjab.niua.org/ egov.pgdetail.path=/pg-detail/_get ##----------------------------- PHONEPE GATEWAY CONFIGURATIONS ------------------------------# payu.active=true @@ -124,9 +127,21 @@ payu.path.pay=_payment payu.path.status=merchant/postservice.php management.endpoints.web.base-path=/ +##----------------------------- RAZORPAY GATEWAY CONFIGURATIONS ------------------------------# +razorpay.active=true +razorpay.currency=INR +razorpay.locale=en_IN +razorpay.hash.algorithm=HmacSHA256 +razorpay.payment_capture=1 +razorpay.merchant.id=rzp_test_hs3Y3SvtPp4N1v +razorpay.merchant.secret.key=3TmZATrd54EcKHVU0kMf983h +##razorpay.merchant.id=rzp_live_H2n9kGeN5lFKnU +##razorpay.merchant.secret.key=dCq9sPlSVvLpvz4D9QbfdShj +razorpay.url.debit=https://api.razorpay.com/v1 +razorpay.url.status=https://api.razorpay.com/v1/orders ##----------------------------- NTT GATEWAY CONFIGURATIONS ------------------------------# -nttdata.active=true +nttdata.active=false nttdata.merchant.id=317156 nttdata.redirect.url=https://upyog.niua.org/pg-service/transaction/v1/_redirect nttdata.gateway.url.status=https://paynetzuat.atomtech.in/ots/payment/status? @@ -137,36 +152,36 @@ nttdata.merchant.checkout.host=https://pgtest.atomtech.in/staticdata/ots/js/atom ##----------------------------- USER SERVICE CONFIGURATIONS ------------------------------# -egov.userservice.host=http://localhost:8081/ +egov.user.host=http://egov-user:8080/ egov.userservice.create.path=user/users/_createnovalidate egov.userservice.search.path=user/v1/_search pg.is.user.create.enabled=true #Notification -notification.url = https://dev.digit.org/ +notification.url = https://msewapunjab.niua.org/ notification.sms.enabled=true kafka.topics.notification.sms=egov.core.notification.sms #Localization config -egov.localization.host=http://egov-localization.egov:8080 +egov.localization.host=https://msewapunjab.niua.org/ egov.localization.context.path=/localization/messages/v1 egov.localization.search.endpoint=/_search egov.localization.statelevel=true #url shortner -egov.url.shortner.host=http://egov-url-shortening.egov:8080 +egov.url.shortner.host=https://msewapunjab.niua.org/ egov.url.shortner.endpoint=/egov-url-shortening/shortener egov.application.pay.link=citizen/withoutAuth/egov-common/pay?consumerCode=$consumerCode&tenantId=$tenantId&businessService=$businessService #Billing service -egov.billing.service.host=http://billing-service.egov:8080 +egov.billing.service.host=https://msewapunjab.niua.org/ egov.bill.searchendpoint=/billing-service/bill/v2/_search egov.pg.reconciliation.system.user.uuid=b405e4d0-99ec-41b1-92e7-2ebda0321e0d -state.level.tenant.id=pg +state.level.tenant.id=pb //systemuser internal.microservice.role.name=Internal Microservice Role diff --git a/core-services/egov-pg-service/src/main/resources/db/Dockerfile b/core-services/egov-pg-service/src/main/resources/db/Dockerfile index 545849c838d..771179b458c 100644 --- a/core-services/egov-pg-service/src/main/resources/db/Dockerfile +++ b/core-services/egov-pg-service/src/main/resources/db/Dockerfile @@ -1,13 +1,13 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/main /flyway/sql -COPY ./migration/dev /flyway/dev +#COPY ./migration/dev /flyway/dev -COPY ./migration/seed /flyway/seed +#COPY ./migration/seed /flyway/seed COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/core-services/egov-pg-service/src/main/resources/db/migrate.sh b/core-services/egov-pg-service/src/main/resources/db/migrate.sh index 5593a173eba..3b0babd2007 100644 --- a/core-services/egov-pg-service/src/main/resources/db/migrate.sh +++ b/core-services/egov-pg-service/src/main/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true migrate \ No newline at end of file +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate diff --git a/core-services/egov-pg-service/src/main/resources/db/migration/main/V20180607185601__eg_pg_ddl.sql b/core-services/egov-pg-service/src/main/resources/db/migration/main/V20180607185601__eg_pg_ddl.sql index be5f40a0524..5bd8013f57b 100644 --- a/core-services/egov-pg-service/src/main/resources/db/migration/main/V20180607185601__eg_pg_ddl.sql +++ b/core-services/egov-pg-service/src/main/resources/db/migration/main/V20180607185601__eg_pg_ddl.sql @@ -1,7 +1,7 @@ -DROP TABLE IF EXISTS eg_pg_transactions; -DROP TABLE IF EXISTS eg_pg_transactions_dump; +-- DROP TABLE IF EXISTS eg_pg_transactions; +-- DROP TABLE IF EXISTS eg_pg_transactions_dump; -CREATE TABLE "eg_pg_transactions" ( +CREATE TABLE IF NOt EXISTS "eg_pg_transactions" ( "txn_id" VARCHAR(128) NOT NULL, "txn_amount" NUMERIC(15,2) NOT NULL, "txn_status" VARCHAR(64) NOT NULL, @@ -30,7 +30,7 @@ CREATE TABLE "eg_pg_transactions" ( PRIMARY KEY ("txn_id") ); -CREATE TABLE "eg_pg_transactions_dump" ( +CREATE TABLE IF NOT EXISTS "eg_pg_transactions_dump" ( "txn_id" VARCHAR(128) NOT NULL, "txn_request" varchar NULL, "txn_response" JSONB NULL, diff --git a/core-services/egov-pg-service/src/main/resources/db/migration/main/V20180613110701__eg_pg_quartz_ddl.sql b/core-services/egov-pg-service/src/main/resources/db/migration/main/V20180613110701__eg_pg_quartz_ddl.sql index ae55997679e..34831ccf2f8 100644 --- a/core-services/egov-pg-service/src/main/resources/db/migration/main/V20180613110701__eg_pg_quartz_ddl.sql +++ b/core-services/egov-pg-service/src/main/resources/db/migration/main/V20180613110701__eg_pg_quartz_ddl.sql @@ -1,17 +1,17 @@ -DROP TABLE IF EXISTS eg_pg_qrtz_fired_triggers; -DROP TABLE IF EXISTS eg_pg_qrtz_PAUSED_TRIGGER_GRPS; -DROP TABLE IF EXISTS eg_pg_qrtz_SCHEDULER_STATE; -DROP TABLE IF EXISTS eg_pg_qrtz_LOCKS; -DROP TABLE IF EXISTS eg_pg_qrtz_simple_triggers; -DROP TABLE IF EXISTS eg_pg_qrtz_cron_triggers; -DROP TABLE IF EXISTS eg_pg_qrtz_simprop_triggers; -DROP TABLE IF EXISTS eg_pg_qrtz_BLOB_TRIGGERS; -DROP TABLE IF EXISTS eg_pg_qrtz_triggers; -DROP TABLE IF EXISTS eg_pg_qrtz_job_details; -DROP TABLE IF EXISTS eg_pg_qrtz_calendars; - -CREATE TABLE eg_pg_qrtz_job_details +-- DROP TABLE IF EXISTS eg_pg_qrtz_fired_triggers; +-- DROP TABLE IF EXISTS eg_pg_qrtz_PAUSED_TRIGGER_GRPS; +-- DROP TABLE IF EXISTS eg_pg_qrtz_SCHEDULER_STATE; +-- DROP TABLE IF EXISTS eg_pg_qrtz_LOCKS; +-- DROP TABLE F EXISTS eg_pg_qrtz_simple_triggers; +-- DROP TABLE IF EXISTS eg_pg_qrtz_cron_triggers; +-- DROP TABLE IF EXISTS eg_pg_qrtz_simprop_triggers; +-- DROP TABLE IF EXISTS eg_pg_qrtz_BLOB_TRIGGERS; +-- DROP TABLE IF EXISTS eg_pg_qrtz_triggers; +-- DROP TABLE IF EXISTS eg_pg_qrtz_job_details; +-- DROP TABLE IF EXISTS eg_pg_qrtz_calendars; + +CREATE TABLE IF NOT EXISTS eg_pg_qrtz_job_details ( SCHED_NAME VARCHAR(120) NOT NULL, JOB_NAME VARCHAR(200) NOT NULL, @@ -26,7 +26,7 @@ CREATE TABLE eg_pg_qrtz_job_details PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP) ); -CREATE TABLE eg_pg_qrtz_triggers +CREATE TABLE IF NOT EXISTS eg_pg_qrtz_triggers ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_NAME VARCHAR(200) NOT NULL, @@ -49,7 +49,7 @@ CREATE TABLE eg_pg_qrtz_triggers REFERENCES eg_pg_qrtz_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP) ); -CREATE TABLE eg_pg_qrtz_simple_triggers +CREATE TABLE IF NOT EXISTS eg_pg_qrtz_simple_triggers ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_NAME VARCHAR(200) NOT NULL, @@ -62,7 +62,7 @@ CREATE TABLE eg_pg_qrtz_simple_triggers REFERENCES eg_pg_qrtz_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) ); -CREATE TABLE eg_pg_qrtz_cron_triggers +CREATE TABLE IF NOT EXISTS eg_pg_qrtz_cron_triggers ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_NAME VARCHAR(200) NOT NULL, @@ -74,7 +74,7 @@ CREATE TABLE eg_pg_qrtz_cron_triggers REFERENCES eg_pg_qrtz_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) ); -CREATE TABLE eg_pg_qrtz_simprop_triggers +CREATE TABLE IF NOT EXISTS eg_pg_qrtz_simprop_triggers ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_NAME VARCHAR(200) NOT NULL, @@ -95,7 +95,7 @@ CREATE TABLE eg_pg_qrtz_simprop_triggers REFERENCES eg_pg_qrtz_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) ); -CREATE TABLE eg_pg_qrtz_blob_triggers +CREATE TABLE IF NOT EXISTS eg_pg_qrtz_blob_triggers ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_NAME VARCHAR(200) NOT NULL, @@ -106,7 +106,7 @@ CREATE TABLE eg_pg_qrtz_blob_triggers REFERENCES eg_pg_qrtz_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP) ); -CREATE TABLE eg_pg_qrtz_calendars +CREATE TABLE IF NOT EXISTS eg_pg_qrtz_calendars ( SCHED_NAME VARCHAR(120) NOT NULL, CALENDAR_NAME VARCHAR(200) NOT NULL, @@ -115,14 +115,14 @@ CREATE TABLE eg_pg_qrtz_calendars ); -CREATE TABLE eg_pg_qrtz_paused_trigger_grps +CREATE TABLE IF NOT EXISTS eg_pg_qrtz_paused_trigger_grps ( SCHED_NAME VARCHAR(120) NOT NULL, TRIGGER_GROUP VARCHAR(200) NOT NULL, PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP) ); -CREATE TABLE eg_pg_qrtz_fired_triggers +CREATE TABLE IF NOT EXISTS eg_pg_qrtz_fired_triggers ( SCHED_NAME VARCHAR(120) NOT NULL, ENTRY_ID VARCHAR(95) NOT NULL, @@ -140,7 +140,7 @@ CREATE TABLE eg_pg_qrtz_fired_triggers PRIMARY KEY (SCHED_NAME,ENTRY_ID) ); -CREATE TABLE eg_pg_qrtz_scheduler_state +CREATE TABLE IF NOT EXISTS eg_pg_qrtz_scheduler_state ( SCHED_NAME VARCHAR(120) NOT NULL, INSTANCE_NAME VARCHAR(200) NOT NULL, @@ -149,35 +149,35 @@ CREATE TABLE eg_pg_qrtz_scheduler_state PRIMARY KEY (SCHED_NAME,INSTANCE_NAME) ); -CREATE TABLE eg_pg_qrtz_locks +CREATE TABLE IF NOT EXISTS eg_pg_qrtz_locks ( SCHED_NAME VARCHAR(120) NOT NULL, LOCK_NAME VARCHAR(40) NOT NULL, PRIMARY KEY (SCHED_NAME,LOCK_NAME) ); -create index idx_eg_pg_qrtz_j_req_recovery on eg_pg_qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY); -create index idx_eg_pg_qrtz_j_grp on eg_pg_qrtz_job_details(SCHED_NAME,JOB_GROUP); - -create index idx_eg_pg_qrtz_t_j on eg_pg_qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); -create index idx_eg_pg_qrtz_t_jg on eg_pg_qrtz_triggers(SCHED_NAME,JOB_GROUP); -create index idx_eg_pg_qrtz_t_c on eg_pg_qrtz_triggers(SCHED_NAME,CALENDAR_NAME); -create index idx_eg_pg_qrtz_t_g on eg_pg_qrtz_triggers(SCHED_NAME,TRIGGER_GROUP); -create index idx_eg_pg_qrtz_t_state on eg_pg_qrtz_triggers(SCHED_NAME,TRIGGER_STATE); -create index idx_eg_pg_qrtz_t_n_state on eg_pg_qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE); -create index idx_eg_pg_qrtz_t_n_g_state on eg_pg_qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE); -create index idx_eg_pg_qrtz_t_next_fire_time on eg_pg_qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME); -create index idx_eg_pg_qrtz_t_nft_st on eg_pg_qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME); -create index idx_eg_pg_qrtz_t_nft_misfire on eg_pg_qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME); -create index idx_eg_pg_qrtz_t_nft_st_misfire on eg_pg_qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE); -create index idx_eg_pg_qrtz_t_nft_st_misfire_grp on eg_pg_qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE); - -create index idx_eg_pg_qrtz_ft_trig_inst_name on eg_pg_qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME); -create index idx_eg_pg_qrtz_ft_inst_job_req_rcvry on eg_pg_qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY); -create index idx_eg_pg_qrtz_ft_j_g on eg_pg_qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); -create index idx_eg_pg_qrtz_ft_jg on eg_pg_qrtz_fired_triggers(SCHED_NAME,JOB_GROUP); -create index idx_eg_pg_qrtz_ft_t_g on eg_pg_qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); -create index idx_eg_pg_qrtz_ft_tg on eg_pg_qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP); +create index IF NOT EXISTS idx_eg_pg_qrtz_j_req_recovery on eg_pg_qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY); +create index IF NOT EXISTS idx_eg_pg_qrtz_j_grp on eg_pg_qrtz_job_details(SCHED_NAME,JOB_GROUP); + +create index IF NOT EXISTS idx_eg_pg_qrtz_t_j on eg_pg_qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); +create index IF NOT EXISTS idx_eg_pg_qrtz_t_jg on eg_pg_qrtz_triggers(SCHED_NAME,JOB_GROUP); +create index IF NOT EXISTS idx_eg_pg_qrtz_t_c on eg_pg_qrtz_triggers(SCHED_NAME,CALENDAR_NAME); +create index IF NOT EXISTS idx_eg_pg_qrtz_t_g on eg_pg_qrtz_triggers(SCHED_NAME,TRIGGER_GROUP); +create index IF NOT EXISTS idx_eg_pg_qrtz_t_state on eg_pg_qrtz_triggers(SCHED_NAME,TRIGGER_STATE); +create index IF NOT EXISTS idx_eg_pg_qrtz_t_n_state on eg_pg_qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE); +create index IF NOT EXISTS idx_eg_pg_qrtz_t_n_g_state on eg_pg_qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE); +create index IF NOT EXISTS idx_eg_pg_qrtz_t_next_fire_time on eg_pg_qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME); +create index IF NOT EXISTS idx_eg_pg_qrtz_t_nft_st on eg_pg_qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME); +create index IF NOT EXISTS idx_eg_pg_qrtz_t_nft_misfire on eg_pg_qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME); +create index IF NOT EXISTS idx_eg_pg_qrtz_t_nft_st_misfire on eg_pg_qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE); +create index IF NOT EXISTS idx_eg_pg_qrtz_t_nft_st_misfire_grp on eg_pg_qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE); + +create index IF NOT EXISTS idx_eg_pg_qrtz_ft_trig_inst_name on eg_pg_qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME); +create index IF NOT EXISTS idx_eg_pg_qrtz_ft_inst_job_req_rcvry on eg_pg_qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY); +create index IF NOT EXISTS idx_eg_pg_qrtz_ft_j_g on eg_pg_qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP); +create index IF NOT EXISTS idx_eg_pg_qrtz_ft_jg on eg_pg_qrtz_fired_triggers(SCHED_NAME,JOB_GROUP); +create index IF NOT EXISTS idx_eg_pg_qrtz_ft_t_g on eg_pg_qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); +create index IF NOT EXISTS idx_eg_pg_qrtz_ft_tg on eg_pg_qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP); commit; diff --git a/core-services/egov-pg-service/src/main/resources/db/migration/main/V20190326220501__alter_eg_pg_transactions.sql b/core-services/egov-pg-service/src/main/resources/db/migration/main/V20190326220501__alter_eg_pg_transactions.sql index 2309172e961..ab774f48334 100644 --- a/core-services/egov-pg-service/src/main/resources/db/migration/main/V20190326220501__alter_eg_pg_transactions.sql +++ b/core-services/egov-pg-service/src/main/resources/db/migration/main/V20190326220501__alter_eg_pg_transactions.sql @@ -1,6 +1,6 @@ ALTER TABLE eg_pg_transactions ALTER COLUMN "module" DROP NOT NULL; ALTER TABLE eg_pg_transactions ALTER COLUMN "module_id" DROP NOT NULL; ALTER TABLE eg_pg_transactions ALTER COLUMN "txn_status_msg" DROP NOT NULL; -ALTER TABLE eg_pg_transactions ADD COLUMN "consumer_code" VARCHAR(128); +ALTER TABLE eg_pg_transactions ADD COLUMN IF NOT EXISTS "consumer_code" VARCHAR(128); UPDATE eg_pg_transactions SET consumer_code = module_id; -ALTER TABLE eg_pg_transactions ADD COLUMN "additional_details" JSONB NULL; \ No newline at end of file +ALTER TABLE eg_pg_transactions ADD COLUMN IF NOT EXISTS "additional_details" JSONB NULL; \ No newline at end of file diff --git a/core-services/egov-user/pom.xml b/core-services/egov-user/pom.xml index 5e3852e9f47..6499458fa93 100644 --- a/core-services/egov-user/pom.xml +++ b/core-services/egov-user/pom.xml @@ -21,8 +21,25 @@ 2.9.6 UTF-8 1.16.12 + 1.2.0.Final + + org.cache2k + cache2k-api + ${cache2k-version} + + + org.cache2k + cache2k-core + ${cache2k-version} + runtime + + + org.cache2k + cache2k-spring + ${cache2k-version} + ch.qos.logback logback-classic @@ -31,7 +48,7 @@ org.egov.services tracer - 2.1.2-SNAPSHOT + 1.1.5-SNAPSHOT org.springframework.kafka @@ -46,7 +63,7 @@ org.egov.services services-common - 1.1.1-SNAPSHOT + 1.0.1-SNAPSHOT @@ -103,7 +120,7 @@ org.postgresql postgresql - 9.4.1212 + 42.2.18 runtime @@ -129,7 +146,7 @@ org.egov mdms-client - 0.0.2-SNAPSHOT + 0.0.3-SNAPSHOT spring-boot-devtools diff --git a/core-services/egov-user/src/main/java/org/egov/user/EgovUserApplication.java b/core-services/egov-user/src/main/java/org/egov/user/EgovUserApplication.java index 8573a97519c..6f884060e55 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/EgovUserApplication.java +++ b/core-services/egov-user/src/main/java/org/egov/user/EgovUserApplication.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; +import org.cache2k.extra.spring.SpringCache2kCacheManager; import org.egov.encryption.EncryptionService; import org.egov.encryption.config.EncryptionConfiguration; import org.egov.tracer.config.TracerConfiguration; @@ -25,8 +26,11 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; +import org.springframework.context.annotation.Profile; import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; @@ -42,6 +46,7 @@ import javax.annotation.PostConstruct; import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.TimeUnit; import java.util.HashMap; import java.util.Locale; import java.util.Map; @@ -51,6 +56,7 @@ @SpringBootApplication @Slf4j +@EnableCaching @Import({TracerConfiguration.class, EncryptionConfiguration.class}) public class EgovUserApplication { @@ -66,6 +72,8 @@ public class EgovUserApplication { @Autowired private CustomAuthenticationKeyGenerator customAuthenticationKeyGenerator; + @Value("${cache.expiry.masterdata.minutes:5}") + private long masterDataExpiry; @PostConstruct public void initialize() { @@ -116,6 +124,13 @@ public TokenStore tokenStore() { } @Bean + @Profile("!test") + public CacheManager cacheManager() { + return new SpringCache2kCacheManager("cache-" + hashCode()) + .addCaches(b->b.name("cRolesByCode").expireAfterWrite(masterDataExpiry, TimeUnit.MINUTES).entryCapacity(50)); + } + + @Bean public JedisConnectionFactory connectionFactory() { return new JedisConnectionFactory(new JedisShardInfo(host)); } diff --git a/core-services/egov-user/src/main/java/org/egov/user/config/UserServiceConstants.java b/core-services/egov-user/src/main/java/org/egov/user/config/UserServiceConstants.java index 7175fea24aa..7a56d195d4e 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/config/UserServiceConstants.java +++ b/core-services/egov-user/src/main/java/org/egov/user/config/UserServiceConstants.java @@ -55,7 +55,7 @@ public class UserServiceConstants { public static final String IP_HEADER_NAME = "x-real-ip"; - public static final String PATTERN_NAME = "^[^\\\\$\\\"<>?\\\\\\\\~`!@#$%^()+={}\\\\[\\\\]*,:;“”‘’]*$"; + public static final String PATTERN_NAME = "^[^\\$\"'<>?~`!@#$%^()+={}\\[\\]*:;“”‘’]*$"; public static final String PATTERN_GENDER = "^[a-zA-Z ]*$"; diff --git a/core-services/egov-user/src/main/java/org/egov/user/domain/model/Address.java b/core-services/egov-user/src/main/java/org/egov/user/domain/model/Address.java index 57d6d9dfa0f..45bd6d29d1d 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/domain/model/Address.java +++ b/core-services/egov-user/src/main/java/org/egov/user/domain/model/Address.java @@ -5,7 +5,7 @@ import org.egov.user.domain.model.enums.AddressType; import java.util.Date; - +@NoArgsConstructor @Getter @Setter @Builder diff --git a/core-services/egov-user/src/main/java/org/egov/user/domain/model/Role.java b/core-services/egov-user/src/main/java/org/egov/user/domain/model/Role.java index 844c59a3a97..1aa0b20e957 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/domain/model/Role.java +++ b/core-services/egov-user/src/main/java/org/egov/user/domain/model/Role.java @@ -3,7 +3,7 @@ import lombok.*; import java.util.Date; - +@NoArgsConstructor @Getter @Setter @Builder diff --git a/core-services/egov-user/src/main/java/org/egov/user/domain/model/UpdateRequest.java b/core-services/egov-user/src/main/java/org/egov/user/domain/model/UpdateRequest.java index 3a3d570004d..ac1029e7b0a 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/domain/model/UpdateRequest.java +++ b/core-services/egov-user/src/main/java/org/egov/user/domain/model/UpdateRequest.java @@ -71,7 +71,7 @@ public class UpdateRequest { public UpdateRequest(User user) { this.id = user.getId(); - this.userName = user.getUsername(); + this.userName = user.getUserName(); this.salutation = user.getSalutation(); this.name = user.getName(); this.gender = user.getGender() != null ? user.getGender().toString() : null; @@ -138,7 +138,7 @@ public User toDomain(Long loggedInUserId, boolean isCreate) { .uuid(this.uuid) .id(this.id) .name(this.name) - .username(this.userName) + .userName(this.userName) .salutation(this.salutation) .mobileNumber(this.mobileNumber) .emailId(this.emailId) diff --git a/core-services/egov-user/src/main/java/org/egov/user/domain/model/User.java b/core-services/egov-user/src/main/java/org/egov/user/domain/model/User.java index 518e699acb6..f0c6dac2e2d 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/domain/model/User.java +++ b/core-services/egov-user/src/main/java/org/egov/user/domain/model/User.java @@ -25,7 +25,7 @@ import javax.validation.constraints.Size; import static org.springframework.util.ObjectUtils.isEmpty; - +@NoArgsConstructor @AllArgsConstructor @Getter @Setter @@ -39,7 +39,7 @@ public class User { @Pattern(regexp = UserServiceConstants.PATTERN_TENANT) @Size(max = 50) private String tenantId; - private String username; + private String userName; private String title; private String password; private String salutation; @@ -167,7 +167,7 @@ public boolean isNameAbsent() { @JsonIgnore public boolean isUsernameAbsent() { - return isEmpty(username); + return isEmpty(userName); } @JsonIgnore @@ -191,7 +191,7 @@ public boolean isIdAbsent() { } public void nullifySensitiveFields() { - username = null; + userName = null; type = null; mobileNumber = null; password = null; diff --git a/core-services/egov-user/src/main/java/org/egov/user/domain/model/UserSearchCriteria.java b/core-services/egov-user/src/main/java/org/egov/user/domain/model/UserSearchCriteria.java index f05a71c682a..cd94ec6def7 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/domain/model/UserSearchCriteria.java +++ b/core-services/egov-user/src/main/java/org/egov/user/domain/model/UserSearchCriteria.java @@ -14,6 +14,7 @@ @Setter @Builder @ToString +@NoArgsConstructor public class UserSearchCriteria { private List id; diff --git a/core-services/egov-user/src/main/java/org/egov/user/domain/model/enums/GuardianRelation.java b/core-services/egov-user/src/main/java/org/egov/user/domain/model/enums/GuardianRelation.java index de652b5f166..d6fd6fce0b8 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/domain/model/enums/GuardianRelation.java +++ b/core-services/egov-user/src/main/java/org/egov/user/domain/model/enums/GuardianRelation.java @@ -41,5 +41,5 @@ package org.egov.user.domain.model.enums; public enum GuardianRelation { - FATHER, MOTHER, HUSBAND, OTHER; + Father, Mother, Husband, Other; } diff --git a/core-services/egov-user/src/main/java/org/egov/user/domain/service/UserService.java b/core-services/egov-user/src/main/java/org/egov/user/domain/service/UserService.java index 79a89c9b4a0..54789dd61d2 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/domain/service/UserService.java +++ b/core-services/egov-user/src/main/java/org/egov/user/domain/service/UserService.java @@ -1,659 +1,657 @@ -package org.egov.user.domain.service; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectReader; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.egov.common.contract.request.RequestInfo; -import org.egov.tracer.model.CustomException; -import org.egov.user.domain.exception.*; -import org.egov.user.domain.model.LoggedInUserUpdatePasswordRequest; -import org.egov.user.domain.model.NonLoggedInUserUpdatePasswordRequest; -import org.egov.user.domain.model.User; -import org.egov.user.domain.model.UserSearchCriteria; -import org.egov.user.domain.model.enums.UserType; -import org.egov.user.domain.service.utils.EncryptionDecryptionUtil; -import org.egov.user.domain.service.utils.NotificationUtil; -import org.egov.user.persistence.dto.FailedLoginAttempt; -import org.egov.user.persistence.repository.FileStoreRepository; -import org.egov.user.persistence.repository.OtpRepository; -import org.egov.user.persistence.repository.UserRepository; -import org.egov.user.web.contract.Otp; -import org.egov.user.web.contract.OtpValidateRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.security.crypto.password.PasswordEncoder; -import org.springframework.security.oauth2.common.OAuth2AccessToken; -import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; -import org.springframework.security.oauth2.provider.token.TokenStore; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestTemplate; - -import java.io.IOException; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import static java.util.Objects.isNull; -import static org.apache.commons.lang3.StringUtils.isEmpty; -import static org.egov.user.config.UserServiceConstants.USER_CLIENT_ID; -import static org.springframework.util.CollectionUtils.isEmpty; - -@Service -@Slf4j -public class UserService { - - private UserRepository userRepository; - private OtpRepository otpRepository; - private PasswordEncoder passwordEncoder; - private int defaultPasswordExpiryInDays; - private boolean isCitizenLoginOtpBased; - private boolean isEmployeeLoginOtpBased; - private FileStoreRepository fileRepository; - private EncryptionDecryptionUtil encryptionDecryptionUtil; - private TokenStore tokenStore; - - @Value("${egov.user.host}") - private String userHost; - - @Value("${account.unlock.cool.down.period.minutes}") - private Long accountUnlockCoolDownPeriod; - - @Value("${max.invalid.login.attempts.period.minutes}") - private Long maxInvalidLoginAttemptsPeriod; - - @Value("${create.user.validate.name}") - private boolean createUserValidateName; - - @Value("${max.invalid.login.attempts}") - private Long maxInvalidLoginAttempts; - - - @Value("${egov.user.pwd.pattern}") - private String pwdRegex; - - @Value("${egov.user.pwd.pattern.min.length}") - private Integer pwdMinLength; - - @Value("${egov.user.pwd.pattern.max.length}") - private Integer pwdMaxLength; - - @Autowired - private RestTemplate restTemplate; - - @Autowired - private NotificationUtil notificationUtil; - - public UserService(UserRepository userRepository, OtpRepository otpRepository, FileStoreRepository fileRepository, - PasswordEncoder passwordEncoder, EncryptionDecryptionUtil encryptionDecryptionUtil, TokenStore tokenStore, - @Value("${default.password.expiry.in.days}") int defaultPasswordExpiryInDays, - @Value("${citizen.login.password.otp.enabled}") boolean isCitizenLoginOtpBased, - @Value("${employee.login.password.otp.enabled}") boolean isEmployeeLoginOtpBased, - @Value("${egov.user.pwd.pattern}") String pwdRegex, - @Value("${egov.user.pwd.pattern.max.length}") Integer pwdMaxLength, - @Value("${egov.user.pwd.pattern.min.length}") Integer pwdMinLength) { - this.userRepository = userRepository; - this.otpRepository = otpRepository; - this.passwordEncoder = passwordEncoder; - this.defaultPasswordExpiryInDays = defaultPasswordExpiryInDays; - this.isCitizenLoginOtpBased = isCitizenLoginOtpBased; - this.isEmployeeLoginOtpBased = isEmployeeLoginOtpBased; - this.fileRepository = fileRepository; - this.encryptionDecryptionUtil = encryptionDecryptionUtil; - this.tokenStore = tokenStore; - this.pwdRegex = pwdRegex; - this.pwdMaxLength = pwdMaxLength; - this.pwdMinLength = pwdMinLength; - - } - - /** - * get user By UserName And TenantId - * - * @param userName - * @param tenantId - * @return - */ - public User getUniqueUser(String userName, String tenantId, UserType userType) { - - UserSearchCriteria userSearchCriteria = UserSearchCriteria.builder() - .userName(userName) - .tenantId(getStateLevelTenantForCitizen(tenantId, userType)) - .type(userType) - .build(); - - if (isEmpty(userName) || isEmpty(tenantId) || isNull(userType)) { - log.error("Invalid lookup, mandatory fields are absent"); - throw new UserNotFoundException(userSearchCriteria); - } - - /* encrypt here */ - - userSearchCriteria = encryptionDecryptionUtil.encryptObject(userSearchCriteria, "User", UserSearchCriteria.class); - List users = userRepository.findAll(userSearchCriteria); - - if (users.isEmpty()) - throw new UserNotFoundException(userSearchCriteria); - if (users.size() > 1) - throw new DuplicateUserNameException(userSearchCriteria); - - return users.get(0); - } - - public User getUserByUuid(String uuid) { - - UserSearchCriteria userSearchCriteria = UserSearchCriteria.builder() - .uuid(Collections.singletonList(uuid)) - .build(); - - if (isEmpty(uuid)) { - log.error("UUID is mandatory"); - throw new UserNotFoundException(userSearchCriteria); - } - - List users = userRepository.findAll(userSearchCriteria); - - if (users.isEmpty()) - throw new UserNotFoundException(userSearchCriteria); - return users.get(0); - } - - - /** - * get the users based on on userSearch criteria - * - * @param searchCriteria - * @return - */ - - public List searchUsers(UserSearchCriteria searchCriteria, - boolean isInterServiceCall, RequestInfo requestInfo) { - - searchCriteria.validate(isInterServiceCall); - - searchCriteria.setTenantId(getStateLevelTenantForCitizen(searchCriteria.getTenantId(), searchCriteria.getType())); - /* encrypt here / encrypted searchcriteria will be used for search*/ - - String altmobnumber=null; - - if(searchCriteria.getMobileNumber()!=null) { - altmobnumber = searchCriteria.getMobileNumber(); - } - - searchCriteria = encryptionDecryptionUtil.encryptObject(searchCriteria, "User", UserSearchCriteria.class); - - if(altmobnumber!=null) { - searchCriteria.setAlternatemobilenumber(altmobnumber); - } - - List list = userRepository.findAll(searchCriteria); - - /* decrypt here / final reponse decrypted*/ - - list = encryptionDecryptionUtil.decryptObject(list, null, User.class, requestInfo); - - setFileStoreUrlsByFileStoreIds(list); - return list; - } - - /** - * api will create the user based on some validations - * - * @param user - * @return - */ - public User createUser(User user, RequestInfo requestInfo) { - user.setUuid(UUID.randomUUID().toString()); - user.validateNewUser(createUserValidateName); - conditionallyValidateOtp(user); - /* encrypt here */ - user = encryptionDecryptionUtil.encryptObject(user, "User", User.class); - validateUserUniqueness(user); - if (isEmpty(user.getPassword())) { - user.setPassword(UUID.randomUUID().toString()); - } else { - validatePassword(user.getPassword()); - } - user.setPassword(encryptPwd(user.getPassword())); - user.setDefaultPasswordExpiry(defaultPasswordExpiryInDays); - user.setTenantId(getStateLevelTenantForCitizen(user.getTenantId(), user.getType())); - User persistedNewUser = persistNewUser(user); - return encryptionDecryptionUtil.decryptObject(persistedNewUser, "UserSelf", User.class, requestInfo); - - /* decrypt here because encrypted data coming from DB*/ - - } - - private void validateUserUniqueness(User user) { - if (userRepository.isUserPresent(user.getUsername(), getStateLevelTenantForCitizen(user.getTenantId(), user - .getType()), user.getType())) - throw new DuplicateUserNameException(UserSearchCriteria.builder().userName(user.getUsername()).type(user - .getType()).tenantId(user.getTenantId()).build()); - } - - private String getStateLevelTenantForCitizen(String tenantId, UserType userType) { - if (!isNull(userType) && userType.equals(UserType.CITIZEN) && !isEmpty(tenantId) && tenantId.contains(".")) - return tenantId.split("\\.")[0]; - else - return tenantId; - } - - /** - * api will create the citizen with otp - * - * @param user - * @return - */ - public User createCitizen(User user, RequestInfo requestInfo) { - validateAndEnrichCitizen(user); - return createUser(user, requestInfo); - } - - - private void validateAndEnrichCitizen(User user) { - log.info("Validating User........"); - if (isCitizenLoginOtpBased && !StringUtils.isNumeric(user.getUsername())) - throw new UserNameNotValidException(); - else if (isCitizenLoginOtpBased) - user.setMobileNumber(user.getUsername()); - if (!isCitizenLoginOtpBased) - validatePassword(user.getPassword()); - user.setRoleToCitizen(); - user.setTenantId(getStateLevelTenantForCitizen(user.getTenantId(), user.getType())); - } - - /** - * api will create the citizen with otp - * - * @param user - * @return - */ - public Object registerWithLogin(User user, RequestInfo requestInfo) { - user.setActive(true); - createCitizen(user, requestInfo); - return getAccess(user, user.getOtpReference()); - } - - private Object getAccess(User user, String password) { - log.info("Fetch access token for register with login flow"); - try { - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - headers.set("Authorization", "Basic ZWdvdi11c2VyLWNsaWVudDo="); - MultiValueMap map = new LinkedMultiValueMap<>(); - map.add("username", user.getUsername()); - if (!isEmpty(password)) - map.add("password", password); - else - map.add("password", user.getPassword()); - map.add("grant_type", "password"); - map.add("scope", "read"); - map.add("tenantId", user.getTenantId()); - map.add("isInternal", "true"); - map.add("userType", UserType.CITIZEN.name()); - - HttpEntity> request = new HttpEntity>(map, - headers); - return restTemplate.postForEntity(userHost + "/user/oauth/token", request, Map.class).getBody(); - - } catch (Exception e) { - log.error("Error occurred while logging-in via register flow", e); - throw new CustomException("LOGIN_ERROR", "Error occurred while logging in via register flow: " + e.getMessage()); - } - } - - /** - * dependent on otpValidationMandatory filed,it will validate the otp. - * - * @param user - */ - private void conditionallyValidateOtp(User user) { - if (user.isOtpValidationMandatory()) { - if (!validateOtp(user)) - throw new OtpValidationPendingException(); - } - } - - /** - * This api will validate the otp - * - * @param user - * @return - */ - public Boolean validateOtp(User user) { - Otp otp = Otp.builder().otp(user.getOtpReference()).identity(user.getMobileNumber()).tenantId(user.getTenantId()) - .userType(user.getType()).build(); - RequestInfo requestInfo = RequestInfo.builder().action("validate").ts(System.currentTimeMillis()).build(); - OtpValidateRequest otpValidationRequest = OtpValidateRequest.builder().requestInfo(requestInfo).otp(otp) - .build(); - return otpRepository.validateOtp(otpValidationRequest); - - } - - - /** - * api will update user details without otp - * - * @param user - * @return - */ - // TODO Fix date formats - public User updateWithoutOtpValidation(User user, RequestInfo requestInfo) { - final User existingUser = getUserByUuid(user.getUuid()); - user.setTenantId(getStateLevelTenantForCitizen(user.getTenantId(), user.getType())); - validateUserRoles(user); - user.validateUserModification(); - validatePassword(user.getPassword()); - user.setPassword(encryptPwd(user.getPassword())); - /* encrypt */ - user = encryptionDecryptionUtil.encryptObject(user, "User", User.class); - userRepository.update(user, existingUser,requestInfo.getUserInfo().getId(), requestInfo.getUserInfo().getUuid() ); - - // If user is being unlocked via update, reset failed login attempts - if (user.getAccountLocked() != null && !user.getAccountLocked() && existingUser.getAccountLocked()) - resetFailedLoginAttempts(user); - - User encryptedUpdatedUserfromDB = getUserByUuid(user.getUuid()); - User decryptedupdatedUserfromDB = encryptionDecryptionUtil.decryptObject(encryptedUpdatedUserfromDB, "UserSelf", User.class, requestInfo); - return decryptedupdatedUserfromDB; - } - - public void removeTokensByUser(User user) { - Collection tokens = tokenStore.findTokensByClientIdAndUserName(USER_CLIENT_ID, - user.getUsername()); - - for (OAuth2AccessToken token : tokens) { - if (token.getAdditionalInformation() != null && token.getAdditionalInformation().containsKey("UserRequest")) { - if (token.getAdditionalInformation().get("UserRequest") instanceof org.egov.user.web.contract.auth.User) { - org.egov.user.web.contract.auth.User userInfo = - (org.egov.user.web.contract.auth.User) token.getAdditionalInformation().get( - "UserRequest"); - if (user.getUsername().equalsIgnoreCase(userInfo.getUserName()) && user.getTenantId().equalsIgnoreCase(userInfo.getTenantId()) - && user.getType().equals(UserType.fromValue(userInfo.getType()))) - tokenStore.removeAccessToken(token); - } - } - } - - } - - /** - * this api will validate whether user roles exist in Database or not - * - * @param user - */ - private void validateUserRoles(User user) { - if (user.getRoles() == null || user.getRoles() != null && user.getRoles().isEmpty()) { - throw new AtleastOneRoleCodeException(); - } - } - - /** - * this api will update user profile data except these fields userName , - * mobileNumber type , password ,pwsExpiryData, roles - * - * @param user - * @return - */ - public User partialUpdate(User user, RequestInfo requestInfo) { - /* encrypt here */ - user = encryptionDecryptionUtil.encryptObject(user, "User", User.class); - - User existingUser = getUserByUuid(user.getUuid()); - validateProfileUpdateIsDoneByTheSameLoggedInUser(user); - user.nullifySensitiveFields(); - validatePassword(user.getPassword()); - userRepository.update(user, existingUser,requestInfo.getUserInfo().getId(), requestInfo.getUserInfo().getUuid() ); - User updatedUser = getUserByUuid(user.getUuid()); - - /* decrypt here */ - existingUser = encryptionDecryptionUtil.decryptObject(existingUser, "UserSelf", User.class, requestInfo); - updatedUser = encryptionDecryptionUtil.decryptObject(updatedUser, "UserSelf", User.class, requestInfo); - - setFileStoreUrlsByFileStoreIds(Collections.singletonList(updatedUser)); - String oldEmail = existingUser.getEmailId(); - String newEmail = updatedUser.getEmailId(); - if((oldEmail != null && !oldEmail.isEmpty()) && newEmail != null && !(newEmail.equalsIgnoreCase(oldEmail))) { - // Sending sms and email to old email to notify that email has been changed - notificationUtil.sendEmail(requestInfo, existingUser, updatedUser); - } - return updatedUser; - } - - /** - * This api will update the password for logged-in user - * - * @param updatePasswordRequest - */ - public void updatePasswordForLoggedInUser(LoggedInUserUpdatePasswordRequest updatePasswordRequest) { - updatePasswordRequest.validate(); - final User user = getUniqueUser(updatePasswordRequest.getUserName(), updatePasswordRequest.getTenantId(), - updatePasswordRequest.getType()); - - if (user.getType().toString().equals(UserType.CITIZEN.toString()) && isCitizenLoginOtpBased) - throw new InvalidUpdatePasswordRequestException(); - if (user.getType().toString().equals(UserType.EMPLOYEE.toString()) && isEmployeeLoginOtpBased) - throw new InvalidUpdatePasswordRequestException(); - - validateExistingPassword(user, updatePasswordRequest.getExistingPassword()); - validatePassword(updatePasswordRequest.getNewPassword()); - user.updatePassword(encryptPwd(updatePasswordRequest.getNewPassword())); - userRepository.update(user, user, user.getId() , user.getUuid()); - } - - /** - * This Api will update the password for non logged-in user - * - * @param request - */ - public void updatePasswordForNonLoggedInUser(NonLoggedInUserUpdatePasswordRequest request, RequestInfo requestInfo) { - request.validate(); - // validateOtp(request.getOtpValidationRequest()); - User user = getUniqueUser(request.getUserName(), request.getTenantId(), request.getType()); - if (user.getType().toString().equals(UserType.CITIZEN.toString()) && isCitizenLoginOtpBased) { - log.info("CITIZEN forgot password flow is disabled"); - throw new InvalidUpdatePasswordRequestException(); - } - if (user.getType().toString().equals(UserType.EMPLOYEE.toString()) && isEmployeeLoginOtpBased) { - log.info("EMPLOYEE forgot password flow is disabled"); - throw new InvalidUpdatePasswordRequestException(); - } - /* decrypt here */ - /* the reason for decryption here is the otp service requires decrypted username */ - user = encryptionDecryptionUtil.decryptObject(user, "User", User.class, requestInfo); - user.setOtpReference(request.getOtpReference()); - validateOtp(user); - validatePassword(request.getNewPassword()); - user.updatePassword(encryptPwd(request.getNewPassword())); - /* encrypt here */ - /* encrypted value is stored in DB*/ - user = encryptionDecryptionUtil.encryptObject(user, "User", User.class); - userRepository.update(user, user,user.getId()!=null?user.getId():0 , user.getUuid()!=null?user.getUuid():"NA"); - } - - - /** - * Deactivate failed login attempts for provided user - * - * @param user whose failed login attempts are to be reset - */ - public void resetFailedLoginAttempts(User user) { - if (user.getUuid() != null) - userRepository.resetFailedLoginAttemptsForUser(user.getUuid()); - } - - /** - * Checks if user is eligible for unlock - * returns true, - * - If configured cool down period has passed since last lock - * else false - * - * @param user to be checked for eligibility for unlock - * @return if unlock able - */ - public boolean isAccountUnlockAble(User user) { - if (user.getAccountLocked()) { - boolean unlockAble = - System.currentTimeMillis() - user.getAccountLockedDate() > TimeUnit.MINUTES.toMillis(accountUnlockCoolDownPeriod); - - log.info("Account eligible for unlock - " + unlockAble); - log.info("Current time {}, last lock time {} , cool down period {} ", System.currentTimeMillis(), - user.getAccountLockedDate(), TimeUnit.MINUTES.toMillis(accountUnlockCoolDownPeriod)); - return unlockAble; - } else - return true; - } - - /** - * Perform actions where a user login fails - * - Fetch existing failed login attempts within configured time - * period{@link UserService#maxInvalidLoginAttemptsPeriod} - * - If failed login attempts exceeds configured {@link UserService#maxInvalidLoginAttempts} - * - then lock account - * - Add failed login attempt entry to repository - * - * @param user user whose failed login attempt to be handled - * @param ipAddress IP address of remote - */ - public void handleFailedLogin(User user, String ipAddress, RequestInfo requestInfo) { - if (!Objects.isNull(user.getUuid())) { - List failedLoginAttempts = - userRepository.fetchFailedAttemptsByUserAndTime(user.getUuid(), - System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(maxInvalidLoginAttemptsPeriod)); - - if (failedLoginAttempts.size() + 1 >= maxInvalidLoginAttempts) { - User userToBeUpdated = user.toBuilder() - .accountLocked(true) - .password(null) - .accountLockedDate(System.currentTimeMillis()) - .build(); - - user = updateWithoutOtpValidation(userToBeUpdated, requestInfo); - removeTokensByUser(user); - log.info("Locked account with uuid {} for {} minutes as exceeded max allowed attempts of {} within {} " + - "minutes", - user.getUuid(), accountUnlockCoolDownPeriod, maxInvalidLoginAttempts, maxInvalidLoginAttemptsPeriod); - throw new OAuth2Exception("Account locked"); - } - - userRepository.insertFailedLoginAttempt(new FailedLoginAttempt(user.getUuid(), ipAddress, - System.currentTimeMillis(), true)); - } - } - - - /** - * This api will validate existing password and current password matching or - * not - * - * @param user - * @param existingRawPassword - */ - private void validateExistingPassword(User user, String existingRawPassword) { - if (!passwordEncoder.matches(existingRawPassword, user.getPassword())) { - throw new PasswordMismatchException("Invalid username or password"); - } - } - -// /** -// * this api will check user is exist or not, If not exist it will throw -// * exception. -// * -// * @param user -// */ -// private void validateUserPresent(User user) { -// if (user == null) { -// throw new UserNotFoundException(null); -// } -// } - - /** - * this api will validate, updating the profile for same logged-in user or - * not - * - * @param user - */ - private void validateProfileUpdateIsDoneByTheSameLoggedInUser(User user) { - if (user.isLoggedInUserDifferentFromUpdatedUser()) { - throw new UserProfileUpdateDeniedException(); - } - } - - - String encryptPwd(String pwd) { - if (!isNull(pwd)) - return passwordEncoder.encode(pwd); - else - return null; - } - - /** - * This api will persist the user - * - * @param user - * @return - */ - private User persistNewUser(User user) { - - return userRepository.create(user); - } - - /** - * This api will fetch the fileStoreUrl By fileStoreId - * - * @param userList - * @throws Exception - */ - private void setFileStoreUrlsByFileStoreIds(List userList) { - List fileStoreIds = userList.parallelStream().filter(p -> p.getPhoto() != null).map(User::getPhoto) - .collect(Collectors.toList()); - if (!isEmpty(fileStoreIds)) { - Map fileStoreUrlList = null; - try { - fileStoreUrlList = fileRepository.getUrlByFileStoreId(userList.get(0).getTenantId(), fileStoreIds); - } catch (Exception e) { - // TODO Auto-generated catch block - - log.error("Error while fetching fileStore url list: " + e.getMessage()); - } - - if (fileStoreUrlList != null && !fileStoreUrlList.isEmpty()) { - for (User user : userList) { - user.setPhoto(fileStoreUrlList.get(user.getPhoto())); - } - } - } - } - - - public void validatePassword(String password) { - Map errorMap = new HashMap<>(); - if (!StringUtils.isEmpty(password)) { - if (password.length() < pwdMinLength || password.length() > pwdMaxLength) - errorMap.put("INVALID_PWD_LENGTH", "Password must be of minimum: " + pwdMinLength + " and maximum: " + pwdMaxLength + " characters."); - Pattern p = Pattern.compile(pwdRegex); - Matcher m = p.matcher(password); - if (!m.find()) { - errorMap.put("INVALID_PWD_PATTERN", "Password MUST HAVE: Atleast one digit, one upper case, one lower case, one special character (@#$%) and MUST NOT contain any spaces"); - } - } - if (!CollectionUtils.isEmpty(errorMap.keySet())) { - throw new CustomException(errorMap); - } - } - - -} +package org.egov.user.domain.service; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectReader; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.node.ObjectNode; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.egov.common.contract.request.RequestInfo; +import org.egov.tracer.model.CustomException; +import org.egov.user.domain.exception.*; +import org.egov.user.domain.model.LoggedInUserUpdatePasswordRequest; +import org.egov.user.domain.model.NonLoggedInUserUpdatePasswordRequest; +import org.egov.user.domain.model.User; +import org.egov.user.domain.model.UserSearchCriteria; +import org.egov.user.domain.model.enums.UserType; +import org.egov.user.domain.service.utils.EncryptionDecryptionUtil; +import org.egov.user.domain.service.utils.NotificationUtil; +import org.egov.user.persistence.dto.FailedLoginAttempt; +import org.egov.user.persistence.repository.FileStoreRepository; +import org.egov.user.persistence.repository.OtpRepository; +import org.egov.user.persistence.repository.UserRepository; +import org.egov.user.web.contract.Otp; +import org.egov.user.web.contract.OtpValidateRequest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.oauth2.common.OAuth2AccessToken; +import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; +import org.springframework.security.oauth2.provider.token.TokenStore; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestTemplate; + +import java.io.IOException; +import java.util.*; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import static java.util.Objects.isNull; +import static org.apache.commons.lang3.StringUtils.isEmpty; +import static org.egov.user.config.UserServiceConstants.USER_CLIENT_ID; +import static org.springframework.util.CollectionUtils.isEmpty; + +@Service +@Slf4j +public class UserService { + + private UserRepository userRepository; + private OtpRepository otpRepository; + private PasswordEncoder passwordEncoder; + private int defaultPasswordExpiryInDays; + private boolean isCitizenLoginOtpBased; + private boolean isEmployeeLoginOtpBased; + private FileStoreRepository fileRepository; + private EncryptionDecryptionUtil encryptionDecryptionUtil; + private TokenStore tokenStore; + + @Value("${egov.user.host}") + private String userHost; + + @Value("${account.unlock.cool.down.period.minutes}") + private Long accountUnlockCoolDownPeriod; + + @Value("${max.invalid.login.attempts.period.minutes}") + private Long maxInvalidLoginAttemptsPeriod; + + @Value("${create.user.validate.name}") + private boolean createUserValidateName; + + @Value("${max.invalid.login.attempts}") + private Long maxInvalidLoginAttempts; + + + @Value("${egov.user.pwd.pattern}") + private String pwdRegex; + + @Value("${egov.user.pwd.pattern.min.length}") + private Integer pwdMinLength; + + @Value("${egov.user.pwd.pattern.max.length}") + private Integer pwdMaxLength; + + @Autowired + private RestTemplate restTemplate; + + @Autowired + private NotificationUtil notificationUtil; + + public UserService(UserRepository userRepository, OtpRepository otpRepository, FileStoreRepository fileRepository, + PasswordEncoder passwordEncoder, EncryptionDecryptionUtil encryptionDecryptionUtil, TokenStore tokenStore, + @Value("${default.password.expiry.in.days}") int defaultPasswordExpiryInDays, + @Value("${citizen.login.password.otp.enabled}") boolean isCitizenLoginOtpBased, + @Value("${employee.login.password.otp.enabled}") boolean isEmployeeLoginOtpBased, + @Value("${egov.user.pwd.pattern}") String pwdRegex, + @Value("${egov.user.pwd.pattern.max.length}") Integer pwdMaxLength, + @Value("${egov.user.pwd.pattern.min.length}") Integer pwdMinLength) { + this.userRepository = userRepository; + this.otpRepository = otpRepository; + this.passwordEncoder = passwordEncoder; + this.defaultPasswordExpiryInDays = defaultPasswordExpiryInDays; + this.isCitizenLoginOtpBased = isCitizenLoginOtpBased; + this.isEmployeeLoginOtpBased = isEmployeeLoginOtpBased; + this.fileRepository = fileRepository; + this.encryptionDecryptionUtil = encryptionDecryptionUtil; + this.tokenStore = tokenStore; + this.pwdRegex = pwdRegex; + this.pwdMaxLength = pwdMaxLength; + this.pwdMinLength = pwdMinLength; + + } + + /** + * get user By UserName And TenantId + * + * @param userName + * @param tenantId + * @return + */ + public User getUniqueUser(String userName, String tenantId, UserType userType) { + + UserSearchCriteria userSearchCriteria = UserSearchCriteria.builder() + .userName(userName) + .tenantId(getStateLevelTenantForCitizen(tenantId, userType)) + .type(userType) + .build(); + + if (isEmpty(userName) || isEmpty(tenantId) || isNull(userType)) { + log.error("Invalid lookup, mandatory fields are absent"); + throw new UserNotFoundException(userSearchCriteria); + } + + /* encrypt here */ + + userSearchCriteria = encryptionDecryptionUtil.encryptObject(userSearchCriteria, "UserSearchCriteria", UserSearchCriteria.class); + List users = userRepository.findAll(userSearchCriteria); + + if (users.isEmpty()) + throw new UserNotFoundException(userSearchCriteria); + if (users.size() > 1) + throw new DuplicateUserNameException(userSearchCriteria); + + return users.get(0); + } + + public User getUserByUuid(String uuid) { + + UserSearchCriteria userSearchCriteria = UserSearchCriteria.builder() + .uuid(Collections.singletonList(uuid)) + .build(); + + if (isEmpty(uuid)) { + log.error("UUID is mandatory"); + throw new UserNotFoundException(userSearchCriteria); + } + + List users = userRepository.findAll(userSearchCriteria); + + if (users.isEmpty()) + throw new UserNotFoundException(userSearchCriteria); + return users.get(0); + } + + + /** + * get the users based on on userSearch criteria + * + * @param searchCriteria + * @return + */ + + public List searchUsers(UserSearchCriteria searchCriteria, + boolean isInterServiceCall, RequestInfo requestInfo) { + + searchCriteria.validate(isInterServiceCall); + + searchCriteria.setTenantId(getStateLevelTenantForCitizen(searchCriteria.getTenantId(), searchCriteria.getType())); + /* encrypt here / encrypted searchcriteria will be used for search*/ + + String altmobnumber=null; + + if(searchCriteria.getMobileNumber()!=null) { + altmobnumber = searchCriteria.getMobileNumber(); + } + // org.egov.user.domain.model.User user= encryptionDecryptionUtil.encryptObject(searchCriteria, "User", User.class); + searchCriteria = encryptionDecryptionUtil.encryptObject(searchCriteria, "UserSearchCriteria", UserSearchCriteria.class); + + if(altmobnumber!=null) { + searchCriteria.setAlternatemobilenumber(altmobnumber); + } + + List list = userRepository.findAll(searchCriteria); + + /* decrypt here / final reponse decrypted*/ + + list = encryptionDecryptionUtil.decryptObject(list, "UserListSelf", User.class, requestInfo); + + setFileStoreUrlsByFileStoreIds(list); + return list; + } + + /** + * api will create the user based on some validations + * + * @param user + * @return + */ + public User createUser(User user, RequestInfo requestInfo) { + user.setUuid(UUID.randomUUID().toString()); + user.validateNewUser(createUserValidateName); + conditionallyValidateOtp(user); + /* encrypt here */ + user = encryptionDecryptionUtil.encryptObject(user, "UserSelf", User.class); + validateUserUniqueness(user); + if (isEmpty(user.getPassword())) { + user.setPassword(UUID.randomUUID().toString()); + } else { + validatePassword(user.getPassword()); + } + user.setPassword(encryptPwd(user.getPassword())); + user.setDefaultPasswordExpiry(defaultPasswordExpiryInDays); + user.setTenantId(getStateLevelTenantForCitizen(user.getTenantId(), user.getType())); + User persistedNewUser = persistNewUser(user); + return encryptionDecryptionUtil.decryptObject(persistedNewUser, null, User.class, requestInfo); + + /* decrypt here because encrypted data coming from DB*/ + + } + + private void validateUserUniqueness(User user) { + if (userRepository.isUserPresent(user.getUserName(), getStateLevelTenantForCitizen(user.getTenantId(), user + .getType()), user.getType())) + throw new DuplicateUserNameException(UserSearchCriteria.builder().userName(user.getUserName()).type(user + .getType()).tenantId(user.getTenantId()).build()); + } + + private String getStateLevelTenantForCitizen(String tenantId, UserType userType) { + if (!isNull(userType) && userType.equals(UserType.CITIZEN) && !isEmpty(tenantId) && tenantId.contains(".")) + return tenantId.split("\\.")[0]; + else + return tenantId; + } + + /** + * api will create the citizen with otp + * + * @param user + * @return + */ + public User createCitizen(User user, RequestInfo requestInfo) { + validateAndEnrichCitizen(user); + return createUser(user, requestInfo); + } + + + private void validateAndEnrichCitizen(User user) { + log.info("Validating User........"); + if (isCitizenLoginOtpBased && !StringUtils.isNumeric(user.getUserName())) + throw new UserNameNotValidException(); + else if (isCitizenLoginOtpBased) + user.setMobileNumber(user.getUserName()); + if (!isCitizenLoginOtpBased) + validatePassword(user.getPassword()); + user.setRoleToCitizen(); + user.setTenantId(getStateLevelTenantForCitizen(user.getTenantId(), user.getType())); + } + + /** + * api will create the citizen with otp + * + * @param user + * @return + */ + public Object registerWithLogin(User user, RequestInfo requestInfo) { + user.setActive(true); + createCitizen(user, requestInfo); + return getAccess(user, user.getOtpReference()); + } + + private Object getAccess(User user, String password) { + log.info("Fetch access token for register with login flow"); + try { + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); + headers.set("Authorization", "Basic ZWdvdi11c2VyLWNsaWVudDplZ292LXVzZXItc2VjcmV0"); + MultiValueMap map = new LinkedMultiValueMap<>(); + map.add("username", user.getUserName()); + if (!isEmpty(password)) + map.add("password", password); + else + map.add("password", user.getPassword()); + map.add("grant_type", "password"); + map.add("scope", "read"); + map.add("tenantId", user.getTenantId()); + map.add("isInternal", "true"); + map.add("userType", UserType.CITIZEN.name()); + + HttpEntity> request = new HttpEntity>(map, + headers); + return restTemplate.postForEntity(userHost + "/user/oauth/token", request, Map.class).getBody(); + + } catch (Exception e) { + log.error("Error occurred while logging-in via register flow", e); + throw new CustomException("LOGIN_ERROR", "Error occurred while logging in via register flow: " + e.getMessage()); + } + } + + /** + * dependent on otpValidationMandatory filed,it will validate the otp. + * + * @param user + */ + private void conditionallyValidateOtp(User user) { + if (user.isOtpValidationMandatory()) { + if (!validateOtp(user)) + throw new OtpValidationPendingException(); + } + } + + /** + * This api will validate the otp + * + * @param user + * @return + */ + public Boolean validateOtp(User user) { + Otp otp = Otp.builder().otp(user.getOtpReference()).identity(user.getMobileNumber()).tenantId(user.getTenantId()) + .userType(user.getType()).build(); + RequestInfo requestInfo = RequestInfo.builder().action("validate").ts(System.currentTimeMillis()).build(); + OtpValidateRequest otpValidationRequest = OtpValidateRequest.builder().requestInfo(requestInfo).otp(otp) + .build(); + return otpRepository.validateOtp(otpValidationRequest); + + } + + + /** + * api will update user details without otp + * + * @param user + * @return + */ + // TODO Fix date formats + public User updateWithoutOtpValidation(User user, RequestInfo requestInfo) { + final User existingUser = getUserByUuid(user.getUuid()); + user.setTenantId(getStateLevelTenantForCitizen(user.getTenantId(), user.getType())); + validateUserRoles(user); + user.validateUserModification(); + validatePassword(user.getPassword()); + user.setPassword(encryptPwd(user.getPassword())); + /* encrypt */ + user = encryptionDecryptionUtil.encryptObject(user, "User", User.class); + userRepository.update(user, existingUser,requestInfo.getUserInfo().getId(), requestInfo.getUserInfo().getUuid() ); + + // If user is being unlocked via update, reset failed login attempts + if (user.getAccountLocked() != null && !user.getAccountLocked() && existingUser.getAccountLocked()) + resetFailedLoginAttempts(user); + + User encryptedUpdatedUserfromDB = getUserByUuid(user.getUuid()); + User decryptedupdatedUserfromDB = encryptionDecryptionUtil.decryptObject(encryptedUpdatedUserfromDB, "User", User.class, requestInfo); + return decryptedupdatedUserfromDB; + } + + public void removeTokensByUser(User user) { + Collection tokens = tokenStore.findTokensByClientIdAndUserName(USER_CLIENT_ID, + user.getUserName()); + + for (OAuth2AccessToken token : tokens) { + if (token.getAdditionalInformation() != null && token.getAdditionalInformation().containsKey("UserRequest")) { + if (token.getAdditionalInformation().get("UserRequest") instanceof org.egov.user.web.contract.auth.User) { + org.egov.user.web.contract.auth.User userInfo = + (org.egov.user.web.contract.auth.User) token.getAdditionalInformation().get( + "UserRequest"); + if (user.getUserName().equalsIgnoreCase(userInfo.getUserName()) && user.getTenantId().equalsIgnoreCase(userInfo.getTenantId()) + && user.getType().equals(UserType.fromValue(userInfo.getType()))) + tokenStore.removeAccessToken(token); + } + } + } + + } + + /** + * this api will validate whether user roles exist in Database or not + * + * @param user + */ + private void validateUserRoles(User user) { + if (user.getRoles() == null || user.getRoles() != null && user.getRoles().isEmpty()) { + throw new AtleastOneRoleCodeException(); + } + } + + /** + * this api will update user profile data except these fields userName , + * mobileNumber type , password ,pwsExpiryData, roles + * + * @param user + * @return + */ + public User partialUpdate(User user, RequestInfo requestInfo) { + /* encrypt here */ + user = encryptionDecryptionUtil.encryptObject(user, "User", User.class); + + User existingUser = getUserByUuid(user.getUuid()); + validateProfileUpdateIsDoneByTheSameLoggedInUser(user); + user.nullifySensitiveFields(); + validatePassword(user.getPassword()); + userRepository.update(user, existingUser,requestInfo.getUserInfo().getId(), requestInfo.getUserInfo().getUuid() ); + User updatedUser = getUserByUuid(user.getUuid()); + + updatedUser = encryptionDecryptionUtil.decryptObject(updatedUser, "User", User.class, requestInfo); + + setFileStoreUrlsByFileStoreIds(Collections.singletonList(updatedUser)); + String oldEmail = existingUser.getEmailId(); + String newEmail = updatedUser.getEmailId(); + if((oldEmail != null && !oldEmail.isEmpty()) && newEmail != null && !(newEmail.equalsIgnoreCase(oldEmail))) { + // Sending sms and email to old email to notify that email has been changed + notificationUtil.sendEmail(requestInfo, existingUser, updatedUser); + } + return updatedUser; + } + + /** + * This api will update the password for logged-in user + * + * @param updatePasswordRequest + */ + public void updatePasswordForLoggedInUser(LoggedInUserUpdatePasswordRequest updatePasswordRequest) { + updatePasswordRequest.validate(); + final User user = getUniqueUser(updatePasswordRequest.getUserName(), updatePasswordRequest.getTenantId(), + updatePasswordRequest.getType()); + + if (user.getType().toString().equals(UserType.CITIZEN.toString()) && isCitizenLoginOtpBased) + throw new InvalidUpdatePasswordRequestException(); + if (user.getType().toString().equals(UserType.EMPLOYEE.toString()) && isEmployeeLoginOtpBased) + throw new InvalidUpdatePasswordRequestException(); + + validateExistingPassword(user, updatePasswordRequest.getExistingPassword()); + validatePassword(updatePasswordRequest.getNewPassword()); + user.updatePassword(encryptPwd(updatePasswordRequest.getNewPassword())); + userRepository.update(user, user, user.getId() , user.getUuid()); + } + + /** + * This Api will update the password for non logged-in user + * + * @param request + */ + public void updatePasswordForNonLoggedInUser(NonLoggedInUserUpdatePasswordRequest request, RequestInfo requestInfo) { + request.validate(); + // validateOtp(request.getOtpValidationRequest()); + User user = getUniqueUser(request.getUserName(), request.getTenantId(), request.getType()); + if (user.getType().toString().equals(UserType.CITIZEN.toString()) && isCitizenLoginOtpBased) { + log.info("CITIZEN forgot password flow is disabled"); + throw new InvalidUpdatePasswordRequestException(); + } + if (user.getType().toString().equals(UserType.EMPLOYEE.toString()) && isEmployeeLoginOtpBased) { + log.info("EMPLOYEE forgot password flow is disabled"); + throw new InvalidUpdatePasswordRequestException(); + } + /* decrypt here */ + /* the reason for decryption here is the otp service requires decrypted username */ + user = encryptionDecryptionUtil.decryptObject(user, "UserListSelf", User.class, requestInfo); + user.setOtpReference(request.getOtpReference()); + validateOtp(user); + validatePassword(request.getNewPassword()); + user.updatePassword(encryptPwd(request.getNewPassword())); + /* encrypt here */ + /* encrypted value is stored in DB*/ + user = encryptionDecryptionUtil.encryptObject(user, "User", User.class); + userRepository.update(user, user,user.getId()!=null?user.getId():0 , user.getUuid()!=null?user.getUuid():"NA"); + } + + + /** + * Deactivate failed login attempts for provided user + * + * @param user whose failed login attempts are to be reset + */ + public void resetFailedLoginAttempts(User user) { + if (user.getUuid() != null) + userRepository.resetFailedLoginAttemptsForUser(user.getUuid()); + } + + /** + * Checks if user is eligible for unlock + * returns true, + * - If configured cool down period has passed since last lock + * else false + * + * @param user to be checked for eligibility for unlock + * @return if unlock able + */ + public boolean isAccountUnlockAble(User user) { + if (user.getAccountLocked()) { + boolean unlockAble = + System.currentTimeMillis() - user.getAccountLockedDate() > TimeUnit.MINUTES.toMillis(accountUnlockCoolDownPeriod); + + log.info("Account eligible for unlock - " + unlockAble); + log.info("Current time {}, last lock time {} , cool down period {} ", System.currentTimeMillis(), + user.getAccountLockedDate(), TimeUnit.MINUTES.toMillis(accountUnlockCoolDownPeriod)); + return unlockAble; + } else + return true; + } + + /** + * Perform actions where a user login fails + * - Fetch existing failed login attempts within configured time + * period{@link UserService#maxInvalidLoginAttemptsPeriod} + * - If failed login attempts exceeds configured {@link UserService#maxInvalidLoginAttempts} + * - then lock account + * - Add failed login attempt entry to repository + * + * @param user user whose failed login attempt to be handled + * @param ipAddress IP address of remote + */ + public void handleFailedLogin(User user, String ipAddress, RequestInfo requestInfo) { + if (!Objects.isNull(user.getUuid())) { + List failedLoginAttempts = + userRepository.fetchFailedAttemptsByUserAndTime(user.getUuid(), + System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(maxInvalidLoginAttemptsPeriod)); + + if (failedLoginAttempts.size() + 1 >= maxInvalidLoginAttempts) { + User userToBeUpdated = user.toBuilder() + .accountLocked(true) + .password(null) + .accountLockedDate(System.currentTimeMillis()) + .build(); + + user = updateWithoutOtpValidation(userToBeUpdated, requestInfo); + removeTokensByUser(user); + log.info("Locked account with uuid {} for {} minutes as exceeded max allowed attempts of {} within {} " + + "minutes", + user.getUuid(), accountUnlockCoolDownPeriod, maxInvalidLoginAttempts, maxInvalidLoginAttemptsPeriod); + throw new OAuth2Exception("Account locked"); + } + + userRepository.insertFailedLoginAttempt(new FailedLoginAttempt(user.getUuid(), ipAddress, + System.currentTimeMillis(), true)); + } + } + + + /** + * This api will validate existing password and current password matching or + * not + * + * @param user + * @param existingRawPassword + */ + private void validateExistingPassword(User user, String existingRawPassword) { + if (!passwordEncoder.matches(existingRawPassword, user.getPassword())) { + throw new PasswordMismatchException("Invalid username or password"); + } + } + +// /** +// * this api will check user is exist or not, If not exist it will throw +// * exception. +// * +// * @param user +// */ +// private void validateUserPresent(User user) { +// if (user == null) { +// throw new UserNotFoundException(null); +// } +// } + + /** + * this api will validate, updating the profile for same logged-in user or + * not + * + * @param user + */ + private void validateProfileUpdateIsDoneByTheSameLoggedInUser(User user) { + if (user.isLoggedInUserDifferentFromUpdatedUser()) { + throw new UserProfileUpdateDeniedException(); + } + } + + + String encryptPwd(String pwd) { + if (!isNull(pwd)) + return passwordEncoder.encode(pwd); + else + return null; + } + + /** + * This api will persist the user + * + * @param user + * @return + */ + private User persistNewUser(User user) { + + return userRepository.create(user); + } + + /** + * This api will fetch the fileStoreUrl By fileStoreId + * + * @param userList + * @throws Exception + */ + private void setFileStoreUrlsByFileStoreIds(List userList) { + List fileStoreIds = userList.parallelStream().filter(p -> p.getPhoto() != null).map(User::getPhoto) + .collect(Collectors.toList()); + if (!isEmpty(fileStoreIds)) { + Map fileStoreUrlList = null; + try { + fileStoreUrlList = fileRepository.getUrlByFileStoreId(userList.get(0).getTenantId(), fileStoreIds); + } catch (Exception e) { + // TODO Auto-generated catch block + + log.error("Error while fetching fileStore url list: " + e.getMessage()); + } + + if (fileStoreUrlList != null && !fileStoreUrlList.isEmpty()) { + for (User user : userList) { + user.setPhoto(fileStoreUrlList.get(user.getPhoto())); + } + } + } + } + + + public void validatePassword(String password) { + Map errorMap = new HashMap<>(); + if (!StringUtils.isEmpty(password)) { + if (password.length() < pwdMinLength || password.length() > pwdMaxLength) + errorMap.put("INVALID_PWD_LENGTH", "Password must be of minimum: " + pwdMinLength + " and maximum: " + pwdMaxLength + " characters."); + Pattern p = Pattern.compile(pwdRegex); + Matcher m = p.matcher(password); + if (!m.find()) { + errorMap.put("INVALID_PWD_PATTERN", "Password MUST HAVE: Atleast one digit, one upper case, one lower case, one special character (@#$%) and MUST NOT contain any spaces"); + } + } + if (!CollectionUtils.isEmpty(errorMap.keySet())) { + throw new CustomException(errorMap); + } + } + + +} diff --git a/core-services/egov-user/src/main/java/org/egov/user/domain/service/utils/EncryptionDecryptionUtil.java b/core-services/egov-user/src/main/java/org/egov/user/domain/service/utils/EncryptionDecryptionUtil.java index f12c38f0209..5c2ea798fb6 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/domain/service/utils/EncryptionDecryptionUtil.java +++ b/core-services/egov-user/src/main/java/org/egov/user/domain/service/utils/EncryptionDecryptionUtil.java @@ -25,6 +25,8 @@ @Slf4j @Component public class EncryptionDecryptionUtil { + + private EncryptionService encryptionService; @Autowired private AuditService auditService; @@ -63,7 +65,7 @@ public T encryptObject(Object objectToEncrypt, String key, Class classTyp public P decryptObject(Object objectToDecrypt, String key, Class classType, RequestInfo requestInfo) { - try { + try { boolean objectToDecryptNotList = false; if (objectToDecrypt == null) { return null; @@ -83,7 +85,7 @@ public P decryptObject(Object objectToDecrypt, String key, Class class if(key == null) key = keyPurposeMap.get("key"); - + P decryptedObject = (P) encryptionService.decryptJson(requestInfo,objectToDecrypt, key, purpose, classType); if (decryptedObject == null) { throw new CustomException("DECRYPTION_NULL_ERROR", "Null object found on performing decryption"); @@ -131,24 +133,24 @@ public Map getKeyToDecrypt(Object objectToDecrypt, User userInfo) Map keyPurposeMap = new HashMap<>(); if (!abacEnabled){ - keyPurposeMap.put("key","UserSelf"); + keyPurposeMap.put("key","UserListSelf"); keyPurposeMap.put("purpose","AbacDisabled"); } else if (isUserDecryptingForSelf(objectToDecrypt, userInfo)){ - keyPurposeMap.put("key","UserSelf"); + keyPurposeMap.put("key","UserListSelf"); keyPurposeMap.put("purpose","Self"); } else if (isDecryptionForIndividualUser(objectToDecrypt)){ - keyPurposeMap.put("key","User"); + keyPurposeMap.put("key","UserListSelf"); keyPurposeMap.put("purpose","SingleSearchResult"); } else{ - keyPurposeMap.put("key","User"); + keyPurposeMap.put("key","UserListSelf"); keyPurposeMap.put("purpose","BulkSearchResult"); } diff --git a/core-services/egov-user/src/main/java/org/egov/user/domain/service/utils/LocalizationUtil.java b/core-services/egov-user/src/main/java/org/egov/user/domain/service/utils/LocalizationUtil.java index c58d48ebbee..71cecfde458 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/domain/service/utils/LocalizationUtil.java +++ b/core-services/egov-user/src/main/java/org/egov/user/domain/service/utils/LocalizationUtil.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.Map; -import static org.reflections.Reflections.log; + @Component @Slf4j diff --git a/core-services/egov-user/src/main/java/org/egov/user/persistence/dto/Otp.java b/core-services/egov-user/src/main/java/org/egov/user/persistence/dto/Otp.java index c2d373f573d..972c216eb8c 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/persistence/dto/Otp.java +++ b/core-services/egov-user/src/main/java/org/egov/user/persistence/dto/Otp.java @@ -4,10 +4,12 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter @Builder @AllArgsConstructor +@NoArgsConstructor public class Otp { @JsonProperty("isValidationSuccessful") diff --git a/core-services/egov-user/src/main/java/org/egov/user/persistence/dto/OtpResponse.java b/core-services/egov-user/src/main/java/org/egov/user/persistence/dto/OtpResponse.java index 1dce001335e..932ce248b99 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/persistence/dto/OtpResponse.java +++ b/core-services/egov-user/src/main/java/org/egov/user/persistence/dto/OtpResponse.java @@ -2,10 +2,13 @@ import lombok.AllArgsConstructor; import lombok.Getter; +import lombok.NoArgsConstructor; + import org.egov.common.contract.response.ResponseInfo; @Getter @AllArgsConstructor +@NoArgsConstructor public class OtpResponse { private Otp otp; private ResponseInfo responseInfo; diff --git a/core-services/egov-user/src/main/java/org/egov/user/persistence/repository/AuditRepository.java b/core-services/egov-user/src/main/java/org/egov/user/persistence/repository/AuditRepository.java index 9971c8fd199..318d7b19655 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/persistence/repository/AuditRepository.java +++ b/core-services/egov-user/src/main/java/org/egov/user/persistence/repository/AuditRepository.java @@ -46,7 +46,7 @@ public void auditUser(User oldUser, long userId, String uuid) { auditInputs.put("id", oldUser.getId()); auditInputs.put("uuid", oldUser.getUuid()); - auditInputs.put("username", oldUser.getUsername()); + auditInputs.put("username", oldUser.getUserName()); auditInputs.put("type", oldUser.getType().toString()); auditInputs.put("tenantid", oldUser.getTenantId()); auditInputs.put("aadhaarnumber", oldUser.getAadhaarNumber()); diff --git a/core-services/egov-user/src/main/java/org/egov/user/persistence/repository/UserRepository.java b/core-services/egov-user/src/main/java/org/egov/user/persistence/repository/UserRepository.java index bbacf63d212..eda165bbdea 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/persistence/repository/UserRepository.java +++ b/core-services/egov-user/src/main/java/org/egov/user/persistence/repository/UserRepository.java @@ -17,6 +17,7 @@ import org.egov.user.repository.builder.UserTypeQueryBuilder; import org.egov.user.repository.rowmapper.UserResultSetExtractor; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; @@ -179,7 +180,7 @@ public void update(final User user, User oldUser, long userId, String uuid) { Map updateuserInputs = new HashMap<>(); - updateuserInputs.put("username", oldUser.getUsername()); + updateuserInputs.put("username", oldUser.getUserName()); updateuserInputs.put("type", oldUser.getType().toString()); updateuserInputs.put("tenantid", oldUser.getTenantId()); updateuserInputs.put("AadhaarNumber", user.getAadhaarNumber()); @@ -199,18 +200,46 @@ public void update(final User user, User oldUser, long userId, String uuid) { List bloodGroupEnumValues = Arrays.asList(BloodGroup.values()); if (user.getBloodGroup() != null) { - if (bloodGroupEnumValues.contains(user.getBloodGroup())) + if (BloodGroup.A_NEGATIVE.toString().equals(user.getBloodGroup().toString())) { updateuserInputs.put("BloodGroup", user.getBloodGroup().toString()); - else + } else if (BloodGroup.A_POSITIVE.toString().equals(user.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", user.getBloodGroup().toString()); + } else if (BloodGroup.AB_NEGATIVE.toString().equals(user.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", user.getBloodGroup().toString()); + } else if (BloodGroup.AB_POSITIVE.toString().equals(user.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", user.getBloodGroup().toString()); + } else if (BloodGroup.O_NEGATIVE.toString().equals(user.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", user.getBloodGroup().toString()); + } else if (BloodGroup.O_POSITIVE.toString().equals(user.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", user.getBloodGroup().toString()); + } else if (BloodGroup.B_POSITIVE.toString().equals(user.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", user.getBloodGroup().toString()); + } else if (BloodGroup.B_NEGATIVE.toString().equals(user.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", user.getBloodGroup().toString()); + } else { updateuserInputs.put("BloodGroup", ""); } - else if (oldUser != null && oldUser.getBloodGroup() != null) { - if (bloodGroupEnumValues.contains(oldUser.getBloodGroup())) + } else if (oldUser != null && oldUser.getBloodGroup() != null) { + if (BloodGroup.A_NEGATIVE.toString().equals(oldUser.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", oldUser.getBloodGroup().toString()); + } else if (BloodGroup.A_POSITIVE.toString().equals(oldUser.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", oldUser.getBloodGroup().toString()); + } else if (BloodGroup.AB_NEGATIVE.toString().equals(oldUser.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", oldUser.getBloodGroup().toString()); + } else if (BloodGroup.AB_POSITIVE.toString().equals(oldUser.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", oldUser.getBloodGroup().toString()); + } else if (BloodGroup.O_NEGATIVE.toString().equals(oldUser.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", oldUser.getBloodGroup().toString()); + } else if (BloodGroup.O_POSITIVE.toString().equals(oldUser.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", oldUser.getBloodGroup().toString()); + } else if (BloodGroup.B_POSITIVE.toString().equals(oldUser.getBloodGroup().toString())) { + updateuserInputs.put("BloodGroup", oldUser.getBloodGroup().toString()); + } else if (BloodGroup.B_NEGATIVE.toString().equals(oldUser.getBloodGroup().toString())) { updateuserInputs.put("BloodGroup", oldUser.getBloodGroup().toString()); - else + } else { updateuserInputs.put("BloodGroup", ""); } - else { + } else { updateuserInputs.put("BloodGroup", ""); } @@ -240,9 +269,15 @@ else if (oldUser != null && oldUser.getBloodGroup() != null) { List enumValues = Arrays.asList(GuardianRelation.values()); if (user.getGuardianRelation() != null) { - if(enumValues.contains(user.getGuardianRelation())) + if (GuardianRelation.Father.toString().equals(user.getGuardianRelation().toString())) { updateuserInputs.put("GuardianRelation", user.getGuardianRelation().toString()); - else { + } else if (GuardianRelation.Mother.toString().equals(user.getGuardianRelation().toString())) { + updateuserInputs.put("GuardianRelation", user.getGuardianRelation().toString()); + } else if (GuardianRelation.Husband.toString().equals(user.getGuardianRelation().toString())) { + updateuserInputs.put("GuardianRelation", user.getGuardianRelation().toString()); + } else if (GuardianRelation.Other.toString().equals(user.getGuardianRelation().toString())) { + updateuserInputs.put("GuardianRelation", user.getGuardianRelation().toString()); + } else { updateuserInputs.put("GuardianRelation", ""); } @@ -279,9 +314,15 @@ else if (oldUser != null && oldUser.getBloodGroup() != null) { List userTypeEnumValues = Arrays.asList(UserType.values()); if (user.getType() != null) { - if (userTypeEnumValues.contains(user.getType())) + if (UserType.BUSINESS.toString().equals(user.getType().toString())) { updateuserInputs.put("Type", user.getType().toString()); - else { + } else if (UserType.CITIZEN.toString().equals(user.getType().toString())) { + updateuserInputs.put("Type", user.getType().toString()); + } else if (UserType.EMPLOYEE.toString().equals(user.getType().toString())) { + updateuserInputs.put("Type", user.getType().toString()); + } else if (UserType.SYSTEM.toString().equals(user.getType().toString())) { + updateuserInputs.put("Type", user.getType().toString()); + } else { updateuserInputs.put("Type", ""); } } @@ -354,6 +395,7 @@ public void resetFailedLoginAttemptsForUser(String uuid) { * @param tenantId tenant id of the roles * @return enriched roles */ + @Cacheable(value = "cRolesByCode", key = "roleCodes", sync = true) private Set fetchRolesByCode(Set roleCodes, String tenantId) { @@ -467,7 +509,7 @@ private User save(User entityUser) { userInputs.put("salutation", entityUser.getSalutation()); userInputs.put("dob", entityUser.getDob()); userInputs.put("locale", entityUser.getLocale()); - userInputs.put("username", entityUser.getUsername()); + userInputs.put("username", entityUser.getUserName()); userInputs.put("password", entityUser.getPassword()); userInputs.put("pwdexpirydate", entityUser.getPasswordExpiryDate()); userInputs.put("mobilenumber", entityUser.getMobileNumber()); @@ -576,8 +618,13 @@ private Address saveAddress(Address address, Long userId, String tenantId) { */ private void updateRoles(User user) { Map roleInputs = new HashMap(); + List roleCodes = user.getRoles().stream().map(Role::getCode).collect(Collectors.toList()); roleInputs.put("user_id", user.getId()); roleInputs.put("user_tenantid", user.getTenantId()); + + // Add roles filter as well, other wise during concurrent update call there is a + // null pointer exception due to delete of roles + roleInputs.put("roles", roleCodes); namedParameterJdbcTemplate.update(RoleQueryBuilder.DELETE_USER_ROLES, roleInputs); saveUserRoles(user); } diff --git a/core-services/egov-user/src/main/java/org/egov/user/repository/builder/RoleQueryBuilder.java b/core-services/egov-user/src/main/java/org/egov/user/repository/builder/RoleQueryBuilder.java index aea67756734..15512e15d6e 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/repository/builder/RoleQueryBuilder.java +++ b/core-services/egov-user/src/main/java/org/egov/user/repository/builder/RoleQueryBuilder.java @@ -9,9 +9,11 @@ public class RoleQueryBuilder { public static final String GET_ROLES_BY_ROLEIDS = "select * from eg_role where id in (:id) and tenantid=:tenantId"; public static final String GET_ROLE_BYTENANT_ANDCODE = "select * from eg_role where code =:code and tenantid=:tenantId"; public static final String INSERT_USER_ROLES = "insert into eg_userrole_v1(role_code, role_tenantid, user_id, " + - "user_tenantid, lastmodifieddate) values(:role_code,:role_tenantid,:user_id,:user_tenantid,:lastmodifieddate)"; + "user_tenantid, lastmodifieddate) values(:role_code,:role_tenantid,:user_id,:user_tenantid,:lastmodifieddate) " + + "ON CONFLICT (role_code, role_tenantid, user_id, user_tenantid) DO NOTHING"; public static final String DELETE_USER_ROLES = "delete from eg_userrole_v1 where user_id=:user_id and " + - "user_tenantid=:user_tenantid"; + "user_tenantid=:user_tenantid and " + + "role_code not in (:roles)"; } diff --git a/core-services/egov-user/src/main/java/org/egov/user/repository/rowmapper/UserResultSetExtractor.java b/core-services/egov-user/src/main/java/org/egov/user/repository/rowmapper/UserResultSetExtractor.java index 8e888af0977..d52cf8b7e64 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/repository/rowmapper/UserResultSetExtractor.java +++ b/core-services/egov-user/src/main/java/org/egov/user/repository/rowmapper/UserResultSetExtractor.java @@ -42,7 +42,7 @@ public List extractData(ResultSet rs) throws SQLException, DataAccessExcep user = User.builder().id(rs.getLong("id")).tenantId(rs.getString("tenantid")).title(rs.getString("title")) .salutation(rs.getString("salutation")) - .dob(rs.getDate("dob")).locale(rs.getString("locale")).username(rs.getString("username")) + .dob(rs.getDate("dob")).locale(rs.getString("locale")).userName(rs.getString("username")) .password(rs.getString("password")).passwordExpiryDate(rs.getTimestamp("pwdexpirydate")) .mobileNumber(rs.getString("mobilenumber")).altContactNumber(rs.getString("altcontactnumber")) .emailId(rs.getString("emailid")).active(rs.getBoolean("active")).name(rs.getString("name")). diff --git a/core-services/egov-user/src/main/java/org/egov/user/repository/rowmapper/UserRowMapper.java b/core-services/egov-user/src/main/java/org/egov/user/repository/rowmapper/UserRowMapper.java index f8c510500fd..47d78ea8891 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/repository/rowmapper/UserRowMapper.java +++ b/core-services/egov-user/src/main/java/org/egov/user/repository/rowmapper/UserRowMapper.java @@ -15,7 +15,7 @@ public class UserRowMapper implements RowMapper { @Override public User mapRow(final ResultSet rs, final int rowNum) throws SQLException { final User user = User.builder().id(rs.getLong("id")).tenantId(rs.getString("tenantid")).title(rs.getString("title")).salutation(rs.getString("salutation")) - .dob(rs.getDate("dob")).locale(rs.getString("locale")).username(rs.getString("username")) + .dob(rs.getDate("dob")).locale(rs.getString("locale")).userName(rs.getString("username")) .password(rs.getString("password")).passwordExpiryDate(rs.getTimestamp("pwdexpirydate")) .mobileNumber(rs.getString("mobilenumber")).altContactNumber(rs.getString("altcontactnumber")) .emailId(rs.getString("emailid")).active(rs.getBoolean("active")).name(rs.getString("name")).lastModifiedBy(rs.getLong("lastmodifiedby")).lastModifiedDate(rs.getTimestamp("lastmodifieddate")) diff --git a/core-services/egov-user/src/main/java/org/egov/user/security/AuthorizationServerConfiguration.java b/core-services/egov-user/src/main/java/org/egov/user/security/AuthorizationServerConfiguration.java index 5f7560f3b4e..d67b9f74e11 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/security/AuthorizationServerConfiguration.java +++ b/core-services/egov-user/src/main/java/org/egov/user/security/AuthorizationServerConfiguration.java @@ -47,7 +47,7 @@ public class AuthorizationServerConfiguration extends AuthorizationServerConfigu public void configure(ClientDetailsServiceConfigurer clients) throws Exception { final int accessTokenValidityInSeconds = accessTokenValidityInMinutes * 60; final int refreshTokenValidityInSeconds = refreshTokenValidityInMinutes * 60; - clients.inMemory().withClient(USER_CLIENT_ID) + clients.inMemory().withClient(USER_CLIENT_ID).secret("egov-user-secret") .authorizedGrantTypes("authorization_code", "refresh_token", "password") .authorities("ROLE_APP", "ROLE_CITIZEN", "ROLE_ADMIN", "ROLE_EMPLOYEE").scopes("read", "write") .refreshTokenValiditySeconds(refreshTokenValidityInSeconds) diff --git a/core-services/egov-user/src/main/java/org/egov/user/security/CustomAuthenticationKeyGenerator.java b/core-services/egov-user/src/main/java/org/egov/user/security/CustomAuthenticationKeyGenerator.java index 0e1d08f132c..306fa86a5e9 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/security/CustomAuthenticationKeyGenerator.java +++ b/core-services/egov-user/src/main/java/org/egov/user/security/CustomAuthenticationKeyGenerator.java @@ -44,9 +44,9 @@ public String extractKey(OAuth2Authentication authentication) { MessageDigest digest; try { - digest = MessageDigest.getInstance(hashAlgorithm); + digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { - throw new IllegalStateException(hashAlgorithm+" algorithm not available. Fatal (should be in the JDK)."); + throw new IllegalStateException("MD5 algorithm not available. Fatal (should be in the JDK)."); } try { diff --git a/core-services/egov-user/src/main/java/org/egov/user/security/oauth2/custom/authproviders/CustomAuthenticationProvider.java b/core-services/egov-user/src/main/java/org/egov/user/security/oauth2/custom/authproviders/CustomAuthenticationProvider.java index 088f51b8772..e2e90a8e8ff 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/security/oauth2/custom/authproviders/CustomAuthenticationProvider.java +++ b/core-services/egov-user/src/main/java/org/egov/user/security/oauth2/custom/authproviders/CustomAuthenticationProvider.java @@ -99,7 +99,7 @@ public Authentication authenticate(Authentication authentication) { org.egov.common.contract.request.User userInfo = org.egov.common.contract.request.User.builder().uuid(user.getUuid()) .type(user.getType() != null ? user.getType().name() : null).roles(contract_roles).build(); requestInfo = RequestInfo.builder().userInfo(userInfo).build(); - user = encryptionDecryptionUtil.decryptObject(user, "UserSelf", User.class, requestInfo); + user = encryptionDecryptionUtil.decryptObject(user, "UserListSelf", User.class, requestInfo); } catch (UserNotFoundException e) { log.error("User not found", e); @@ -204,7 +204,7 @@ private String getTenantId(Authentication authentication) { } private org.egov.user.web.contract.auth.User getUser(User user) { - org.egov.user.web.contract.auth.User authUser = org.egov.user.web.contract.auth.User.builder().id(user.getId()).userName(user.getUsername()).uuid(user.getUuid()) + org.egov.user.web.contract.auth.User authUser = org.egov.user.web.contract.auth.User.builder().id(user.getId()).userName(user.getUserName()).uuid(user.getUuid()) .name(user.getName()).mobileNumber(user.getMobileNumber()).emailId(user.getEmailId()) .locale(user.getLocale()).active(user.getActive()).type(user.getType().name()) .roles(toAuthRole(user.getRoles())).tenantId(user.getTenantId()) diff --git a/core-services/egov-user/src/main/java/org/egov/user/security/oauth2/custom/authproviders/CustomPreAuthenticatedProvider.java b/core-services/egov-user/src/main/java/org/egov/user/security/oauth2/custom/authproviders/CustomPreAuthenticatedProvider.java index 8d6712d7ddb..19bc5d67f00 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/security/oauth2/custom/authproviders/CustomPreAuthenticatedProvider.java +++ b/core-services/egov-user/src/main/java/org/egov/user/security/oauth2/custom/authproviders/CustomPreAuthenticatedProvider.java @@ -74,7 +74,7 @@ public Authentication authenticate(Authentication authentication) throws Authent org.egov.common.contract.request.User userInfo = org.egov.common.contract.request.User.builder().uuid(user.getUuid()) .type(user.getType() != null ? user.getType().name() : null).roles(contract_roles).build(); RequestInfo requestInfo = RequestInfo.builder().userInfo(userInfo).build(); - user = encryptionDecryptionUtil.decryptObject(user, "UserSelf", User.class, requestInfo); + user = encryptionDecryptionUtil.decryptObject(user, "UserListSelf", User.class, requestInfo); } catch (UserNotFoundException e) { log.error("User not found", e); throw new OAuth2Exception("Invalid login credentials"); @@ -102,7 +102,7 @@ public boolean supports(Class authentication) { private org.egov.user.web.contract.auth.User getUser(User user) { - org.egov.user.web.contract.auth.User authUser = org.egov.user.web.contract.auth.User.builder().id(user.getId()).userName(user.getUsername()).uuid(user.getUuid()) + org.egov.user.web.contract.auth.User authUser = org.egov.user.web.contract.auth.User.builder().id(user.getId()).userName(user.getUserName()).uuid(user.getUuid()) .name(user.getName()).mobileNumber(user.getMobileNumber()).emailId(user.getEmailId()) .locale(user.getLocale()).active(user.getActive()).type(user.getType().name()) .roles(toAuthRole(user.getRoles())).tenantId(user.getTenantId()) diff --git a/core-services/egov-user/src/main/java/org/egov/user/web/contract/RoleRequest.java b/core-services/egov-user/src/main/java/org/egov/user/web/contract/RoleRequest.java index d39fa2eaf24..3ebfd3626d5 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/web/contract/RoleRequest.java +++ b/core-services/egov-user/src/main/java/org/egov/user/web/contract/RoleRequest.java @@ -4,8 +4,10 @@ import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; -import org.egov.user.domain.model.Role; +import lombok.NoArgsConstructor; +import org.egov.user.domain.model.Role; +@NoArgsConstructor @Getter @Builder @AllArgsConstructor diff --git a/core-services/egov-user/src/main/java/org/egov/user/web/contract/UserRequest.java b/core-services/egov-user/src/main/java/org/egov/user/web/contract/UserRequest.java index ebcdf121a58..eb5ce3c62be 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/web/contract/UserRequest.java +++ b/core-services/egov-user/src/main/java/org/egov/user/web/contract/UserRequest.java @@ -7,7 +7,11 @@ import org.egov.user.domain.model.Address; import org.egov.user.domain.model.Role; import org.egov.user.domain.model.User; -import org.egov.user.domain.model.enums.*; +import org.egov.user.domain.model.enums.AddressType; +import org.egov.user.domain.model.enums.BloodGroup; +import org.egov.user.domain.model.enums.Gender; +import org.egov.user.domain.model.enums.GuardianRelation; +import org.egov.user.domain.model.enums.UserType; import org.hibernate.validator.constraints.Email; import org.hibernate.validator.constraints.SafeHtml; @@ -37,7 +41,7 @@ public class UserRequest { private String salutation; @Pattern(regexp = UserServiceConstants.PATTERN_NAME) - @Size(max = 50) + @Size(max = 100) private String name; @Pattern(regexp = UserServiceConstants.PATTERN_GENDER) @@ -102,7 +106,7 @@ public class UserRequest { private Long accountLockedDate; @Pattern(regexp = UserServiceConstants.PATTERN_NAME) - @Size(max = 50) + @Size(max = 100) private String fatherOrHusbandName; private GuardianRelation relationship; @@ -153,7 +157,7 @@ public class UserRequest { public UserRequest(User user) { this.id = user.getId(); - this.userName = user.getUsername(); + this.userName = user.getUserName(); this.salutation = user.getSalutation(); this.name = user.getName(); this.gender = user.getGender() != null ? user.getGender().toString() : null; @@ -221,7 +225,7 @@ public User toDomain(Long loggedInUserId, String loggedInUserUuid, boolean isCre .uuid(this.uuid) .id(this.id) .name(this.name) - .username(this.userName) + .userName(this.userName) .salutation(this.salutation) .mobileNumber(this.mobileNumber) .emailId(this.emailId) diff --git a/core-services/egov-user/src/main/java/org/egov/user/web/contract/UserSearchResponseContent.java b/core-services/egov-user/src/main/java/org/egov/user/web/contract/UserSearchResponseContent.java index 4243716baab..fc81f175d2f 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/web/contract/UserSearchResponseContent.java +++ b/core-services/egov-user/src/main/java/org/egov/user/web/contract/UserSearchResponseContent.java @@ -71,7 +71,7 @@ public class UserSearchResponseContent { public UserSearchResponseContent(User user) { this.id = user.getId(); - this.userName = user.getUsername(); + this.userName = user.getUserName(); this.salutation = user.getSalutation(); this.name = user.getName(); this.gender = user.getGender() != null ? user.getGender().toString() : null; diff --git a/core-services/egov-user/src/main/java/org/egov/user/web/controller/UserController.java b/core-services/egov-user/src/main/java/org/egov/user/web/controller/UserController.java index 9f809f0900f..4c84da4a9cf 100644 --- a/core-services/egov-user/src/main/java/org/egov/user/web/controller/UserController.java +++ b/core-services/egov-user/src/main/java/org/egov/user/web/controller/UserController.java @@ -1,44 +1,41 @@ package org.egov.user.web.controller; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.time.DateFormatUtils; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.user.domain.model.*; +import static org.egov.tracer.http.HttpUtils.isInterServiceCall; +import static org.springframework.util.CollectionUtils.isEmpty; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import javax.validation.Valid; -import org.apache.commons.lang3.StringUtils; import org.egov.common.contract.response.ResponseInfo; -import org.egov.tracer.model.CustomException; +import org.egov.user.domain.model.UpdateRequest; +import org.egov.user.domain.model.UpdateResponse; import org.egov.user.domain.model.User; import org.egov.user.domain.model.UserDetail; import org.egov.user.domain.model.UserSearchCriteria; import org.egov.user.domain.service.TokenService; import org.egov.user.domain.service.UserService; -import org.egov.user.web.contract.*; +import org.egov.user.web.contract.CreateUserRequest; +import org.egov.user.web.contract.UserDetailResponse; +import org.egov.user.web.contract.UserRequest; +import org.egov.user.web.contract.UserSearchRequest; +import org.egov.user.web.contract.UserSearchResponse; +import org.egov.user.web.contract.UserSearchResponseContent; import org.egov.user.web.contract.auth.CustomUserDetails; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import javax.validation.Valid; - -import static org.egov.tracer.http.HttpUtils.isInterServiceCall; -import static org.springframework.util.CollectionUtils.isEmpty; +import lombok.extern.slf4j.Slf4j; @RestController @Slf4j diff --git a/core-services/egov-user/src/main/resources/application.properties b/core-services/egov-user/src/main/resources/application.properties index 768947449dd..0dceb782fb0 100644 --- a/core-services/egov-user/src/main/resources/application.properties +++ b/core-services/egov-user/src/main/resources/application.properties @@ -1,5 +1,6 @@ #Set context root server.contextPath=/user +cache.expiry.masterdata.minutes=5 server.port=8081 app.timezone=UTC security.sessions:NEVER @@ -67,7 +68,7 @@ egov.enc.decrypt.endpoint=/egov-enc-service/crypto/v1/_decrypt #----------------MDMS config---------------------# egov.mdms.host=https://upyog-sandbox.niua.org egov.mdms.search.endpoint=/egov-mdms-service/v1/_search -state.level.tenant.id=pg +state.level.tenant.id=pb #-----------Kafka Audit Topic Name------------# kafka.topic.audit=audit_data diff --git a/core-services/egov-user/src/main/resources/db/Dockerfile b/core-services/egov-user/src/main/resources/db/Dockerfile index 37f9738105d..2f5df5c9d89 100644 --- a/core-services/egov-user/src/main/resources/db/Dockerfile +++ b/core-services/egov-user/src/main/resources/db/Dockerfile @@ -1,17 +1,9 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/ddl /flyway/sql -COPY ./migration/seed /flyway/seed - -COPY ./migration/dev /flyway/dev - -COPY ./migration/qa /flyway/qa - -COPY ./migration/test /flyway/test - COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/core-services/egov-user/src/main/resources/db/migrate.sh b/core-services/egov-user/src/main/resources/db/migrate.sh index 43960b25cdb..8865fad1ae1 100644 --- a/core-services/egov-user/src/main/resources/db/migrate.sh +++ b/core-services/egov-user/src/main/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate \ No newline at end of file +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223150524__create_eg_user_table.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223150524__create_eg_user_table.sql index 37f1248c87a..5f1cc44205a 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223150524__create_eg_user_table.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223150524__create_eg_user_table.sql @@ -1,4 +1,4 @@ -CREATE TABLE eg_user ( +CREATE TABLE IF NOT EXISTS eg_user ( id bigint NOT NULL, title character varying(8), salutation character varying(5), @@ -31,11 +31,11 @@ CREATE TABLE eg_user ( tenantid character varying(256) not null ); -CREATE SEQUENCE seq_eg_user +CREATE SEQUENCE IF NOT EXISTS seq_eg_user START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -ALTER TABLE eg_user ADD CONSTRAINT eg_user_pkey PRIMARY KEY (id); -ALTER TABLE eg_user ADD CONSTRAINT eg_user_user_name_key UNIQUE (username); \ No newline at end of file +--alter table eg_user ADD CONSTRAINT IF NOT EXISTS eg_user_pkey PRIMARY KEY (id); +--alter table eg_user ADD CONSTRAINT IF NOT EXISTS eg_user_user_name_key UNIQUE (username); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151046__create_eg_address_table.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151046__create_eg_address_table.sql index 4bbda016a0d..c88f73cbffe 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151046__create_eg_address_table.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151046__create_eg_address_table.sql @@ -1,4 +1,4 @@ -CREATE TABLE eg_address ( +CREATE TABLE IF NOT EXISTS eg_address ( housenobldgapt character varying(32), subdistrict character varying(100), postoffice character varying(100), diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151145__create_eg_role_table.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151145__create_eg_role_table.sql index eeb7e991677..5a01d6e9aca 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151145__create_eg_role_table.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151145__create_eg_role_table.sql @@ -1,4 +1,4 @@ -CREATE TABLE eg_role ( +CREATE TABLE IF NOT EXISTS eg_role ( id serial NOT NULL primary key, name character varying(32) NOT NULL, code character varying(50) NOT NULL, diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151229__create_eg_user_role_table.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151229__create_eg_user_role_table.sql index 382aada38b2..feb2c3a892d 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151229__create_eg_user_role_table.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151229__create_eg_user_role_table.sql @@ -1,4 +1,4 @@ -CREATE TABLE eg_userrole ( +CREATE TABLE IF NOT EXISTS eg_userrole ( roleid bigint NOT NULL references eg_role(id), userid bigint NOT NULL references eg_user(id) ); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151230__eg_user_drop_FK_PK_recreate.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151230__eg_user_drop_FK_PK_recreate.sql index 0352232cd22..de35de69428 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151230__eg_user_drop_FK_PK_recreate.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170223151230__eg_user_drop_FK_PK_recreate.sql @@ -1,24 +1,26 @@ -alter table eg_address add column userid_bak bigint; -update eg_address set userid_bak=userid; -alter table eg_address drop column userid; -alter table eg_address add column userid bigint; -update eg_address set userid=userid_bak; -alter table eg_address drop column userid_bak; +--alter table eg_user DROP constraint IF EXISTS eg_user_pkey ; +--alter table eg_user add constraint eg_user_pkey primary key (id,tenantid); +alter table eg_address add column IF NOT EXISTS userid_bak bigint; +update eg_address set userid_bak=userid; +-- alter table eg_address drop column userid; +alter table eg_address add column IF NOT EXISTS userid bigint; +update eg_address set userid=userid_bak; +-- alter table eg_address drop column userid_bak; -alter table eg_userrole add column userid_bak bigint; -update eg_userrole set userid_bak=userid; -alter table eg_userrole drop column userid; -alter table eg_userrole add column userid bigint; + +alter table eg_userrole add column IF NOT EXISTS userid_bak bigint; +update eg_userrole set userid_bak=userid; +-- alter table eg_userrole drop column userid; +alter table eg_userrole add column IF NOT EXISTS userid bigint; update eg_userrole set userid=userid_bak; -alter table eg_userrole drop column userid_bak; +-- alter table eg_userrole drop column userid_bak; -alter table eg_user add column id_bak bigint; -update eg_user set id_bak=id; -alter table eg_user drop column id; -alter table eg_user add column id bigint; +alter table eg_user add column IF NOT EXISTS id_bak bigint; +update eg_user set id_bak=id; +-- alter table eg_user drop column id; +alter table eg_user add column IF NOT EXISTS id bigint; update eg_user set id=id_bak; -alter table eg_user drop column id_bak; -alter table eg_user alter column id set not null; -alter table eg_user add constraint eg_user_pkey primary key (id,tenantid); +-- alter table eg_user drop column id_bak; +alter table eg_user alter column id set not null; diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170404154844__create_role_sequence.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170404154844__create_role_sequence.sql index 6ebcacc749c..8e0b3bf6df1 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170404154844__create_role_sequence.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170404154844__create_role_sequence.sql @@ -1,4 +1,4 @@ -CREATE SEQUENCE SEQ_EG_ROLE +CREATE SEQUENCE IF NOT EXISTS SEQ_EG_ROLE START WITH 1 INCREMENT BY 1 NO MINVALUE diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170417165545__create_unique_username_tenant_constraint.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170417165545__create_unique_username_tenant_constraint.sql index ed900c80c65..dae01f6f86e 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170417165545__create_unique_username_tenant_constraint.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170417165545__create_unique_username_tenant_constraint.sql @@ -1,3 +1,3 @@ -ALTER TABLE eg_user DROP CONSTRAINT eg_user_user_name_key; - -ALTER TABLE eg_user ADD CONSTRAINT eg_user_user_name_tenant UNIQUE (username, tenantid); \ No newline at end of file +-- alter table eg_user DROP CONSTRAINT eg_user_user_name_key; +alter table eg_user DROP CONSTRAINT IF EXISTS eg_user_user_name_tenant; +alter table eg_user ADD CONSTRAINT eg_user_user_name_tenant UNIQUE (username, tenantid); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170417165956__create_unique_role_code_tenant_constraint.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170417165956__create_unique_role_code_tenant_constraint.sql index f27335daebb..7a66c2a0fb7 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170417165956__create_unique_role_code_tenant_constraint.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170417165956__create_unique_role_code_tenant_constraint.sql @@ -1,3 +1,3 @@ -ALTER TABLE eg_role DROP CONSTRAINT eg_roles_role_name_key; - -ALTER TABLE eg_role ADD CONSTRAINT eg_roles_code_tenant UNIQUE (code, tenantid); \ No newline at end of file +-- alter table eg_role DROP CONSTRAINT eg_roles_role_name_key; +alter table eg_role DROP CONSTRAINT IF EXISTS eg_roles_code_tenant ; +alter table eg_role ADD CONSTRAINT eg_roles_code_tenant UNIQUE (code, tenantid); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170423025220__alter_table_eg_user_to_increase_signature_length.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170423025220__alter_table_eg_user_to_increase_signature_length.sql index 8200454e8e6..7d688072cb3 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170423025220__alter_table_eg_user_to_increase_signature_length.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170423025220__alter_table_eg_user_to_increase_signature_length.sql @@ -1,2 +1,2 @@ -ALTER TABLE eg_user ALTER COLUMN signature TYPE CHARACTER VARYING(1000); -ALTER TABLE eg_user ALTER COLUMN photo TYPE CHARACTER VARYING(1000); +alter table eg_user ALTER COLUMN signature TYPE CHARACTER VARYING(1000); +alter table eg_user ALTER COLUMN photo TYPE CHARACTER VARYING(1000); diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170423025221__alter_table_eg_user_to_reset_signature_length.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170423025221__alter_table_eg_user_to_reset_signature_length.sql index f17ca301ad1..8e512bd8383 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170423025221__alter_table_eg_user_to_reset_signature_length.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170423025221__alter_table_eg_user_to_reset_signature_length.sql @@ -1,2 +1,2 @@ -ALTER TABLE eg_user ALTER COLUMN signature TYPE CHARACTER VARYING(36); -ALTER TABLE eg_user ALTER COLUMN photo TYPE CHARACTER VARYING(36); +alter table eg_user ALTER COLUMN signature TYPE CHARACTER VARYING(36); +alter table eg_user ALTER COLUMN photo TYPE CHARACTER VARYING(36); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/App/index.scss b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170425163119__user_insert_users.sql similarity index 100% rename from frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/App/index.scss rename to core-services/egov-user/src/main/resources/db/migration/ddl/V20170425163119__user_insert_users.sql diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170428175632__recreate_user_address_table.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170428175632__recreate_user_address_table.sql index 21b706ce0de..d3b7cc20f78 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170428175632__recreate_user_address_table.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170428175632__recreate_user_address_table.sql @@ -1,4 +1,4 @@ -CREATE TABLE eg_user_address ( +CREATE TABLE IF NOT EXISTS eg_user_address ( id bigint NOT NULL, version numeric DEFAULT 0, createddate timestamp NOT NULL, @@ -13,11 +13,11 @@ CREATE TABLE eg_user_address ( tenantid VARCHAR(256) NOT NULL ); -ALTER TABLE eg_user_address ADD CONSTRAINT eg_user_address_pkey PRIMARY KEY (id); +--alter table eg_user_address ADD CONSTRAINT IF NOT EXISTS eg_user_address_pkey PRIMARY KEY (id); -ALTER TABLE eg_user_address ADD CONSTRAINT eg_user_address_user_fkey FOREIGN KEY (userid, tenantid) -REFERENCES eg_user ON DELETE CASCADE; +--alter table eg_user_address ADD CONSTRAINT IF NOT EXISTS eg_user_address_user_fkey FOREIGN KEY (userid, tenantid) +-- REFERENCES eg_user ON DELETE CASCADE; -ALTER TABLE eg_user_address ADD CONSTRAINT eg_user_address_type_unique UNIQUE (userid, tenantid, type); +--alter table eg_user_address ADD CONSTRAINT IF NOT EXISTS eg_user_address_type_unique UNIQUE (userid, tenantid, type); -CREATE SEQUENCE seq_eg_user_address START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; \ No newline at end of file +CREATE SEQUENCE IF NOT EXISTS seq_eg_user_address START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170509172805__recreate_role_and_user_role_table_with_tenantid.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170509172805__recreate_role_and_user_role_table_with_tenantid.sql index 97bc5845c4c..0f9187660b8 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170509172805__recreate_role_and_user_role_table_with_tenantid.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170509172805__recreate_role_and_user_role_table_with_tenantid.sql @@ -1,12 +1,13 @@ -DROP TABLE eg_userrole; -ALTER TABLE eg_role ADD roleid bigint NOT NULL DEFAULT 0; -UPDATE eg_role SET roleid = id; -ALTER TABLE eg_role ALTER COLUMN roleid DROP DEFAULT; -ALTER TABLE eg_role DROP COLUMN id; -ALTER TABLE eg_role RENAME COLUMN roleid TO id; -ALTER TABLE eg_role ADD CONSTRAINT eg_role_pk PRIMARY KEY (id, tenantid); +-- DROP TABLE eg_userrole; +ALTER TABLE eg_role ADD IF NOT EXISTS roleid bigint NOT NULL DEFAULT 0; +UPDATE eg_role SET roleid = id; +alter table eg_role ALTER COLUMN roleid DROP DEFAULT; +alter table eg_role DROP COLUMN id CASCADE; +alter table eg_role RENAME COLUMN roleid TO id; +alter table eg_role DROP CONSTRAINT IF EXISTS eg_role_pk; +alter table eg_role ADD CONSTRAINT eg_role_pk PRIMARY KEY (id, tenantid); -CREATE TABLE eg_userrole ( +CREATE TABLE IF NOT EXISTS eg_userrole ( roleid bigint NOT NULL, roleidtenantid character varying(256) NOT NULL, userid bigint NOT NULL, diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170516145558__alter_userrole_add_lastmodifieddate.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170516145558__alter_userrole_add_lastmodifieddate.sql index 8a08f55a38e..37c6e1ccc6b 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170516145558__alter_userrole_add_lastmodifieddate.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170516145558__alter_userrole_add_lastmodifieddate.sql @@ -1 +1 @@ -alter table eg_userrole add column lastmodifieddate TIMESTAMP default now(); \ No newline at end of file +alter table eg_userrole add column IF NOT EXISTS lastmodifieddate TIMESTAMP default now(); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170823203553__dropping_not_null_for_mobilenumber_in_eg_user.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170823203553__dropping_not_null_for_mobilenumber_in_eg_user.sql index f8d594af4ad..94ff6ff21f2 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20170823203553__dropping_not_null_for_mobilenumber_in_eg_user.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20170823203553__dropping_not_null_for_mobilenumber_in_eg_user.sql @@ -1 +1 @@ -ALTER TABLE eg_user ALTER COLUMN mobilenumber DROP NOT NULL; \ No newline at end of file +-- alter table eg_user ALTER COLUMN mobilenumber DROP NOT NULL; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20180313150524__added_uuid_user_table.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20180313150524__added_uuid_user_table.sql index e4c672852ef..2123edbd52e 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20180313150524__added_uuid_user_table.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20180313150524__added_uuid_user_table.sql @@ -1 +1 @@ -alter table eg_user add column uuid character(36); \ No newline at end of file +alter table eg_user add column IF NOT EXISTS uuid character(36); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20180725165212__alter_eg_role_name.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20180725165212__alter_eg_role_name.sql index b53499e3df4..a5db5d8c654 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20180725165212__alter_eg_role_name.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20180725165212__alter_eg_role_name.sql @@ -1 +1 @@ -ALTER TABLE eg_role ALTER COLUMN name TYPE VARCHAR(128); +alter table eg_role ALTER COLUMN name TYPE VARCHAR(128); diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20180731215512__alter_eg_role_address_fk.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20180731215512__alter_eg_role_address_fk.sql index 079fda2603c..158d0d71b96 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20180731215512__alter_eg_role_address_fk.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20180731215512__alter_eg_role_address_fk.sql @@ -1,8 +1,8 @@ -ALTER TABLE eg_user DROP CONSTRAINT eg_user_user_name_tenant; -ALTER TABLE eg_user ADD CONSTRAINT eg_user_user_name_tenant UNIQUE (username, type, tenantid); +alter table eg_user DROP CONSTRAINT IF EXISTS eg_user_user_name_tenant; +alter table eg_user ADD CONSTRAINT eg_user_user_name_tenant UNIQUE (username, type, tenantid); -ALTER TABLE eg_userrole DROP CONSTRAINT eg_userrole_userid_fkey; -ALTER TABLE eg_user_address DROP CONSTRAINT eg_user_address_user_fkey; +ALTER TABLE eg_userrole DROP CONSTRAINT IF EXISTS eg_userrole_userid_fkey; +alter table eg_user_address DROP CONSTRAINT IF EXISTS eg_user_address_user_fkey; -ALTER TABLE eg_userrole ADD CONSTRAINT eg_userrole_userid_fkey FOREIGN KEY (userid, tenantid) REFERENCES eg_user (id, tenantid) ON UPDATE CASCADE ON DELETE CASCADE; -ALTER TABLE eg_user_address ADD CONSTRAINT eg_user_address_user_fkey FOREIGN KEY (userid, tenantid) REFERENCES eg_user (id, tenantid) ON UPDATE CASCADE ON DELETE CASCADE; \ No newline at end of file +alter table eg_userrole ADD CONSTRAINT eg_userrole_userid_fkey FOREIGN KEY (userid, tenantid) REFERENCES eg_user (id, tenantid) ON UPDATE CASCADE ON DELETE CASCADE; +alter table eg_user_address ADD CONSTRAINT eg_user_address_user_fkey FOREIGN KEY (userid, tenantid) REFERENCES eg_user (id, tenantid) ON UPDATE CASCADE ON DELETE CASCADE; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20181108160312__create_indices_eg_user_role.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20181108160312__create_indices_eg_user_role.sql index 670a1634693..02a10af2e24 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20181108160312__create_indices_eg_user_role.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20181108160312__create_indices_eg_user_role.sql @@ -1,7 +1,7 @@ -CREATE INDEX IDX_EG_USER_USERNAME ON EG_USER (username); -CREATE INDEX IDX_EG_USER_NAME ON EG_USER (name); -CREATE INDEX IDX_EG_USER_ACTIVE ON EG_USER (active); -CREATE INDEX IDX_EG_USER_MOBILE ON EG_USER (mobilenumber); -CREATE INDEX IDX_EG_USER_TYPE ON EG_USER (type); -CREATE INDEX IDX_EG_USER_UUID ON EG_USER (uuid); -CREATE INDEX IDX_EG_ROLE_CODE ON EG_ROLE (code); +CREATE INDEX IF NOT EXISTS IDX_EG_USER_USERNAME ON EG_USER (username); +CREATE INDEX IF NOT EXISTS IDX_EG_USER_NAME ON EG_USER (name); +CREATE INDEX IF NOT EXISTS IDX_EG_USER_ACTIVE ON EG_USER (active); +CREATE INDEX IF NOT EXISTS IDX_EG_USER_MOBILE ON EG_USER (mobilenumber); +CREATE INDEX IF NOT EXISTS IDX_EG_USER_TYPE ON EG_USER (type); +CREATE INDEX IF NOT EXISTS IDX_EG_USER_UUID ON EG_USER (uuid); +CREATE INDEX IF NOT EXISTS IDX_EG_ROLE_CODE ON EG_ROLE (code); diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20190204144112__create_eg_userrole_v1.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20190204144112__create_eg_userrole_v1.sql index 5969e3dfc88..27cd7221ce2 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20190204144112__create_eg_userrole_v1.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20190204144112__create_eg_userrole_v1.sql @@ -1,5 +1,5 @@ -CREATE TABLE eg_userrole_v1 AS +CREATE TABLE IF NOT EXISTS eg_userrole_v1 AS select r.code as role_code, ur.roleidtenantid role_tenantid, ur.userid as user_id, ur.tenantid as user_tenantid, ur .lastmodifieddate as lastmodifieddate from eg_userrole ur join eg_role r ON ur.roleid = r.id AND ur.roleidtenantid = r.tenantid ; -ALTER TABLE eg_userrole_v1 ADD CONSTRAINT fk_user_role_v1 FOREIGN KEY (user_id, user_tenantid) REFERENCES eg_user(id, tenantid); \ No newline at end of file +-- alter table eg_userrole_v1 ADD CONSTRAINT IF NOT EXISTS fk_user_role_v1 FOREIGN KEY (user_id, user_tenantid) REFERENCES eg_user(id, tenantid); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20190222121612__create_eg_user_failed_login_attempts.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20190222121612__create_eg_user_failed_login_attempts.sql index 449d0c73ce7..1559cf5cdab 100644 --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20190222121612__create_eg_user_failed_login_attempts.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20190222121612__create_eg_user_failed_login_attempts.sql @@ -1,4 +1,4 @@ -ALTER TABLE eg_user ADD COLUMN accountlockeddate bigint; +alter table eg_user ADD COLUMN IF NOT EXISTS accountlockeddate bigint; CREATE TABLE IF NOT EXISTS eg_user_login_failed_attempts ( user_uuid character varying(64) NOT NULL, ip character varying(46), diff --git a/core-services/egov-user/src/main/resources/db/migration/ddl/V20190313165702__alter_eg_user_address_extend.sql b/core-services/egov-user/src/main/resources/db/migration/ddl/V20190313165702__alter_eg_user_address_extend.sql old mode 100755 new mode 100644 index 409272c5a13..66ed8bbf26c --- a/core-services/egov-user/src/main/resources/db/migration/ddl/V20190313165702__alter_eg_user_address_extend.sql +++ b/core-services/egov-user/src/main/resources/db/migration/ddl/V20190313165702__alter_eg_user_address_extend.sql @@ -1,12 +1,12 @@ -ALTER TABLE eg_user - ALTER COLUMN name TYPE varchar (250), - ALTER COLUMN mobilenumber TYPE varchar (150), - ALTER COLUMN emailid TYPE varchar (300), - ALTER COLUMN username TYPE varchar (180), - ALTER COLUMN altcontactnumber TYPE varchar (150), - ALTER COLUMN pan TYPE varchar (65), - ALTER COLUMN aadhaarnumber TYPE varchar (85), - ALTER COLUMN guardian TYPE varchar (250); - -ALTER TABLE eg_user_address - ALTER COLUMN address TYPE varchar (440); \ No newline at end of file +alter table eg_user + ALTER COLUMN name TYPE varchar (250), + ALTER COLUMN mobilenumber TYPE varchar (150), + ALTER COLUMN emailid TYPE varchar (300), + ALTER COLUMN username TYPE varchar (180), + ALTER COLUMN altcontactnumber TYPE varchar (150), + ALTER COLUMN pan TYPE varchar (65), + ALTER COLUMN aadhaarnumber TYPE varchar (85), + ALTER COLUMN guardian TYPE varchar (250); + +alter table eg_user_address + ALTER COLUMN address TYPE varchar (440); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/Dockerfile b/core-services/egov-user/src/main/resources/db2/Dockerfile new file mode 100644 index 00000000000..2f5df5c9d89 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/Dockerfile @@ -0,0 +1,9 @@ +FROM egovio/flyway:10.7.1 + +COPY ./migration/ddl /flyway/sql + +COPY migrate.sh /usr/bin/migrate.sh + +RUN chmod +x /usr/bin/migrate.sh + +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/core-services/egov-user/src/main/resources/db2/migrate.sh b/core-services/egov-user/src/main/resources/db2/migrate.sh new file mode 100644 index 00000000000..8865fad1ae1 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migrate.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170223150524__create_eg_user_table.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170223150524__create_eg_user_table.sql new file mode 100644 index 00000000000..5e30a689299 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170223150524__create_eg_user_table.sql @@ -0,0 +1,41 @@ +CREATE TABLE IF NOT EXISTS eg_user ( + id bigint NOT NULL, + title character varying(8), + salutation character varying(5), + dob timestamp, + locale character varying(16), + username character varying(64) NOT NULL, + password character varying(64) NOT NULL, + pwdexpirydate timestamp DEFAULT CURRENT_TIMESTAMP, + mobilenumber character varying(50), + altcontactnumber character varying(50), + emailid character varying(128), + createddate timestamp, + lastmodifieddate timestamp, + createdby bigint, + lastmodifiedby bigint, + active boolean, + name character varying(100), + gender smallint, + pan character varying(10), + aadhaarnumber character varying(20), + type character varying(50), + version numeric DEFAULT 0, + guardian character varying(100), + guardianrelation character varying(32), + signature character varying(36), + accountlocked boolean DEFAULT false, + bloodgroup character varying(32), + photo character varying(36), + identificationmark character varying(300), + tenantid character varying(256) not null +); + +CREATE SEQUENCE IF NOT EXISTS seq_eg_user + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; +ALTER TABLE eg_user ADD CONSTRAINT IF NOT EXISTS eg_user_pkey PRIMARY KEY (id); +ALTER TABLE eg_user ADD CONSTRAINT IF NOT EXISTS eg_user_user_name_key UNIQUE (username); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170223151046__create_eg_address_table.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170223151046__create_eg_address_table.sql new file mode 100644 index 00000000000..4bbda016a0d --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170223151046__create_eg_address_table.sql @@ -0,0 +1,17 @@ +CREATE TABLE eg_address ( + housenobldgapt character varying(32), + subdistrict character varying(100), + postoffice character varying(100), + landmark character varying(256), + country character varying(50), + userid bigint not null references eg_user(id), + type character varying(50), + streetroadline character varying(256), + citytownvillage character varying(256), + arealocalitysector character varying(256), + district character varying(100), + state character varying(100), + pincode character varying(10), + id serial NOT NULL primary key, + version bigint DEFAULT 0, + tenantid character varying(256) not null); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170223151145__create_eg_role_table.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170223151145__create_eg_role_table.sql new file mode 100644 index 00000000000..eeb7e991677 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170223151145__create_eg_role_table.sql @@ -0,0 +1,13 @@ +CREATE TABLE eg_role ( + id serial NOT NULL primary key, + name character varying(32) NOT NULL, + code character varying(50) NOT NULL, + description character varying(128), + createddate timestamp DEFAULT CURRENT_TIMESTAMP, + createdby bigint, + lastmodifiedby bigint, + lastmodifieddate timestamp, + version bigint, + tenantid character varying(256) not null, + CONSTRAINT eg_roles_role_name_key UNIQUE (name) +); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170223151229__create_eg_user_role_table.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170223151229__create_eg_user_role_table.sql new file mode 100644 index 00000000000..382aada38b2 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170223151229__create_eg_user_role_table.sql @@ -0,0 +1,4 @@ +CREATE TABLE eg_userrole ( + roleid bigint NOT NULL references eg_role(id), + userid bigint NOT NULL references eg_user(id) +); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170223151230__eg_user_drop_FK_PK_recreate.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170223151230__eg_user_drop_FK_PK_recreate.sql new file mode 100644 index 00000000000..0352232cd22 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170223151230__eg_user_drop_FK_PK_recreate.sql @@ -0,0 +1,24 @@ +alter table eg_address add column userid_bak bigint; +update eg_address set userid_bak=userid; +alter table eg_address drop column userid; +alter table eg_address add column userid bigint; +update eg_address set userid=userid_bak; +alter table eg_address drop column userid_bak; + + +alter table eg_userrole add column userid_bak bigint; +update eg_userrole set userid_bak=userid; +alter table eg_userrole drop column userid; +alter table eg_userrole add column userid bigint; +update eg_userrole set userid=userid_bak; +alter table eg_userrole drop column userid_bak; + +alter table eg_user add column id_bak bigint; +update eg_user set id_bak=id; +alter table eg_user drop column id; +alter table eg_user add column id bigint; +update eg_user set id=id_bak; +alter table eg_user drop column id_bak; +alter table eg_user alter column id set not null; +alter table eg_user add constraint eg_user_pkey primary key (id,tenantid); + diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170404154844__create_role_sequence.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170404154844__create_role_sequence.sql new file mode 100644 index 00000000000..6ebcacc749c --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170404154844__create_role_sequence.sql @@ -0,0 +1,6 @@ +CREATE SEQUENCE SEQ_EG_ROLE + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170417165545__create_unique_username_tenant_constraint.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170417165545__create_unique_username_tenant_constraint.sql new file mode 100644 index 00000000000..ed900c80c65 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170417165545__create_unique_username_tenant_constraint.sql @@ -0,0 +1,3 @@ +ALTER TABLE eg_user DROP CONSTRAINT eg_user_user_name_key; + +ALTER TABLE eg_user ADD CONSTRAINT eg_user_user_name_tenant UNIQUE (username, tenantid); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170417165956__create_unique_role_code_tenant_constraint.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170417165956__create_unique_role_code_tenant_constraint.sql new file mode 100644 index 00000000000..f27335daebb --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170417165956__create_unique_role_code_tenant_constraint.sql @@ -0,0 +1,3 @@ +ALTER TABLE eg_role DROP CONSTRAINT eg_roles_role_name_key; + +ALTER TABLE eg_role ADD CONSTRAINT eg_roles_code_tenant UNIQUE (code, tenantid); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170423025220__alter_table_eg_user_to_increase_signature_length.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170423025220__alter_table_eg_user_to_increase_signature_length.sql new file mode 100644 index 00000000000..8200454e8e6 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170423025220__alter_table_eg_user_to_increase_signature_length.sql @@ -0,0 +1,2 @@ +ALTER TABLE eg_user ALTER COLUMN signature TYPE CHARACTER VARYING(1000); +ALTER TABLE eg_user ALTER COLUMN photo TYPE CHARACTER VARYING(1000); diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170423025221__alter_table_eg_user_to_reset_signature_length.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170423025221__alter_table_eg_user_to_reset_signature_length.sql new file mode 100644 index 00000000000..f17ca301ad1 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170423025221__alter_table_eg_user_to_reset_signature_length.sql @@ -0,0 +1,2 @@ +ALTER TABLE eg_user ALTER COLUMN signature TYPE CHARACTER VARYING(36); +ALTER TABLE eg_user ALTER COLUMN photo TYPE CHARACTER VARYING(36); diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170428175632__recreate_user_address_table.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170428175632__recreate_user_address_table.sql new file mode 100644 index 00000000000..21b706ce0de --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170428175632__recreate_user_address_table.sql @@ -0,0 +1,23 @@ +CREATE TABLE eg_user_address ( + id bigint NOT NULL, + version numeric DEFAULT 0, + createddate timestamp NOT NULL, + lastmodifieddate timestamp, + createdby bigint NOT NULL, + lastmodifiedby bigint, + type VARCHAR (50) NOT NULL, + address VARCHAR(300), + city VARCHAR(300), + pincode VARCHAR(10), + userid bigint NOT NULL, + tenantid VARCHAR(256) NOT NULL + ); + +ALTER TABLE eg_user_address ADD CONSTRAINT eg_user_address_pkey PRIMARY KEY (id); + +ALTER TABLE eg_user_address ADD CONSTRAINT eg_user_address_user_fkey FOREIGN KEY (userid, tenantid) +REFERENCES eg_user ON DELETE CASCADE; + +ALTER TABLE eg_user_address ADD CONSTRAINT eg_user_address_type_unique UNIQUE (userid, tenantid, type); + +CREATE SEQUENCE seq_eg_user_address START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170509172805__recreate_role_and_user_role_table_with_tenantid.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170509172805__recreate_role_and_user_role_table_with_tenantid.sql new file mode 100644 index 00000000000..97bc5845c4c --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170509172805__recreate_role_and_user_role_table_with_tenantid.sql @@ -0,0 +1,16 @@ +DROP TABLE eg_userrole; +ALTER TABLE eg_role ADD roleid bigint NOT NULL DEFAULT 0; +UPDATE eg_role SET roleid = id; +ALTER TABLE eg_role ALTER COLUMN roleid DROP DEFAULT; +ALTER TABLE eg_role DROP COLUMN id; +ALTER TABLE eg_role RENAME COLUMN roleid TO id; +ALTER TABLE eg_role ADD CONSTRAINT eg_role_pk PRIMARY KEY (id, tenantid); + +CREATE TABLE eg_userrole ( + roleid bigint NOT NULL, + roleidtenantid character varying(256) NOT NULL, + userid bigint NOT NULL, + tenantid character varying(256) NOT NULL, + FOREIGN KEY (roleid, roleidtenantid) REFERENCES eg_role (id, tenantid), + FOREIGN KEY (userid, tenantid) REFERENCES eg_user (id, tenantid) +); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170516145558__alter_userrole_add_lastmodifieddate.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170516145558__alter_userrole_add_lastmodifieddate.sql new file mode 100644 index 00000000000..8a08f55a38e --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170516145558__alter_userrole_add_lastmodifieddate.sql @@ -0,0 +1 @@ +alter table eg_userrole add column lastmodifieddate TIMESTAMP default now(); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20170823203553__dropping_not_null_for_mobilenumber_in_eg_user.sql b/core-services/egov-user/src/main/resources/db2/migration/V20170823203553__dropping_not_null_for_mobilenumber_in_eg_user.sql new file mode 100644 index 00000000000..f8d594af4ad --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20170823203553__dropping_not_null_for_mobilenumber_in_eg_user.sql @@ -0,0 +1 @@ +ALTER TABLE eg_user ALTER COLUMN mobilenumber DROP NOT NULL; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20180313150524__added_uuid_user_table.sql b/core-services/egov-user/src/main/resources/db2/migration/V20180313150524__added_uuid_user_table.sql new file mode 100644 index 00000000000..e4c672852ef --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20180313150524__added_uuid_user_table.sql @@ -0,0 +1 @@ +alter table eg_user add column uuid character(36); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20180725165212__alter_eg_role_name.sql b/core-services/egov-user/src/main/resources/db2/migration/V20180725165212__alter_eg_role_name.sql new file mode 100644 index 00000000000..b53499e3df4 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20180725165212__alter_eg_role_name.sql @@ -0,0 +1 @@ +ALTER TABLE eg_role ALTER COLUMN name TYPE VARCHAR(128); diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20180731215512__alter_eg_role_address_fk.sql b/core-services/egov-user/src/main/resources/db2/migration/V20180731215512__alter_eg_role_address_fk.sql new file mode 100644 index 00000000000..21c671b98ab --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20180731215512__alter_eg_role_address_fk.sql @@ -0,0 +1,8 @@ +ALTER TABLE eg_user DROP CONSTRAINT eg_user_user_name_tenant; +ALTER TABLE eg_user ADD CONSTRAINT eg_user_user_name_tenant UNIQUE (username, type, tenantid); + +--ALTER TABLE eg_userrole DROP CONSTRAINT eg_userrole_userid_fkey; +ALTER TABLE eg_user_address DROP CONSTRAINT eg_user_address_user_fkey; + +ALTER TABLE eg_userrole ADD CONSTRAINT eg_userrole_userid_fkey FOREIGN KEY (userid, tenantid) REFERENCES eg_user (id, tenantid) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE eg_user_address ADD CONSTRAINT eg_user_address_user_fkey FOREIGN KEY (userid, tenantid) REFERENCES eg_user (id, tenantid) ON UPDATE CASCADE ON DELETE CASCADE; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20181108160312__create_indices_eg_user_role.sql b/core-services/egov-user/src/main/resources/db2/migration/V20181108160312__create_indices_eg_user_role.sql new file mode 100644 index 00000000000..670a1634693 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20181108160312__create_indices_eg_user_role.sql @@ -0,0 +1,7 @@ +CREATE INDEX IDX_EG_USER_USERNAME ON EG_USER (username); +CREATE INDEX IDX_EG_USER_NAME ON EG_USER (name); +CREATE INDEX IDX_EG_USER_ACTIVE ON EG_USER (active); +CREATE INDEX IDX_EG_USER_MOBILE ON EG_USER (mobilenumber); +CREATE INDEX IDX_EG_USER_TYPE ON EG_USER (type); +CREATE INDEX IDX_EG_USER_UUID ON EG_USER (uuid); +CREATE INDEX IDX_EG_ROLE_CODE ON EG_ROLE (code); diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20190204144112__create_eg_userrole_v1.sql b/core-services/egov-user/src/main/resources/db2/migration/V20190204144112__create_eg_userrole_v1.sql new file mode 100644 index 00000000000..5969e3dfc88 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20190204144112__create_eg_userrole_v1.sql @@ -0,0 +1,5 @@ +CREATE TABLE eg_userrole_v1 AS +select r.code as role_code, ur.roleidtenantid role_tenantid, ur.userid as user_id, ur.tenantid as user_tenantid, ur +.lastmodifieddate as lastmodifieddate + from eg_userrole ur join eg_role r ON ur.roleid = r.id AND ur.roleidtenantid = r.tenantid ; +ALTER TABLE eg_userrole_v1 ADD CONSTRAINT fk_user_role_v1 FOREIGN KEY (user_id, user_tenantid) REFERENCES eg_user(id, tenantid); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20190222121612__create_eg_user_failed_login_attempts.sql b/core-services/egov-user/src/main/resources/db2/migration/V20190222121612__create_eg_user_failed_login_attempts.sql new file mode 100644 index 00000000000..449d0c73ce7 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20190222121612__create_eg_user_failed_login_attempts.sql @@ -0,0 +1,9 @@ +ALTER TABLE eg_user ADD COLUMN accountlockeddate bigint; +CREATE TABLE IF NOT EXISTS eg_user_login_failed_attempts ( + user_uuid character varying(64) NOT NULL, + ip character varying(46), + attempt_date bigint NOT NULL, + active boolean +); +CREATE INDEX IF NOT EXISTS idx_eg_user_failed_attempts_user_uuid ON eg_user_login_failed_attempts (user_uuid); +CREATE INDEX IF NOT EXISTS idx_eg_user_failed_attempts_user_attemptdate ON eg_user_login_failed_attempts (attempt_date); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20190313165702__alter_eg_user_address_extend.sql b/core-services/egov-user/src/main/resources/db2/migration/V20190313165702__alter_eg_user_address_extend.sql new file mode 100644 index 00000000000..958da941aec --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20190313165702__alter_eg_user_address_extend.sql @@ -0,0 +1,12 @@ +ALTER TABLE eg_user + ALTER COLUMN name TYPE varchar (250), + ALTER COLUMN mobilenumber TYPE varchar (150), + ALTER COLUMN emailid TYPE varchar (300), + ALTER COLUMN username TYPE varchar (180), + ALTER COLUMN altcontactnumber TYPE varchar (150), + ALTER COLUMN pan TYPE varchar (65), + ALTER COLUMN aadhaarnumber TYPE varchar (85), + ALTER COLUMN guardian TYPE varchar (250); + +ALTER TABLE eg_user_address + ALTER COLUMN address TYPE varchar (440); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/V20190402123143__create_indices_eg_user_eg_userrole_v1 .sql b/core-services/egov-user/src/main/resources/db2/migration/V20190402123143__create_indices_eg_user_eg_userrole_v1 .sql new file mode 100644 index 00000000000..b535ff2c49b --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/V20190402123143__create_indices_eg_user_eg_userrole_v1 .sql @@ -0,0 +1,6 @@ +CREATE INDEX IF NOT EXISTS idx_eg_user_tenantid ON eg_user(tenantid); +CREATE INDEX IF NOT EXISTS idx_eg_user_address_tenantid ON eg_user_address(tenantid); +CREATE INDEX IF NOT EXISTS idx_eg_userrole_v1_rolecode ON eg_userrole_v1(role_code); +CREATE INDEX IF NOT EXISTS idx_eg_userrole_v1_roletenantid ON eg_userrole_v1(role_tenantid); +CREATE INDEX IF NOT EXISTS idx_eg_userrole_v1_userid ON eg_userrole_v1(user_id); +CREATE INDEX IF NOT EXISTS idx_eg_userrole_v1_usertenantid ON eg_userrole_v1(user_tenantid); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/ddl/V20210908231720__alter_table_eg_user_alternate_number.sql b/core-services/egov-user/src/main/resources/db2/migration/ddl/V20210908231720__alter_table_eg_user_alternate_number.sql new file mode 100644 index 00000000000..db062a36766 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/ddl/V20210908231720__alter_table_eg_user_alternate_number.sql @@ -0,0 +1 @@ +ALTER TABLE eg_user ADD IF NOT EXISTS alternatemobilenumber character varying (50) DEFAULT NULL; diff --git a/core-services/egov-user/src/main/resources/db2/migration/ddl/V20211029155746__create_table_user_audit.sql b/core-services/egov-user/src/main/resources/db2/migration/ddl/V20211029155746__create_table_user_audit.sql new file mode 100644 index 00000000000..6f8e1c496ad --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/ddl/V20211029155746__create_table_user_audit.sql @@ -0,0 +1,31 @@ +CREATE TABLE eg_user_audit_table( + id bigint NOT NULL, + title character varying(8), + salutation character varying(5), + dob timestamp, + locale character varying(16), + username character varying(64) NOT NULL, + password character varying(64) NOT NULL, + pwdexpirydate timestamp DEFAULT CURRENT_TIMESTAMP, + mobilenumber character varying(50), + altcontactnumber character varying(50), + emailid character varying(128), + active boolean, + name character varying(100), + gender smallint, + pan character varying(50), + aadhaarnumber character varying(50), + type character varying(50), + version numeric DEFAULT 0, + guardian character varying(100), + guardianrelation character varying(32), + signature character varying(36), + accountlocked boolean DEFAULT false, + bloodgroup character varying(32), + photo character varying(36), + identificationmark character varying(300), + tenantid character varying(256) not null, + uuid character(36), + auditcreatedby bigint, + auditcreatedtime bigint +); diff --git a/core-services/egov-user/src/main/resources/db2/migration/ddl/V20211029171730__modified_auditby.sql b/core-services/egov-user/src/main/resources/db2/migration/ddl/V20211029171730__modified_auditby.sql new file mode 100644 index 00000000000..49fe7c5adf7 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/ddl/V20211029171730__modified_auditby.sql @@ -0,0 +1 @@ +ALTER TABLE eg_user_audit_table ALTER COLUMN auditcreatedby TYPE character varying(100); diff --git a/core-services/egov-user/src/main/resources/db2/migration/ddl/V20211029175430__modified_username_audit.sql b/core-services/egov-user/src/main/resources/db2/migration/ddl/V20211029175430__modified_username_audit.sql new file mode 100644 index 00000000000..057d382f7a8 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/ddl/V20211029175430__modified_username_audit.sql @@ -0,0 +1,3 @@ +ALTER TABLE eg_user_audit_table ALTER COLUMN username TYPE character varying(300); +ALTER TABLE eg_user_audit_table ALTER COLUMN password TYPE character varying(300); +ALTER TABLE eg_user_audit_table ALTER COLUMN uuid TYPE character varying(300); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/App.scss b/core-services/egov-user/src/main/resources/db2/migration/dev/V20170425163119__user_insert_users.sql similarity index 100% rename from frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/App.scss rename to core-services/egov-user/src/main/resources/db2/migration/dev/V20170425163119__user_insert_users.sql diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170425163119__user_insert_users.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170425163119__user_insert_users.sql new file mode 100644 index 00000000000..3d032e29f43 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170425163119__user_insert_users.sql @@ -0,0 +1,10 @@ +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation,signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'narasappa', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'narasappa', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','default'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation,signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'manas', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'manas', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','default'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, signature, bloodgroup,accountlocked,photo,identificationmark, tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'ramana', '$2a$10$/pAdOFmv9h7jrnm2zkEQjOKnWO9/xt8T0t.gkT7rb7t4ugz7QUEPi', '2017-03-10 10:32:17.627', '0123456789', NULL, NULL, '2016-12-10 08:32:45.545', '2016-12-10 10:32:17.629', 1, 73, true, 'Ramana', 1, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,NULL,'identification mark','default'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', '9999999999', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2020-12-31 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, '999999999', NULL, NULL, NULL, 'CITIZEN', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','default'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation,signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'ravi', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'ravi', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','default'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170425163441__user_insert_user_role_data.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170425163441__user_insert_user_role_data.sql new file mode 100644 index 00000000000..5682cdabe98 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170425163441__user_insert_user_role_data.sql @@ -0,0 +1,6 @@ +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='narasappa')); +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='manas')); +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='ramana')); +insert into eg_userrole values((select id from eg_role where name='Citizen'),(select id from eg_user where username='9999999999')); +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='ravi')); +insert into eg_userrole values((select id from eg_role where name='Grievance Routing Officer'),(select id from eg_user where username='ravi')); diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170509173136__insert_user_role_data_with_tenant_id.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170509173136__insert_user_role_data_with_tenant_id.sql new file mode 100644 index 00000000000..dafb323a5e5 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170509173136__insert_user_role_data_with_tenant_id.sql @@ -0,0 +1,30 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Employee' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default', +'default'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Employee' and tenantid='default'), +(select id from eg_user where username='manas' and tenantid='default'), +'default', +'default'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values((select id from eg_role where name='Employee' and tenantid='default'), +(select id from eg_user where username='ramana' and tenantid='default'), +'default', +'default'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values((select id from eg_role where name='Citizen' and tenantid='default'), +(select id from eg_user where username='9999999999' and tenantid='default'), +'default', +'default'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) values +((select id from eg_role where name='Employee' and tenantid='default'), +(select id from eg_user where username='ravi' and tenantid='default'), +'default', +'default'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) values( +(select id from eg_role where name='Grievance Routing Officer' and tenantid='default'), +(select id from eg_user where username='ravi' and tenantid='default'), +'default', +'default'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170510143711__insert_user_role_redressal_officer.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170510143711__insert_user_role_redressal_officer.sql new file mode 100644 index 00000000000..c5fdd2794d5 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170510143711__insert_user_role_redressal_officer.sql @@ -0,0 +1,5 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Redressal Officer' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default', +'default'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170511114218__insert_redressal_officer_role.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170511114218__insert_redressal_officer_role.sql new file mode 100644 index 00000000000..f4ba0d701ab --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170511114218__insert_redressal_officer_role.sql @@ -0,0 +1,5 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Redressal Officer' and tenantid='default'), +(select id from eg_user where username='ravi' and tenantid='default'), +'default', +'default'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170517175914__insert_user_data.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170517175914__insert_user_data.sql new file mode 100644 index 00000000000..0e7d19fc1b9 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170517175914__insert_user_data.sql @@ -0,0 +1,2 @@ +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation,signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'mahaadmin', '$2a$10$ZpX0jsy.ZyZGtfSkV0wz9e5P1OubgKMZino396w.2kw2FCU3t1tYy', '2099-01-01 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'admin', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','default'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170517212937__insert_user_role_for_citizenservices.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170517212937__insert_user_role_for_citizenservices.sql new file mode 100644 index 00000000000..a7df5de8420 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170517212937__insert_user_role_for_citizenservices.sql @@ -0,0 +1,4 @@ +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid) values((select id from eg_role where name='Service request Creator'),'default',(select id from eg_user where username='mahaadmin'),'default'); +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid) values((select id from eg_role where name='Service request administrator'),'default',(select id from eg_user where username='mahaadmin'),'default'); +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid) values((select id from eg_role where name='Service request status update'),'default',(select id from eg_user where username='mahaadmin'),'default'); +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid) values((select id from eg_role where name='Service request Report viewer'),'default',(select id from eg_user where username='mahaadmin'),'default'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170525144823__insert_servicerequest_creator.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170525144823__insert_servicerequest_creator.sql new file mode 100644 index 00000000000..2975fa02349 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170525144823__insert_servicerequest_creator.sql @@ -0,0 +1,5 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Service request Creator' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default', +'default'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170529191439__user_initial_data_panavel.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170529191439__user_initial_data_panavel.sql new file mode 100644 index 00000000000..aef9f26d9b0 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170529191439__user_initial_data_panavel.sql @@ -0,0 +1,50 @@ +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation,signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'admin', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'admin', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','panavel'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation,signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'sanjeev', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'sanjeev', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','panavel'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, signature, bloodgroup,accountlocked,photo,identificationmark, tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'ajay', '$2a$10$/pAdOFmv9h7jrnm2zkEQjOKnWO9/xt8T0t.gkT7rb7t4ugz7QUEPi', '2017-03-10 10:32:17.627', '0123456789', NULL, NULL, '2016-12-10 08:32:45.545', '2016-12-10 10:32:17.629', 1, 73, true, 'ajay', 1, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,NULL,'identification mark','panavel'); + + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Super User','SUPERUSER','System Administrator. Can change all master data and has access to all the system screens.',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Officer','GO','Heads the grivance cell. Also all complaints that cannot be routed based on the rules are routed to Grievance Officer.',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Redressal Officer','RO','Employees that address citizens grievances.',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grivance Administrator','GA','System Administator for PGR. Can change PGR Master data only.',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request Creator','SRC','Service request Creator',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request administrator','SRA','Service request administrator',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request status update','SRSU','Service request status update',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request Report viewer','SRV','Service request Report viewer',now(),1,1,now(),0,'panavel'); + + +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Employee' and tenantid='panavel'), +(select id from eg_user where username='admin' and tenantid='panavel'),'panavel','panavel'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Employee' and tenantid='panavel'), +(select id from eg_user where username='ajay' and tenantid='panavel'),'panavel','panavel'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values((select id from eg_role where name='Citizen' and tenantid='panavel'), +(select id from eg_user where username='sanjeev' and tenantid='panavel'),'panavel','panavel'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values((select id from eg_role where name='Grievance Routing Officer' and tenantid='panavel'), +(select id from eg_user where username='ajay' and tenantid='panavel'),'panavel','panavel'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Redressal Officer' and tenantid='panavel'), +(select id from eg_user where username='admin' and tenantid='panavel'),'panavel','panavel'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Service request Creator' and tenantid='panavel'), +(select id from eg_user where username='ajay' and tenantid='panavel'),'panavel','panavel'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170530134617__users_data_panavel.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170530134617__users_data_panavel.sql new file mode 100644 index 00000000000..fe35ac88cce --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170530134617__users_data_panavel.sql @@ -0,0 +1,22 @@ +update eg_user set type = 'CITIZEN' where username = 'sanjeev' and tenantid = 'panavel'; + + +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', 'Mrs', '1990-07-23 00:00:00', 'en_IN', 'anonymous', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', +'2020-12-31 00:00:00', '1234567890', '9876543210', 'anonymous@gmail.com', '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, +'Anonymous', 2, 'ABCDE1234F', '12346789011', 'SYSTEM', 0, 'Guardian name', 'Mother', +'0fef5a6f-fb86-493d-9ecf-8f4b37fa498c', 'AB_POSITIVE', '54fc046d-12be-4733-b88c-cf7c06402980', 'identificationmark','panavel'); + +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', 'Mrs', '1990-07-23 00:00:00', 'en_IN', 'system', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', +'2020-12-31 00:00:00', '0000000000', '0000000000', 'system@gmail.com', '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, +'System', 2, 'ABCDE1234F', '12346789011', 'SYSTEM', 0, 'Guardian name', 'Mother', +'0fef5a6f-fb86-493d-9ecf-8f4b37fa498c', 'AB_POSITIVE', '54fc046d-12be-4733-b88c-cf7c06402980', 'identificationmark','panavel'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170530150635__update_password_panavel.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170530150635__update_password_panavel.sql new file mode 100644 index 00000000000..afa5be1b0a4 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170530150635__update_password_panavel.sql @@ -0,0 +1 @@ +update eg_user set password = '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK' where username = 'ajay' and tenantid = 'panavel'; diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170530192632__user_role_panavel.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170530192632__user_role_panavel.sql new file mode 100644 index 00000000000..ab1349b5633 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170530192632__user_role_panavel.sql @@ -0,0 +1,3 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Service request Creator' and tenantid='panavel'), +(select id from eg_user where username='admin' and tenantid='panavel'),'panavel','panavel'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170717145752__user_role_data.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170717145752__user_role_data.sql new file mode 100644 index 00000000000..1bc361480a3 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170717145752__user_role_data.sql @@ -0,0 +1,40 @@ +delete from eg_userrole where userid = (select id from eg_user where username = 'narasappa') and +tenantid = 'default' and roleidtenantid = 'default'; + +delete from eg_userrole where userid = (select id from eg_user where username = 'ramana') and +tenantid = 'default' and roleidtenantid = 'default'; + +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Employee' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default','default'); + +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Redressal Officer' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default','default'); + +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Service request Creator' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default','default'); + +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Grievance Officer' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default','default'); + +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Grivance Administrator' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default','default'); + +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Employee' and tenantid='default'), +(select id from eg_user where username='ramana' and tenantid='default'), +'default','default'); + +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Redressal Officer' and tenantid='default'), +(select id from eg_user where username='ramana' and tenantid='default'), +'default','default'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170804150924__user_role_data_for_panavel_user.sql b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170804150924__user_role_data_for_panavel_user.sql new file mode 100644 index 00000000000..d11c4d4948b --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/dev2/V20170804150924__user_role_data_for_panavel_user.sql @@ -0,0 +1 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid, lastmodifieddate) values( (select id from eg_role where code='SUPERUSER' and tenantid='panavel'), (select id from eg_user where username='ajay' and tenantid='panavel'), 'panavel','panavel', now()); \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/index.scss b/core-services/egov-user/src/main/resources/db2/migration/qa/V20170425163119__user_insert_users.sql similarity index 100% rename from frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/index.scss rename to core-services/egov-user/src/main/resources/db2/migration/qa/V20170425163119__user_insert_users.sql diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170425163119__user_insert_users.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170425163119__user_insert_users.sql new file mode 100644 index 00000000000..ca4c084e30b --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170425163119__user_insert_users.sql @@ -0,0 +1,10 @@ +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation,signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'narasappa', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'narasappa', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','default'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation,signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'manas', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'manas', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','default'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, signature, bloodgroup,accountlocked,photo,identificationmark, tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'ramana', '$2a$10$/pAdOFmv9h7jrnm2zkEQjOKnWO9/xt8T0t.gkT7rb7t4ugz7QUEPi', '2017-03-10 10:32:17.627', '0123456789', NULL, NULL, '2016-12-10 08:32:45.545', '2016-12-10 10:32:17.629', 1, 73, true, 'Ramana', 1, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,NULL,'identification mark','default'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', '9999999999', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2020-12-31 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, '999999999', NULL, NULL, NULL, 'CITIZEN', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','default'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation,signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'ravi', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'ravi', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','default'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170425163441__user_insert_user_role_data.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170425163441__user_insert_user_role_data.sql new file mode 100644 index 00000000000..5682cdabe98 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170425163441__user_insert_user_role_data.sql @@ -0,0 +1,6 @@ +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='narasappa')); +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='manas')); +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='ramana')); +insert into eg_userrole values((select id from eg_role where name='Citizen'),(select id from eg_user where username='9999999999')); +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='ravi')); +insert into eg_userrole values((select id from eg_role where name='Grievance Routing Officer'),(select id from eg_user where username='ravi')); diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170509173136__insert_user_role_data_with_tenant_id.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170509173136__insert_user_role_data_with_tenant_id.sql new file mode 100644 index 00000000000..dafb323a5e5 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170509173136__insert_user_role_data_with_tenant_id.sql @@ -0,0 +1,30 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Employee' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default', +'default'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Employee' and tenantid='default'), +(select id from eg_user where username='manas' and tenantid='default'), +'default', +'default'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values((select id from eg_role where name='Employee' and tenantid='default'), +(select id from eg_user where username='ramana' and tenantid='default'), +'default', +'default'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values((select id from eg_role where name='Citizen' and tenantid='default'), +(select id from eg_user where username='9999999999' and tenantid='default'), +'default', +'default'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) values +((select id from eg_role where name='Employee' and tenantid='default'), +(select id from eg_user where username='ravi' and tenantid='default'), +'default', +'default'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) values( +(select id from eg_role where name='Grievance Routing Officer' and tenantid='default'), +(select id from eg_user where username='ravi' and tenantid='default'), +'default', +'default'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170510143711__insert_user_role_redressal_officer.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170510143711__insert_user_role_redressal_officer.sql new file mode 100644 index 00000000000..c5fdd2794d5 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170510143711__insert_user_role_redressal_officer.sql @@ -0,0 +1,5 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Redressal Officer' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default', +'default'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170511114218__insert_redressal_officer_role.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170511114218__insert_redressal_officer_role.sql new file mode 100644 index 00000000000..f4ba0d701ab --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170511114218__insert_redressal_officer_role.sql @@ -0,0 +1,5 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Redressal Officer' and tenantid='default'), +(select id from eg_user where username='ravi' and tenantid='default'), +'default', +'default'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170525144823__insert_servicerequest_creator.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170525144823__insert_servicerequest_creator.sql new file mode 100644 index 00000000000..2975fa02349 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170525144823__insert_servicerequest_creator.sql @@ -0,0 +1,5 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Service request Creator' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default', +'default'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170529191439__user_initial_data_panavel.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170529191439__user_initial_data_panavel.sql new file mode 100644 index 00000000000..aef9f26d9b0 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170529191439__user_initial_data_panavel.sql @@ -0,0 +1,50 @@ +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation,signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'admin', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'admin', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','panavel'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation,signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'sanjeev', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', '1234567890', NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'sanjeev', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','panavel'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, signature, bloodgroup,accountlocked,photo,identificationmark, tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'ajay', '$2a$10$/pAdOFmv9h7jrnm2zkEQjOKnWO9/xt8T0t.gkT7rb7t4ugz7QUEPi', '2017-03-10 10:32:17.627', '0123456789', NULL, NULL, '2016-12-10 08:32:45.545', '2016-12-10 10:32:17.629', 1, 73, true, 'ajay', 1, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,NULL,'identification mark','panavel'); + + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Super User','SUPERUSER','System Administrator. Can change all master data and has access to all the system screens.',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Officer','GO','Heads the grivance cell. Also all complaints that cannot be routed based on the rules are routed to Grievance Officer.',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Redressal Officer','RO','Employees that address citizens grievances.',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grivance Administrator','GA','System Administator for PGR. Can change PGR Master data only.',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request Creator','SRC','Service request Creator',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request administrator','SRA','Service request administrator',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request status update','SRSU','Service request status update',now(),1,1,now(),0,'panavel'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request Report viewer','SRV','Service request Report viewer',now(),1,1,now(),0,'panavel'); + + +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Employee' and tenantid='panavel'), +(select id from eg_user where username='admin' and tenantid='panavel'),'panavel','panavel'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Employee' and tenantid='panavel'), +(select id from eg_user where username='ajay' and tenantid='panavel'),'panavel','panavel'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values((select id from eg_role where name='Citizen' and tenantid='panavel'), +(select id from eg_user where username='sanjeev' and tenantid='panavel'),'panavel','panavel'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values((select id from eg_role where name='Grievance Routing Officer' and tenantid='panavel'), +(select id from eg_user where username='ajay' and tenantid='panavel'),'panavel','panavel'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Redressal Officer' and tenantid='panavel'), +(select id from eg_user where username='admin' and tenantid='panavel'),'panavel','panavel'); +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Service request Creator' and tenantid='panavel'), +(select id from eg_user where username='ajay' and tenantid='panavel'),'panavel','panavel'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170530134617__users_data_panavel.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170530134617__users_data_panavel.sql new file mode 100644 index 00000000000..fe35ac88cce --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170530134617__users_data_panavel.sql @@ -0,0 +1,22 @@ +update eg_user set type = 'CITIZEN' where username = 'sanjeev' and tenantid = 'panavel'; + + +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', 'Mrs', '1990-07-23 00:00:00', 'en_IN', 'anonymous', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', +'2020-12-31 00:00:00', '1234567890', '9876543210', 'anonymous@gmail.com', '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, +'Anonymous', 2, 'ABCDE1234F', '12346789011', 'SYSTEM', 0, 'Guardian name', 'Mother', +'0fef5a6f-fb86-493d-9ecf-8f4b37fa498c', 'AB_POSITIVE', '54fc046d-12be-4733-b88c-cf7c06402980', 'identificationmark','panavel'); + +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', 'Mrs', '1990-07-23 00:00:00', 'en_IN', 'system', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', +'2020-12-31 00:00:00', '0000000000', '0000000000', 'system@gmail.com', '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, +'System', 2, 'ABCDE1234F', '12346789011', 'SYSTEM', 0, 'Guardian name', 'Mother', +'0fef5a6f-fb86-493d-9ecf-8f4b37fa498c', 'AB_POSITIVE', '54fc046d-12be-4733-b88c-cf7c06402980', 'identificationmark','panavel'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170530150635__update_password_panavel.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170530150635__update_password_panavel.sql new file mode 100644 index 00000000000..afa5be1b0a4 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170530150635__update_password_panavel.sql @@ -0,0 +1 @@ +update eg_user set password = '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK' where username = 'ajay' and tenantid = 'panavel'; diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170530192632__user_role_panavel.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170530192632__user_role_panavel.sql new file mode 100644 index 00000000000..ab1349b5633 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170530192632__user_role_panavel.sql @@ -0,0 +1,3 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Service request Creator' and tenantid='panavel'), +(select id from eg_user where username='admin' and tenantid='panavel'),'panavel','panavel'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170712115918__update_script_for_eguser_table.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170712115918__update_script_for_eguser_table.sql new file mode 100644 index 00000000000..b9510b2b162 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170712115918__update_script_for_eguser_table.sql @@ -0,0 +1,2 @@ +update eg_user set mobilenumber= '9036544535' , emailid='akhilagd@gmail.com' where username='narasappa' and tenantid='default'; + diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170713171524__user_role_data.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170713171524__user_role_data.sql new file mode 100644 index 00000000000..fa5483627b1 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170713171524__user_role_data.sql @@ -0,0 +1,14 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Grievance Officer' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default','default'); + +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Grivance Administrator' and tenantid='default'), +(select id from eg_user where username='narasappa' and tenantid='default'), +'default','default'); + +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid) +values( (select id from eg_role where name='Redressal Officer' and tenantid='default'), +(select id from eg_user where username='ramana' and tenantid='default'), +'default','default'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170804150924__user_role_data_for_panavel_user.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170804150924__user_role_data_for_panavel_user.sql new file mode 100644 index 00000000000..d11c4d4948b --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170804150924__user_role_data_for_panavel_user.sql @@ -0,0 +1 @@ +insert into eg_userrole (roleid, userid, roleidtenantid, tenantid, lastmodifieddate) values( (select id from eg_role where code='SUPERUSER' and tenantid='panavel'), (select id from eg_user where username='ajay' and tenantid='panavel'), 'panavel','panavel', now()); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170826161819__update_narasappa_user.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170826161819__update_narasappa_user.sql new file mode 100644 index 00000000000..37c926e1a7b --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20170826161819__update_narasappa_user.sql @@ -0,0 +1 @@ +update eg_user set mobilenumber= '0123456789' , emailid=null where username='narasappa' and tenantid='default'; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/qa2/V20171229121210__role_insert_testtenantulb1.sql b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20171229121210__role_insert_testtenantulb1.sql new file mode 100644 index 00000000000..466264f68c9 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/qa2/V20171229121210__role_insert_testtenantulb1.sql @@ -0,0 +1,4 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'testtenant.ulb1'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Super User','SUPERUSER','System Administrator. Can change all master data and has access to all the system screens.',now(),1,1,now(),0,'testtenant.ulb1'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed/V20170223151327__user_setup_data.sql b/core-services/egov-user/src/main/resources/db2/migration/seed/V20170223151327__user_setup_data.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170223151327__user_setup_data.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170223151327__user_setup_data.sql new file mode 100644 index 00000000000..bcb7ae85b0a --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170223151327__user_setup_data.sql @@ -0,0 +1,70 @@ +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', 'Mrs', '1990-07-23 00:00:00', 'en_IN', 'anonymous', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', +'2020-12-31 00:00:00', '1234567890', '9876543210', 'anonymous@gmail.com', '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, +'Anonymous', 2, 'ABCDE1234F', '12346789011', 'SYSTEM', 0, 'Guardian name', 'Mother', +'0fef5a6f-fb86-493d-9ecf-8f4b37fa498c', 'AB_POSITIVE', '54fc046d-12be-4733-b88c-cf7c06402980', 'identificationmark','default'); + + +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', 'Mrs', '1990-07-23 00:00:00', 'en_IN', 'system', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', +'2020-12-31 00:00:00', '0000000000', '0000000000', 'system@gmail.com', '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, +'System', 2, 'ABCDE1234F', '12346789011', 'SYSTEM', 0, 'Guardian name', 'Mother', +'0fef5a6f-fb86-493d-9ecf-8f4b37fa498c', 'AB_POSITIVE', '54fc046d-12be-4733-b88c-cf7c06402980', 'identificationmark','default'); + +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', 'Mrs', '1990-07-23 00:00:00', 'en_IN', 'bigcat399', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', +'2020-12-31 00:00:00', '9731123456', '080292575', 'kay.alexander@example.com', '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, +'Kay Alexander', 0, 'ABCDE1234F', '12346789011', 'EMPLOYEE', 0, 'Guardian name', 'Father', +'7a9d7f12-bdcb-4487-9d43-709838a0ad39', 'A_POSITIVE', '3b26fb49-e43d-401b-899a-f8f0a1572de0', 'identificationmark','ap.public'); + +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', 'Mrs', '1990-07-23 00:00:00', 'en_IN', 'greenfish424', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', +'2020-12-31 00:00:00', '9731123456', '080292575', 'ferdinand.douwes@example.com', '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, +'Ferdinand Douwes', 2, 'ABCDE1234F', '12346789011', 'CITIZEN', 0, 'Guardian name', 'Mother', +'0fef5a6f-fb86-493d-9ecf-8f4b37fa498c', 'AB_POSITIVE', '54fc046d-12be-4733-b88c-cf7c06402980', 'identificationmark','ap.public'); + +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', 'Mrs', '1990-07-23 00:00:00', 'en_IN', 'tinymouse812', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', +'2020-12-31 00:00:00', '9731123456', '080292575', 'email3@gmail.com', '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, +'Raman', 1, 'ABCDE1234F', '12346789011', 'CITIZEN', 0, 'Guardian name', 'Mother', +'0fef5a6f-fb86-493d-9ecf-8f4b37fa498c', 'AB_POSITIVE', '54fc046d-12be-4733-b88c-cf7c06402980', 'identificationmark','ap.public'); + +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', 'Mrs', '1990-07-23 00:00:00', 'en_IN', 'organicelephant552', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', +'2020-12-31 00:00:00', '9731123456', '080292575', 'email4@gmail.com', '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, +'Seetharam', 1, 'ABCDE1234F', '12346789011', 'CITIZEN', 0, 'Guardian name', 'Mother', +'0fef5a6f-fb86-493d-9ecf-8f4b37fa498c', 'AB_POSITIVE', '54fc046d-12be-4733-b88c-cf7c06402980', 'identificationmark','ap.public'); + +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', 'Mrs', '1990-07-23 00:00:00', 'en_IN', 'ege.koyluoglu@example.com', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', +'2020-12-31 00:00:00', '9731123456', '080292575', 'email5@gmail.com', '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, +'Sreerama Krishnan', 1, 'ABCDE1234F', '12346789011', 'EMPLOYEE', 0, 'Guardian name', 'Mother', +'0fef5a6f-fb86-493d-9ecf-8f4b37fa498c', 'AB_POSITIVE', '54fc046d-12be-4733-b88c-cf7c06402980', 'identificationmark','ap.public'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170223151350__address_setup_data.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170223151350__address_setup_data.sql new file mode 100644 index 00000000000..2591598a0c4 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170223151350__address_setup_data.sql @@ -0,0 +1,7 @@ +INSERT INTO eg_address( + housenobldgapt, subdistrict, postoffice, landmark, country, userid, + type, streetroadline, citytownvillage, arealocalitysector, district, + state, pincode, id, version,tenantid) + VALUES ('house no', 'sub district', 'post office', 'landmark', 'country', 1, + 'PERMANENT', 'street line', 'city town village', 'area locality sector', 'district', + 'state', '506034', 1, 0,'ap.public'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170404155010__insert_role_data.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170404155010__insert_role_data.sql new file mode 100644 index 00000000000..07d7a133b49 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170404155010__insert_role_data.sql @@ -0,0 +1,14 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'ap.public'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'ap.public'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Super User','SUPERUSER','System Administrator. Can change all master data and has access to all the system screens.',now(),1,1,now(),0,'ap.public'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Officer','GO','Heads the grivance cell. Also all complaints that cannot be routed based on the rules are routed to Grievance Officer.',now(),1,1,now(),0,'ap.public'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Redressal Officer','RO','Employees that address citizens grievances.',now(),1,1,now(),0,'ap.public'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grivance Administrator','GA','System Administator for PGR. Can change PGR Master data only.',now(),1,1,now(),0,'ap.public'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'ap.public'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170405171456__user_initial_data.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170405171456__user_initial_data.sql new file mode 100644 index 00000000000..fd1d5172418 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170405171456__user_initial_data.sql @@ -0,0 +1,195 @@ +-----------------START------------------- +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'gayathri', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'gayathri', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'manas', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'manas', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'narasappa', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'narasappa', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'krishna', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'krishna', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'elzan', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'elzan', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'girish', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'girish', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'iffath', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'iffath', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'nirbhay', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'nirbhay', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'prk', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'prk', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'pradeep', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'pradeep', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'rajashree', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'rajashree', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'ramakrishna', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'ramakrishna', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'manikanta', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'manikanta', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'rishi', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'rishi', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'sathish', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'sathish', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'mohanraj', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'mohanraj', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'sankar', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'sankar', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'vaibhav', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'vaibhav', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'rajkumar', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'rajkumar', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'jayashree', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'jayashree', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'subhash', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'subhash', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'nayeemalla', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'nayeemalla', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'deepa', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'deepa', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'suresh', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'suresh', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'malathi', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'malathi', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'surya', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'surya ', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'satish', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'satish', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'satyam', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'satyam', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'shahid', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'shahid', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'sathyandra', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'sathyandra', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'syed', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'syed', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'seema', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'seema', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'roopa', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'roopa', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'parvati', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'parvati', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'manasa', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'manasa', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'makaraju', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'makaraju', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'arun', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'arun', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'venkataramana', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'venkataramana', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'mahesh', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'mahesh', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'chandrashekar', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'chandrashekar', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'gireesh', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'gireesh', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'jitha', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'jitha', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'vijay', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'vijay', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'evlyn', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'evlyn', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'pramod', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'pramod', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'vasanth', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'vasanth', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'julian', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'julian', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'gauthami', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'gauthami', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'chetan', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'chetan', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'vikas', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'vikas', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'akash', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'akash', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'shamili', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'shamili', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'mussavir', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'mussavir', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'phanindra', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'phanindra', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'neetu', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'neetu', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'tilak', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'tilak', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'prabhu', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'prabhu', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'suhail', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'suhail', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'venkatesh', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'venkatesh', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'ramandeep ', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'ramandeep ', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'sumit', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'sumit', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'ravi', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'ravi', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', 'dharmendra', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2099-01-01 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, 'dharmendra', NULL, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, signature, bloodgroup, photo, identificationmark ,tenantid) +VALUES (nextval('seq_eg_user'), NULL, NULL, NULL, 'en_IN', '9999999999', '$2a$10$uheIOutTnD33x7CDqac1zOL8DMiuz7mWplToPgcf7oxAI9OzRKxmK', '2020-12-31 00:00:00', NULL, NULL, NULL, '2010-01-01 00:00:00', '2015-01-01 00:00:00', 1, 1, true, '999999999', NULL, NULL, NULL, 'CITIZEN', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,'identification mark','ap.public'); +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, signature, bloodgroup,accountlocked,photo,identificationmark, tenantid) +VALUES (156, NULL, 'MR.', NULL, 'en_IN', 'ramana', '$2a$10$/pAdOFmv9h7jrnm2zkEQjOKnWO9/xt8T0t.gkT7rb7t4ugz7QUEPi', '2017-03-10 10:32:17.627', '0123456789', NULL, NULL, '2016-12-10 08:32:45.545', '2016-12-10 10:32:17.629', 1, 73, true, 'Ramana', 1, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,NULL,'identification mark','ap.public'); +------------------END--------------------- diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170406125044__insert_user_role_data.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170406125044__insert_user_role_data.sql new file mode 100644 index 00000000000..5682cdabe98 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170406125044__insert_user_role_data.sql @@ -0,0 +1,6 @@ +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='narasappa')); +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='manas')); +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='ramana')); +insert into eg_userrole values((select id from eg_role where name='Citizen'),(select id from eg_user where username='9999999999')); +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='ravi')); +insert into eg_userrole values((select id from eg_role where name='Grievance Routing Officer'),(select id from eg_user where username='ravi')); diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170414120251__hr_employee_insert_employeeadmin_role.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170414120251__hr_employee_insert_employeeadmin_role.sql new file mode 100644 index 00000000000..522993369dd --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170414120251__hr_employee_insert_employeeadmin_role.sql @@ -0,0 +1,2 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee Admin','EMPLOYEE ADMIN','Employee Administrator',now(),1,1,now(),0,'ap.public'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170419162007__alter_user_mobile_number.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170419162007__alter_user_mobile_number.sql new file mode 100644 index 00000000000..d1e3b83bf02 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170419162007__alter_user_mobile_number.sql @@ -0,0 +1 @@ +UPDATE eg_user set mobilenumber='1234567890' where mobilenumber is null; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170419163013__user_delete_add_user.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170419163013__user_delete_add_user.sql new file mode 100644 index 00000000000..53ce8e39bbc --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170419163013__user_delete_add_user.sql @@ -0,0 +1,8 @@ +DELETE from eg_userrole where userid in(select id from eg_user where username='ramana'); + +DELETE from eg_user where username='ramana'; + +INSERT INTO eg_user (id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, signature, bloodgroup,accountlocked,photo,identificationmark, tenantid) +VALUES (nextval('seq_eg_user'), NULL, 'MR.', NULL, 'en_IN', 'ramana', '$2a$10$/pAdOFmv9h7jrnm2zkEQjOKnWO9/xt8T0t.gkT7rb7t4ugz7QUEPi', '2017-03-10 10:32:17.627', '0123456789', NULL, NULL, '2016-12-10 08:32:45.545', '2016-12-10 10:32:17.629', 1, 73, true, 'Ramana', 1, NULL, NULL, 'EMPLOYEE', 0, NULL, NULL, NULL, 'AB_POSITIVE', NULL,NULL,'identification mark','ap.public'); + +insert into eg_userrole values((select id from eg_role where name='Employee'),(select id from eg_user where username='ramana')); diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170420160504__lams_roles.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170420160504__lams_roles.sql new file mode 100644 index 00000000000..8453ae92006 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170420160504__lams_roles.sql @@ -0,0 +1,8 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'ULB Operator','ULB Operator','City Official',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Property Verifier','Property Verifier','One who do field survey and verified the data entered by ULB Operator',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Property Approver','Property Approver','One who approves the record finally',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Asset Administrator','Asset Administrator','One who manages the Asset Master data',now(),1,1,now(),0,'default'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170425134613__user_delete_initial_data.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170425134613__user_delete_initial_data.sql new file mode 100644 index 00000000000..f7fc7a4115e --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170425134613__user_delete_initial_data.sql @@ -0,0 +1,77 @@ +delete from eg_userrole where userid = (select id from eg_user where username='narasappa'); +delete from eg_userrole where userid = (select id from eg_user where username='manas'); +delete from eg_userrole where userid = (select id from eg_user where username='ramana'); +delete from eg_userrole where userid = (select id from eg_user where username='9999999999'); +delete from eg_userrole where userid = (select id from eg_user where username='ravi'); + +delete from eg_user where username = 'greenfish424'; +delete from eg_user where username = 'tinymouse812'; +delete from eg_user where username = 'gayathri'; +delete from eg_user where username = 'organicelephant552'; +delete from eg_user where username = 'ege.koyluoglu@example.com'; +delete from eg_user where username = 'manas'; +delete from eg_user where username = 'narasappa'; +delete from eg_user where username = 'krishna'; +delete from eg_user where username = 'elzan'; +delete from eg_user where username = 'girish'; +delete from eg_user where username = 'iffath'; +delete from eg_user where username = 'nirbhay'; +delete from eg_user where username = 'prk'; +delete from eg_user where username = 'pradeep'; +delete from eg_user where username = 'rajashree'; +delete from eg_user where username = 'ramakrishna'; +delete from eg_user where username = 'manikanta'; +delete from eg_user where username = 'rishi'; +delete from eg_user where username = 'sathish'; +delete from eg_user where username = 'mohanraj'; +delete from eg_user where username = 'sankar'; +delete from eg_user where username = 'vaibhav'; +delete from eg_user where username = 'rajkumar'; +delete from eg_user where username = 'jayashree'; +delete from eg_user where username = 'subhash'; +delete from eg_user where username = 'nayeemalla'; +delete from eg_user where username = 'deepa'; +delete from eg_user where username = 'suresh'; +delete from eg_user where username = 'malathi'; +delete from eg_user where username = 'surya'; +delete from eg_user where username = 'satish'; +delete from eg_user where username = 'satyam'; +delete from eg_user where username = 'shahid'; +delete from eg_user where username = 'sathyandra'; +delete from eg_user where username = 'syed'; +delete from eg_user where username = 'seema'; +delete from eg_user where username = 'roopa'; +delete from eg_user where username = 'parvati'; +delete from eg_user where username = 'manasa'; +delete from eg_user where username = 'makaraju'; +delete from eg_user where username = 'arun'; +delete from eg_user where username = 'venkataramana'; +delete from eg_user where username = 'mahesh'; +delete from eg_user where username = 'chandrashekar'; +delete from eg_user where username = 'gireesh'; +delete from eg_user where username = 'jitha'; +delete from eg_user where username = 'vijay'; +delete from eg_user where username = 'evlyn'; +delete from eg_user where username = 'pramod'; +delete from eg_user where username = 'vasanth'; +delete from eg_user where username = 'julian'; +delete from eg_user where username = 'gauthami'; +delete from eg_user where username = 'chetan'; +delete from eg_user where username = 'vikas'; +delete from eg_user where username = 'akash'; +delete from eg_user where username = 'shamili'; +delete from eg_user where username = 'mussavir'; +delete from eg_user where username = 'phanindra'; +delete from eg_user where username = 'neetu'; +delete from eg_user where username = 'tilak'; +delete from eg_user where username = 'prabhu'; +delete from eg_user where username = 'suhail'; +delete from eg_user where username = 'venkatesh'; +delete from eg_user where username = 'ramandeep'; +delete from eg_user where username = 'sumit'; +delete from eg_user where username = 'ravi'; +delete from eg_user where username = 'dharmendra'; +delete from eg_user where username = '9999999999'; +delete from eg_user where username = 'ramana'; +delete from eg_user where username = 'ramandeep '; +delete from eg_user where username = 'bigcat399'; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170427110043__user_set_default_tenant_and_mobilenumber.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170427110043__user_set_default_tenant_and_mobilenumber.sql new file mode 100644 index 00000000000..d928c84613e --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170427110043__user_set_default_tenant_and_mobilenumber.sql @@ -0,0 +1,7 @@ +update eg_role set tenantid = 'default' where tenantid = 'ap.public' and code not in('CITIZEN','EMPLOYEE','SUPERUSER','EMPLOYEE ADMIN'); + +delete from eg_address where id = 1; +UPDATE eg_user set mobilenumber='1234567890' where mobilenumber is null; + +ALTER TABLE eg_user ALTER COLUMN mobilenumber SET NOT NULL; + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170503192010__update_role_data.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170503192010__update_role_data.sql new file mode 100644 index 00000000000..c58f198cfb6 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170503192010__update_role_data.sql @@ -0,0 +1,2 @@ + +update eg_role set tenantid='default' where tenantid='ap.public'; diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170508144639__asset_creator_role.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170508144639__asset_creator_role.sql new file mode 100644 index 00000000000..43f8e286b9b --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170508144639__asset_creator_role.sql @@ -0,0 +1,3 @@ +INSERT INTO EG_ROLE (ID,NAME,DESCRIPTION,CREATEDDATE,CREATEDBY,LASTMODIFIEDBY,LASTMODIFIEDDATE,VERSION,CODE,TENANTID) values(nextval('seq_eg_role'),'Asset Creator','Creator of Assets',now(),1,1,now(),0,'AssetCreator','default'); + +--rollback delete from eg_role where name like 'Asset Creator' and tenantid = 'default'; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170517102938__insert_role_for_citizen_services.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170517102938__insert_role_for_citizen_services.sql new file mode 100644 index 00000000000..efd5e2da7e4 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170517102938__insert_role_for_citizen_services.sql @@ -0,0 +1,9 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request Creator','SRC','Service request Creator',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request administrator','SRA','Service request administrator',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request status update','SRSU','Service request status update',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Service request Report viewer','SRV','Service request Report viewer',now(),1,1,now(),0,'default'); + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170609115303__asset_assetreport_viewer_role.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170609115303__asset_assetreport_viewer_role.sql new file mode 100644 index 00000000000..c7851802b67 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170609115303__asset_assetreport_viewer_role.sql @@ -0,0 +1,5 @@ +INSERT INTO EG_ROLE (ID,NAME,DESCRIPTION,CREATEDDATE,CREATEDBY,LASTMODIFIEDBY,LASTMODIFIEDDATE, + VERSION,CODE,TENANTID) values(nextval('seq_eg_role'),'Asset Report Viewer', + 'Viewer of Assets Reports',now(),1,1,now(),0,'AssetReportViewer','default'); + +--rollback delete from eg_role where name = 'Asset Report Viewer' and tenantid = 'default'; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170804185200__tl_tladmin_role.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170804185200__tl_tladmin_role.sql new file mode 100644 index 00000000000..f5359fc9868 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170804185200__tl_tladmin_role.sql @@ -0,0 +1,5 @@ +INSERT INTO EG_ROLE (ID,NAME,DESCRIPTION,CREATEDDATE,CREATEDBY,LASTMODIFIEDBY,LASTMODIFIEDDATE, VERSION,CODE,TENANTID) +values(nextval('seq_eg_role'),'TL Admin','Who has a access to Trade License Masters',now(),1,1,now(),0,'TL_ADMIN','default'); + + +--rollback delete from eg_role where name = 'TL Admin' and tenantid = 'default'; diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170829142108__collection_role_collectionoperator.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170829142108__collection_role_collectionoperator.sql new file mode 100644 index 00000000000..74e6437a95a --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170829142108__collection_role_collectionoperator.sql @@ -0,0 +1,10 @@ +INSERT INTO EG_ROLE (ID,NAME,DESCRIPTION,CREATEDDATE,CREATEDBY,LASTMODIFIEDBY,LASTMODIFIEDDATE, VERSION,CODE,TENANTID) +values(nextval('seq_eg_role'),'Collection Operator','Can Create, Search and Update Receipt',now(),1,1,now(),0,'COLL_OPERATOR','default'); + +INSERT INTO EG_ROLE (ID,NAME,DESCRIPTION,CREATEDDATE,CREATEDBY,LASTMODIFIEDBY,LASTMODIFIEDDATE, VERSION,CODE,TENANTID) +values(nextval('seq_eg_role'),'Bank Collection Operator','Can Create, Search Receipt',now(),1,1,now(),0,'BANK_COLL_OPERATOR','default'); + +INSERT INTO EG_ROLE (ID,NAME,DESCRIPTION,CREATEDDATE,CREATEDBY,LASTMODIFIEDBY,LASTMODIFIEDDATE, VERSION,CODE,TENANTID) +values(nextval('seq_eg_role'),'CSC Collection Operator','Can Create, Search Receipt',now(),1,1,now(),0,'CSC_COLL_OPERATOR','default'); + + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170829175200__tl_tlcreator_role.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170829175200__tl_tlcreator_role.sql new file mode 100644 index 00000000000..29d95decd25 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170829175200__tl_tlcreator_role.sql @@ -0,0 +1,5 @@ +INSERT INTO EG_ROLE (ID,NAME,DESCRIPTION,CREATEDDATE,CREATEDBY,LASTMODIFIEDBY,LASTMODIFIEDDATE, VERSION,CODE,TENANTID) +values(nextval('seq_eg_role'),'TL Creator','Who has a access to Trade License Transactions',now(),1,1,now(),0,'TL_CREATOR','default'); + + +--rollback delete from eg_role where name = 'TL_CREATOR' and tenantid = 'default'; diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170831132404__egcl_legacy_receipt_creator_role.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170831132404__egcl_legacy_receipt_creator_role.sql new file mode 100644 index 00000000000..37c97844220 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170831132404__egcl_legacy_receipt_creator_role.sql @@ -0,0 +1,2 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Legacy Receipt Creator','LEGACY_RECEIPT_CREATOR','Legacy Receipt Creator',now(),1,1,now(),0,'default'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170912164800__tl_tlapprover_role.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170912164800__tl_tlapprover_role.sql new file mode 100644 index 00000000000..bdd4aa81f16 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170912164800__tl_tlapprover_role.sql @@ -0,0 +1,4 @@ +INSERT INTO EG_ROLE (ID,NAME,DESCRIPTION,CREATEDDATE,CREATEDBY,LASTMODIFIEDBY,LASTMODIFIEDDATE, VERSION,CODE,TENANTID) values(nextval('seq_eg_role'),'TL Approver','Who has a access to Trade License Workflow',now(),1,1,now(),0,'TL_APPROVER','default'); + + +--rollback delete from eg_role where name = 'TL Approver' and tenantid = 'default'; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170913162108__collection_role_collectionreportviewer.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170913162108__collection_role_collectionreportviewer.sql new file mode 100644 index 00000000000..0ffbad16d4d --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20170913162108__collection_role_collectionreportviewer.sql @@ -0,0 +1,3 @@ +INSERT INTO EG_ROLE (ID,NAME,DESCRIPTION,CREATEDDATE,CREATEDBY,LASTMODIFIEDBY,LASTMODIFIEDDATE, VERSION,CODE,TENANTID) +values(nextval('seq_eg_role'),'Collection Report Viewer','Collection Report Viewer can view Reports',now(),1,1,now(),0,'COLL_REP_VIEW','default'); + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20171221115710__adding_new_role.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20171221115710__adding_new_role.sql new file mode 100644 index 00000000000..67d2330caa1 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20171221115710__adding_new_role.sql @@ -0,0 +1,11 @@ +INSERT INTO eg_role (name, code, description, createddate, createdby, tenantid, id) +VALUES ('DMA Office Officer','DMA OFFICE OFFICER','Officer who supervises the ULBs performance', now(), 1, 'default', nextval('seq_eg_role')); + +INSERT INTO eg_role (name, code, description, createddate, createdby, tenantid, id) +VALUES ('DMA Office Officer','DMA OFFICE OFFICER','Officer who supervises the ULBs performance', now(), 1, 'mh.rohatest', nextval('seq_eg_role')); + +INSERT INTO eg_role (name, code, description, createddate, createdby, tenantid, id) +VALUES ('ULB Officer','ULB OFFICER','Officer at ULB Level', now(), 1, 'default', nextval('seq_eg_role')); + +INSERT INTO eg_role (name, code, description, createddate, createdby, tenantid, id) +VALUES ('ULB Officer','ULB OFFICER','Officer at ULB Level', now(), 1, 'mh.rohatest', nextval('seq_eg_role')); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20171221124638__adding_commissioner_role.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20171221124638__adding_commissioner_role.sql new file mode 100644 index 00000000000..98999682c7f --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20171221124638__adding_commissioner_role.sql @@ -0,0 +1,5 @@ +INSERT INTO eg_role (name, code, description, createddate, createdby, tenantid, id) +VALUES ('Commissioner','COMMISSIONER','Commissioner', now(), 1, 'default', nextval('seq_eg_role')); + +INSERT INTO eg_role (name, code, description, createddate, createdby, tenantid, id) +VALUES ('Commissioner','COMMISSIONER','Commissioner', now(), 1, 'mh.rohatest', nextval('seq_eg_role')); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180104155010__insert_works_role_data.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180104155010__insert_works_role_data.sql new file mode 100644 index 00000000000..0a00ce79c4a --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180104155010__insert_works_role_data.sql @@ -0,0 +1,22 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Abstract Estimate Creator','AE_CREATOR','Who has a access to create Abstract Estimate',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Financials Approver','WORKS_FINANCIAL_APPROVER','Who has a access to capture Financial details and budgetary/financial sanction',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Detailed Estimate Creator','DE_CREATOR','Who has a access to create Detailed Estimate',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'LOA Creator','LOA_CREATOR','Who has a access to create Letter Of Acceptance',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'WO Creator','WO_CREATOR','Who has a access to create Work Order',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Works Bill Creator','WORKS_BILL_CREATOR','Who has a access to create Contractor Bill',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Contractor Advance creator','CONTRACTOR_ADVANCE_CREATOR','Who has a access to create Contractor Advance',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'MB creator','MB_CREATOR','Who has a access to create MB',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Works Approver','WORKS_APPROVER','Who has a access to approve/verify Works objects',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Works Administrator','WORKS_ADMINISTRATOR','Who has a access to all the transactions, masters and reports',now(),1,1,now(),0,'default'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Works Master creator','WORKS_MASTER_CREATOR','Who has a access to all the works masters.',now(),1,1,now(),0,'default'); diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180330110224__roles_for_pb.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180330110224__roles_for_pb.sql new file mode 100644 index 00000000000..f84c8ca2b71 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180330110224__roles_for_pb.sql @@ -0,0 +1,34 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb.amritsar'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.amritsar'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'pb.amritsar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb.patiala'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.patiala'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'pb.patiala'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb.jalandhar'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.jalandhar'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'pb.jalandhar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb.bathinda'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.bathinda'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'pb.bathinda'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb.hoshiarpur'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.hoshiarpur'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'pb.hoshiarpur'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180619130525__role_csr_pb_dml.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180619130525__role_csr_pb_dml.sql new file mode 100644 index 00000000000..27e9f6d0500 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180619130525__role_csr_pb_dml.sql @@ -0,0 +1,14 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Customer Support Representative','CSR','Employee who files and follows up complaints on behalf of the citizen',now(),1,1,now(),0,'pb.amritsar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Customer Support Representative','CSR','Employee who files and follows up complaints on behalf of the citizen',now(),1,1,now(),0,'pb.patiala'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Customer Support Representative','CSR','Employee who files and follows up complaints on behalf of the citizen',now(),1,1,now(),0,'pb.jalandhar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Customer Support Representative','CSR','Employee who files and follows up complaints on behalf of the citizen',now(),1,1,now(),0,'pb.bathinda'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Customer Support Representative','CSR','Employee who files and follows up complaints on behalf of the citizen',now(),1,1,now(),0,'pb.hoshiarpur'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180709194344__role_pgradmin_update_csr_dml.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180709194344__role_pgradmin_update_csr_dml.sql new file mode 100644 index 00000000000..146cba3844e --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180709194344__role_pgradmin_update_csr_dml.sql @@ -0,0 +1,16 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'PGR Administrator','PGR-ADMIN','Admin role that has super access over the system',now(),1,1,now(),0,'pb.amritsar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'PGR Administrator','PGR-ADMIN','Admin role that has super access over the system',now(),1,1,now(),0,'pb.patiala'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'PGR Administrator','PGR-ADMIN','Admin role that has super access over the system',now(),1,1,now(),0,'pb.jalandhar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'PGR Administrator','PGR-ADMIN','Admin role that has super access over the system',now(),1,1,now(),0,'pb.bathinda'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'PGR Administrator','PGR-ADMIN','Admin role that has super access over the system',now(),1,1,now(),0,'pb.hoshiarpur'); + +Update eg_role set name = 'Citizen Service Representative' where code = 'CSR' and tenantid LIKE 'pb%'; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180713164022__superuser_pb.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180713164022__superuser_pb.sql new file mode 100644 index 00000000000..27cd5139ee6 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180713164022__superuser_pb.sql @@ -0,0 +1,4 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Super User','SUPERUSER','System Administrator. Can change all master data and has access to all the system screens.',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180725181512__eg_role_for_phagwara.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180725181512__eg_role_for_phagwara.sql new file mode 100644 index 00000000000..94b9996ba5e --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180725181512__eg_role_for_phagwara.sql @@ -0,0 +1,24 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen Service Representative','CSR', +'Employee who files and follows up complaints on behalf of the citizen',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'PGR Administrator','PGR-ADMIN','Admin role that has super access over the system',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Super User','SUPERUSER','System Administrator. Can change all master data and has access to all the system screens.',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180801122512__eg_role_citizen_pb.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180801122512__eg_role_citizen_pb.sql new file mode 100644 index 00000000000..c411d6f71dc --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180801122512__eg_role_citizen_pb.sql @@ -0,0 +1,3 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb') +ON CONFLICT (code, tenantid) DO NOTHING; diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180820193243__eg_role_for_pt_nawanshahr_dml.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180820193243__eg_role_for_pt_nawanshahr_dml.sql new file mode 100644 index 00000000000..4dc797b597a --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180820193243__eg_role_for_pt_nawanshahr_dml.sql @@ -0,0 +1,16 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Counter Employee','CEMP','Employee at the counter who performs assessment on behalf of citizen',now(),1,1,now(),0,'pb.nawanshahr') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Field Employee','FEMP','Employee on the field',now(),1,1,now(),0,'pb.nawanshahr') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'ULB Administrator','ULBADMIN','Admin role that as access over an ulb',now(),1,1,now(),0,'pb.nawanshahr') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'State Administrator','STADMIN', +'Admin role that as access over a state',now(),1,1,now(),0,'pb.nawanshahr') +ON CONFLICT (code, tenantid) DO NOTHING; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180827021743__eg_role_for_financial_jalandhar.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180827021743__eg_role_for_financial_jalandhar.sql new file mode 100644 index 00000000000..ae5648d8eee --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180827021743__eg_role_for_financial_jalandhar.sql @@ -0,0 +1,7 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'EGF Bill Creator','EGF-BILL_CREATOR','Employee who creates Bills mainly expense bill',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'EGF Bill Approver','EGF-BILL_APPROVER','Employee who takes part in Bills approval mainly expense bill',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180925102410__eg_role_for_finance_jalandhar.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180925102410__eg_role_for_finance_jalandhar.sql new file mode 100644 index 00000000000..a79e1228266 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180925102410__eg_role_for_finance_jalandhar.sql @@ -0,0 +1,31 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Voucher Creator','EGF-VOUCHER_CREATOR','One who can create a voucher',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Voucher Approver','EGF-VOUCHER_APPROVER','One who can approve a voucher',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Payment Creator','EGF-PAYMENT_CREATOR','One who can create payment',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Payment Approver','EGF-PAYMENT_APPROVER','One who can approve a payment',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Master Admin','EGF-MASTER_ADMIN','One who is the administrator for all master data in Finance',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Report View','EGF-REPORT_VIEW','One who has acess to all financial reports',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Collections Receipt Creator','COLL_RECEIPT_CREATOR','One who can create and approve a receipt and receipt voucher',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Collections Remitter','COLL_REMIT_TO_BANK','One who can remit the instruments to bank',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180925102831__eg_role_for_finance_phagwara.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180925102831__eg_role_for_finance_phagwara.sql new file mode 100644 index 00000000000..f796b7c54c7 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180925102831__eg_role_for_finance_phagwara.sql @@ -0,0 +1,39 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'EGF Bill Creator','EGF-BILL_CREATOR','Employee who creates Bills mainly expense bill',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'EGF Bill Approver','EGF-BILL_APPROVER','Employee who takes part in Bills approval mainly expense bill',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Voucher Creator','EGF-VOUCHER_CREATOR','One who can create a voucher',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Voucher Approver','EGF-VOUCHER_APPROVER','One who can approve a voucher',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Payment Creator','EGF-PAYMENT_CREATOR','One who can create payment',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Payment Approver','EGF-PAYMENT_APPROVER','One who can approve a payment',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Master Admin','EGF-MASTER_ADMIN','One who is the administrator for all master data in Finance',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Report View','EGF-REPORT_VIEW','One who has acess to all financial reports',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Collections Receipt Creator','COLL_RECEIPT_CREATOR','One who can create and approve a receipt and receipt voucher',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Collections Remitter','COLL_REMIT_TO_BANK','One who can remit the instruments to bank',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180925103411__eg_role_for_financial_amritsar.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180925103411__eg_role_for_financial_amritsar.sql new file mode 100644 index 00000000000..531d46c63dd --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180925103411__eg_role_for_financial_amritsar.sql @@ -0,0 +1,43 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Super User','SUPERUSER','System Administrator. Can change all master data and has access to all the system screens.',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'EGF Bill Creator','EGF-BILL_CREATOR','Employee who creates Bills mainly expense bill',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'EGF Bill Approver','EGF-BILL_APPROVER','Employee who takes part in Bills approval mainly expense bill',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Voucher Creator','EGF-VOUCHER_CREATOR','One who can create a voucher',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Voucher Approver','EGF-VOUCHER_APPROVER','One who can approve a voucher',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Payment Creator','EGF-PAYMENT_CREATOR','One who can create payment',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Payment Approver','EGF-PAYMENT_APPROVER','One who can approve a payment',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Master Admin','EGF-MASTER_ADMIN','One who is the administrator for all master data in Finance',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Report View','EGF-REPORT_VIEW','One who has acess to all financial reports',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Collections Receipt Creator','COLL_RECEIPT_CREATOR','One who can create and approve a receipt and receipt voucher',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Collections Remitter','COLL_REMIT_TO_BANK','One who can remit the instruments to bank',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180927171820__sysintg_role_user.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180927171820__sysintg_role_user.sql new file mode 100644 index 00000000000..30aa241f8be --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20180927171820__sysintg_role_user.sql @@ -0,0 +1,31 @@ + -- password is siwater123@ +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', null, '1990-07-23 00:00:00', 'en_IN', 'SIWATER', '$2a$10$4e79gVHpe4zZHC6Xy/bWouZOVQaqwgrW5U6IdrhNVBmkbgXfBo8lm', +'2025-12-31 00:00:00', null, null, null, '2018-09-01 00:00:00', '2018-09-01 00:00:00', 1, 1, true, +'SYS INTG WATER', 2, null, null, 'SYSTEM', 0, 'Guardian name', 'Father', +null, 'A_POSITIVE', null, 'identificationmark','pb.jalandhar'); + -- password is sifinance123@ +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', null, '1990-07-23 00:00:00', 'en_IN', 'SIFINANCE', '$2a$10$ehRKHzRqr0i8gQf4g8nQWOUhXAFNr43cdQLU/t48jcHkcKZEihM5y', +'2025-12-31 00:00:00', null, null, null, '2018-09-01 00:00:00', '2018-09-01 00:00:00', 1, 1, true, +'SYS INTG FINANCE', 2, null, null, 'SYSTEM', 0, 'Guardian name', 'Father', +null, 'A_POSITIVE', null, 'identificationmark','pb.jalandhar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'System Integrator Finance','SYS_INTEGRATOR_FINANCE','Role for allowing system integration of Finance app with rainmaker',now(),1,1,now(),0,'pb.jalandhar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'System Integrator W&S','SYS_INTEGRATOR_WATER_SEW','Role for allowing system integration of Water and Sewerage app with rainmaker',now(),1,1,now(),0,'pb.jalandhar'); + +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid,lastmodifieddate) values((select id from eg_role where code='SYS_INTEGRATOR_WATER_SEW' and tenantid='pb.jalandhar'),'pb.jalandhar',(select id from eg_user where username='SIWATER' and tenantid='pb.jalandhar'),'pb.jalandhar','2018-09-01 00:00:00'); + +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid,lastmodifieddate) values((select id from eg_role where code='SYS_INTEGRATOR_FINANCE' and tenantid='pb.jalandhar'),'pb.jalandhar',(select id from eg_user where username='SIFINANCE' and tenantid='pb.jalandhar'),'pb.jalandhar','2018-09-01 00:00:00'); + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181008191435__roles_tl_dml.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181008191435__roles_tl_dml.sql new file mode 100644 index 00000000000..f79a0c5bc66 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181008191435__roles_tl_dml.sql @@ -0,0 +1,15 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'TL Counter Employee','TL_CEMP','Counter Employee in Trade License who files TL on behalf of the citizen',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'TL Approver','TL_APPROVER','Approver who verifies and approves the TL application',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'TL Counter Employee','TL_CEMP','Counter Employee in Trade License who files TL on behalf of the citizen',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'TL Approver','TL_APPROVER','Approver who verifies and approves the TL application',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181010113411__eg_role_for_financial_mohali_nayagaon.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181010113411__eg_role_for_financial_mohali_nayagaon.sql new file mode 100644 index 00000000000..8736f782387 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181010113411__eg_role_for_financial_mohali_nayagaon.sql @@ -0,0 +1,90 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Super User','SUPERUSER','System Administrator. Can change all master data and has access to all the system screens.',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'EGF Bill Creator','EGF-BILL_CREATOR','Employee who creates Bills mainly expense bill',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'EGF Bill Approver','EGF-BILL_APPROVER','Employee who takes part in Bills approval mainly expense bill',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Voucher Creator','EGF-VOUCHER_CREATOR','One who can create a voucher',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Voucher Approver','EGF-VOUCHER_APPROVER','One who can approve a voucher',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Payment Creator','EGF-PAYMENT_CREATOR','One who can create payment',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Payment Approver','EGF-PAYMENT_APPROVER','One who can approve a payment',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Master Admin','EGF-MASTER_ADMIN','One who is the administrator for all master data in Finance',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Report View','EGF-REPORT_VIEW','One who has acess to all financial reports',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Collections Receipt Creator','COLL_RECEIPT_CREATOR','One who can create and approve a receipt and receipt voucher',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Collections Remitter','COLL_REMIT_TO_BANK','One who can remit the instruments to bank',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; + +----- +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Super User','SUPERUSER','System Administrator. Can change all master data and has access to all the system screens.',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'EGF Bill Creator','EGF-BILL_CREATOR','Employee who creates Bills mainly expense bill',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'EGF Bill Approver','EGF-BILL_APPROVER','Employee who takes part in Bills approval mainly expense bill',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Voucher Creator','EGF-VOUCHER_CREATOR','One who can create a voucher',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Voucher Approver','EGF-VOUCHER_APPROVER','One who can approve a voucher',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Payment Creator','EGF-PAYMENT_CREATOR','One who can create payment',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Payment Approver','EGF-PAYMENT_APPROVER','One who can approve a payment',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Master Admin','EGF-MASTER_ADMIN','One who is the administrator for all master data in Finance',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Report View','EGF-REPORT_VIEW','One who has acess to all financial reports',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Collections Receipt Creator','COLL_RECEIPT_CREATOR','One who can create and approve a receipt and receipt voucher',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Collections Remitter','COLL_REMIT_TO_BANK','One who can remit the instruments to bank',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; + + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181010174021__eg_employeerole_mohali_nayagaon.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181010174021__eg_employeerole_mohali_nayagaon.sql new file mode 100644 index 00000000000..a69ce9451d2 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181010174021__eg_employeerole_mohali_nayagaon.sql @@ -0,0 +1,6 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.mohali') +ON CONFLICT (code, tenantid) DO NOTHING; +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.nayagaon') +ON CONFLICT (code, tenantid) DO NOTHING; diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181010222820__sysintg_role_user_mohali_naya.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181010222820__sysintg_role_user_mohali_naya.sql new file mode 100644 index 00000000000..01f0a889af0 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181010222820__sysintg_role_user_mohali_naya.sql @@ -0,0 +1,63 @@ + -- password is siwater123@ +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', null, '1990-07-23 00:00:00', 'en_IN', 'SIWATER', '$2a$10$4e79gVHpe4zZHC6Xy/bWouZOVQaqwgrW5U6IdrhNVBmkbgXfBo8lm', +'2025-12-31 00:00:00', null, null, null, '2018-09-01 00:00:00', '2018-09-01 00:00:00', 1, 1, true, +'SYS INTG WATER', 2, null, null, 'SYSTEM', 0, 'Guardian name', 'Father', +null, 'A_POSITIVE', null, 'identificationmark','pb.mohali'); + -- password is sifinance123@ +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', null, '1990-07-23 00:00:00', 'en_IN', 'SIFINANCE', '$2a$10$ehRKHzRqr0i8gQf4g8nQWOUhXAFNr43cdQLU/t48jcHkcKZEihM5y', +'2025-12-31 00:00:00', null, null, null, '2018-09-01 00:00:00', '2018-09-01 00:00:00', 1, 1, true, +'SYS INTG FINANCE', 2, null, null, 'SYSTEM', 0, 'Guardian name', 'Father', +null, 'A_POSITIVE', null, 'identificationmark','pb.mohali'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'System Integrator Finance','SYS_INTEGRATOR_FINANCE','Role for allowing system integration of Finance app with rainmaker',now(),1,1,now(),0,'pb.mohali'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'System Integrator W&S','SYS_INTEGRATOR_WATER_SEW','Role for allowing system integration of Water and Sewerage app with rainmaker',now(),1,1,now(),0,'pb.mohali'); + +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid,lastmodifieddate) values((select id from eg_role where code='SYS_INTEGRATOR_WATER_SEW' and tenantid='pb.mohali'),'pb.mohali',(select id from eg_user where username='SIWATER' and tenantid='pb.mohali'),'pb.mohali','2018-09-01 00:00:00'); + +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid,lastmodifieddate) values((select id from eg_role where code='SYS_INTEGRATOR_FINANCE' and tenantid='pb.mohali'),'pb.mohali',(select id from eg_user where username='SIFINANCE' and tenantid='pb.mohali'),'pb.mohali','2018-09-01 00:00:00'); + +--------------------------------------------------- + -- password is siwater123@ +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', null, '1990-07-23 00:00:00', 'en_IN', 'SIWATER', '$2a$10$4e79gVHpe4zZHC6Xy/bWouZOVQaqwgrW5U6IdrhNVBmkbgXfBo8lm', +'2025-12-31 00:00:00', null, null, null, '2018-09-01 00:00:00', '2018-09-01 00:00:00', 1, 1, true, +'SYS INTG WATER', 2, null, null, 'SYSTEM', 0, 'Guardian name', 'Father', +null, 'A_POSITIVE', null, 'identificationmark','pb.nayagaon'); + -- password is sifinance123@ +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', null, '1990-07-23 00:00:00', 'en_IN', 'SIFINANCE', '$2a$10$ehRKHzRqr0i8gQf4g8nQWOUhXAFNr43cdQLU/t48jcHkcKZEihM5y', +'2025-12-31 00:00:00', null, null, null, '2018-09-01 00:00:00', '2018-09-01 00:00:00', 1, 1, true, +'SYS INTG FINANCE', 2, null, null, 'SYSTEM', 0, 'Guardian name', 'Father', +null, 'A_POSITIVE', null, 'identificationmark','pb.nayagaon'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'System Integrator Finance','SYS_INTEGRATOR_FINANCE','Role for allowing system integration of Finance app with rainmaker',now(),1,1,now(),0,'pb.nayagaon'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'System Integrator W&S','SYS_INTEGRATOR_WATER_SEW','Role for allowing system integration of Water and Sewerage app with rainmaker',now(),1,1,now(),0,'pb.nayagaon'); + +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid,lastmodifieddate) values((select id from eg_role where code='SYS_INTEGRATOR_WATER_SEW' and tenantid='pb.nayagaon'),'pb.nayagaon',(select id from eg_user where username='SIWATER' and tenantid='pb.nayagaon'),'pb.nayagaon','2018-09-01 00:00:00'); + +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid,lastmodifieddate) values((select id from eg_role where code='SYS_INTEGRATOR_FINANCE' and tenantid='pb.nayagaon'),'pb.nayagaon',(select id from eg_user where username='SIFINANCE' and tenantid='pb.nayagaon'),'pb.nayagaon','2018-09-01 00:00:00'); + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181011140910__sysintg_role_user_amritsar.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181011140910__sysintg_role_user_amritsar.sql new file mode 100644 index 00000000000..a3e55f1d660 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181011140910__sysintg_role_user_amritsar.sql @@ -0,0 +1,31 @@ + -- password is siwater123@ +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', null, '1990-07-23 00:00:00', 'en_IN', 'SIWATER', '$2a$10$4e79gVHpe4zZHC6Xy/bWouZOVQaqwgrW5U6IdrhNVBmkbgXfBo8lm', +'2025-12-31 00:00:00', null, null, null, '2018-09-01 00:00:00', '2018-09-01 00:00:00', 1, 1, true, +'SYS INTG WATER', 2, null, null, 'SYSTEM', 0, 'Guardian name', 'Father', +null, 'A_POSITIVE', null, 'identificationmark','pb.amritsar'); + -- password is sifinance123@ +INSERT INTO eg_user ( +id, title, salutation, dob, locale, username, password, pwdexpirydate, mobilenumber, altcontactnumber, emailid, createddate, +lastmodifieddate, createdby, lastmodifiedby, active, name, gender, pan, aadhaarnumber, type, version, guardian, guardianrelation, +signature, bloodgroup, photo, identificationmark,tenantid) +VALUES ( +nextval('seq_eg_user'), 'title', null, '1990-07-23 00:00:00', 'en_IN', 'SIFINANCE', '$2a$10$ehRKHzRqr0i8gQf4g8nQWOUhXAFNr43cdQLU/t48jcHkcKZEihM5y', +'2025-12-31 00:00:00', null, null, null, '2018-09-01 00:00:00', '2018-09-01 00:00:00', 1, 1, true, +'SYS INTG FINANCE', 2, null, null, 'SYSTEM', 0, 'Guardian name', 'Father', +null, 'A_POSITIVE', null, 'identificationmark','pb.amritsar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'System Integrator Finance','SYS_INTEGRATOR_FINANCE','Role for allowing system integration of Finance app with rainmaker',now(),1,1,now(),0,'pb.amritsar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'System Integrator W&S','SYS_INTEGRATOR_WATER_SEW','Role for allowing system integration of Water and Sewerage app with rainmaker',now(),1,1,now(),0,'pb.amritsar'); + +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid,lastmodifieddate) values((select id from eg_role where code='SYS_INTEGRATOR_WATER_SEW' and tenantid='pb.amritsar'),'pb.amritsar',(select id from eg_user where username='SIWATER' and tenantid='pb.amritsar'),'pb.amritsar','2018-09-01 00:00:00'); + +insert into eg_userrole (roleid,roleidtenantid,userid,tenantid,lastmodifieddate) values((select id from eg_role where code='SYS_INTEGRATOR_FINANCE' and tenantid='pb.amritsar'),'pb.amritsar',(select id from eg_user where username='SIFINANCE' and tenantid='pb.amritsar'),'pb.amritsar','2018-09-01 00:00:00'); + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181015150910__role_employeefin.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181015150910__role_employeefin.sql new file mode 100644 index 00000000000..84f465a84e9 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181015150910__role_employeefin.sql @@ -0,0 +1,7 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee Finance','EMPLOYEE_FINANCE','Role for all employees who are using finance',now(),1,1,now(),0,'pb.mohali'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee Finance','EMPLOYEE_FINANCE','Role for all employees who are using finance',now(),1,1,now(),0,'pb.nayagaon'); + + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181015190610__role_updatefin.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181015190610__role_updatefin.sql new file mode 100644 index 00000000000..e357dd0b2e1 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181015190610__role_updatefin.sql @@ -0,0 +1,9 @@ +update eg_role set code='EGF_BILL_CREATOR' where code='EGF-BILL_CREATOR'; +update eg_role set code='EGF_BILL_APPROVER' where code='EGF-BILL_APPROVER'; +update eg_role set code='EGF_VOUCHER_CREATOR' where code='EGF-VOUCHER_CREATOR'; +update eg_role set code='EGF_VOUCHER_APPROVER' where code='EGF-VOUCHER_APPROVER'; +update eg_role set code='EGF_PAYMENT_CREATOR' where code='EGF-PAYMENT_CREATOR'; +update eg_role set code='EGF_PAYMENT_APPROVER' where code='EGF-PAYMENT_APPROVER'; +update eg_role set code='EGF_MASTER_ADMIN' where code='EGF-MASTER_ADMIN'; +update eg_role set code='EGF_REPORT_VIEW' where code='EGF_REPORT_VIEW'; + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181029143630__role_updatereport.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181029143630__role_updatereport.sql new file mode 100644 index 00000000000..0dd0b240ddb --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181029143630__role_updatereport.sql @@ -0,0 +1,2 @@ +update eg_role set code='EGF_REPORT_VIEW' where code='EGF-REPORT_VIEW'; + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181102121133__role_financeadmin.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181102121133__role_financeadmin.sql new file mode 100644 index 00000000000..41e6c2888a3 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181102121133__role_financeadmin.sql @@ -0,0 +1,18 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Admin','EGF_ADMINISTRATOR','One who is the administrator for all master data in Finance',now(),1,1,now(),0,'pb.mohali') ON CONFLICT(code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Admin','EGF_ADMINISTRATOR','One who is the administrator for all master data in Finance',now(),1,1,now(),0,'pb.jalandhar') ON CONFLICT(code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Admin','EGF_ADMINISTRATOR','One who is the administrator for all master data in Finance',now(),1,1,now(),0,'pb.amritsar') ON CONFLICT(code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Admin','EGF_ADMINISTRATOR','One who is the administrator for all master data in Finance',now(),1,1,now(),0,'pb.kharar') ON CONFLICT(code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Admin','EGF_ADMINISTRATOR','One who is the administrator for all master data in Finance',now(),1,1,now(),0,'pb.zirakpur') ON CONFLICT(code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Finance Admin','EGF_ADMINISTRATOR','One who is the administrator for all master data in Finance',now(),1,1,now(),0,'pb.nayagaon') ON CONFLICT(code, tenantid) DO NOTHING; + diff --git a/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181102144300__dgro_role_dml.sql b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181102144300__dgro_role_dml.sql new file mode 100644 index 00000000000..c12415f06d1 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/seed2/V20181102144300__dgro_role_dml.sql @@ -0,0 +1,15 @@ +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Department Grievance Routing Officer','DGRO','GRO for a sepcific dept who assings the grievances to last mile employees',now(),1,1,now(),0,'pb.amritsar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Department Grievance Routing Officer','DGRO','GRO for a sepcific dept who assings the grievances to last mile employees',now(),1,1,now(),0,'pb.jalandhar') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Department Grievance Routing Officer','DGRO','GRO for a sepcific dept who assings the grievances to last mile employees',now(),1,1,now(),0,'pb.phagwara') +ON CONFLICT (code, tenantid) DO NOTHING; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Department Grievance Routing Officer','DGRO','GRO for a sepcific dept who assings the grievances to last mile employees',now(),1,1,now(),0,'pb.nawanshahr') +ON CONFLICT (code, tenantid) DO NOTHING; \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/test/V20180327160924__updating_roles_for_pb.sql b/core-services/egov-user/src/main/resources/db2/migration/test/V20180327160924__updating_roles_for_pb.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/core-services/egov-user/src/main/resources/db2/migration/test2/V20180327160924__updating_roles_for_pb.sql b/core-services/egov-user/src/main/resources/db2/migration/test2/V20180327160924__updating_roles_for_pb.sql new file mode 100644 index 00000000000..ff2a5f8684b --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/test2/V20180327160924__updating_roles_for_pb.sql @@ -0,0 +1,44 @@ +delete from eg_userrole where tenantid='pb.Amritsar'; +delete from eg_user where tenantid='pb.Amritsar'; + + +delete from eg_role where tenantid='pb.Amritsar'; +delete from eg_role where tenantid='pb.Patiala'; +delete from eg_role where tenantid='pb.Jalandhar'; +delete from eg_role where tenantid='pb.Bathinda'; +delete from eg_role where tenantid='pb.Hoshiarpur'; + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb.amritsar'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.amritsar'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'pb.amritsar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb.patiala'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.patiala'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'pb.patiala'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb.jalandhar'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.jalandhar'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'pb.jalandhar'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb.bathinda'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.bathinda'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'pb.bathinda'); + +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Citizen','CITIZEN','Citizen who can raise complaint',now(),1,1,now(),0,'pb.hoshiarpur'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Employee','EMPLOYEE','Default role for all employees',now(),1,1,now(),0,'pb.hoshiarpur'); +insert into eg_role (id,name,code,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,tenantid)values +(nextval('SEQ_EG_ROLE'),'Grievance Routing Officer','GRO','Grievance Routing Officer',now(),1,1,now(),0,'pb.hoshiarpur'); \ No newline at end of file diff --git a/core-services/egov-user/src/main/resources/db2/migration/test2/V20180330100224__delete_script_for_pbroles.sql b/core-services/egov-user/src/main/resources/db2/migration/test2/V20180330100224__delete_script_for_pbroles.sql new file mode 100644 index 00000000000..d278e32ca09 --- /dev/null +++ b/core-services/egov-user/src/main/resources/db2/migration/test2/V20180330100224__delete_script_for_pbroles.sql @@ -0,0 +1,9 @@ +delete from eg_userrole where tenantid='pb.amritsar'; +delete from eg_user where tenantid='pb.amritsar'; + +delete from eg_role where tenantid='pb.amritsar'; +delete from eg_role where tenantid='pb.patiala'; +delete from eg_role where tenantid='pb.jalandhar'; +delete from eg_role where tenantid='pb.bathinda'; +delete from eg_role where tenantid='pb.hoshiarpur'; + diff --git a/core-services/egov-user/src/test/java/org/egov/user/domain/model/UserTest.java b/core-services/egov-user/src/test/java/org/egov/user/domain/model/UserTest.java index 009a496ca58..525dac9cb20 100644 --- a/core-services/egov-user/src/test/java/org/egov/user/domain/model/UserTest.java +++ b/core-services/egov-user/src/test/java/org/egov/user/domain/model/UserTest.java @@ -18,7 +18,7 @@ public class UserTest { public void testUserWithEmptyNameIsInvalid() throws Exception { User user = User.builder() .mobileNumber("8899776655") - .username("foolan_devi") + .userName("foolan_devi") .active(Boolean.TRUE) .gender(Gender.FEMALE) .type(UserType.CITIZEN) @@ -45,7 +45,7 @@ public void testUserWithEmptyUserNameIsInvalid() throws Exception { @Test(expected = InvalidUserCreateException.class) public void testUserWithEmptyMobileIsInvalid() throws Exception { User user = User.builder() - .username("foolan_devi") + .userName("foolan_devi") .name("foolan") .active(Boolean.TRUE) .gender(Gender.FEMALE) @@ -60,7 +60,7 @@ public void testUserWithEmptyMobileIsInvalid() throws Exception { @Test(expected = InvalidUserCreateException.class) public void testUserWithEmptyTypeIsInvalid() throws Exception { User user = User.builder() - .username("foolan_devi") + .userName("foolan_devi") .name("foolan") .mobileNumber("9988776655") .active(Boolean.TRUE) @@ -74,7 +74,7 @@ public void testUserWithEmptyTypeIsInvalid() throws Exception { @Test(expected = InvalidUserCreateException.class) public void test_should_throw_exception_when_tenant_id_is_not_present() { User user = User.builder() - .username("foolan_devi") + .userName("foolan_devi") .name("foolan") .mobileNumber("9988776655") .active(Boolean.TRUE) @@ -90,7 +90,7 @@ public void test_should_throw_exception_when_tenant_id_is_not_present() { @Test(expected = InvalidUserCreateException.class) public void test_should_throw_exception_when_roles_is_not_present() { User user = User.builder() - .username("foolan_devi") + .userName("foolan_devi") .name("foolan") .mobileNumber("9988776655") .active(Boolean.TRUE) @@ -110,7 +110,7 @@ public void test_should_throw_exception_when_role_code_is_not_present() { final Role role2 = Role.builder().code(null).build(); User user = User.builder() - .username("foolan_devi") + .userName("foolan_devi") .name("foolan") .mobileNumber("9988776655") .active(Boolean.TRUE) @@ -246,7 +246,7 @@ public void test_should_return_false_when_otp_reference_is_present() { public void test_should_not_throw_exception_on_user_create_with_all_mandatory_fields() { final Role role1 = Role.builder().code("roleCode1").build(); User user = User.builder() - .username("foolan_devi") + .userName("foolan_devi") .name("foolan") .mobileNumber("9988776655") .password("password") @@ -312,7 +312,7 @@ public void test_should_nullify_fields() { Role role1 = Role.builder().code("roleCode1").build(); Role role2 = Role.builder().code("roleCode2").build(); User user = User.builder() - .username("userName") + .userName("userName") .mobileNumber("mobileNumber") .password("password") .passwordExpiryDate(new Date()) @@ -321,7 +321,7 @@ public void test_should_nullify_fields() { user.nullifySensitiveFields(); - assertNull(user.getUsername()); + assertNull(user.getUserName()); assertNull(user.getMobileNumber()); assertNull(user.getPassword()); assertNull(user.getPasswordExpiryDate()); diff --git a/core-services/egov-user/src/test/java/org/egov/user/domain/service/UserServiceTest.java b/core-services/egov-user/src/test/java/org/egov/user/domain/service/UserServiceTest.java index 6a1a9a47e04..c3241046bf6 100644 --- a/core-services/egov-user/src/test/java/org/egov/user/domain/service/UserServiceTest.java +++ b/core-services/egov-user/src/test/java/org/egov/user/domain/service/UserServiceTest.java @@ -107,7 +107,7 @@ public void test_should_save_a_valid_user() { when(userRepository.create(domainUser)).thenReturn(expectedEntityUser); when(encryptionDecryptionUtil.encryptObject(domainUser, "User", User.class)).thenReturn(domainUser); - when(encryptionDecryptionUtil.decryptObject(expectedEntityUser, "UserSelf", User.class, + when(encryptionDecryptionUtil.decryptObject(expectedEntityUser, "UserListSelf", User.class, getValidRequestInfo())).thenReturn(expectedEntityUser); User returnedUser = userService.createUser(domainUser, getValidRequestInfo()); @@ -136,7 +136,7 @@ public void test_should_create_a_valid_citizen() { when(domainUser.getPassword()).thenReturn("P@assw0rd"); when(userRepository.create(domainUser)).thenReturn(expectedUser); when(encryptionDecryptionUtil.encryptObject(domainUser, "User", User.class)).thenReturn(domainUser); - when(encryptionDecryptionUtil.decryptObject(expectedUser, "UserSelf", User.class, getValidRequestInfo())).thenReturn(expectedUser); + when(encryptionDecryptionUtil.decryptObject(expectedUser, "UserListSelf", User.class, getValidRequestInfo())).thenReturn(expectedUser); User returnedUser = userService.createCitizen(domainUser, getValidRequestInfo()); assertEquals(expectedUser, returnedUser); @@ -147,7 +147,7 @@ public void test_should_not_create_citizenWithWrongUserName() { userService = new UserService(userRepository, otpRepository, fileRepository, passwordEncoder, encryptionDecryptionUtil, tokenStore, DEFAULT_PASSWORD_EXPIRY_IN_DAYS, true, false, pwdRegex, pwdMaxLength, pwdMinLength); - org.egov.user.domain.model.User domainUser = User.builder().username("TestUser").name("Test").active(true) + org.egov.user.domain.model.User domainUser = User.builder().userName("TestUser").name("Test").active(true) .tenantId("default").mobileNumber("123456789").type(UserType.CITIZEN).build(); userService.createCitizen(domainUser, getValidRequestInfo()); } @@ -276,7 +276,7 @@ public void test_should_validate_user_on_update() { // @Ignore //// @Test(expected = DuplicateUserNameException.class) -//// public void test_should_throw_error_when_username_exists_while_updating() throws Exception { +//// public void test_should_throw_error_when_userName_exists_while_updating() throws Exception { //// User domainUser = validDomainUser(false); //// when(userRepository.isUserPresent(any(String.class), any(String.class))).thenReturn(true); //// @@ -322,7 +322,7 @@ public void test_should_partially_update_user() { @Test(expected = UserProfileUpdateDeniedException.class) public void test_should_throw_exception_when_logged_in_user_is_different_from_user_being_updated() { - final User user = User.builder().id(12L).username("xyz").uuid("zyz").type(UserType.CITIZEN).loggedInUserId(11L) + final User user = User.builder().id(12L).userName("xyz").uuid("zyz").type(UserType.CITIZEN).loggedInUserId(11L) .tenantId ("default").build(); when(encryptionDecryptionUtil.encryptObject(user, "User", User.class)).thenReturn(user); @@ -342,7 +342,7 @@ public void test_should_validate_update_password_request() { .newPassword("newPassword") .existingPassword("existingPassword") .build(); - User user = User.builder().username("xyz").tenantId("default").type(UserType.CITIZEN).build(); + User user = User.builder().userName("xyz").tenantId("default").type(UserType.CITIZEN).build(); when(userRepository.findAll(any(UserSearchCriteria.class))).thenReturn(Collections.singletonList(user)); when(passwordEncoder.matches(anyString(), anyString())).thenReturn(true); @@ -356,7 +356,7 @@ public void test_should_throwexception_incaseofloginotpenabledastrue_forcitizen_ userService = new UserService(userRepository, otpRepository, fileRepository, passwordEncoder, encryptionDecryptionUtil, tokenStore, DEFAULT_PASSWORD_EXPIRY_IN_DAYS, true, isEmployeeLoginOtpBased, pwdRegex, pwdMaxLength, pwdMinLength); - User user = User.builder().username("xyz").tenantId("default").type(UserType.CITIZEN).build(); + User user = User.builder().userName("xyz").tenantId("default").type(UserType.CITIZEN).build(); when(userRepository.findAll(any(UserSearchCriteria.class))).thenReturn(Collections.singletonList(user)); final LoggedInUserUpdatePasswordRequest updatePasswordRequest = LoggedInUserUpdatePasswordRequest.builder() .userName("xyz") @@ -374,7 +374,7 @@ public void test_should_throwexception_incaseofloginotpenabledastrue_foremployee userService = new UserService(userRepository, otpRepository, fileRepository, passwordEncoder, encryptionDecryptionUtil, tokenStore, DEFAULT_PASSWORD_EXPIRY_IN_DAYS, false, true, pwdRegex, pwdMaxLength, pwdMinLength); - User user = User.builder().username("xyz").tenantId("default").type(UserType.EMPLOYEE).build(); + User user = User.builder().userName("xyz").tenantId("default").type(UserType.EMPLOYEE).build(); when(userRepository.findAll(any(UserSearchCriteria.class))).thenReturn(Collections.singletonList(user)); final LoggedInUserUpdatePasswordRequest updatePasswordRequest = LoggedInUserUpdatePasswordRequest.builder() .userName("xyz") @@ -405,7 +405,7 @@ public void test_should_throw_exception_when_existing_password_does_not_match_on .newPassword("newPassword") .existingPassword("existingPassword") .build(); - User user = User.builder().username("xyz").tenantId("default").type(UserType.CITIZEN).password("existingPasswordEncoded").build(); + User user = User.builder().userName("xyz").tenantId("default").type(UserType.CITIZEN).password("existingPasswordEncoded").build(); when(passwordEncoder.matches("wrongPassword", "existingPasswordEncoded")).thenReturn(false); when(userRepository.findAll(any(UserSearchCriteria.class))).thenReturn(Collections.singletonList(user)); @@ -422,7 +422,7 @@ public void test_should_update_password_for_logged_in_user() { .existingPassword("existingPassword") .build(); Long id =(long) 123; - User domainUser = User.builder().id(id).username("xyz").tenantId("default").type(UserType.CITIZEN).password("existingPasswordEncoded").build(); + User domainUser = User.builder().id(id).userName("xyz").tenantId("default").type(UserType.CITIZEN).password("existingPasswordEncoded").build(); when(passwordEncoder.matches("existingPassword", "existingPasswordEncoded")).thenReturn(true); when(userRepository.findAll(any(UserSearchCriteria.class))).thenReturn(Collections.singletonList(domainUser)); @@ -583,7 +583,7 @@ public void test_should_persist_changes_on_updating_password_for_non_logged_in_u } private org.egov.user.domain.model.User validDomainUser(boolean otpValidationMandatory) { - return User.builder().username("supandi_rocks").name("Supandi").gender(Gender.MALE).type(UserType.CITIZEN) + return User.builder().userName("supandi_rocks").name("Supandi").gender(Gender.MALE).type(UserType.CITIZEN) .active(Boolean.TRUE).mobileNumber("9988776655").tenantId("tenantId").otpReference("12312") .password("P@ssw0rd").roles(Collections.singleton(Role.builder().code("roleCode1").build())) .accountLocked(false).otpValidationMandatory(otpValidationMandatory).build(); @@ -601,6 +601,6 @@ private RequestInfo getValidRequestInfo() { } private User getUserObject() { - return User.builder().id(ID.get(0)).emailId(EMAIL).username(USER_NAME).build(); + return User.builder().id(ID.get(0)).emailId(EMAIL).userName(USER_NAME).build(); } } diff --git a/core-services/egov-user/src/test/java/org/egov/user/persistence/repository/OtpRepositoryTest.java b/core-services/egov-user/src/test/java/org/egov/user/persistence/repository/OtpRepositoryTest.java index 3250e54df88..3da24d0b4e5 100644 --- a/core-services/egov-user/src/test/java/org/egov/user/persistence/repository/OtpRepositoryTest.java +++ b/core-services/egov-user/src/test/java/org/egov/user/persistence/repository/OtpRepositoryTest.java @@ -1,5 +1,13 @@ package org.egov.user.persistence.repository; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.springframework.test.web.client.ExpectedCount.once; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.content; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; +import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; + import org.egov.user.Resources; import org.egov.user.domain.model.OtpValidationRequest; import org.egov.user.web.contract.Otp; @@ -14,12 +22,6 @@ import org.springframework.test.web.client.MockRestServiceServer; import org.springframework.web.client.RestTemplate; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.springframework.test.web.client.ExpectedCount.once; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.*; -import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; - @RunWith(MockitoJUnitRunner.class) public class OtpRepositoryTest { @@ -36,19 +38,7 @@ public void setUp() throws Exception { this.otpRepository = new OtpRepository(otpHost, otpSearchContext, otpValidateContext, restTemplate); } - @Test - public void testShouldReturnTrueWhenOtpHasBeenValidated() throws Exception { - server.expect(once(), requestTo("http://otp-host.com/otp/_search")).andExpect(method(HttpMethod.POST)) - .andExpect(content().string(new Resources().getFileContents("otpSearchSuccessRequest.json"))) - .andRespond(withSuccess(new Resources().getFileContents("otpSearchValidatedResponse.json"), - MediaType.APPLICATION_JSON_UTF8)); - final OtpValidationRequest request = buildRequest(); - - boolean isOtpValidated = otpRepository.isOtpValidationComplete(request); - - server.verify(); - assertEquals(Boolean.TRUE, isOtpValidated); - } + @Test @Ignore @@ -81,32 +71,9 @@ public void testShouldReturnTrueWhenOtpValidated() throws Exception { } - @Test - public void testShouldReturnFalseWhenOtpHasNotBeenValidated() throws Exception { - server.expect(once(), requestTo("http://otp-host.com/otp/_search")).andExpect(method(HttpMethod.POST)) - .andExpect(content().string(new Resources().getFileContents("otpSearchSuccessRequest.json"))) - .andRespond(withSuccess(new Resources().getFileContents("otpSearchNonValidatedResponse.json"), - MediaType.APPLICATION_JSON_UTF8)); - final OtpValidationRequest request = buildRequest(); - - boolean isOtpValidated = otpRepository.isOtpValidationComplete(request); - server.verify(); - assertFalse(isOtpValidated); - } - - @Test - public void testShouldReturnFalseWhenOtpIdentityDoesNotMatch() throws Exception { - server.expect(once(), requestTo("http://otp-host.com/otp/_search")).andExpect(method(HttpMethod.POST)) - .andExpect(content().string(new Resources().getFileContents("otpSearchSuccessRequest.json"))) - .andRespond(withSuccess(new Resources().getFileContents("otpSearchIdentityDifferentResponse.json"), - MediaType.APPLICATION_JSON_UTF8)); - final OtpValidationRequest request = buildRequest(); - - boolean isOtpValidated = otpRepository.isOtpValidationComplete(request); + - server.verify(); - assertFalse(isOtpValidated); - } + private OtpValidationRequest buildRequest() { return OtpValidationRequest.builder().otpReference("2b936aae-c3b6-4c89-b3b3-a098cdcbb706") diff --git a/core-services/egov-user/src/test/java/org/egov/user/persistence/repository/UserRepositoryTest.java b/core-services/egov-user/src/test/java/org/egov/user/persistence/repository/UserRepositoryTest.java index 9e36223a9f3..9246bdc3ef4 100644 --- a/core-services/egov-user/src/test/java/org/egov/user/persistence/repository/UserRepositoryTest.java +++ b/core-services/egov-user/src/test/java/org/egov/user/persistence/repository/UserRepositoryTest.java @@ -111,7 +111,7 @@ public void test_get_user_by_userName() { User user = userRepository.findAll(UserSearchCriteria.builder().userName("bigcat399") .tenantId("ap.public").type(UserType.EMPLOYEE).build()).get(0); assertThat(user.getId().equals(1l)); - assertThat(user.getUsername().equals("bigcat399")); + assertThat(user.getUserName().equals("bigcat399")); assertThat(user.getMobileNumber().equals("9731123456")); assertThat(user.getEmailId().equals("kay.alexander@example.com")); assertThat(user.getTenantId().equals("ap.public")); @@ -124,7 +124,7 @@ public void test_should_save_entity_user() { final Set roles = new HashSet<>(); final String roleCode = "EMP"; roles.add(Role.builder().code(roleCode).tenantId("ap.public").build()); - User domainUser = User.builder().roles(roles).name("test1").username("TestUserName").password("password") + User domainUser = User.builder().roles(roles).name("test1").userName("TestUserName").password("password") .emailId("Test@gmail.com").aadhaarNumber("AadharNumber").mobileNumber("1234567890").active(true) .gender(Gender.FEMALE).bloodGroup(BloodGroup.A_NEGATIVE).accountLocked(true).loggedInUserId(10l) .createdBy(10l).tenantId("ap.public").build(); @@ -133,7 +133,7 @@ public void test_should_save_entity_user() { assertThat(actualUser != null); assertThat(actualUser.getId().equals(1l)); assertThat(actualUser.getRoles().size() == 1l); - assertThat(actualUser.getUsername().equals("TestUserName")); + assertThat(actualUser.getUserName().equals("TestUserName")); assertThat(actualUser.getEmailId().equals("Test@gmail.com")); assertThat(actualUser.getAadhaarNumber().equals("AadharNumber")); assertThat(actualUser.getMobileNumber().equals("1234567890")); @@ -153,14 +153,14 @@ public void test_should_save_correspondence_address_on_creating_new_user() { final String roleCode = "EMP"; roles.add(Role.builder().code(roleCode).tenantId("ap.public").build()); User domainUser = User.builder().roles(roles) - .username("TestUserName").password("password").tenantId("ap.public") + .userName("TestUserName").password("password").tenantId("ap.public") .correspondenceAddress(correspondenceAddress).build(); User actualUser = userRepository.create(domainUser); assertThat(actualUser != null); assertThat(actualUser.getId().equals(1l)); assertThat(actualUser.getRoles().size() == 1l); - assertThat(actualUser.getUsername().equals("TestUserName")); + assertThat(actualUser.getUserName().equals("TestUserName")); assertThat(actualUser.getTenantId().equals("ap.public")); assertThat(actualUser.getCorrespondenceAddress() != null); assertThat(actualUser.getCorrespondenceAddress().getAddressType().toString().equals("CORRESPONDENCE")); @@ -179,14 +179,14 @@ public void test_should_save_permanent_address_on_creating_new_user() { final String roleCode = "EMP"; roles.add(Role.builder().code(roleCode).tenantId("ap.public").build()); User domainUser = User.builder().roles(roles) - .username("TestUserName").password("password").tenantId("ap.public").permanentAddress(permanentAddress) + .userName("TestUserName").password("password").tenantId("ap.public").permanentAddress(permanentAddress) .build(); User actualUser = userRepository.create(domainUser); assertThat(actualUser != null); assertThat(actualUser.getId().equals(1l)); assertThat(actualUser.getRoles().size() == 1l); - assertThat(actualUser.getUsername().equals("TestUserName")); + assertThat(actualUser.getUserName().equals("TestUserName")); assertThat(actualUser.getTenantId().equals("ap.public")); assertThat(actualUser.getPermanentAddress() != null); assertThat(actualUser.getPermanentAddress().getAddressType().toString().equals("PERMANENT")); @@ -215,7 +215,7 @@ public void test_should_set_encrypted_password_to_new_user() { roles.add(org.egov.user.domain.model.Role.builder().code(roleCode).tenantId("ap.public").build()); final String rawPassword = "rawPassword"; User domainUser = User.builder().roles(roles) - .username("Test UserName").password(rawPassword).tenantId("ap.public").build(); + .userName("Test UserName").password(rawPassword).tenantId("ap.public").build(); User actualUser = userRepository.create(domainUser); assertThat(actualUser != null); assertThat(actualUser.getId().equals(1l)); @@ -230,7 +230,7 @@ public void test_should_save_new_user_when_enriched_roles() { final Set roles = new HashSet<>(); roles.add(Role.builder().code("EMP").tenantId("ap.public").build()); roles.add(Role.builder().code("EADMIN").tenantId("ap.public").build()); - User domainUser = User.builder().roles(roles).username("Test UserName").password("pasword") + User domainUser = User.builder().roles(roles).userName("Test UserName").password("pasword") .tenantId("ap.public").build(); User actualUser = userRepository.create(domainUser); assertThat(actualUser != null); @@ -348,7 +348,7 @@ public void test_should_update_entity_user() { final Set roles = new HashSet<>(); final String roleCode = "EMP"; roles.add(Role.builder().code(roleCode).build()); - User domainUser = User.builder().roles(roles).name("test1").id(1L).username("TestUserName").password("password") + User domainUser = User.builder().roles(roles).name("test1").id(1L).userName("TestUserName").password("password") .emailId("Test@gmail.com").aadhaarNumber("AadharNumber").mobileNumber("1234567890").active(true) .gender(Gender.FEMALE).bloodGroup(BloodGroup.A_NEGATIVE).accountLocked(true).loggedInUserId(10L) .createdBy(10L).tenantId("ap.public").build(); @@ -360,7 +360,7 @@ public void test_should_update_entity_user() { assertThat(actualUser != null); assertThat(actualUser.getId().equals(1L)); assertThat(actualUser.getRoles().size() == 1L); - assertThat(actualUser.getUsername().equals("TestUserName")); + assertThat(actualUser.getUserName().equals("TestUserName")); assertThat(actualUser.getEmailId().equals("Test@gmail.com")); assertThat(actualUser.getAadhaarNumber().equals("AadharNumber")); assertThat(actualUser.getGender().toString().equals("FEMALE")); diff --git a/core-services/egov-user/src/test/java/org/egov/user/web/contract/UserRequestTest.java b/core-services/egov-user/src/test/java/org/egov/user/web/contract/UserRequestTest.java index 7fa73754fb5..7bd8cc4ba36 100644 --- a/core-services/egov-user/src/test/java/org/egov/user/web/contract/UserRequestTest.java +++ b/core-services/egov-user/src/test/java/org/egov/user/web/contract/UserRequestTest.java @@ -20,7 +20,7 @@ public void test_domain_to_contract_conversion() { UserRequest userRequestContract = new UserRequest(domainUser); assertThat(userRequestContract.getId()).isEqualTo(domainUser.getId()); - assertThat(userRequestContract.getUserName()).isEqualTo(domainUser.getUsername()); + assertThat(userRequestContract.getUserName()).isEqualTo(domainUser.getUserName()); assertThat(userRequestContract.getSalutation()).isEqualTo(domainUser.getSalutation()); assertThat(userRequestContract.getName()).isEqualTo(domainUser.getName()); assertThat(userRequestContract.getGender()).isEqualTo(domainUser.getGender().toString()); @@ -65,7 +65,7 @@ public void test_contract_to_domain_conversion() { String expectedDate = c.getTime().toString(); assertEquals("Kroorveer", userForCreate.getName()); - assertEquals("yakku", userForCreate.getUsername()); + assertEquals("yakku", userForCreate.getUserName()); assertEquals("Dr.", userForCreate.getSalutation()); assertEquals("8967452310", userForCreate.getMobileNumber()); assertEquals("kroorkool@maildrop.cc", userForCreate.getEmailId()); @@ -142,7 +142,7 @@ private User getUser() { return User.builder() .id(1L) - .username("userName") + .userName("userName") .salutation("salutation") .name("name") .gender(Gender.FEMALE) @@ -161,7 +161,7 @@ private User getUser() { .accountLocked(false) .roles(getListOfRoles()) .guardian("name of relative") - .guardianRelation(GuardianRelation.FATHER) + .guardianRelation(GuardianRelation.Father) .signature("7a9d7f12-bdcb-4487-9d43-709838a0ad39") .bloodGroup(BloodGroup.A_POSITIVE) .photo("3b26fb49-e43d-401b-899a-f8f0a1572de0") diff --git a/core-services/egov-user/src/test/java/org/egov/user/web/controller/UserControllerTest.java b/core-services/egov-user/src/test/java/org/egov/user/web/controller/UserControllerTest.java index c6bac7c79f9..569fe003d20 100644 --- a/core-services/egov-user/src/test/java/org/egov/user/web/controller/UserControllerTest.java +++ b/core-services/egov-user/src/test/java/org/egov/user/web/controller/UserControllerTest.java @@ -194,7 +194,7 @@ public void test_should_update_user_profile() throws Exception { @Ignore public void test_should_update_user_details() throws Exception { - org.egov.user.domain.model.User userRequest = org.egov.user.domain.model.User.builder().name("foo").username("userName").dob(new Date("04/08/1986")).guardian("name of relative").build(); + org.egov.user.domain.model.User userRequest = org.egov.user.domain.model.User.builder().name("foo").userName("userName").dob(new Date("04/08/1986")).guardian("name of relative").build(); when(userService.updateWithoutOtpValidation(any(org.egov.user.domain.model.User.class), any())).thenReturn (userRequest); mockMvc.perform(post("/users/112/_updatenovalidate") @@ -211,7 +211,7 @@ public void test_should_update_user_details() throws Exception { public void test_should_create_citizen() throws Exception { final Date expectedDate = toDate(LocalDateTime.of(1986, 8, 4, 5, 30)); final org.egov.user.domain.model.User user = org.egov.user.domain.model.User.builder() - .username("userName") + .userName("userName") .name("foo") .dob(expectedDate) .guardian("name of relative") @@ -231,7 +231,7 @@ public void test_should_create_citizen() throws Exception { public void test_should_create_user_without_otp_validation() throws Exception { final Date expectedDate = toDate(LocalDateTime.of(1986, 8, 4, 0, 0)); final org.egov.user.domain.model.User expectedUser = org.egov.user.domain.model.User.builder() - .username("userName") + .userName("userName") .name("foo") .dob(expectedDate) .guardian("name of relative") @@ -249,7 +249,7 @@ public void test_should_create_user_without_otp_validation() throws Exception { final org.egov.user.domain.model.User actualUser = argumentCaptor.getValue(); assertEquals("foo", actualUser.getName()); - assertEquals("userName", actualUser.getUsername()); + assertEquals("userName", actualUser.getUserName()); assertEquals("name of relative", actualUser.getGuardian()); } @@ -295,12 +295,12 @@ private List getUserModels() { org.egov.user.domain.model.User user = org.egov.user.domain.model.User.builder() .id(1L) .tenantId("") - .username("userName") + .userName("userName") .title("title") .password("password") .salutation("salutation") .guardian("name of relative") - .guardianRelation(GuardianRelation.FATHER) + .guardianRelation(GuardianRelation.Father) .name("name") .gender(Gender.FEMALE) .mobileNumber("mobileNumber1") diff --git a/core-services/egov-user/src/test/java/org/egov/user/web/controller/UserRequestControllerTest.java b/core-services/egov-user/src/test/java/org/egov/user/web/controller/UserRequestControllerTest.java index eb43b25e53d..d18b23c947a 100644 --- a/core-services/egov-user/src/test/java/org/egov/user/web/controller/UserRequestControllerTest.java +++ b/core-services/egov-user/src/test/java/org/egov/user/web/controller/UserRequestControllerTest.java @@ -118,7 +118,7 @@ private User buildUser() { return User.builder() .id(12L) .name("Jamaal Bhai") - .username("jamaalbhai") + .userName("jamaalbhai") .salutation("dawakhana@charminar") .gender(Gender.MALE) .mobileNumber("9988776655") diff --git a/core-services/egov-workflow-v2/pom.xml b/core-services/egov-workflow-v2/pom.xml index 0ec1e31ea76..086ee94461e 100644 --- a/core-services/egov-workflow-v2/pom.xml +++ b/core-services/egov-workflow-v2/pom.xml @@ -127,7 +127,7 @@ org.postgresql postgresql - 42.2.2.jre7 + 42.2.18 diff --git a/core-services/egov-workflow-v2/src/main/resources/db/Dockerfile b/core-services/egov-workflow-v2/src/main/resources/db/Dockerfile index 3c4ecd3c667..f38638a269f 100644 --- a/core-services/egov-workflow-v2/src/main/resources/db/Dockerfile +++ b/core-services/egov-workflow-v2/src/main/resources/db/Dockerfile @@ -1,4 +1,4 @@ -FROM upyogio/flyway:4.1.2 +FROM egovio/flyway:10.7.1 COPY ./migration/main /flyway/sql @@ -6,4 +6,4 @@ COPY migrate.sh /usr/bin/migrate.sh RUN chmod +x /usr/bin/migrate.sh -CMD ["/usr/bin/migrate.sh"] +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/core-services/egov-workflow-v2/src/main/resources/db/migrate.sh b/core-services/egov-workflow-v2/src/main/resources/db/migrate.sh index 43960b25cdb..8d8089316d5 100644 --- a/core-services/egov-workflow-v2/src/main/resources/db/migrate.sh +++ b/core-services/egov-workflow-v2/src/main/resources/db/migrate.sh @@ -1,3 +1,3 @@ #!/bin/sh -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate \ No newline at end of file +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate \ No newline at end of file diff --git a/core-services/libraries/digit-models/.gitignore b/core-services/libraries/digit-models/.gitignore index 2af7cefb0a3..3467f05c98a 100644 --- a/core-services/libraries/digit-models/.gitignore +++ b/core-services/libraries/digit-models/.gitignore @@ -21,4 +21,5 @@ build/ nbbuild/ dist/ nbdist/ -.nb-gradle/ \ No newline at end of file +.nb-gradle/ +/bin/ diff --git a/core-services/libraries/digit-models/pom.xml b/core-services/libraries/digit-models/pom.xml index 400e6d08bf1..5f58b549c9c 100644 --- a/core-services/libraries/digit-models/pom.xml +++ b/core-services/libraries/digit-models/pom.xml @@ -73,7 +73,7 @@ org.egov.services services-common - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT jakarta.validation diff --git a/core-services/libraries/digit-models/src/main/java/digit/models/coremodels/user/Role.java b/core-services/libraries/digit-models/src/main/java/digit/models/coremodels/user/Role.java index 290503083f9..1db6fcbd7ca 100644 --- a/core-services/libraries/digit-models/src/main/java/digit/models/coremodels/user/Role.java +++ b/core-services/libraries/digit-models/src/main/java/digit/models/coremodels/user/Role.java @@ -3,7 +3,7 @@ import lombok.*; import java.util.Date; - +@NoArgsConstructor @Getter @Setter @Builder diff --git a/core-services/libraries/digit-models/src/main/java/digit/models/coremodels/user/enums/GuardianRelation.java b/core-services/libraries/digit-models/src/main/java/digit/models/coremodels/user/enums/GuardianRelation.java index 34859c66fb5..390efeece2f 100644 --- a/core-services/libraries/digit-models/src/main/java/digit/models/coremodels/user/enums/GuardianRelation.java +++ b/core-services/libraries/digit-models/src/main/java/digit/models/coremodels/user/enums/GuardianRelation.java @@ -41,5 +41,5 @@ package digit.models.coremodels.user.enums; public enum GuardianRelation { - FATHER, MOTHER, HUSBAND, OTHER; + Father, Mother, Husband, Other; } diff --git a/core-services/libraries/enc-client/bin/Dockerfile b/core-services/libraries/enc-client/bin/Dockerfile new file mode 100644 index 00000000000..cd50dd4120d --- /dev/null +++ b/core-services/libraries/enc-client/bin/Dockerfile @@ -0,0 +1,17 @@ +FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build +ARG WORK_DIR +ARG nexusUsername +ARG nexusPassword +WORKDIR /app +# copy the project files +COPY ${WORK_DIR}/pom.xml ./pom.xml +COPY ${WORK_DIR}/settings.xml ./settings.xml +# COPY build/maven/settings.xml ./settings.xml +# COPY build/maven/start.sh ./start.sh +COPY ${WORK_DIR}/src ./src +# not useful for stateless builds +# RUN mvn -B dependency:go-offline +RUN cd ${WORK_DIR} \ + && mvn -B -f /app/pom.xml test verify deploy -s settings.xml \ + -Dnexus.user=${nexusUsername} -Dnexus.password=${nexusPassword} +FROM scratch \ No newline at end of file diff --git a/core-services/libraries/enc-client/bin/README.md b/core-services/libraries/enc-client/bin/README.md new file mode 100644 index 00000000000..75601e7a775 --- /dev/null +++ b/core-services/libraries/enc-client/bin/README.md @@ -0,0 +1,2 @@ +# Encryption Client APIs (enc-client) + diff --git a/core-services/libraries/enc-client/bin/pom.xml b/core-services/libraries/enc-client/bin/pom.xml new file mode 100644 index 00000000000..36ce61dcd99 --- /dev/null +++ b/core-services/libraries/enc-client/bin/pom.xml @@ -0,0 +1,147 @@ + + + 4.0.0 + org.egov + enc-client + 1.1.0-beta-SNAPSHOT + + + repo.digit.org + eGov ERP Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/releases/ + + + repo.digit.org + eGov ERP Snapshots Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + + 2.17.1 + UTF-8 + 1.8 + UTF-8 + + + + org.egov.services + services-common + 0.12.1 + + + org.egov.services + tracer + 1.1.5-SNAPSHOT + + + org.egov + mdms-client + 0.0.2-SNAPSHOT + + + com.fasterxml.jackson.core + jackson-databind + 2.9.8 + + + com.fasterxml.jackson.core + jackson-annotations + 2.9.8 + + + org.reflections + reflections + 0.9.11 + + + com.jayway.jsonpath + json-path + 2.4.0 + + + junit + junit + 4.12 + test + + + org.mockito + mockito-all + 1.9.5 + test + + + org.springframework + spring-core + 4.3.6.RELEASE + + + org.springframework + spring-test + 4.3.6.RELEASE + test + + + org.springframework.boot + spring-boot-test + 2.1.3.RELEASE + test + + + org.projectlombok + lombok + 1.18.4 + provided + + + org.slf4j + slf4j-api + 1.7.25 + + + ch.qos.logback + logback-classic + 1.1.11 + + + ch.qos.logback + logback-core + 1.1.11 + + + + + repo.egovernments.org + eGov ERP Releases Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/releases/ + + + snapshots.repo.egovernments.org + eGov ERP Snapshots Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/ + + + + + + maven-compiler-plugin + + 8 + 8 + + + + maven-source-plugin + + + attach-sources + + jar + + + + + + + diff --git a/core-services/libraries/enc-client/bin/settings.xml b/core-services/libraries/enc-client/bin/settings.xml new file mode 100644 index 00000000000..8de43f8a369 --- /dev/null +++ b/core-services/libraries/enc-client/bin/settings.xml @@ -0,0 +1,23 @@ + + + + + nexus + central + https://nexus-repo.egovernments.org/nexus/content/groups/public/ + + + + + repo.digit.org + ${nexus.user} + ${nexus.password} + + + + com.versioneye + + diff --git a/core-services/libraries/enc-client/bin/src/main/resources/enc.properties b/core-services/libraries/enc-client/bin/src/main/resources/enc.properties new file mode 100644 index 00000000000..dcef3af1690 --- /dev/null +++ b/core-services/libraries/enc-client/bin/src/main/resources/enc.properties @@ -0,0 +1,18 @@ +#------------egov-enc-service config----------------# +egov.enc.host=https://msewapunjab.niua.org/ +egov.enc.encrypt.endpoint=/egov-enc-service/crypto/v1/_encrypt +egov.enc.decrypt.endpoint=/egov-enc-service/crypto/v1/_decrypt + +#----------------MDMS config---------------------# +egov.mdms.host=https://msewapunjab.niua.org/ +egov.mdms.search.endpoint=/egov-mdms-service/v1/_search + +egov.state.level.tenant.id=pb + +#-----------Kafka Audit Topic Name------------# +kafka.topic.audit=audit_data + +#------------Kafka Config----------------------# +kafka.config.bootstrap_server_config=localhost:9092 +spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer +spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer diff --git a/core-services/libraries/enc-client/src/test/resources/DecryptionABAC.json b/core-services/libraries/enc-client/bin/src/test/resources/DecryptionABAC.json similarity index 100% rename from core-services/libraries/enc-client/src/test/resources/DecryptionABAC.json rename to core-services/libraries/enc-client/bin/src/test/resources/DecryptionABAC.json diff --git a/core-services/libraries/enc-client/src/test/resources/EncryptionPolicy.json b/core-services/libraries/enc-client/bin/src/test/resources/EncryptionPolicy.json similarity index 100% rename from core-services/libraries/enc-client/src/test/resources/EncryptionPolicy.json rename to core-services/libraries/enc-client/bin/src/test/resources/EncryptionPolicy.json diff --git a/core-services/libraries/enc-client/pom.xml b/core-services/libraries/enc-client/pom.xml index 36ce61dcd99..60b75937d83 100644 --- a/core-services/libraries/enc-client/pom.xml +++ b/core-services/libraries/enc-client/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.egov enc-client - 1.1.0-beta-SNAPSHOT + 2.0.4-SNAPSHOT repo.digit.org @@ -27,7 +27,7 @@ org.egov.services services-common - 0.12.1 + 1.0.1-SNAPSHOT org.egov.services @@ -37,7 +37,7 @@ org.egov mdms-client - 0.0.2-SNAPSHOT + 0.0.3-SNAPSHOT com.fasterxml.jackson.core diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionService.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionService.java index 8c36c8a92d5..f49b4b5ff48 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionService.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionService.java @@ -1,20 +1,24 @@ package org.egov.encryption; import com.fasterxml.jackson.databind.JsonNode; -import org.egov.common.contract.request.User; +import org.egov.common.contract.request.RequestInfo; import java.io.IOException; import java.util.List; public interface EncryptionService { - public JsonNode encryptJson(Object plaintextJson, String key, String tenantId) throws IOException; + public JsonNode encryptJson(Object plaintextJson, String model, String tenantId) throws IOException; - public P encryptJson(Object plaintextJson, String key, String tenantId, Class valueType) throws IOException; + public P encryptJson(Object plaintextJson, String model, String tenantId, Class valueType) throws IOException; - public JsonNode decryptJson(Object ciphertextJson, String key, User user) throws IOException; + public JsonNode decryptJson(RequestInfo requestInfo, Object ciphertextJson, String model, + String purpose) throws IOException; - public P decryptJson(Object ciphertextJson, String key, User user, Class valueType) throws IOException; + public P decryptJson(RequestInfo requestInfo, Object ciphertextJson, String model, String purpose, + Class valueType) throws IOException; + + public String encryptValue(Object plaintext, String tenantId) throws IOException; public String encryptValue(Object plaintext, String tenantId, String type) throws IOException; diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionServiceImpl.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionServiceImpl.java index 780a932c706..a6df7626bf5 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionServiceImpl.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionServiceImpl.java @@ -2,19 +2,23 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; import lombok.extern.slf4j.Slf4j; +import org.egov.common.contract.request.RequestInfo; import org.egov.common.contract.request.Role; -import org.egov.common.contract.request.User; -import org.egov.encryption.accesscontrol.AbacFilter; -import org.egov.encryption.config.AbacConfiguration; +import org.egov.encryption.audit.AuditService; +import org.egov.encryption.config.DecryptionPolicyConfiguration; import org.egov.encryption.config.EncClientConstants; +import org.egov.encryption.config.EncProperties; import org.egov.encryption.config.EncryptionPolicyConfiguration; import org.egov.encryption.masking.MaskingService; -import org.egov.encryption.models.AccessType; import org.egov.encryption.models.Attribute; +import org.egov.encryption.models.UniqueIdentifier; +import org.egov.encryption.models.Visibility; import org.egov.encryption.util.ConvertClass; import org.egov.encryption.util.JSONBrowseUtil; import org.egov.encryption.util.JacksonUtils; +import org.egov.encryption.util.JsonPathConverter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -29,105 +33,126 @@ @Service public class EncryptionServiceImpl implements EncryptionService { + @Autowired + private EncProperties encProperties; @Autowired private EncryptionServiceRestConnection encryptionServiceRestConnection; @Autowired private EncryptionPolicyConfiguration encryptionPolicyConfiguration; @Autowired - private AbacConfiguration abacConfiguration; - @Autowired - private AbacFilter abacFilter; + private DecryptionPolicyConfiguration decryptionPolicyConfiguration; @Autowired private MaskingService maskingService; @Autowired + private AuditService auditService; + @Autowired private ObjectMapper objectMapper; - public JsonNode encryptJson(Object plaintextJson, String key, String tenantId) throws IOException { - - JsonNode plaintextNode = createJsonNode(plaintextJson); + private JsonNode encryptJsonArray(JsonNode plaintextNode, String model, String tenantId) throws IOException { JsonNode encryptNode = plaintextNode.deepCopy(); + List attributes = encryptionPolicyConfiguration.getAttributeDetailsForModel(model); + List attributesToEncrypt = attributes.stream().map(Attribute::getJsonPath).collect(Collectors.toList()); + attributesToEncrypt = JsonPathConverter.convertToArrayJsonPaths(attributesToEncrypt); + JsonNode jsonNode = JacksonUtils.filterJsonNodeForPaths(plaintextNode, attributesToEncrypt); + + if (!jsonNode.isEmpty(objectMapper.getSerializerProvider())) { + JsonNode returnedEncryptedNode = objectMapper.valueToTree(encryptionServiceRestConnection.callEncrypt(tenantId, + encProperties.getDefaultEncryptDataType(), jsonNode)); + encryptNode = JacksonUtils.merge(returnedEncryptedNode, encryptNode); + } - List attributesToEncrypt = encryptionPolicyConfiguration.getAttributesForKey(key); - Map> typeAttributeMap = encryptionPolicyConfiguration.getTypeAttributeMap(attributesToEncrypt); - - for (String type : typeAttributeMap.keySet()) { - List attributes = typeAttributeMap.get(type); - List paths = attributes.stream().map(Attribute::getJsonPath).collect(Collectors.toList()); + return encryptNode; + } - JsonNode jsonNode = JacksonUtils.filterJsonNodeForPaths(plaintextNode, paths); + public JsonNode encryptJson(Object plaintextJson, String model, String tenantId) throws IOException { + JsonNode plaintextNode = createJsonNode(plaintextJson); + JsonNode plaintextNodeCopy = plaintextNode.deepCopy(); - if(! jsonNode.isEmpty(objectMapper.getSerializerProvider())) { - JsonNode returnedEncryptedNode = objectMapper.valueToTree(encryptionServiceRestConnection.callEncrypt(tenantId, - type, jsonNode)); - encryptNode = JacksonUtils.merge(returnedEncryptedNode, encryptNode); - } + // Convert input to array if it isn't already + if (!plaintextNodeCopy.isArray()) { + ArrayNode arrayNode = objectMapper.createArrayNode(); + arrayNode.add(plaintextNodeCopy); + plaintextNodeCopy = arrayNode; } + JsonNode encryptedNode = encryptJsonArray(plaintextNodeCopy, model, tenantId); - return encryptNode; + if (!plaintextNode.isArray()) { + return encryptedNode.get(0); + } + return encryptedNode; } - public P encryptJson(Object plaintextJson, String key, String tenantId, Class valueType) throws IOException { - return ConvertClass.convertTo(encryptJson(plaintextJson, key, tenantId), valueType); + public P encryptJson(Object plaintextJson, String model, String tenantId, Class valueType) throws IOException { + return ConvertClass.convertTo(encryptJson(plaintextJson, model, tenantId), valueType); } - - public JsonNode decryptJson(Object ciphertextJson, Map attributeAccessTypeMap, User user) - throws IOException { + private JsonNode decryptJson(RequestInfo requestInfo, Object ciphertextJson, + Map attributesVisibilityMap, + String model, String purpose, UniqueIdentifier uniqueIdentifier) throws IOException { JsonNode ciphertextNode = createJsonNode(ciphertextJson); JsonNode decryptNode = ciphertextNode.deepCopy(); - if(attributeAccessTypeMap.containsValue(AccessType.NONE)) { - List attributesToBeRemoved = attributeAccessTypeMap.keySet().stream() - .filter(attribute -> attributeAccessTypeMap.get(attribute) == AccessType.NONE).collect(Collectors.toList()); - List pathsToBeRemoved = attributesToBeRemoved.stream().map(Attribute::getJsonPath).collect(Collectors.toList()); - JsonNode nodeToBeEmptied = JacksonUtils.filterJsonNodeForPaths(decryptNode, pathsToBeRemoved); + // Convert input to array if it isn't already + if (!decryptNode.isArray()) { + ArrayNode arrayNode = objectMapper.createArrayNode(); + arrayNode.add(decryptNode); + decryptNode = arrayNode; + } + + if (attributesVisibilityMap.containsValue(Visibility.NONE)) { + List attributesToBeRemoved = attributesVisibilityMap.keySet().stream() + .filter(attribute -> attributesVisibilityMap.get(attribute) == Visibility.NONE).collect(Collectors.toList()); + List pathToBeRemoved = attributesToBeRemoved.stream().map(Attribute::getJsonPath).collect(Collectors.toList()); + JsonNode nodeToBeEmptied = JacksonUtils.filterJsonNodeForPaths(decryptNode, pathToBeRemoved); JsonNode emptyNode = JSONBrowseUtil.mapValues(nodeToBeEmptied, __ -> EncClientConstants.STRING_FOR_NONE_ACCESS); decryptNode = JacksonUtils.merge(emptyNode, decryptNode); } - List attributesToBeDecrypted = attributeAccessTypeMap.keySet().stream() - .filter(attribute -> attributeAccessTypeMap.get(attribute) != AccessType.NONE).collect(Collectors.toList()); + List attributesToBeDecrypted = attributesVisibilityMap.keySet().stream() + .filter(attribute -> attributesVisibilityMap.get(attribute) != Visibility.NONE).collect(Collectors.toList()); List pathsToBeDecrypted = attributesToBeDecrypted.stream().map(Attribute::getJsonPath).collect(Collectors.toList()); - + pathsToBeDecrypted = JsonPathConverter.convertToArrayJsonPaths(pathsToBeDecrypted); JsonNode jsonNode = JacksonUtils.filterJsonNodeForPaths(ciphertextNode, pathsToBeDecrypted); - if(! jsonNode.isEmpty(objectMapper.getSerializerProvider())) { + if (!jsonNode.isEmpty(objectMapper.getSerializerProvider())) { JsonNode returnedDecryptedNode = encryptionServiceRestConnection.callDecrypt(jsonNode); decryptNode = JacksonUtils.merge(returnedDecryptedNode, decryptNode); } - if(attributeAccessTypeMap.containsValue(AccessType.MASK)) { - List attributesToBeMasked = attributeAccessTypeMap.keySet().stream() - .filter(attribute -> attributeAccessTypeMap.get(attribute) == AccessType.MASK).collect(Collectors.toList()); - decryptNode = maskingService.maskData(decryptNode, attributesToBeMasked); + if (attributesVisibilityMap.containsValue(Visibility.MASKED)) { + List attributesToBeMasked = attributesVisibilityMap.keySet().stream() + .filter(attribute -> attributesVisibilityMap.get(attribute) == Visibility.MASKED).collect(Collectors.toList()); + decryptNode = maskingService.maskData(decryptNode, attributesToBeMasked, uniqueIdentifier, requestInfo); } + // auditService.audit(decryptNode, model, purpose, requestInfo); + return decryptNode; } + @Override + public JsonNode decryptJson(RequestInfo requestInfo, Object ciphertextJson, String model, String purpose) throws IOException { + List roles = requestInfo.getUserInfo().getRoles().stream().map(Role::getCode).collect(Collectors.toList()); + Map attributesVisibilityMap = decryptionPolicyConfiguration.getRoleAttributeAccessListForModel(requestInfo, model, roles); - public JsonNode decryptJson(Object ciphertextJson, String key, User user) throws IOException { - - List roles = user.getRoles().stream().map(Role::getCode).collect(Collectors.toList()); - - Map attributeAccessTypeMap = abacFilter.getAttributeAccessForRoles(roles, - abacConfiguration.getRoleAttributeAccessListForKey(key)); - - JsonNode decryptedNode = decryptJson(ciphertextJson, attributeAccessTypeMap, user); + UniqueIdentifier uniqueIdentifier = decryptionPolicyConfiguration.getSecurityPolicyUniqueIdentifier(model); + JsonNode decryptedNode = decryptJson(requestInfo, ciphertextJson, attributesVisibilityMap, model, purpose, uniqueIdentifier); return decryptedNode; } - public P decryptJson(Object ciphertextJson, String key, User user, Class valueType) throws IOException { - return ConvertClass.convertTo(decryptJson(ciphertextJson, key, user), valueType); + public P decryptJson(RequestInfo requestInfo, Object ciphertextJson, String model, String purpose + , Class valueType) throws IOException { + return ConvertClass.convertTo(decryptJson(requestInfo, ciphertextJson, model, purpose), valueType); } + JsonNode createJsonNode(Object json) throws IOException { JsonNode jsonNode; - if(json instanceof JsonNode) + if (json instanceof JsonNode) jsonNode = (JsonNode) json; - else if(json instanceof String) + else if (json instanceof String) jsonNode = objectMapper.readTree((String) json); //JsonNode from JSON String else jsonNode = objectMapper.valueToTree(json); //JsonNode from POJO or Map @@ -135,6 +160,10 @@ else if(json instanceof String) } + public String encryptValue(Object plaintext, String tenantId) throws IOException { + return encryptValue(plaintext, tenantId, encProperties.getDefaultEncryptDataType()); + } + public String encryptValue(Object plaintext, String tenantId, String type) throws IOException { return encryptValue(new ArrayList<>(Collections.singleton(plaintext)), tenantId, type).get(0); } @@ -144,5 +173,4 @@ public List encryptValue(List plaintext, String tenantId, String return ConvertClass.convertTo(objectMapper.valueToTree(encryptionResponse), List.class); } - } \ No newline at end of file diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionServiceRestConnection.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionServiceRestConnection.java index 147fa008f5b..ed3bfec8f93 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionServiceRestConnection.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/EncryptionServiceRestConnection.java @@ -4,8 +4,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; import org.egov.encryption.config.EncProperties; +import org.egov.encryption.config.ErrorConstants; import org.egov.encryption.web.contract.EncReqObject; import org.egov.encryption.web.contract.EncryptionRequest; +import org.egov.tracer.model.CustomException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; @@ -28,20 +30,28 @@ class EncryptionServiceRestConnection { Object callEncrypt(String tenantId, String type, Object value) throws IOException { - EncReqObject encReqObject = new EncReqObject(tenantId, type, value); EncryptionRequest encryptionRequest = new EncryptionRequest(); encryptionRequest.setEncryptionRequests(new ArrayList<>(Collections.singleton(encReqObject))); - ResponseEntity response = restTemplate.postForEntity(encProperties.getEgovEncHost() + encProperties.getEgovEncEncryptPath() , - encryptionRequest, String.class); - return objectMapper.readTree(response.getBody()).get(0); + try { + ResponseEntity response = restTemplate.postForEntity(encProperties.getEgovEncHost() + encProperties.getEgovEncEncryptPath(), + encryptionRequest, String.class); + return objectMapper.readTree(response.getBody()).get(0); + } catch (Exception e) { + log.error(ErrorConstants.ENCRYPTION_SERVICE_ERROR_MESSAGE, e); + throw new CustomException(ErrorConstants.ENCRYPTION_SERVICE_ERROR, ErrorConstants.ENCRYPTION_SERVICE_ERROR_MESSAGE); + } } - JsonNode callDecrypt(Object ciphertext) throws IOException { - ResponseEntity response = restTemplate.postForEntity( - encProperties.getEgovEncHost() + encProperties.getEgovEncDecryptPath(), ciphertext, JsonNode.class); - return response.getBody(); + JsonNode callDecrypt(Object ciphertext) { + try { + ResponseEntity response = restTemplate.postForEntity( + encProperties.getEgovEncHost() + encProperties.getEgovEncDecryptPath(), ciphertext, JsonNode.class); + return response.getBody(); + } catch (Exception e) { + throw new CustomException(ErrorConstants.ENCRYPTION_SERVICE_ERROR, ErrorConstants.ENCRYPTION_SERVICE_ERROR_MESSAGE); + } } } \ No newline at end of file diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/audit/AuditService.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/audit/AuditService.java index 3b61cb673f6..57c72a77a55 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/audit/AuditService.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/audit/AuditService.java @@ -2,16 +2,18 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.LongNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.node.TextNode; +import org.egov.common.contract.request.RequestInfo; import org.egov.common.contract.request.User; +import org.egov.encryption.config.DecryptionPolicyConfiguration; import org.egov.encryption.config.EncProperties; import org.egov.encryption.models.AuditObject; +import org.egov.encryption.models.UniqueIdentifier; import org.egov.encryption.producer.Producer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; import java.util.UUID; @Service @@ -23,28 +25,35 @@ public class AuditService { private EncProperties encProperties; @Autowired private ObjectMapper objectMapper; + @Autowired + private DecryptionPolicyConfiguration decryptionPolicyConfiguration; + + public void audit(JsonNode json, String model, String purpose, RequestInfo requestInfo) { + User user = requestInfo.getUserInfo(); - public void audit(JsonNode data, User user) { AuditObject auditObject = AuditObject.builder().build(); - auditObject.setData(data); + auditObject.setId(UUID.randomUUID().toString()); auditObject.setTimestamp(System.currentTimeMillis()); auditObject.setUserId(user.getUuid()); - auditObject.setId(UUID.randomUUID().toString()); - - producer.push(encProperties.getAuditTopicName(), auditObject.getId(), objectMapper.valueToTree(auditObject).toString()); - } - - public void audit(String userId, Long timestamp, String purpose, JsonNode abacParams, JsonNode data) { - ObjectNode auditObject = objectMapper.createObjectNode(); - - auditObject.set("id", TextNode.valueOf(UUID.randomUUID().toString())); - auditObject.set("userId", TextNode.valueOf(userId)); - auditObject.set("timestamp", LongNode.valueOf(timestamp)); - auditObject.set("purpose", TextNode.valueOf(purpose)); - auditObject.set("abacParams", abacParams); - auditObject.set("data", data); - - producer.push(encProperties.getAuditTopicName(), auditObject.get("id").asText(), auditObject); + auditObject.setModel(model); + auditObject.setPurpose(purpose); + + if (requestInfo.getPlainAccessRequest() != null) { + auditObject.setPlainAccessRequest(requestInfo.getPlainAccessRequest()); + } + + UniqueIdentifier uniqueIdentifier = + decryptionPolicyConfiguration.getUniqueIdentifierForModel(model); + List entityIds = new ArrayList<>(); + for (JsonNode node : json) { + if(node.at(uniqueIdentifier.getJsonPath())!=null) { + String nodeUuid = node.at(uniqueIdentifier.getJsonPath()).asText(); + entityIds.add(nodeUuid); + } + } + auditObject.setEntityIds(entityIds); + + producer.push(encProperties.getAuditTopicName(), auditObject.getId(), auditObject); } } diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/DecryptionPolicyConfiguration.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/DecryptionPolicyConfiguration.java new file mode 100644 index 00000000000..33b66c41eec --- /dev/null +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/DecryptionPolicyConfiguration.java @@ -0,0 +1,199 @@ +package org.egov.encryption.config; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectReader; +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; +import org.egov.common.contract.request.RequestInfo; +import org.egov.encryption.models.*; +import org.egov.encryption.util.MdmsFetcher; +import org.egov.tracer.model.CustomException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import org.springframework.web.client.RestTemplate; + +import javax.annotation.PostConstruct; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Slf4j +@Component +public class DecryptionPolicyConfiguration { + + @Autowired + private EncProperties encProperties; + + @Autowired + private MdmsFetcher mdmsFetcher; + @Autowired + private RestTemplate restTemplate; + @Autowired + private ObjectMapper objectMapper; + + private Map> modelAttributeAccessMap; + + private Map>> modelRoleBasedDecryptionPolicyMap; + + private Map uniqueIdentifierMap; + + + void initializeModelAttributeAccessMap(List modelRoleAttributeAccessList) { + modelAttributeAccessMap = modelRoleAttributeAccessList.stream() + .collect(Collectors.toMap(SecurityPolicy::getModel, + SecurityPolicy::getAttributes)); + } + + void initializeRoleBasedDecryptionPolicyMap(List modelRoleAttributeAccessList) { + modelRoleBasedDecryptionPolicyMap = new HashMap<>(); + for (SecurityPolicy securityPolicy : modelRoleAttributeAccessList) { + modelRoleBasedDecryptionPolicyMap.put(securityPolicy.getModel(), + makeRoleAttributeAccessMapping(securityPolicy.getRoleBasedDecryptionPolicy())); + } + } + + void initializeUniqueIdentifierMap(List modelRoleAttributeAccessList) { + uniqueIdentifierMap = modelRoleAttributeAccessList.stream() + .collect(Collectors.toMap(SecurityPolicy::getModel, + SecurityPolicy::getUniqueIdentifier)); + } + + @PostConstruct + void initializeModelAttributeAccessMapFromMdms() { + List securityPolicyList = null; + try { + JSONArray securityPolicyJson = mdmsFetcher.getSecurityMdmsForFilter(null); + ObjectReader reader = objectMapper.readerFor(objectMapper.getTypeFactory().constructCollectionType(List.class, + SecurityPolicy.class)); + securityPolicyList = reader.readValue(securityPolicyJson.toString()); + } catch (IOException e) { + log.error(ErrorConstants.SECURITY_POLICY_READING_ERROR_MESSAGE, e); + throw new CustomException(ErrorConstants.SECURITY_POLICY_READING_ERROR, ErrorConstants.SECURITY_POLICY_READING_ERROR_MESSAGE); + } + + initializeModelAttributeAccessMap(securityPolicyList); + initializeRoleBasedDecryptionPolicyMap(securityPolicyList); + initializeUniqueIdentifierMap(securityPolicyList); + } + + public UniqueIdentifier getUniqueIdentifierForModel(String model) { + return uniqueIdentifierMap.get(model); + } + + public Map getRoleAttributeAccessListForModel(RequestInfo requestInfo, String model, List roles) { + Map mapping = new HashMap<>(); + try { + List attributesList = modelAttributeAccessMap.get(model); + Map> roleAttributeAccessMap = + modelRoleBasedDecryptionPolicyMap.get(model); + + boolean isAttributeListEmpty = CollectionUtils.isEmpty(attributesList); + boolean isRoleAttributeAccessMapEmpty = CollectionUtils.isEmpty(roleAttributeAccessMap); + + if (isAttributeListEmpty) { + throw new CustomException("DECRYPTION_NULL_ERROR", "Attribute list is empty"); + } + + + if (!isAttributeListEmpty && !isRoleAttributeAccessMapEmpty) { + Map attributesMap = makeAttributeMap(attributesList); + + List secondLevelVisibility = new ArrayList<>(); + + for (String role : roles) { + if (!roleAttributeAccessMap.containsKey(role)) + continue; + + List attributeList = roleAttributeAccessMap.get(role); + + for (AttributeAccess attributeAccess : attributeList) { + String attributeName = attributeAccess.getAttribute(); + Attribute attribute = attributesMap.get(attributeName); + if (requestInfo.getPlainAccessRequest() != null && !CollectionUtils.isEmpty(requestInfo.getPlainAccessRequest().getPlainRequestFields()) + && requestInfo.getPlainAccessRequest().getPlainRequestFields().contains(attributeName) + && attributeAccess.getSecondLevelVisibility() != null && !secondLevelVisibility.contains(attributeName)) { + secondLevelVisibility.add(attributeName); + } + String firstLevelVisibility = attributeAccess.getFirstLevelVisibility() != null ? + String.valueOf(attributeAccess.getFirstLevelVisibility()) : String.valueOf(attribute.getDefaultVisibility()); + Visibility visibility = Visibility.valueOf(firstLevelVisibility); + if (mapping.containsKey(attribute)) { + if (mapping.get(attribute).ordinal() > visibility.ordinal()) { + mapping.remove(attribute); + mapping.put(attribute, visibility); + } + } else { + mapping.put(attribute, visibility); + } + } + } + + if (requestInfo.getPlainAccessRequest() != null) + requestInfo.getPlainAccessRequest().setPlainRequestFields(secondLevelVisibility); + } + + List mappingAttributesList = new ArrayList<>(mapping.keySet()); + List attributesToAvoidlist = new ArrayList<>(); + for (Attribute attribute : mappingAttributesList) + attributesToAvoidlist.add(attribute.getName()); + + + if (!isAttributeListEmpty) + getDefaultVisibilityMapping(attributesList, mapping, attributesToAvoidlist); + + + return mapping; + } catch (Exception e) { + throw new CustomException("DECRYPTION_NULL_ERROR", "Error in decryption process"); + } + } + + private Map> makeRoleAttributeAccessMapping(List roleBasedDecryptionPolicyList) { + Map> roleAttributeAccessMap = new HashMap<>(); + for (RoleBasedDecryptionPolicy roleBasedDecryptionPolicy : roleBasedDecryptionPolicyList) { + List roles = roleBasedDecryptionPolicy.getRoles(); + List attributeAccessList = roleBasedDecryptionPolicy.getAttributeAccessList(); + for (String role : roles) { + roleAttributeAccessMap.put(role, attributeAccessList); + } + } + return roleAttributeAccessMap; + } + + private Map makeAttributeMap(List attributesList) { + Map atrributesMap = new HashMap<>(); + + for (Attribute attribute : attributesList) { + String filedName = attribute.getName(); + atrributesMap.put(filedName, attribute); + } + return atrributesMap; + } + + public UniqueIdentifier getSecurityPolicyUniqueIdentifier(String model) { + return uniqueIdentifierMap.get(model); + } + + private void getDefaultVisibilityMapping(List attributesList, Map mapping, List attributesToAvoidlist) { + + for (Attribute attribute : attributesList) { + String defaultVisibility = String.valueOf(attribute.getDefaultVisibility()); + Visibility visibility = Visibility.valueOf(defaultVisibility); + if (!attributesToAvoidlist.contains(attribute.getName())) { + if (mapping.containsKey(attribute)) { + if (mapping.get(attribute).ordinal() > visibility.ordinal()) { + mapping.remove(attribute); + mapping.put(attribute, visibility); + } + } else { + mapping.put(attribute, visibility); + } + } + } + } + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncClientConstants.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncClientConstants.java index 113077a8039..82ad2a239ac 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncClientConstants.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncClientConstants.java @@ -4,9 +4,11 @@ public class EncClientConstants { public static final String MDMS_MODULE_NAME = "DataSecurity"; - public static final String MDMS_ENCRYPTION_MASTER_NAME = "EncryptionPolicy"; + public static final String MDMS_SECURITY_POLICY_MASTER_NAME = "SecurityPolicy"; - public static final String MDMS_DECRYPTION_MASTER_NAME = "DecryptionABAC"; + public static final String MDMS_MASKING_PATTERN_MASTER_NAME = "MaskingPatterns"; public static final String STRING_FOR_NONE_ACCESS = "Confidential Information"; + + public static final String TENANTID_MDC = "TENANTID"; } diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncProperties.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncProperties.java index e20e227db6c..ca408934242 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncProperties.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncProperties.java @@ -1,11 +1,12 @@ package org.egov.encryption.config; -import lombok.Getter; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; +import lombok.Getter; + @Getter @Configuration @PropertySource("classpath:enc.properties") @@ -16,17 +17,21 @@ public class EncProperties { @Value("${egov.mdms.host}") private String egovMdmsHost; + @Value("${egov.mdms.search.endpoint}") private String egovMdmsSearchEndpoint; - @Value("${egov.state.level.tenant.id}") + @Value("${state.level.tenant.id}") private String stateLevelTenantId; + @Value("${default.encrypt.data.type}") + private String defaultEncryptDataType; @Value("${egov.enc.host}") private String egovEncHost; + @Value("${egov.enc.encrypt.endpoint}") private String egovEncEncryptPath; + @Value("${egov.enc.decrypt.endpoint}") private String egovEncDecryptPath; - } diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncryptionConfiguration.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncryptionConfiguration.java index c474c8115a6..cdce12df813 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncryptionConfiguration.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncryptionConfiguration.java @@ -2,12 +2,15 @@ import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.databind.ObjectMapper; +import org.egov.common.utils.MultiStateInstanceUtil; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; @Configuration @ComponentScan(basePackages = {"org.egov.encryption"}) +@Import({MultiStateInstanceUtil.class}) public class EncryptionConfiguration { @Bean diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncryptionPolicyConfiguration.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncryptionPolicyConfiguration.java index 5f45410d8e7..a1ee893b4b9 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncryptionPolicyConfiguration.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/EncryptionPolicyConfiguration.java @@ -1,82 +1,56 @@ package org.egov.encryption.config; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectReader; +import lombok.extern.slf4j.Slf4j; import net.minidev.json.JSONArray; -import org.egov.common.contract.request.RequestInfo; import org.egov.encryption.models.Attribute; -import org.egov.encryption.models.EncryptionPolicy; -import org.egov.mdms.model.*; +import org.egov.encryption.models.SecurityPolicy; +import org.egov.encryption.util.MdmsFetcher; +import org.egov.tracer.model.CustomException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; -import org.springframework.web.client.RestTemplate; import javax.annotation.PostConstruct; import java.io.IOException; -import java.util.*; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; +@Slf4j @Component public class EncryptionPolicyConfiguration { @Autowired - private EncProperties encProperties; - @Autowired - private RestTemplate restTemplate; + private MdmsFetcher mdmsFetcher; @Autowired private ObjectMapper objectMapper; - private Map> keyAttributeMap; + private Map> encryptionPolicyAttributesMap; @PostConstruct - void initializeKeyAttributeMapFromMdms() { - List encryptionPolicyList = null; + void initializeEncryptionPolicyAttributesMapFromMdms() throws JsonProcessingException { try { - MasterDetail masterDetail = MasterDetail.builder().name(EncClientConstants.MDMS_ENCRYPTION_MASTER_NAME).build(); - ModuleDetail moduleDetail = ModuleDetail.builder().moduleName(EncClientConstants.MDMS_MODULE_NAME) - .masterDetails(Arrays.asList(masterDetail)) .build(); - - MdmsCriteria mdmsCriteria = MdmsCriteria.builder().tenantId(encProperties.getStateLevelTenantId()) - .moduleDetails(Arrays.asList(moduleDetail)).build(); - - MdmsCriteriaReq mdmsCriteriaReq = MdmsCriteriaReq.builder().requestInfo(RequestInfo.builder().build()) - .mdmsCriteria(mdmsCriteria).build(); - - ResponseEntity response = - restTemplate.postForEntity(encProperties.getEgovMdmsHost() + encProperties.getEgovMdmsSearchEndpoint(), - mdmsCriteriaReq, MdmsResponse.class); - - JSONArray policyListJSON = response.getBody().getMdmsRes().get(EncClientConstants.MDMS_MODULE_NAME) - .get(EncClientConstants.MDMS_ENCRYPTION_MASTER_NAME); - + JSONArray attributesDetailsJSON = mdmsFetcher.getSecurityMdmsForFilter(null); ObjectReader reader = objectMapper.readerFor(objectMapper.getTypeFactory().constructCollectionType(List.class, - EncryptionPolicy.class)); - encryptionPolicyList = reader.readValue(policyListJSON.toString()); - } catch (IOException e) {} - - initializeKeyAttributeMap(encryptionPolicyList); + SecurityPolicy.class)); + List securityPolicies = reader.readValue(attributesDetailsJSON.toString()); + encryptionPolicyAttributesMap = securityPolicies.stream() + .collect(Collectors.toMap(SecurityPolicy::getModel, SecurityPolicy::getAttributes)); + } catch (IOException e) { + log.error(ErrorConstants.SECURITY_POLICY_READING_ERROR_MESSAGE, e); + throw new CustomException(ErrorConstants.SECURITY_POLICY_READING_ERROR, ErrorConstants.SECURITY_POLICY_READING_ERROR_MESSAGE); + } } - void initializeKeyAttributeMap(List encryptionPolicyList) { - keyAttributeMap = encryptionPolicyList.stream().collect(Collectors - .toMap(EncryptionPolicy::getKey, EncryptionPolicy::getAttributeList)); - } + public List getAttributeDetailsForModel(String modelName) { + try { + return encryptionPolicyAttributesMap.get(modelName); + } catch (Exception e) { + throw new CustomException("DECRYPTION_ERROR", "Error in retrieving MDMS data"); + } - public List getAttributesForKey(String key) { - return keyAttributeMap.get(key); } - public Map> getTypeAttributeMap(List attributeList) { - Map> typeAttributeMap = new HashMap<>(); - for (Attribute attribute : attributeList) { - String type = attribute.getType(); - if (! typeAttributeMap.containsKey(type)) { - List attributesToEncrypt = new ArrayList<>(); - typeAttributeMap.put(type, attributesToEncrypt); - } - typeAttributeMap.get(type).add(attribute); - } - return typeAttributeMap; - } -} +} \ No newline at end of file diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/ErrorConstants.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/ErrorConstants.java new file mode 100644 index 00000000000..e54d570c954 --- /dev/null +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/ErrorConstants.java @@ -0,0 +1,20 @@ +package org.egov.encryption.config; + +public class ErrorConstants { + + public static final String MDMS_FETCH_ERROR = "MDMS_FETCH_ERROR"; + public static final String MDMS_FETCH_ERROR_MESSAGE = "Error occurred while fetching MDMS Configs"; + + public static final String ENCRYPTION_SERVICE_ERROR = "ENCRYPTION_SERVICE_ERROR"; + public static final String ENCRYPTION_SERVICE_ERROR_MESSAGE + = "Error occurred while calling Encryption Service"; + + public static final String SECURITY_POLICY_READING_ERROR = "SECURITY_POLICY_READING_ERROR"; + public static final String SECURITY_POLICY_READING_ERROR_MESSAGE + = "Error occurred while reading Security Policy from MDMS Config"; + + public static final String MASKING_PATTERN_READING_ERROR = "MASKING_PATTER_READING_ERROR"; + public static final String MASKING_PATTER_READING_ERROR_MESSAGE + = "Error occurred while reading Masking Pattern from MDMS Config"; + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/masking/MaskingService.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/masking/MaskingService.java index a8c01be2ef8..093fabf7a59 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/masking/MaskingService.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/masking/MaskingService.java @@ -1,50 +1,109 @@ package org.egov.encryption.masking; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; +import org.egov.common.contract.request.RequestInfo; +import org.egov.encryption.config.EncProperties; +import org.egov.encryption.config.ErrorConstants; import org.egov.encryption.models.Attribute; +import org.egov.encryption.models.UniqueIdentifier; import org.egov.encryption.util.JSONBrowseUtil; import org.egov.encryption.util.JacksonUtils; -import org.reflections.Reflections; +import org.egov.encryption.util.JsonPathConverter; +import org.egov.encryption.util.MdmsFetcher; +import org.egov.tracer.model.CustomException; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.web.client.RestTemplate; import javax.annotation.PostConstruct; import java.util.*; +@Slf4j @Service public class MaskingService { - Map maskingTechniqueMap; + Map maskingPatternMap = new HashMap<>(); + @Autowired + private EncProperties encProperties; + @Autowired + private RestTemplate restTemplate; + @Autowired + private ObjectMapper objectMapper; + @Autowired + private MdmsFetcher mdmsFetcher; @PostConstruct - private void init() throws IllegalAccessException, InstantiationException { - maskingTechniqueMap = new HashMap<>(); - - Reflections reflections = new Reflections(getClass().getPackage().getName()); - Set> maskingTechniques = reflections.getSubTypesOf(Masking.class); - for(Class maskingTechnique : maskingTechniques) { - Masking masking = maskingTechnique.newInstance(); - maskingTechniqueMap.put(masking.getMaskingTechnique(), masking); + private void initMaskingPatternMap() { + try { + JSONArray maskingPatternListJSON = mdmsFetcher.getMaskingMdmsForFilter(null); + for (int i = 0; i < maskingPatternListJSON.size(); i++) { + Map obj = objectMapper.convertValue(maskingPatternListJSON.get(i), Map.class); + maskingPatternMap.put(obj.get("patternId"), obj.get("pattern")); + } + } catch (Exception e) { + log.error(ErrorConstants.MASKING_PATTER_READING_ERROR_MESSAGE, e); + throw new CustomException(ErrorConstants.MASKING_PATTERN_READING_ERROR, ErrorConstants.MASKING_PATTER_READING_ERROR_MESSAGE); } } public T maskData(T data, Attribute attribute) { - Masking masking = maskingTechniqueMap.get(attribute.getMaskingTechnique()); + String value = String.valueOf(data); + String patternId = attribute.getPatternId(); + String maskingRegex = maskingPatternMap.get(patternId); + value = value.replaceAll(maskingRegex, "*"); - return masking.maskData(data); + return (T) value; } - public JsonNode maskData(JsonNode decryptedNode, List attributes) { + public JsonNode maskData(JsonNode decryptedNode, List attributes, UniqueIdentifier uniqueIdentifier, RequestInfo requestInfo) { JsonNode maskedNode = decryptedNode.deepCopy(); - - for(Attribute attribute : attributes) { - JsonNode jsonNode = JacksonUtils.filterJsonNodeForPaths(maskedNode, Arrays.asList(attribute.getJsonPath())); - + for (Attribute attribute : attributes) { + JsonNode jsonNode = JacksonUtils.filterJsonNodeForPaths(maskedNode, + JsonPathConverter.convertToArrayJsonPaths(Arrays.asList(attribute.getJsonPath()))); jsonNode = JSONBrowseUtil.mapValues(jsonNode, value -> maskData(value, attribute)); - maskedNode = JacksonUtils.merge(jsonNode, maskedNode); } - + if (requestInfo.getPlainAccessRequest() != null && requestInfo.getPlainAccessRequest().getRecordId() != null) { + maskedNode = addPlainRequestAccessValues((ArrayNode) maskedNode, (ArrayNode) decryptedNode, attributes, uniqueIdentifier, requestInfo); + } return maskedNode; } + private JsonNode addPlainRequestAccessValues(ArrayNode maskedArray, ArrayNode decryptedArray, + List attributes, + UniqueIdentifier uniqueIdentifier, + RequestInfo requestInfo) { + String recordId = requestInfo.getPlainAccessRequest().getRecordId(); + List plainRequestFields = requestInfo.getPlainAccessRequest().getPlainRequestFields(); + for (int i = 0; i < maskedArray.size(); i++) { + JsonNode maskedNode = maskedArray.get(i); + JsonNode decryptedNode = decryptedArray.get(i); + String nodeUuid = maskedNode.at(uniqueIdentifier.getJsonPath()).asText(); + if (recordId.equals(nodeUuid)) { + JsonNode plainNode = createPlainNode(decryptedNode, plainRequestFields, attributes); + plainNode = JacksonUtils.merge(plainNode, maskedNode); + maskedArray.remove(i); + maskedArray.insert(i, plainNode); + } + } + return maskedArray; + } + + private JsonNode createPlainNode(JsonNode decryptedNode, List plainRequestFields, + List attributes) { + JsonNode plainNode = decryptedNode.deepCopy(); + List plainPaths = new ArrayList<>(); + for (Attribute attribute : attributes) { + if (plainRequestFields.contains(attribute.getName())) { + plainPaths.add(attribute.getJsonPath()); + } + } + plainNode = JacksonUtils.filterJsonNodeForPaths(plainNode, plainPaths); + return plainNode; + } + } diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/Attribute.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/Attribute.java index 6222ba5e941..5beca1a8f66 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/Attribute.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/Attribute.java @@ -1,6 +1,5 @@ package org.egov.encryption.models; - import lombok.*; @Getter @@ -8,12 +7,14 @@ @Builder @AllArgsConstructor @NoArgsConstructor -@EqualsAndHashCode(of = {"jsonPath"}) -@ToString public class Attribute { - private String jsonPath; - private String maskingTechnique; - private String type; + private String name = null; + + private String jsonPath = null; + + private String patternId = null; + + private Visibility defaultVisibility = null; -} \ No newline at end of file +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AttributeAccess.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AttributeAccess.java index 40034d4f380..8210877c1bf 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AttributeAccess.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AttributeAccess.java @@ -7,20 +7,12 @@ @Builder @AllArgsConstructor @NoArgsConstructor -@EqualsAndHashCode -@ToString public class AttributeAccess { - private Attribute attribute; - private AccessType accessType; + private String attribute = null; - public AttributeAccess(Attribute attribute) { - this.attribute = attribute; - this.accessType = AccessType.PLAIN; - } + private Visibility firstLevelVisibility = null; - @Override - public String toString() { - return attribute + ", AccessType : " + accessType; - } -} \ No newline at end of file + private Visibility secondLevelVisibility = null; + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AttributeVisibility.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AttributeVisibility.java new file mode 100644 index 00000000000..f5dcfe8d085 --- /dev/null +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AttributeVisibility.java @@ -0,0 +1,15 @@ +package org.egov.encryption.models; + +import lombok.*; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class AttributeVisibility { + + private Attribute attribute; + private Visibility visibility; + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AuditObject.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AuditObject.java index 2490e8448e0..80449ace194 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AuditObject.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AuditObject.java @@ -2,6 +2,9 @@ import com.fasterxml.jackson.databind.JsonNode; import lombok.*; +import org.egov.common.contract.request.PlainAccessRequest; + +import java.util.List; @Getter @Setter @@ -16,6 +19,14 @@ public class AuditObject { private Long timestamp; - private JsonNode data; + private String purpose; + + private String model; + + private List entityIds; + + private PlainAccessRequest plainAccessRequest; + + private JsonNode additionalInfo; } diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/MaskingPattern.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/MaskingPattern.java new file mode 100644 index 00000000000..aaa9f4e3c77 --- /dev/null +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/MaskingPattern.java @@ -0,0 +1,16 @@ +package org.egov.encryption.models; + +import lombok.*; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class MaskingPattern { + + private String id = null; + + private String pattern = null; + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/RoleBasedDecryptionPolicy.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/RoleBasedDecryptionPolicy.java new file mode 100644 index 00000000000..21e40f0ce39 --- /dev/null +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/RoleBasedDecryptionPolicy.java @@ -0,0 +1,18 @@ +package org.egov.encryption.models; + +import lombok.*; + +import java.util.List; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class RoleBasedDecryptionPolicy { + + private List roles = null; + + private List attributeAccessList = null; + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/SecurityPolicy.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/SecurityPolicy.java new file mode 100644 index 00000000000..bff9e97724e --- /dev/null +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/SecurityPolicy.java @@ -0,0 +1,22 @@ +package org.egov.encryption.models; + +import lombok.*; + +import java.util.List; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SecurityPolicy { + + private String model = null; + + private UniqueIdentifier uniqueIdentifier = null; + + private List attributes = null; + + private List roleBasedDecryptionPolicy = null; + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/UniqueIdentifier.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/UniqueIdentifier.java new file mode 100644 index 00000000000..f9551bd143c --- /dev/null +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/UniqueIdentifier.java @@ -0,0 +1,16 @@ +package org.egov.encryption.models; + +import lombok.*; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class UniqueIdentifier { + + private String name = null; + + private String jsonPath = null; + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/Visibility.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/Visibility.java new file mode 100644 index 00000000000..395c380ab50 --- /dev/null +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/Visibility.java @@ -0,0 +1,33 @@ +package org.egov.encryption.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + +public enum Visibility { + PLAIN("PLAIN"), + MASKED("MASKED"), + NONE("NONE"); + + private final String value; + + Visibility(String value) { + this.value = value; + } + + @JsonCreator + public static Visibility fromValue(String text) { + for (Visibility b : Visibility.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/ConvertClass.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/ConvertClass.java index b4fb9740262..3adadfc55a0 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/ConvertClass.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/ConvertClass.java @@ -10,16 +10,15 @@ public class ConvertClass { - public static P convertTo(JsonNode jsonNode, Class valueType) throws IOException { + public static P convertTo(JsonNode jsonNode, Class valueType) throws IOException { ObjectMapper objectMapper = new ObjectMapper(new JsonFactory()); - if(jsonNode.isArray()) - { + if (jsonNode.isArray()) { ObjectReader reader = objectMapper.readerFor(objectMapper.getTypeFactory().constructCollectionType(List.class, valueType)); return reader.readValue(jsonNode); } else { - return (P)objectMapper.treeToValue(jsonNode, valueType); + return (P) objectMapper.treeToValue(jsonNode, valueType); } } diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JSONBrowseUtil.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JSONBrowseUtil.java index bc4d88da71f..417c602b351 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JSONBrowseUtil.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JSONBrowseUtil.java @@ -9,36 +9,36 @@ public class JSONBrowseUtil { public static JsonNode mapValues(JsonNode jsonNode, Function valueMapper) { - if(jsonNode.isArray()) { + if (jsonNode.isArray()) { jsonNode = mapValuesForArrayNode((ArrayNode) jsonNode, valueMapper); - } else if(jsonNode.isObject()) { + } else if (jsonNode.isObject()) { jsonNode = mapValuesForObjectNode((ObjectNode) jsonNode, valueMapper); - } else if(jsonNode.isValueNode()) { + } else if (jsonNode.isValueNode()) { jsonNode = mapValuesForValueNode((ValueNode) jsonNode, valueMapper); } return jsonNode; } - private static ArrayNode mapValuesForArrayNode(ArrayNode arrayNode, Function valueMapper) { - for(int i = 0; i < arrayNode.size(); i++) { + private static ArrayNode mapValuesForArrayNode(ArrayNode arrayNode, Function valueMapper) { + for (int i = 0; i < arrayNode.size(); i++) { arrayNode.set(i, mapValues(arrayNode.get(i), valueMapper)); } return arrayNode; } - private static ObjectNode mapValuesForObjectNode(ObjectNode objectNode, Function valueMapper) { + private static ObjectNode mapValuesForObjectNode(ObjectNode objectNode, Function valueMapper) { Iterator fields = objectNode.fieldNames(); - while(fields.hasNext()) { - String field = fields.next(); - objectNode.set(field, mapValues(objectNode.get(field), valueMapper)); + while (fields.hasNext()) { + String field = fields.next(); + objectNode.set(field, mapValues(objectNode.get(field), valueMapper)); } return objectNode; } private static ValueNode mapValuesForValueNode(ValueNode valueNode, Function valueMapper) { - if(valueNode.isNull()) + if (valueNode.isNull()) return NullNode.getInstance(); - return new TextNode(String.valueOf(valueMapper.apply( (T) valueNode.asText()))); + return new TextNode(String.valueOf(valueMapper.apply((T) valueNode.asText()))); } } diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JacksonUtils.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JacksonUtils.java index be7b36ec616..10617f435a2 100644 --- a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JacksonUtils.java +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JacksonUtils.java @@ -15,26 +15,26 @@ public class JacksonUtils { public static JsonNode merge(JsonNode newNode, JsonNode originalNode) { - if(newNode == null || newNode.isNull()) + if (newNode == null || newNode.isNull()) return originalNode; - else if(originalNode == null || originalNode.isNull()) + else if (originalNode == null || originalNode.isNull()) return newNode; - if(newNode.isObject()) - newNode = mergeObjectNodes( (ObjectNode) newNode, (ObjectNode) originalNode); - else if(newNode.isArray()) - newNode = mergeArrayNode( (ArrayNode) newNode, (ArrayNode) originalNode); + if (newNode.isObject()) + newNode = mergeObjectNodes((ObjectNode) newNode, (ObjectNode) originalNode); + else if (newNode.isArray()) + newNode = mergeArrayNode((ArrayNode) newNode, (ArrayNode) originalNode); return newNode; } static ArrayNode mergeArrayNode(ArrayNode newNode, ArrayNode originalNode) { int size = newNode.size(); - if(newNode.size() < originalNode.size()) + if (newNode.size() < originalNode.size()) size = originalNode.size(); for (int i = 0; i < size; i++) { JsonNode jsonNode = merge(newNode.get(i), originalNode.get(i)); - if(i < newNode.size()) + if (i < newNode.size()) newNode.set(i, jsonNode); else newNode.add(jsonNode); @@ -67,14 +67,14 @@ public static JsonNode filterJsonNodeForPaths(JsonNode jsonNode, List fi ObjectMapper mapper = new ObjectMapper(new JsonFactory()); JsonNode filteredNode; - if(jsonNode instanceof ArrayNode) + if (jsonNode instanceof ArrayNode) filteredNode = mapper.createArrayNode(); - else if(jsonNode instanceof ObjectNode) + else if (jsonNode instanceof ObjectNode) filteredNode = mapper.createObjectNode(); else return null; - for(String path : filterPaths) { + for (String path : filterPaths) { JsonNode singlePathFilterNode = filterJsonNodeForPath(jsonNode, path); filteredNode = merge(singlePathFilterNode, filteredNode); } @@ -85,9 +85,9 @@ else if(jsonNode instanceof ObjectNode) static JsonNode filterJsonNodeForPath(JsonNode jsonNode, String filterPath) { ObjectMapper objectMapper = new ObjectMapper(new JsonFactory()); - if(filterPath == null) + if (filterPath == null) return jsonNode; - else if(jsonNode == null) + else if (jsonNode == null) return null; String key = getFirstJsonKeyForPath(filterPath); @@ -99,7 +99,7 @@ else if(jsonNode == null) newNode = objectMapper.createArrayNode(); for (JsonNode value : arrayNode) { JsonNode filteredNode = filterJsonNodeForPath(value, getRemainingJsonKeyForPath(filterPath)); - if(filteredNode != null && ! filteredNode.isNull()) + if (filteredNode != null && !filteredNode.isNull()) ((ArrayNode) newNode).add(filteredNode); } } else { //ObjectNode @@ -107,7 +107,7 @@ else if(jsonNode == null) newNode = objectMapper.createObjectNode(); JsonNode value = objectNode.get(key); JsonNode filteredNode = filterJsonNodeForPath(value, getRemainingJsonKeyForPath(filterPath)); - if(filteredNode != null && ! filteredNode.isNull()) + if (filteredNode != null && !filteredNode.isNull()) ((ObjectNode) newNode).set(key, filteredNode); } } catch (ClassCastException e) { @@ -124,46 +124,46 @@ static String getFirstJsonKeyForPath(String path) { static String getRemainingJsonKeyForPath(String path) { String keys[] = path.split("/", 2); - if(keys.length == 1) + if (keys.length == 1) return null; return keys[1]; } public static JsonNode filterJsonNodeWithFields(JsonNode jsonNode, List filterFields) { - if(checkIfNoFieldExistsInJsonNode(jsonNode, filterFields)) + if (checkIfNoFieldExistsInJsonNode(jsonNode, filterFields)) return null; ObjectMapper mapper = new ObjectMapper(new JsonFactory()); - if(jsonNode.isObject()) { + if (jsonNode.isObject()) { ObjectNode objectNode = (ObjectNode) jsonNode; ObjectNode filteredObjectNode = mapper.createObjectNode(); Iterator fieldIterator = objectNode.fieldNames(); while (fieldIterator.hasNext()) { String field = fieldIterator.next(); - if(filterFields.contains(field) && !objectNode.get(field).isNull()) { + if (filterFields.contains(field) && !objectNode.get(field).isNull()) { filteredObjectNode.set(field, objectNode.get(field)); } else { JsonNode filteredJsonNode = filterJsonNodeWithFields(objectNode.get(field), filterFields); - if(filteredJsonNode != null) { + if (filteredJsonNode != null) { filteredObjectNode.set(field, filteredJsonNode); } } } - if(filteredObjectNode.isEmpty(mapper.getSerializerProvider())) + if (filteredObjectNode.isEmpty(mapper.getSerializerProvider())) return null; return filteredObjectNode; - } else if(jsonNode.isArray()) { + } else if (jsonNode.isArray()) { ArrayNode arrayNode = (ArrayNode) jsonNode; ArrayNode filteredArrayNode = mapper.createArrayNode(); - for(int i = 0; i < arrayNode.size(); i++) { + for (int i = 0; i < arrayNode.size(); i++) { JsonNode filteredJsonNode = filterJsonNodeWithFields(arrayNode.get(i), filterFields); - if(filteredJsonNode == null) { - if(arrayNode.get(i).isArray()) + if (filteredJsonNode == null) { + if (arrayNode.get(i).isArray()) filteredJsonNode = mapper.createArrayNode(); - else if(arrayNode.get(i).isObject()) + else if (arrayNode.get(i).isObject()) filteredJsonNode = mapper.createObjectNode(); else filteredJsonNode = NullNode.getInstance(); @@ -178,8 +178,8 @@ else if(arrayNode.get(i).isObject()) static boolean checkIfNoFieldExistsInJsonNode(JsonNode jsonNode, List fields) { - for(String field : fields) { - if(! String.valueOf(jsonNode.findPath(field)).isEmpty()) + for (String field : fields) { + if (!String.valueOf(jsonNode.findPath(field)).isEmpty()) return false; } return true; diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JsonPathConverter.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JsonPathConverter.java new file mode 100644 index 00000000000..3ba904dbd8f --- /dev/null +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JsonPathConverter.java @@ -0,0 +1,15 @@ +package org.egov.encryption.util; + + +import java.util.ArrayList; +import java.util.List; + +public class JsonPathConverter { + + public static List convertToArrayJsonPaths(List jsonPaths) { + List arrayJsonPaths = new ArrayList<>(); + jsonPaths.stream().map(path -> "*/" + path).forEach(arrayJsonPaths::add); + return arrayJsonPaths; + } + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/MdmsFetcher.java b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/MdmsFetcher.java new file mode 100644 index 00000000000..4447191d736 --- /dev/null +++ b/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/MdmsFetcher.java @@ -0,0 +1,67 @@ +package org.egov.encryption.util; + +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.utils.MultiStateInstanceUtil; +import org.egov.encryption.config.EncClientConstants; +import org.egov.encryption.config.EncProperties; +import org.egov.encryption.config.ErrorConstants; +import org.egov.mdms.model.*; +import org.egov.tracer.model.CustomException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; +import org.slf4j.MDC; +import java.util.Arrays; + +@Slf4j +@Component +public class MdmsFetcher { + + @Autowired + private EncProperties encProperties; + @Autowired + private RestTemplate restTemplate; + + @Autowired + private MultiStateInstanceUtil multiStateInstanceUtil; + + public static final String TENANTID_MDC_STRING = "TENANTID"; + + public JSONArray getSecurityMdmsForFilter(String filter) { + return getMdmsForFilter(filter, EncClientConstants.MDMS_SECURITY_POLICY_MASTER_NAME); + } + + public JSONArray getMaskingMdmsForFilter(String filter) { + return getMdmsForFilter(filter, EncClientConstants.MDMS_MASKING_PATTERN_MASTER_NAME); + } + + public JSONArray getMdmsForFilter(String filter, String masterName) { + MasterDetail masterDetail = MasterDetail.builder().name(masterName) + .filter(filter).build(); + ModuleDetail moduleDetail = ModuleDetail.builder().moduleName(EncClientConstants.MDMS_MODULE_NAME) + .masterDetails(Arrays.asList(masterDetail)).build(); + MdmsCriteria mdmsCriteria = MdmsCriteria.builder().tenantId(encProperties.getStateLevelTenantId()) + .moduleDetails(Arrays.asList(moduleDetail)).build(); + + MdmsCriteriaReq mdmsCriteriaReq = MdmsCriteriaReq.builder().requestInfo(RequestInfo.builder().build()) + .mdmsCriteria(mdmsCriteria).build(); + if(multiStateInstanceUtil.getIsEnvironmentCentralInstance()){ + MDC.put(TENANTID_MDC_STRING, encProperties.getStateLevelTenantId()); + } + + try { + ResponseEntity response = + restTemplate.postForEntity(encProperties.getEgovMdmsHost() + encProperties.getEgovMdmsSearchEndpoint(), + mdmsCriteriaReq, MdmsResponse.class); + return response.getBody().getMdmsRes().get(EncClientConstants.MDMS_MODULE_NAME) + .get(masterName); + } catch (Exception e) { + log.error(ErrorConstants.MDMS_FETCH_ERROR_MESSAGE, e); + throw new CustomException(ErrorConstants.MDMS_FETCH_ERROR, ErrorConstants.MDMS_FETCH_ERROR_MESSAGE); + } + } + +} diff --git a/core-services/libraries/enc-client/src/main/resources/enc.properties b/core-services/libraries/enc-client/src/main/resources/enc.properties index 0159a0fc408..f756a7c6675 100644 --- a/core-services/libraries/enc-client/src/main/resources/enc.properties +++ b/core-services/libraries/enc-client/src/main/resources/enc.properties @@ -1,13 +1,14 @@ #------------egov-enc-service config----------------# -egov.enc.host=http://localhost:1234 +egov.enc.host=https://msewapunjab.niua.org/ egov.enc.encrypt.endpoint=/egov-enc-service/crypto/v1/_encrypt egov.enc.decrypt.endpoint=/egov-enc-service/crypto/v1/_decrypt #----------------MDMS config---------------------# -egov.mdms.host=https://dev.digit.org +egov.mdms.host=https://msewapunjab.niua.org/ egov.mdms.search.endpoint=/egov-mdms-service/v1/_search -egov.state.level.tenant.id=pb +state.level.tenant.id=pb +default.encrypt.data.type=Normal #-----------Kafka Audit Topic Name------------# kafka.topic.audit=audit_data diff --git a/core-services/libraries/enc-client/src/test/java/org/egov/encryption/EncryptionServiceImplTest.java b/core-services/libraries/enc-client/src/test/java/org/egov/encryption/EncryptionServiceImplTest.java index d061b84798b..0fe09c2691b 100644 --- a/core-services/libraries/enc-client/src/test/java/org/egov/encryption/EncryptionServiceImplTest.java +++ b/core-services/libraries/enc-client/src/test/java/org/egov/encryption/EncryptionServiceImplTest.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; +import org.egov.common.contract.request.RequestInfo; import org.egov.common.contract.request.Role; import org.egov.common.contract.request.User; import org.junit.Before; @@ -22,11 +23,10 @@ //@SpringBootTest(classes = TestConfiguration.class) public class EncryptionServiceImplTest { - @Autowired - private EncryptionServiceImpl encryptionServiceImpl; - ObjectMapper mapper; User user; + @Autowired + private EncryptionServiceImpl encryptionServiceImpl; @Before public void init() throws InstantiationException, IllegalAccessException, IOException { @@ -42,7 +42,7 @@ public void init() throws InstantiationException, IllegalAccessException, IOExce @Ignore @Test public void encryptValueTest() throws IOException { - log.info( encryptionServiceImpl.encryptValue(1, "pb", "Normal") ); + log.info(encryptionServiceImpl.encryptValue(1, "pb", "Normal")); } @Ignore @@ -61,40 +61,43 @@ public void encryptJsonUsingKey() throws IOException { @Ignore @Test public void decryptJsonArrayUsingRoles() throws IOException { + RequestInfo requestInfo = new RequestInfo(); JsonNode ciphertext = mapper.readTree("[{\"User\":{\"mobileNumber\":\"341642|WfYfJPRug15R2wFh17PlQr5d9YhNkFk1" + "\",\"name\":\"341642|Ca5NbGHu3aB2ufjrNfZarW1VGBA=\"," + "\"userName\":\"341642|Ca5NbGHu3aB2ufjrNfZarW1VGBA=\",\"gender\":\"male\",\"active\":true," + - "\"type\":\"CITIZEN\",\"password\":\"password\"},\"RequestInfo\":{\"api_id\":\"1\",\"ver\":\"1\"," + - "\"ts\":null,\"action\":\"create\",\"did\":\"\",\"key\":\"\",\"msg_id\":\"\",\"requester_id\":\"\"," + - "\"auth_token\":null}}]"); + "\"type\":\"CITIZEN\",\"password\":\"password\"}}]"); User user = User.builder().roles(Arrays.asList(Role.builder().code("GRO").build())).build(); - JsonNode plaintext = encryptionServiceImpl.decryptJson(ciphertext, "PGR-Complaints-Report", user); + requestInfo.setUserInfo(user); + JsonNode plaintext = encryptionServiceImpl.decryptJson(requestInfo, ciphertext, "PGR-Complaints-Report", + "Report"); log.info(plaintext.toString()); } @Ignore @Test public void decryptJsonObjectUsingRoles() throws IOException { + RequestInfo requestInfo = new RequestInfo(); JsonNode ciphertext = mapper.readTree("{\"User\":{\"mobileNumber\":\"341642|WfYfJPRug15R2wFh17PlQr5d9YhNkFk1" + "\",\"name\":\"341642|Ca5NbGHu3aB2ufjrNfZarW1VGBA=\"," + "\"userName\":\"341642|Ca5NbGHu3aB2ufjrNfZarW1VGBA=\",\"gender\":\"male\",\"active\":true," + - "\"type\":\"CITIZEN\",\"password\":\"password\"},\"RequestInfo\":{\"api_id\":\"1\",\"ver\":\"1\"," + - "\"ts\":null,\"action\":\"create\",\"did\":\"\",\"key\":\"\",\"msg_id\":\"\",\"requester_id\":\"\"," + - "\"auth_token\":null}}"); + "\"type\":\"CITIZEN\",\"password\":\"password\"}}"); User user = User.builder().roles(Arrays.asList(Role.builder().code("GRO").build())).build(); - JsonNode plaintext = encryptionServiceImpl.decryptJson(ciphertext, "PGR-Complaints-Report", user, JsonNode.class); + requestInfo.setUserInfo(user); + JsonNode plaintext = encryptionServiceImpl.decryptJson(requestInfo, ciphertext, "PGR-Complaints-Report", + "Report", JsonNode.class); log.info(plaintext.toString()); } @Ignore @Test public void test() throws IOException { + RequestInfo requestInfo = new RequestInfo(); Map data = new HashMap<>(); data.put("name", "341642|Ca5NbGHu3aB2ufjrNfZarW1VGBA="); data.put("mobileNumber", "341642|WfYfJPRug15R2wFh17PlQr5d9YhNkFk1"); user.setRoles(Arrays.asList(Role.builder().code("CITIZEN").build())); - - data = encryptionServiceImpl.decryptJson(data, "User", user, Map.class); + requestInfo.setUserInfo(user); + data = encryptionServiceImpl.decryptJson(requestInfo, data, "User", "UserSearch", Map.class); log.info(String.valueOf(data)); } diff --git a/core-services/libraries/enc-client/src/test/java/org/egov/encryption/util/JSONBrowseUtilTest.java b/core-services/libraries/enc-client/src/test/java/org/egov/encryption/util/JSONBrowseUtilTest.java index a4bf31afd8d..4bdb9050d81 100644 --- a/core-services/libraries/enc-client/src/test/java/org/egov/encryption/util/JSONBrowseUtilTest.java +++ b/core-services/libraries/enc-client/src/test/java/org/egov/encryption/util/JSONBrowseUtilTest.java @@ -3,14 +3,13 @@ import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ValueNode; import lombok.extern.slf4j.Slf4j; import org.junit.Before; import org.junit.Test; import java.io.IOException; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; @Slf4j public class JSONBrowseUtilTest { @@ -25,7 +24,7 @@ public void init() { @Test public void test() throws IOException { JsonNode jsonNode = mapper.readTree("{\"asd\" : \"qwe\"}"); - jsonNode = JSONBrowseUtil.mapValues(jsonNode, v -> ((String) v).length() ); + jsonNode = JSONBrowseUtil.mapValues(jsonNode, v -> ((String) v).length()); JsonNode expectedNode = mapper.readTree("{\"asd\" : \"3\"}"); diff --git a/core-services/libraries/enc-client/src/test/java/org/egov/encryption/util/JacksonUtilsTest.java b/core-services/libraries/enc-client/src/test/java/org/egov/encryption/util/JacksonUtilsTest.java index 15f6770100c..93c474420dd 100644 --- a/core-services/libraries/enc-client/src/test/java/org/egov/encryption/util/JacksonUtilsTest.java +++ b/core-services/libraries/enc-client/src/test/java/org/egov/encryption/util/JacksonUtilsTest.java @@ -214,5 +214,4 @@ public void test1() throws IOException { } - } \ No newline at end of file diff --git a/core-services/libraries/mdms-client/bin/pom.xml b/core-services/libraries/mdms-client/bin/pom.xml new file mode 100644 index 00000000000..2703d27de82 --- /dev/null +++ b/core-services/libraries/mdms-client/bin/pom.xml @@ -0,0 +1,138 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 1.5.22.RELEASE + + + org.egov + mdms-client + 0.0.3-SNAPSHOT + + + repo.egovernments.org + eGov ERP Releases Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/releases/ + + + repo.egovernments.org + eGov ERP Snapshots Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/ + + + + 2.17.1 + UTF-8 + 1.8 + UTF-8 + 3.3.9 + 1.18.8 + 2.6 + + + + org.springframework.boot + spring-boot-starter-web + + + commons-lang + commons-lang + ${commons-lang-version} + + + org.apache.commons + commons-lang3 + 3.0 + + + org.springframework.boot + spring-boot-devtools + runtime + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.egov.services + services-common + 0.9.0 + + + com.jayway.jsonpath + json-path + 2.2.0 + + + org.json + json + 20160810 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + 2.7.9 + + + com.fasterxml.jackson.core + jackson-databind + 2.7.9 + + + org.egov.services + tracer + 1.1.4-SNAPSHOT + + + + + repo.egovernments.org.snapshots + eGov ERP Snapshots Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/ + + + repo.egovernments.org + eGov ERP Releases Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/releases/ + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + exec + + + + + + + org.projectlombok + lombok + + + org.springframework.boot + spring-boot-devtools + + + + + + + diff --git a/core-services/libraries/mdms-client/bin/settings.xml b/core-services/libraries/mdms-client/bin/settings.xml new file mode 100644 index 00000000000..092c5ee4b49 --- /dev/null +++ b/core-services/libraries/mdms-client/bin/settings.xml @@ -0,0 +1,23 @@ + + + + + nexus + central + https://nexus-repo.egovernments.org/nexus/content/groups/public/ + + + + + repo.egovernments.org + ${nexus.user} + ${nexus.password} + + + + com.versioneye + + diff --git a/core-services/libraries/mdms-client/pom.xml b/core-services/libraries/mdms-client/pom.xml index 2703d27de82..4af829ef4f5 100644 --- a/core-services/libraries/mdms-client/pom.xml +++ b/core-services/libraries/mdms-client/pom.xml @@ -65,7 +65,7 @@ org.egov.services services-common - 0.9.0 + 1.0.1-SNAPSHOT com.jayway.jsonpath @@ -90,7 +90,7 @@ org.egov.services tracer - 1.1.4-SNAPSHOT + 1.1.5-SNAPSHOT diff --git a/core-services/libraries/services-common/pom.xml b/core-services/libraries/services-common/pom.xml index fa64011628b..c559c23a25a 100644 --- a/core-services/libraries/services-common/pom.xml +++ b/core-services/libraries/services-common/pom.xml @@ -32,6 +32,23 @@ 1.16.12 true + + org.springframework + spring-beans + 3.0.5.RELEASE + + + org.springframework + spring-context + 4.1.3.RELEASE + + + org.springframework.boot + spring-boot-starter-parent + 1.3.2.RELEASE + + pom + com.fasterxml.jackson.core jackson-annotations @@ -43,6 +60,7 @@ 2.0.2 compile + diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/constants/ServiceCommonConstants.java b/core-services/libraries/services-common/src/main/java/org/egov/common/constants/ServiceCommonConstants.java new file mode 100644 index 00000000000..b404466b374 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/constants/ServiceCommonConstants.java @@ -0,0 +1,13 @@ +package org.egov.common.constants; + +public class ServiceCommonConstants { + public static final String EMPTY_STRING = ""; + + public static final String RES_MESSAGE_ID = "uief87324"; + + public static final String SUCCESSFUL_STATUS = "successful"; + + public static final String FAILED_STATUS = "failed"; + + public static final String SET_KEYWORD = "set"; +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdGenerationRequest.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdGenerationRequest.java new file mode 100644 index 00000000000..b7aff5085d2 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdGenerationRequest.java @@ -0,0 +1,23 @@ +package org.egov.common.contract.idgen; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.request.RequestInfo; + +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class IdGenerationRequest { + + @JsonProperty("RequestInfo") + private RequestInfo requestInfo; + + private List idRequests; + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdGenerationResponse.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdGenerationResponse.java new file mode 100644 index 00000000000..0dbbac681d9 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdGenerationResponse.java @@ -0,0 +1,21 @@ +package org.egov.common.contract.idgen; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.response.ResponseInfo; + +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class IdGenerationResponse { + + private ResponseInfo responseInfo; + + private List idResponses; + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdRequest.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdRequest.java new file mode 100644 index 00000000000..8e7dadc11cc --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdRequest.java @@ -0,0 +1,28 @@ +package org.egov.common.contract.idgen; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class IdRequest { + + @JsonProperty("idName") + @NotNull + private String idName; + + @NotNull + @JsonProperty("tenantId") + private String tenantId; + + @JsonProperty("format") + private String format; + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdResponse.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdResponse.java new file mode 100644 index 00000000000..7161adf43b9 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/idgen/IdResponse.java @@ -0,0 +1,16 @@ +package org.egov.common.contract.idgen; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class IdResponse { + + private String id; + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/Address.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/Address.java new file mode 100644 index 00000000000..85d38d5a3ff --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/Address.java @@ -0,0 +1,45 @@ +package org.egov.common.contract.models; + +import lombok.*; +import org.egov.common.contract.user.enums.AddressType; + + +import java.util.Date; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@EqualsAndHashCode(of = {"id"}) +public class Address { + private String pinCode; + private String city; + private String address; + private AddressType type; + private Long id; + private String tenantId; + private Long userId; + private String addressType; + private Long LastModifiedBy; + private Date LastModifiedDate; + + boolean isInvalid() { + return isPinCodeInvalid() + || isCityInvalid() + || isAddressInvalid(); + } + + + + boolean isPinCodeInvalid() { + return pinCode != null && pinCode.length() > 10; + } + + boolean isCityInvalid() { + return city != null && city.length() > 300; + } + + boolean isAddressInvalid() { + return address != null && address.length() > 300; + } +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/AuditDetails.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/AuditDetails.java new file mode 100644 index 00000000000..8a8b0fae5fb --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/AuditDetails.java @@ -0,0 +1,32 @@ +package org.egov.common.contract.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + + +/** + * Collection of audit related fields used by most models + */ + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +public class AuditDetails { + @JsonProperty("createdBy") + private String createdBy = null; + + @JsonProperty("lastModifiedBy") + private String lastModifiedBy = null; + + @JsonProperty("createdTime") + private Long createdTime = null; + + @JsonProperty("lastModifiedTime") + private Long lastModifiedTime = null; + + +} + diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/Document.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/Document.java new file mode 100644 index 00000000000..5bdf6899771 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/Document.java @@ -0,0 +1,27 @@ +package org.egov.common.contract.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class Document { + @JsonProperty("id") + private String id = null; + + @JsonProperty("documentType") + private String documentType = null; + + @JsonProperty("fileStore") + private String fileStore = null; + + @JsonProperty("documentUid") + private String documentUid = null; + + @JsonProperty("additionalDetails") + private Object additionalDetails = null; + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/RequestInfoWrapper.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/RequestInfoWrapper.java new file mode 100644 index 00000000000..fef3038c5dd --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/RequestInfoWrapper.java @@ -0,0 +1,16 @@ +package org.egov.common.contract.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.request.RequestInfo; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class RequestInfoWrapper { + + @JsonProperty("RequestInfo") + private RequestInfo requestInfo; +} \ No newline at end of file diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/Workflow.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/Workflow.java new file mode 100644 index 00000000000..64e4da0a135 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/models/Workflow.java @@ -0,0 +1,41 @@ +package org.egov.common.contract.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class Workflow { + @JsonProperty("action") + private String action = null; + + @JsonProperty("comments") + private String comments = null; + + @JsonProperty("documents") + @Valid + private List documents = null; + + @JsonProperty("assignes") + @Valid + private List assignes = null; + + @JsonProperty("rating") + private Integer rating = null; + + public Workflow addDocumentsItem(Document documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/request/PlainAccessRequest.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/request/PlainAccessRequest.java new file mode 100644 index 00000000000..06d33720163 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/request/PlainAccessRequest.java @@ -0,0 +1,17 @@ +package org.egov.common.contract.request; + +import lombok.*; + +import java.util.List; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +@EqualsAndHashCode +public class PlainAccessRequest { + private String recordId; + + private List plainRequestFields; +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/request/RequestInfo.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/request/RequestInfo.java index 6443858c031..1ad4c2dde99 100644 --- a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/request/RequestInfo.java +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/request/RequestInfo.java @@ -1,12 +1,7 @@ package org.egov.common.contract.request; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; +import lombok.*; + @Getter @Setter @@ -35,5 +30,7 @@ public class RequestInfo { private String correlationId; + private PlainAccessRequest plainAccessRequest; + private User userInfo; } \ No newline at end of file diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/request/User.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/request/User.java index 16a3b80a9f8..57f623d86e8 100644 --- a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/request/User.java +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/request/User.java @@ -1,16 +1,9 @@ package org.egov.common.contract.request; -import java.util.List; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; +import lombok.*; import javax.validation.constraints.Size; +import java.util.List; @Getter @Setter diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ErrorField.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ErrorField.java index 4a99a383a2e..32f2aef1418 100644 --- a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ErrorField.java +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ErrorField.java @@ -1,12 +1,6 @@ package org.egov.common.contract.response; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.NonNull; -import lombok.Setter; +import lombok.*; @Getter @Setter diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ErrorResponse.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ErrorResponse.java index ef283034b38..dbc11e1d53d 100644 --- a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ErrorResponse.java +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ErrorResponse.java @@ -1,11 +1,6 @@ package org.egov.common.contract.response; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; @Getter @Setter diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ResponseInfo.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ResponseInfo.java index c8d1e4b3912..5e2a8ed2f66 100644 --- a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ResponseInfo.java +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/response/ResponseInfo.java @@ -1,12 +1,6 @@ package org.egov.common.contract.response; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; +import lombok.*; @Getter @Setter diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/CreateUserRequest.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/CreateUserRequest.java new file mode 100644 index 00000000000..ac806885f8b --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/CreateUserRequest.java @@ -0,0 +1,21 @@ +package org.egov.common.contract.user; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.contract.request.User; + +@AllArgsConstructor +@Getter +@NoArgsConstructor +public class CreateUserRequest { + + @JsonProperty("requestInfo") + private RequestInfo requestInfo; + + @JsonProperty("user") + private User user; + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/OtpValidationRequest.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/OtpValidationRequest.java new file mode 100644 index 00000000000..470992cc9d9 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/OtpValidationRequest.java @@ -0,0 +1,17 @@ +package org.egov.common.contract.user; + + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@AllArgsConstructor +@Builder +@Getter +@EqualsAndHashCode +public class OtpValidationRequest { + private String otpReference; + private String mobileNumber; + protected String tenantId; +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/UserDetailResponse.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/UserDetailResponse.java new file mode 100644 index 00000000000..1ebd0ae4650 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/UserDetailResponse.java @@ -0,0 +1,21 @@ +package org.egov.common.contract.user; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.egov.common.contract.request.User; +import org.egov.common.contract.response.ResponseInfo; + +import java.util.List; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +public class UserDetailResponse { + @JsonProperty("responseInfo") + ResponseInfo responseInfo; + + @JsonProperty("user") + List user; +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/UserSearchRequest.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/UserSearchRequest.java new file mode 100644 index 00000000000..a8dae66e541 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/UserSearchRequest.java @@ -0,0 +1,68 @@ +package org.egov.common.contract.user; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; +import org.egov.common.contract.request.RequestInfo; + +import java.util.Collections; +import java.util.List; + +@Getter +@Setter +public class UserSearchRequest { + + @JsonProperty("RequestInfo") + private RequestInfo requestInfo; + + @JsonProperty("uuid") + private List uuid; + + @JsonProperty("id") + private List id; + + @JsonProperty("userName") + private String userName; + + @JsonProperty("name") + private String name; + + @JsonProperty("mobileNumber") + private String mobileNumber; + + @JsonProperty("aadhaarNumber") + private String aadhaarNumber; + + @JsonProperty("pan") + private String pan; + + @JsonProperty("emailId") + private String emailId; + + @JsonProperty("fuzzyLogic") + private boolean fuzzyLogic; + + @JsonProperty("active") + @Setter + private Boolean active; + + @JsonProperty("tenantId") + private String tenantId; + + @JsonProperty("pageSize") + private int pageSize; + + @JsonProperty("pageNumber") + private int pageNumber = 0; + + @JsonProperty("sort") + private List sort = Collections.singletonList("name"); + + @JsonProperty("userType") + private String userType; + + @JsonProperty("roleCodes") + private List roleCodes; + + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/config/UserServiceConstants.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/config/UserServiceConstants.java new file mode 100644 index 00000000000..2edd06fbf40 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/config/UserServiceConstants.java @@ -0,0 +1,24 @@ +package org.egov.common.contract.user.config; + +public class UserServiceConstants { + + public static final String EMAIL_UPDATION_CODE = "EMAIL_UPDATED"; + + public static final String INVALID_USER_REQUEST = "UserRequest is Invalid"; + + public static final String ROLECODE_MISSING_CODE = "egs_001"; + public static final String ROLECODE_MISSING_FIELD = "roles"; + public static final String ROLECODE_MISSING_MESSAGE = "Atleast One Role Is Required."; + public static final String USER_CLIENT_ID = "egov-user-client"; + public static final String IP_HEADER_NAME = "x-real-ip"; + + + public static final String PATTERN_NAME = "^[^\\\\$\\\"<>?\\\\\\\\~`!@#$%^()+={}\\\\[\\\\]*,:;“”‘’]*$"; + + + public static final String PATTERN_GENDER = "^[a-zA-Z ]*$"; + public static final String PATTERN_MOBILE = "(^$|[0-9]{10})"; + public static final String PATTERN_CITY = "^[a-zA-Z. ]*$"; + public static final String PATTERN_TENANT = "^[a-zA-Z. ]*$"; + public static final String PATTERN_PINCODE = "^[1-9][0-9]{5}$"; +} \ No newline at end of file diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/AddressType.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/AddressType.java new file mode 100644 index 00000000000..75ba54f78f0 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/AddressType.java @@ -0,0 +1,25 @@ +package org.egov.common.contract.user.enums; + +import com.fasterxml.jackson.annotation.JsonCreator; + +public enum AddressType { + // This order should not be interrupted + PERMANENT("PERMANENT"), CORRESPONDENCE("CORRESPONDENCE"), USUALADDRESS("CORRESPONDENCE"), EVENTADDRESS("CORRESPONDENCE"), PRESENTADDRESS("CORRESPONDENCE"), PROPERTYADDRESS("CORRESPONDENCE"); + + @JsonCreator + public static AddressType fromValue(String text) { + for (AddressType b : AddressType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + private String value; + + AddressType(String value) { + this.value = value; + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/BloodGroup.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/BloodGroup.java new file mode 100644 index 00000000000..1eb56b59a95 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/BloodGroup.java @@ -0,0 +1,32 @@ +package org.egov.common.contract.user.enums; + +import com.fasterxml.jackson.annotation.JsonCreator; +import lombok.Getter; + +@Getter +public enum BloodGroup { + A_POSITIVE("A+"), + B_POSITIVE("B+"), + O_POSITIVE("O+"), + AB_POSITIVE("AB+"), + A_NEGATIVE("A-"), + B_NEGATIVE("B-"), + AB_NEGATIVE("AB-"), + O_NEGATIVE("O-"); + + private String value; + + BloodGroup(String value) { + this.value = value; + } + + @JsonCreator + public static BloodGroup fromValue(String text) { + for (BloodGroup b : BloodGroup.values()) { + if (String.valueOf(b.value).equalsIgnoreCase(text) || String.valueOf(b.name()).equalsIgnoreCase(text)) { + return b; + } + } + return null; + } +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/Gender.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/Gender.java new file mode 100644 index 00000000000..3029b6daab9 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/Gender.java @@ -0,0 +1,46 @@ +/* + * eGov suite of products aim to improve the internal efficiency,transparency, + * accountability and the service delivery of the government organizations. + * + * Copyright (C) 2016 eGovernments Foundation + * + * The updated version of eGov suite of products as by eGovernments Foundation + * is available at http://www.egovernments.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/ or + * http://www.gnu.org/licenses/gpl.html . + * + * In addition to the terms of the GPL license to be adhered to in using this + * program, the following additional terms are to be complied with: + * + * 1) All versions of this program, verbatim or modified must carry this + * Legal Notice. + * + * 2) Any misrepresentation of the origin of the material is prohibited. It + * is required that all modified versions of this material be marked in + * reasonable ways as different from the original version. + * + * 3) This license does not grant any rights to any user of the program + * with regards to rights under trademark law for use of the trade names + * or trademarks of eGovernments Foundation. + * + * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. + */ + +package org.egov.common.contract.user.enums; + +public enum Gender { + //This order should not be interrupted + FEMALE, MALE, OTHERS, TRANSGENDER; +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/GuardianRelation.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/GuardianRelation.java new file mode 100644 index 00000000000..4c9fc8a18ff --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/GuardianRelation.java @@ -0,0 +1,45 @@ +/* + * eGov suite of products aim to improve the internal efficiency,transparency, + * accountability and the service delivery of the government organizations. + * + * Copyright (C) 2016 eGovernments Foundation + * + * The updated version of eGov suite of products as by eGovernments Foundation + * is available at http://www.egovernments.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/ or + * http://www.gnu.org/licenses/gpl.html . + * + * In addition to the terms of the GPL license to be adhered to in using this + * program, the following additional terms are to be complied with: + * + * 1) All versions of this program, verbatim or modified must carry this + * Legal Notice. + * + * 2) Any misrepresentation of the origin of the material is prohibited. It + * is required that all modified versions of this material be marked in + * reasonable ways as different from the original version. + * + * 3) This license does not grant any rights to any user of the program + * with regards to rights under trademark law for use of the trade names + * or trademarks of eGovernments Foundation. + * + * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. + */ + +package org.egov.common.contract.user.enums; + +public enum GuardianRelation { + FATHER, MOTHER, HUSBAND, OTHER; +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/UserType.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/UserType.java new file mode 100644 index 00000000000..ab8e9cd8713 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/enums/UserType.java @@ -0,0 +1,57 @@ +/* + * eGov suite of products aim to improve the internal efficiency,transparency, + * accountability and the service delivery of the government organizations. + * + * Copyright (C) 2016 eGovernments Foundation + * + * The updated version of eGov suite of products as by eGovernments Foundation + * is available at http://www.egovernments.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/ or + * http://www.gnu.org/licenses/gpl.html . + * + * In addition to the terms of the GPL license to be adhered to in using this + * program, the following additional terms are to be complied with: + * + * 1) All versions of this program, verbatim or modified must carry this + * Legal Notice. + * + * 2) Any misrepresentation of the origin of the material is prohibited. It + * is required that all modified versions of this material be marked in + * reasonable ways as different from the original version. + * + * 3) This license does not grant any rights to any user of the program + * with regards to rights under trademark law for use of the trade names + * or trademarks of eGovernments Foundation. + * + * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. + */ + +package org.egov.common.contract.user.enums; + +import com.fasterxml.jackson.annotation.JsonCreator; + +public enum UserType { + CITIZEN, EMPLOYEE, SYSTEM, BUSINESS; + + @JsonCreator + public static UserType fromValue(String text) { + for (UserType userType : UserType.values()) { + if (String.valueOf(userType).equalsIgnoreCase(text)) { + return userType; + } + } + return null; + } +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/exception/InvalidUserCreateException.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/exception/InvalidUserCreateException.java new file mode 100644 index 00000000000..e2f1cdeb3fc --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/exception/InvalidUserCreateException.java @@ -0,0 +1,16 @@ +package org.egov.common.contract.user.exception; + +import lombok.Getter; +import org.egov.common.contract.request.User; + +@Getter +public class InvalidUserCreateException extends RuntimeException { + + private static final long serialVersionUID = -761312648494992125L; + private User user; + + public InvalidUserCreateException(User user) { + this.user = user; + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/exception/InvalidUserUpdateException.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/exception/InvalidUserUpdateException.java new file mode 100644 index 00000000000..bef41a28850 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/user/exception/InvalidUserUpdateException.java @@ -0,0 +1,16 @@ +package org.egov.common.contract.user.exception; + +import lombok.Getter; +import org.egov.common.contract.request.User; + +public class InvalidUserUpdateException extends RuntimeException { + + private static final long serialVersionUID = 580361940613077431L; + @Getter + private User user; + + public InvalidUserUpdateException(User user) { + this.user = user; + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/Action.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/Action.java new file mode 100644 index 00000000000..accece7876d --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/Action.java @@ -0,0 +1,57 @@ +package org.egov.common.contract.workflow; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +import javax.validation.Valid; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; +import org.egov.common.contract.models.AuditDetails; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +@EqualsAndHashCode(of = {"tenantId", "currentState", "action"}) +public class Action { + + @Size(max = 256) + @JsonProperty("uuid") + private String uuid; + + @Size(max = 256) + @JsonProperty("tenantId") + private String tenantId; + + @Size(max = 256) + @JsonProperty("currentState") + private String currentState; + + @Size(max = 256) + @JsonProperty("action") + private String action; + + @Size(max = 256) + @JsonProperty("nextState") + private String nextState; + + @Size(max = 1024) + @JsonProperty("roles") + @Valid + private List roles; + + private AuditDetails auditDetails; + + + public Action addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/BusinessService.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/BusinessService.java new file mode 100644 index 00000000000..9cd28d08b81 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/BusinessService.java @@ -0,0 +1,89 @@ +package org.egov.common.contract.workflow; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.models.AuditDetails; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +@EqualsAndHashCode(of = {"tenantId", "businessService"}) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class BusinessService { + + @Size(max = 256) + @JsonProperty("tenantId") + private String tenantId = null; + + @Size(max = 256) + @JsonProperty("uuid") + private String uuid = null; + + @Size(max = 256) + @JsonProperty("businessService") + private String businessService = null; + + @Size(max = 256) + @JsonProperty("business") + private String business = null; + + @Size(max = 1024) + @JsonProperty("getUri") + private String getUri = null; + + @Size(max = 1024) + @JsonProperty("postUri") + private String postUri = null; + + @JsonProperty("businessServiceSla") + private Long businessServiceSla = null; + + @NotNull + @Valid + @JsonProperty("states") + private List states = null; + + @JsonProperty("auditDetails") + private AuditDetails auditDetails = null; + + + public BusinessService addStatesItem(State statesItem) { + if (this.states == null) { + this.states = new ArrayList<>(); + } + this.states.add(statesItem); + return this; + } + + + /** + * Returns the currentState with the given uuid if not present returns null + * + * @param uuid the uuid of the currentState to be returned + * @return + */ + public State getStateFromUuid(String uuid) { + State state = null; + if (this.states != null) { + for (State s : this.states) { + if (s.getUuid().equalsIgnoreCase(uuid)) { + state = s; + break; + } + } + } + return state; + } + + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/BusinessServiceResponse.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/BusinessServiceResponse.java new file mode 100644 index 00000000000..d2eaa7e105c --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/BusinessServiceResponse.java @@ -0,0 +1,37 @@ +package org.egov.common.contract.workflow; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.response.ResponseInfo; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.util.ArrayList; +import java.util.List; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +@ToString +public class BusinessServiceResponse { + + @JsonProperty("ResponseInfo") + private ResponseInfo responseInfo; + + @JsonProperty("BusinessServices") + @Valid + @NotNull + private List businessServices; + + + public BusinessServiceResponse addBusinessServiceItem(BusinessService businessServiceItem) { + if (this.businessServices == null) { + this.businessServices = new ArrayList<>(); + } + this.businessServices.add(businessServiceItem); + return this; + } + + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/ProcessInstance.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/ProcessInstance.java new file mode 100644 index 00000000000..001d881f695 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/ProcessInstance.java @@ -0,0 +1,76 @@ +package org.egov.common.contract.workflow; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.models.Document; +import org.egov.common.contract.request.User; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@EqualsAndHashCode(of = {"id"}) +@ToString +public class ProcessInstance { + + @Size(max = 64) + @JsonProperty("id") + private String id; + + @NotNull + @Size(max = 128) + @JsonProperty("tenantId") + private String tenantId; + + @NotNull + @Size(max = 128) + @JsonProperty("businessService") + private String businessService; + + @NotNull + @Size(max = 128) + @JsonProperty("businessId") + private String businessId; + + @NotNull + @Size(max = 128) + @JsonProperty("action") + private String action; + + @NotNull + @Size(max = 64) + @JsonProperty("moduleName") + private String moduleName; + + @JsonProperty("state") + private State state; + + + @JsonProperty("comment") + private String comment; + + @JsonProperty("documents") + @Valid + private List documents; + + @JsonProperty("assignes") + private List assignes; + + public ProcessInstance addDocumentsItem(Document documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + if (!this.documents.contains(documentsItem)) + this.documents.add(documentsItem); + + return this; + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/ProcessInstanceRequest.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/ProcessInstanceRequest.java new file mode 100644 index 00000000000..da34016e91f --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/ProcessInstanceRequest.java @@ -0,0 +1,36 @@ +package org.egov.common.contract.workflow; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.request.RequestInfo; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +public class ProcessInstanceRequest { + @JsonProperty("RequestInfo") + private RequestInfo requestInfo; + + @JsonProperty("ProcessInstances") + @Valid + @NotNull + private List processInstances; + + + public ProcessInstanceRequest addProcessInstanceItem(ProcessInstance processInstanceItem) { + if (this.processInstances == null) { + this.processInstances = new ArrayList<>(); + } + this.processInstances.add(processInstanceItem); + return this; + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/ProcessInstanceResponse.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/ProcessInstanceResponse.java new file mode 100644 index 00000000000..30867bfb03a --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/ProcessInstanceResponse.java @@ -0,0 +1,33 @@ +package org.egov.common.contract.workflow; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.response.ResponseInfo; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ProcessInstanceResponse { + @JsonProperty("ResponseInfo") + private ResponseInfo responseInfo; + + @JsonProperty("ProcessInstances") + @Valid + private List processInstances; + + + public ProcessInstanceResponse addProcessInstanceItem(ProcessInstance proceInstanceItem) { + if (this.processInstances == null) { + this.processInstances = new ArrayList<>(); + } + this.processInstances.add(proceInstanceItem); + return this; + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/State.java b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/State.java new file mode 100644 index 00000000000..da9535ec439 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/contract/workflow/State.java @@ -0,0 +1,71 @@ +package org.egov.common.contract.workflow; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.models.AuditDetails; + +import javax.validation.Valid; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +@EqualsAndHashCode(of = {"tenantId", "businessServiceId", "state"}) +public class State { + + @Size(max = 256) + @JsonProperty("uuid") + private String uuid; + + @Size(max = 256) + @JsonProperty("tenantId") + private String tenantId; + + @Size(max = 256) + @JsonProperty("businessServiceId") + private String businessServiceId; + + @JsonProperty("sla") + private Long sla; + + @Size(max = 256) + @JsonProperty("state") + private String state; + + @Size(max = 256) + @JsonProperty("applicationStatus") + private String applicationStatus; + + @JsonProperty("docUploadRequired") + private Boolean docUploadRequired; + + @JsonProperty("isStartState") + private Boolean isStartState; + + @JsonProperty("isTerminateState") + private Boolean isTerminateState; + + @JsonProperty("isStateUpdatable") + private Boolean isStateUpdatable; + + @JsonProperty("actions") + @Valid + private List actions; + + private AuditDetails auditDetails; + + + public State addActionsItem(Action actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } + this.actions.add(actionsItem); + return this; + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/error/ErrorCode.java b/core-services/libraries/services-common/src/main/java/org/egov/common/error/ErrorCode.java new file mode 100644 index 00000000000..e6cf909ec7f --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/error/ErrorCode.java @@ -0,0 +1,17 @@ +package org.egov.common.error; + +public class ErrorCode { + public static final String IS_CREATE_REQUEST_FLAG_NULL_ERROR_MESSAGE = "IsCreateRequest flag being sent to enrichAuditDetails method must not be null"; + + public static final String AUDIT_DETAILS_NULL_ERROR_MESSAGE = "AuditDetails being sent to enrichAuditDetails method must not be null"; + + public static final String REQUEST_INFO_NULL_ERROR_MESSAGE = "RequestInfo being sent to enrichAuditDetails method must not be null"; + + public static final String USER_INFO_NULL_ERROR_MESSAGE = "UserInfo present inside RequestInfo being sent to enrichAuditDetails method must not be null"; + + public static final String USER_UUID_NULL_ERROR_MESSAGE = "User uuid present inside UserInfo being sent to enrichAuditDetails method must not be null"; + + public static final String CREATED_TIME_NULL_ERROR_MESSAGE = "CreatedTime present inside AuditDetails being sent to enrichAuditDetails method must not be null in case of update request"; + + public static final String CREATED_BY_NULL_ERROR_MESSAGE = "CreatedBy present inside AuditDetails being sent to enrichAuditDetails method must not be null in case of update request"; +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/exception/InvalidTenantIdException.java b/core-services/libraries/services-common/src/main/java/org/egov/common/exception/InvalidTenantIdException.java new file mode 100644 index 00000000000..73da025d6c8 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/exception/InvalidTenantIdException.java @@ -0,0 +1,15 @@ +package org.egov.common.exception; + +public class InvalidTenantIdException extends Exception { + + + public InvalidTenantIdException(String message){ + super(message); + } + + /** + * + */ + private static final long serialVersionUID = 1L; + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/exception/MethodNotFoundException.java b/core-services/libraries/services-common/src/main/java/org/egov/common/exception/MethodNotFoundException.java new file mode 100644 index 00000000000..22e7114a2d2 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/exception/MethodNotFoundException.java @@ -0,0 +1,9 @@ +package org.egov.common.exception; + +public class MethodNotFoundException extends RuntimeException { + + public MethodNotFoundException(String message){ + super(message); + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/exception/NullCheckException.java b/core-services/libraries/services-common/src/main/java/org/egov/common/exception/NullCheckException.java new file mode 100644 index 00000000000..9a6c86f9b99 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/exception/NullCheckException.java @@ -0,0 +1,11 @@ +package org.egov.common.exception; + +public class NullCheckException extends RuntimeException { + + public NullCheckException(String message){ + super(message); + } + + private static final long serialVersionUID = 1L; + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/utils/AuditDetailsEnrichmentUtil.java b/core-services/libraries/services-common/src/main/java/org/egov/common/utils/AuditDetailsEnrichmentUtil.java new file mode 100644 index 00000000000..0540b4e4faa --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/utils/AuditDetailsEnrichmentUtil.java @@ -0,0 +1,85 @@ +package org.egov.common.utils; + +import org.egov.common.contract.models.AuditDetails; +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.exception.NullCheckException; + + +import static org.egov.common.error.ErrorCode.*; + +public class AuditDetailsEnrichmentUtil { + + private AuditDetailsEnrichmentUtil(){}; + + /** + * This is a utility method to enrich auditDetails so that modules don't have to write logic to + * enrich auditDetails in case of create and update requests. + * @param auditDetails + * @param requestInfo + * @param isCreateRequest + */ + public static AuditDetails prepareAuditDetails(AuditDetails auditDetails, RequestInfo requestInfo, Boolean isCreateRequest) { + // This method validates if auditDetails, requestInfo and userInfo are not null. + validateInput(auditDetails, requestInfo, isCreateRequest); + + // Check if isCreateRequest flag is true - in this case, enrich createdTime and createdBy fields. + if(isCreateRequest){ + auditDetails = AuditDetails.builder().build(); + auditDetails.setCreatedTime(System.currentTimeMillis()); + auditDetails.setCreatedBy(requestInfo.getUserInfo().getUuid()); + } + + // Update lastModifiedBy and lastModifiedTime fields for both create and update requests. + auditDetails.setLastModifiedTime(System.currentTimeMillis()); + auditDetails.setLastModifiedBy(requestInfo.getUserInfo().getUuid()); + + // Check if isCreateRequest flag is true - in this case, enrich createdTime and createdBy fields. + if(isCreateRequest){ + auditDetails.setCreatedTime(System.currentTimeMillis()); + auditDetails.setCreatedBy(requestInfo.getUserInfo().getUuid()); + } + + return auditDetails; + } + + /** + * This method validates the input fed to enrichAuditDetails method + * @param auditDetails + * @param requestInfo + * @param isCreateRequest + */ + private static void validateInput(AuditDetails auditDetails, RequestInfo requestInfo, Boolean isCreateRequest) { + // Throw null check exception in case isCreateRequest flag is null. + /* if(ObjectUtils.isEmpty(isCreateRequest)) + throw new NullCheckException(IS_CREATE_REQUEST_FLAG_NULL_ERROR_MESSAGE); + + // Throw null check exception in case requestInfo is null. + if(ObjectUtils.isEmpty(requestInfo)) + throw new NullCheckException(REQUEST_INFO_NULL_ERROR_MESSAGE); + + // Throw null check exception in case userInfo within requestInfo is null. + if(ObjectUtils.isEmpty(requestInfo.getUserInfo())) + throw new NullCheckException(USER_INFO_NULL_ERROR_MESSAGE); + + // Throw null check exception in case userInfo within requestInfo is null. + if(ObjectUtils.isEmpty(requestInfo.getUserInfo().getUuid())) + throw new NullCheckException(USER_UUID_NULL_ERROR_MESSAGE); + + // Check whether createdBy and createdTime fields are set within auditDetails in case of update request. + if(!isCreateRequest) { + // Throw null check exception in case auditDetails is null. + if(ObjectUtils.isEmpty(auditDetails)) + throw new NullCheckException(AUDIT_DETAILS_NULL_ERROR_MESSAGE); + + // Throw null check exception in case createdBy within auditDetails is null + if (ObjectUtils.isEmpty(auditDetails.getCreatedBy())) + throw new NullCheckException(CREATED_BY_NULL_ERROR_MESSAGE); + + // Throw null check exception in case createdTime within auditDetails is null + if (ObjectUtils.isEmpty(auditDetails.getCreatedTime())) + throw new NullCheckException(CREATED_TIME_NULL_ERROR_MESSAGE); + }*/ + + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/utils/MultiStateInstanceUtil.java b/core-services/libraries/services-common/src/main/java/org/egov/common/utils/MultiStateInstanceUtil.java new file mode 100644 index 00000000000..9dfa75898cc --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/utils/MultiStateInstanceUtil.java @@ -0,0 +1,137 @@ +package org.egov.common.utils; + +import java.util.regex.Pattern; + +import org.egov.common.exception.InvalidTenantIdException; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Configuration +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class MultiStateInstanceUtil { + + // central-instance configs + public static String SCHEMA_REPLACE_STRING = "{schema}"; + /* + * Represents the length of the tenantId array when it's split by "." + * + * if the array length is equal or lesser than, then the tennatId belong to state level + * + * else it's tenant level + */ + @Value("${state.level.tenantid.length:1}") + private Integer stateLevelTenantIdLength; + + /* + * Boolean field informing whether the deployed server is a multi-state/central-instance + * + */ + @Value("${is.environment.central.instance:false}") + private Boolean isEnvironmentCentralInstance; + + /* + * Index in which to find the schema name in a tenantId split by "." + */ + @Value("${state.schema.index.position.tenantid:1}") + private Integer stateSchemaIndexPositionInTenantId; + + /** + * Method to fetch the state name from the tenantId + * + * @param query + * @param tenantId + * @return + */ + public String replaceSchemaPlaceholder(String query, String tenantId) throws InvalidTenantIdException { + + String finalQuery = null; + if (tenantId.contains(".") && getIsEnvironmentCentralInstance()) { + + if (stateSchemaIndexPositionInTenantId >= tenantId.length()) { + throw new InvalidTenantIdException( + "The tenantId length is smaller than the defined schema index in tenantId for central instance"); + } + String schemaName = tenantId.split("\\.")[getStateSchemaIndexPositionInTenantId()]; + finalQuery = query.replaceAll("(?i)" + Pattern.quote(SCHEMA_REPLACE_STRING), schemaName); + } else { + finalQuery = query.replaceAll("(?i)" + Pattern.quote(SCHEMA_REPLACE_STRING.concat(".")), ""); + } + return finalQuery; + } + + /** + * Method to determine if the given tenantId belong to tenant or state level in + * the current environment + * + * @param tenantId + * @return + */ + public Boolean isTenantIdStateLevel(String tenantId) { + + if (getIsEnvironmentCentralInstance()) { + + int tenantLevel = tenantId.split("\\.").length; + return tenantLevel <= stateLevelTenantIdLength; + } else { + /* + * if the instance is not multi-state/central-instance then tenant is always + * two level + * + * if tenantId contains "." then it is tenant level + */ + return !tenantId.contains("."); + } + } + + /** + * For central instance if the tenantId size is lesser than state level + * length the same will be returned without splitting + * + * if the tenant-id is longer than the given stateTenantlength then the length of tenant-id + * till state-level index will be returned + * (for example if statetenantlength is 1 and tenant-id is 'in.statea.tenantx'. the returned tenant-id will be in.statea) + * + * @param tenantId + * @return + */ + public String getStateLevelTenant(String tenantId) { + + String[] tenantArray = tenantId.split("\\."); + String stateTenant = tenantArray[0]; + + if (getIsEnvironmentCentralInstance()) { + if (getStateLevelTenantIdLength() < tenantArray.length) { + for (int i = 1; i < getStateLevelTenantIdLength(); i++) + stateTenant = stateTenant.concat(".").concat(tenantArray[i]); + } else { + stateTenant = tenantId; + } + } + return stateTenant; + } + + /** + * method to prefix the state specific tag to the topic names + * + * @param tenantId + * @param topic + * @return + */ + public String getStateSpecificTopicName(String tenantId, String topic) { + + String updatedTopic = topic; + if (getIsEnvironmentCentralInstance()) { + + String[] tenants = tenantId.split("\\."); + if (tenants.length > 1) + updatedTopic = tenants[stateSchemaIndexPositionInTenantId].concat("-").concat(topic); + } + return updatedTopic; + } +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/utils/ResponseInfoUtil.java b/core-services/libraries/services-common/src/main/java/org/egov/common/utils/ResponseInfoUtil.java new file mode 100644 index 00000000000..e746fa7c79a --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/utils/ResponseInfoUtil.java @@ -0,0 +1,25 @@ +package org.egov.common.utils; + +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.contract.response.ResponseInfo; + +import static org.egov.common.constants.ServiceCommonConstants.*; + +public class ResponseInfoUtil { + + public static ResponseInfo createResponseInfoFromRequestInfo(final RequestInfo requestInfo, final Boolean success) { + + final String apiId = requestInfo != null ? requestInfo.getApiId() : EMPTY_STRING; + final String ver = requestInfo != null ? requestInfo.getVer() : EMPTY_STRING; + Long ts = null; + if(requestInfo != null) + ts = requestInfo.getTs(); + final String resMsgId = RES_MESSAGE_ID; + final String msgId = requestInfo != null ? requestInfo.getMsgId() : EMPTY_STRING; + final String responseStatus = success ? SUCCESSFUL_STATUS : FAILED_STATUS; + + return ResponseInfo.builder().apiId(apiId).ver(ver).ts(ts).resMsgId(resMsgId).msgId(msgId).resMsgId(resMsgId) + .status(responseStatus).build(); + } + +} diff --git a/core-services/libraries/services-common/src/main/java/org/egov/common/utils/UUIDEnrichmentUtil.java b/core-services/libraries/services-common/src/main/java/org/egov/common/utils/UUIDEnrichmentUtil.java new file mode 100644 index 00000000000..04239791344 --- /dev/null +++ b/core-services/libraries/services-common/src/main/java/org/egov/common/utils/UUIDEnrichmentUtil.java @@ -0,0 +1,82 @@ +package org.egov.common.utils; + +import org.egov.common.exception.MethodNotFoundException; +import org.springframework.util.ReflectionUtils; + +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.stream.IntStream; + +import static org.egov.common.constants.ServiceCommonConstants.SET_KEYWORD; + +public class UUIDEnrichmentUtil { + + private UUIDEnrichmentUtil(){} + + /** + * This method accepts an object of generic type and the field to be enriched. + * If the parent object passed is an instance of List, each of the child objects + * are enriched with random UUIDs. However, if the passed parent object is non-collection + * type, the target field passed is enriched with UUID. + * + * @param obj + * @param field + * @param + */ + public static void enrichRandomUuid(T obj, String field) { + Class objClass = getObjClass(obj); + Method setIdMethod = getMethod(getSetterMethodName(field), objClass); + + if (obj instanceof List) { + IntStream.range(0, ((List) obj).size()) + .forEach(i -> { + ReflectionUtils.invokeMethod(setIdMethod, ((List) obj).get(i), UUID.randomUUID().toString()); + }); + } else { + ReflectionUtils.invokeMethod(setIdMethod, obj, UUID.randomUUID().toString()); + } + } + + /** + * This method accepts an object and returns the + * class the parameter object belongs to + * @param obj + * @param + * @return + */ + private static Class getObjClass(T obj) { + if(obj instanceof List){ + return ((List) obj).stream().findAny().get().getClass(); + }else{ + return obj.getClass(); + } + } + + /** + * This method returns the invokable method from the class + * based on the methodName passed to it + * @param methodName + * @param clazz + * @return + */ + private static Method getMethod(String methodName, Class clazz) { + return Arrays.stream(clazz.getDeclaredMethods()) + .filter(m -> m.getName().equals(methodName)) + .findFirst().orElseThrow(() -> new MethodNotFoundException("Method " + methodName + " not found in class " + clazz.getName())); // Change this + } + + /** + * This method generates and returns the setter method name for the + * field being passed to it + * @param field + * @return + */ + private static String getSetterMethodName(String field) { + return new StringBuilder(SET_KEYWORD) + .append(field.substring(0, 1).toUpperCase()) + .append(field.substring(1)) + .toString(); + } +} diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/ExceptionAdvise.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/ExceptionAdvise.java index d9c4c9334b5..78d7388b1ff 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/ExceptionAdvise.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/ExceptionAdvise.java @@ -5,6 +5,7 @@ import com.jayway.jsonpath.DocumentContext; import com.jayway.jsonpath.JsonPath; import lombok.extern.slf4j.Slf4j; + import org.apache.commons.io.IOUtils; import org.egov.tracer.config.TracerProperties; import org.egov.tracer.http.filters.MultiReadRequestWrapper; @@ -12,6 +13,7 @@ import org.egov.tracer.model.*; import org.egov.tracer.model.Error; import org.slf4j.MDC; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -20,6 +22,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.util.ObjectUtils; import org.springframework.validation.BindException; import org.springframework.validation.BindingResult; import org.springframework.validation.ObjectError; @@ -36,11 +39,12 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; +import java.nio.charset.StandardCharsets; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_MDC; +import static org.egov.tracer.constants.TracerConstants.*; @ControllerAdvice @@ -52,25 +56,26 @@ public class ExceptionAdvise { @Value("${tracer.errors.provideExceptionInDetails:false}") private boolean provideExceptionInDetails; - @Autowired - private ErrorQueueProducer errorQueueProducer; + @Autowired + private ErrorQueueProducer errorQueueProducer; - @Autowired + @Autowired private TracerProperties tracerProperties; @ExceptionHandler(value = Exception.class) - @ResponseBody - public ResponseEntity exceptionHandler(HttpServletRequest request ,Exception ex) { + @ResponseBody + public ResponseEntity exceptionHandler(HttpServletRequest request, Exception ex) { - String contentType = request.getContentType(); - boolean isJsonContentType = (contentType != null && contentType.toLowerCase().contains("application/json")); + String contentType = request.getContentType(); + boolean isJsonContentType = (contentType != null && contentType.toLowerCase().contains("application/json")); log.error("Exception caught in tracer ", ex); String body = ""; try { - if(request instanceof MultiReadRequestWrapper) { + if (request instanceof MultiReadRequestWrapper) { ServletInputStream stream = request.getInputStream(); body = IOUtils.toString(stream, "UTF-8"); + // body = new String(stream.readAllBytes(), StandardCharsets.UTF_8); } else body = "Unable to retrieve request body"; @@ -78,143 +83,243 @@ public ResponseEntity exceptionHandler(HttpServletRequest request ,Exception body = "Unable to retrieve request body"; } - ErrorRes errorRes = new ErrorRes(); - List errors = new ArrayList<>(); - - try { - if (ex instanceof HttpMediaTypeNotSupportedException) { - errorRes.setErrors(new ArrayList<>(Collections.singletonList(new Error("UnsupportedMediaType", "An " + - "unsupported media Type was used - " + request.getContentType(), null, null)))); - } else if (ex instanceof ResourceAccessException) { - Error err = new Error(); - err.setCode("ResourceAccessError"); - err.setMessage("An error occurred while accessing a underlying resource"); - errors.add(err); - errorRes.setErrors(errors); - } else if (ex instanceof HttpMessageNotReadableException) { - Error err = new Error(); - String message = ex.getMessage(); - - if (ex.getCause() instanceof JsonMappingException) { - - Pattern pattern = Pattern.compile("(.+)Can not deserialize instance of ([a-z]+\\.){1,}(?[^ ]+).*\\[\"(?[^\"]+)\"\\].*", - Pattern.CASE_INSENSITIVE | Pattern.DOTALL); - Matcher match = pattern.matcher(message); - boolean matched = match.find(); - if (matched) { - err.setMessage("Failed to parse field - " + match.group("objectname") + ". Expected type is " + match.group("objecttype")); - } else { - err.setMessage("Failed to deserialize certain JSON fields"); - } - - err.setCode("JsonMappingException"); - - } else if (ex.getCause() instanceof JsonParseException) { - err.setCode("JsonParseException"); - message = ex.getCause().getMessage().replaceAll("Source: [^;]+; ", "").replaceAll(" \\(code \\d+\\)", "").replaceAll("\\n", ""); - err.setMessage(message); - } else { - try { - err.setMessage("JSON body has errors or is missing"); - JsonPath.parse(request).json(); - } catch (Exception jsonParseException) { - log.error("Error while parsing JSON", jsonParseException); - } - err.setCode("MissingJsonException"); - } - errors.add(err); - errorRes.setErrors(errors); - } else if (ex instanceof MethodArgumentNotValidException) { - MethodArgumentNotValidException argumentNotValidException = (MethodArgumentNotValidException) ex; - errorRes.setErrors(getBindingErrors(argumentNotValidException.getBindingResult(), errors)); - - } else if (ex instanceof CustomBindingResultExceprion) { - CustomBindingResultExceprion customBindingResultExceprion = (CustomBindingResultExceprion) ex; - errorRes.setErrors(getBindingErrors(customBindingResultExceprion.getBindingResult(), errors)); - } else if (ex instanceof CustomException) { - CustomException customException = (CustomException) ex; - populateCustomErrors(customException, errors); - errorRes.setErrors(errors); - } else if (ex instanceof ServiceCallException) { - ServiceCallException serviceCallException = (ServiceCallException) ex; - sendErrorMessage(body, ex, request.getRequestURL().toString(),errorRes, isJsonContentType); - DocumentContext documentContext = JsonPath.parse(serviceCallException.getError()); - LinkedHashMap linkedHashMap = documentContext.json(); - return new ResponseEntity<>(linkedHashMap, HttpStatus.BAD_REQUEST); - - } else if (ex instanceof MissingServletRequestParameterException) { - MissingServletRequestParameterException exception = (MissingServletRequestParameterException) ex; - Error error = new Error(); - error.setCode(""); - error.setMessage(exception.getMessage()); - //error.setDescription(exception.getCause().toString()); - List params = new ArrayList<>(); - params.add(exception.getParameterName()); - error.setParams(params); - errors.add(error); - errorRes.setErrors(errors); - } else if (ex instanceof BindException) { - BindException bindException = (BindException) ex; - - errorRes.setErrors(getBindingErrors(bindException.getBindingResult(), errors)); - - //errorRes.setErrors(errors); - } + ErrorRes errorRes = new ErrorRes(); + List errors = new ArrayList<>(); + + try { + if (ex instanceof HttpMediaTypeNotSupportedException) { + errorRes.setErrors(new ArrayList<>(Collections.singletonList(new Error("UnsupportedMediaType", "An " + + "unsupported media Type was used - " + request.getContentType(), null, null)))); + } else if (ex instanceof ResourceAccessException) { + Error err = new Error(); + err.setCode("ResourceAccessError"); + err.setMessage("An error occurred while accessing a underlying resource"); + errors.add(err); + errorRes.setErrors(errors); + } else if (ex instanceof HttpMessageNotReadableException) { + Error err = new Error(); + String message = ex.getMessage(); + + if (ex.getCause() instanceof JsonMappingException) { + + Pattern pattern = Pattern.compile("(.+)Can not deserialize instance of ([a-z]+\\.){1,}(?[^ ]+).*\\[\"(?[^\"]+)\"\\].*", + Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Matcher match = pattern.matcher(message); + boolean matched = match.find(); + if (matched) { + err.setMessage("Failed to parse field - " + match.group("objectname") + ". Expected type is " + match.group("objecttype")); + } else { + err.setMessage("Failed to deserialize certain JSON fields"); + } + + err.setCode("JsonMappingException"); + + } else if (ex.getCause() instanceof JsonParseException) { + err.setCode("JsonParseException"); + message = ex.getCause().getMessage().replaceAll("Source: [^;]+; ", "").replaceAll(" \\(code \\d+\\)", "").replaceAll("\\n", ""); + err.setMessage(message); + } else { + try { + err.setMessage("JSON body has errors or is missing"); + JsonPath.parse(request).json(); + } catch (Exception jsonParseException) { + log.error("Error while parsing JSON", jsonParseException); + } + err.setCode("MissingJsonException"); + } + errors.add(err); + errorRes.setErrors(errors); + } else if (ex instanceof MethodArgumentNotValidException) { + MethodArgumentNotValidException argumentNotValidException = (MethodArgumentNotValidException) ex; + errorRes.setErrors(getBindingErrors(argumentNotValidException.getBindingResult(), errors)); + + } else if (ex instanceof CustomBindingResultExceprion) { + CustomBindingResultExceprion customBindingResultExceprion = (CustomBindingResultExceprion) ex; + errorRes.setErrors(getBindingErrors(customBindingResultExceprion.getBindingResult(), errors)); + } else if (ex instanceof CustomException) { + CustomException customException = (CustomException) ex; + populateCustomErrors(customException, errors); + errorRes.setErrors(errors); + } else if (ex instanceof ServiceCallException) { + ServiceCallException serviceCallException = (ServiceCallException) ex; + sendErrorMessage(body, ex, request.getRequestURL().toString(), errorRes, isJsonContentType); + if(tracerProperties.isShouldPublishErrorDetailsFlag()) + prepareErrorDetailsAndInvokeExceptionHandler(request, ex); + DocumentContext documentContext = JsonPath.parse(serviceCallException.getError()); + LinkedHashMap linkedHashMap = documentContext.json(); + return new ResponseEntity<>(linkedHashMap, HttpStatus.BAD_REQUEST); + + } else if (ex instanceof MissingServletRequestParameterException) { + MissingServletRequestParameterException exception = (MissingServletRequestParameterException) ex; + Error error = new Error(); + error.setCode(""); + error.setMessage(exception.getMessage()); + //error.setDescription(exception.getCause().toString()); + List params = new ArrayList<>(); + params.add(exception.getParameterName()); + error.setParams(params); + errors.add(error); + errorRes.setErrors(errors); + } else if (ex instanceof BindException) { + BindException bindException = (BindException) ex; + + errorRes.setErrors(getBindingErrors(bindException.getBindingResult(), errors)); + + //errorRes.setErrors(errors); + } String exceptionName = ex.getClass().getSimpleName(); - String exceptionMessage = ex.getMessage(); + String exceptionMessage = ex.getMessage(); - if (errorRes.getErrors() == null || errorRes.getErrors().size() == 0) { - errorRes.setErrors(new ArrayList<>(Collections.singletonList(new Error(exceptionName, "An unhandled exception occurred on the server", exceptionMessage, null)))); - } else if (provideExceptionInDetails && errorRes.getErrors() != null && errorRes.getErrors().size() > 0) { + if (errorRes.getErrors() == null || errorRes.getErrors().size() == 0) { + errorRes.setErrors(new ArrayList<>(Collections.singletonList(new Error(exceptionName, "An unhandled exception occurred on the server", exceptionMessage, null)))); + if(tracerProperties.isShouldPublishErrorDetailsFlag()) + prepareErrorDetailsAndInvokeExceptionHandler(request, ex); + } else if (provideExceptionInDetails && errorRes.getErrors() != null && errorRes.getErrors().size() > 0) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); errorRes.getErrors().get(0).setDescription(sw.toString()); } - sendErrorMessage(body, ex, request.getRequestURL().toString(),errorRes, isJsonContentType); - } catch (Exception tracerException) { - log.error("Error in tracer", tracerException); - errorRes.setErrors(new ArrayList<>(Collections.singletonList(new Error("TracerException", "An unhandled exception occurred in tracer handler", null, null)))); - } - return new ResponseEntity<>(errorRes, HttpStatus.BAD_REQUEST); - } - - private List getBindingErrors(BindingResult bindingResult, List errors) { - - List objectErrors = bindingResult.getAllErrors(); - - for (ObjectError objectError : objectErrors) { - Error error = new Error(); - String[] codes = objectError.getCodes(); - error.setCode(codes[0]); - error.setMessage(objectError.getDefaultMessage()); - errors.add(error); - } - - return errors; - } - - private void populateCustomErrors(CustomException customException, List errors) { - Map map = customException.getErrors(); - if (map != null && !map.isEmpty()) { - for (Map.Entry entry : map.entrySet()) { - Error error = new Error(); - error.setCode(entry.getKey()); - error.setMessage(entry.getValue()); - errors.add(error); - } - } else { - Error error = new Error(); - error.setCode(customException.getCode()); - error.setMessage(customException.getMessage()); - errors.add(error); - } - - } - - void sendErrorMessage(String body, Exception ex, String source, ErrorRes errorRes, boolean isJsonContentType) { - DocumentContext documentContext; + sendErrorMessage(body, ex, request.getRequestURL().toString(), errorRes, isJsonContentType); + } catch (Exception tracerException) { + log.error("Error in tracer", tracerException); + errorRes.setErrors(new ArrayList<>(Collections.singletonList(new Error("TracerException", "An unhandled exception occurred in tracer handler", null, null)))); + } + return new ResponseEntity<>(errorRes, HttpStatus.BAD_REQUEST); + } + + /** + * This method is an overloaded sister method of error handling interceptor method + * to enable modules to invoke it based on the error details they have prepared + * to allow them to store these errors and retry them. + * + * @param errorDetails + */ + public void exceptionHandler(List errorDetails) { + + // Log incoming errors + errorDetails.forEach(errorDetail -> { + errorDetail.getErrors().forEach(errorEntity -> { + Exception ex = errorEntity.getException(); + log.error(EXCEPTION_CAUGHT_IN_TRACER_MSG, ex); + }); + }); + + // Initialize error details list for indexing + List errorDetailsForIndexing = new ArrayList<>(); + + // Prepare audit details + AuditDetails auditDetails = AuditDetails.builder().createdTime(System.currentTimeMillis()).lastModifiedTime(System.currentTimeMillis()).build(); + + // Enrich error uuid and audit details for indexing error details + errorDetails.forEach(errorDetail -> { + // Initialize error details + ErrorDetailDTO errorDetailDTO = new ErrorDetailDTO(); + BeanUtils.copyProperties(errorDetail, errorDetailDTO); + + // Initialize values for error detail + errorDetailDTO.setAuditDetails(auditDetails); + errorDetailDTO.setStatus(Status.PENDING); + + // Set uuid and retry count only if errorDetail does not have an id + if(ObjectUtils.isEmpty(errorDetailDTO.getApiDetails().getId())) { + errorDetailDTO.setUuid(UUID.randomUUID().toString()); + errorDetailDTO.setRetryCount(0); + }else{ + errorDetailDTO.setUuid(errorDetailDTO.getApiDetails().getId()); + } + + errorDetailsForIndexing.add(errorDetailDTO); + }); + + // Send error details for indexing + errorQueueProducer.sendErrorDetails(errorDetailsForIndexing); + + } + + + /** + * This method prepares error details in case of unhandled exceptions caught by tracer interceptor + * and invokes its sister exceptionHandler method to store it for retry. + * @param request + * @param ex + */ + private void prepareErrorDetailsAndInvokeExceptionHandler(HttpServletRequest request, Exception ex) { + String contentType = request.getContentType(); + String body = ""; + + // Block to parse incoming request for which exception was thrown + try { + if (request instanceof MultiReadRequestWrapper) { + ServletInputStream stream = request.getInputStream(); + body = IOUtils.toString(stream, UTF_8_CODE); + // body = new String(stream.readAllBytes(), StandardCharsets.UTF_8); + } else + body = UNABLE_TO_RETRIEVE_REQUEST_BODY_MSG; + + } catch (IOException ignored) { + body = UNABLE_TO_RETRIEVE_REQUEST_BODY_MSG; + } + + // Prepare API Details + ApiDetails apiDetails = new ApiDetails(); + apiDetails.setRequestBody(body); + apiDetails.setContentType(contentType); + apiDetails.setUrl(request.getRequestURL().toString()); + + // Prepare error entity + ErrorEntity errorEntity = new ErrorEntity(); + errorEntity.setErrorType(ErrorType.RECOVERABLE); + errorEntity.setErrorMessage(ex.getMessage()); + errorEntity.setErrorCode(UNHANDLED_EXCEPTION_ERROR_CODE); + errorEntity.setException(ex); + + // Prepare error detail + ErrorDetail errorDetail = new ErrorDetail(); + errorDetail.setApiDetails(apiDetails); + errorDetail.setErrors(Collections.singletonList(errorEntity)); + + // Call exceptionHandler method to persist unhandled errors + exceptionHandler(Collections.singletonList(errorDetail)); + } + + + private List getBindingErrors(BindingResult bindingResult, List errors) { + + List objectErrors = bindingResult.getAllErrors(); + + for (ObjectError objectError : objectErrors) { + Error error = new Error(); + String[] codes = objectError.getCodes(); + error.setCode(codes[0]); + error.setMessage(objectError.getDefaultMessage()); + errors.add(error); + } + + return errors; + } + + private void populateCustomErrors(CustomException customException, List errors) { + Map map = customException.getErrors(); + if (map != null && !map.isEmpty()) { + for (Map.Entry entry : map.entrySet()) { + Error error = new Error(); + error.setCode(entry.getKey()); + error.setMessage(entry.getValue()); + errors.add(error); + } + } else { + Error error = new Error(); + error.setCode(customException.getCode()); + error.setMessage(customException.getMessage()); + errors.add(error); + } + + } + + void sendErrorMessage(String body, Exception ex, String source, boolean isJsonContentType) { + DocumentContext documentContext; if (tracerProperties.isErrorsPublish()) { Object requestBody = body; @@ -230,19 +335,50 @@ void sendErrorMessage(String body, Exception ex, String source, ErrorRes errorRe StackTraceElement elements[] = ex.getStackTrace(); ErrorQueueContract errorQueueContract = ErrorQueueContract.builder() - .id(UUID.randomUUID().toString()) - .correlationId(MDC.get(CORRELATION_ID_MDC)) - .body(requestBody) - .source(source) - .ts(new Date().getTime()) - .errorRes(errorRes) - .exception(Arrays.asList(elements)) - .message(ex.getMessage()) - .build(); + .id(UUID.randomUUID().toString()) + .correlationId(MDC.get(CORRELATION_ID_MDC)) + .body(requestBody) + .source(source) + .ts(new Date().getTime()) + .exception(Arrays.asList(elements)) + .message(ex.getMessage()) + .build(); errorQueueProducer.sendMessage(errorQueueContract); } - } - + } + + void sendErrorMessage(String body, Exception ex, String source, ErrorRes errorRes, boolean isJsonContentType) { + DocumentContext documentContext; + + if (tracerProperties.isErrorsPublish()) { + Object requestBody = body; + if (isJsonContentType) { + try { + documentContext = JsonPath.parse(body); + requestBody = documentContext.json(); + } catch (Exception exception) { + requestBody = body; + } + } + + StackTraceElement elements[] = ex.getStackTrace(); + + ErrorQueueContract errorQueueContract = ErrorQueueContract.builder() + .id(UUID.randomUUID().toString()) + .correlationId(MDC.get(CORRELATION_ID_MDC)) + .body(requestBody) + .source(source) + .ts(new Date().getTime()) + .errorRes(errorRes) + .exception(Arrays.asList(elements)) + .message(ex.getMessage()) + .build(); + + errorQueueProducer.sendMessage(errorQueueContract); + } + + } + } diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/KafkaConsumerErrorHandler.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/KafkaConsumerErrorHandler.java index f481dd2222a..315e72c91e4 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/KafkaConsumerErrorHandler.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/KafkaConsumerErrorHandler.java @@ -2,19 +2,24 @@ import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; +import org.apache.kafka.clients.consumer.Consumer; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; + import org.springframework.kafka.listener.LoggingErrorHandler; +import org.springframework.kafka.listener.MessageListenerContainer; import org.springframework.stereotype.Component; import org.springframework.util.ObjectUtils; +import java.util.List; + @Component @Slf4j -public class KafkaConsumerErrorHandler extends LoggingErrorHandler { +public class KafkaConsumerErrorHandler extends LoggingErrorHandler { - @Autowired - private ExceptionAdvise exceptionAdvise; + @Autowired + private ExceptionAdvise exceptionAdvise; @Value("${tracer.errorsPublish}") private boolean sendErrorsToKafka; diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/OpenTracingConfiguration.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/OpenTracingConfiguration.java index 07364ac00f2..64d898bf144 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/OpenTracingConfiguration.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/OpenTracingConfiguration.java @@ -1,3 +1,4 @@ +/* package org.egov.tracer.config; import io.opentracing.Span; @@ -10,47 +11,51 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; -import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_OPENTRACING_FORMAT; import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_MDC; +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_OPENTRACING_FORMAT; @Configuration @ConditionalOnWebApplication @AutoConfigureAfter({TracerAutoConfiguration.class}) -@ConditionalOnClass({WebMvcConfigurerAdapter.class}) +@ConditionalOnClass({WebMvcConfigurer.class}) @ConditionalOnProperty( - name = {"tracer.opentracing.enabled"}, - havingValue = "true", - matchIfMissing = false + name = {"tracer.opentracing.enabled"}, + havingValue = "true", + matchIfMissing = false ) public class OpenTracingConfiguration { - /** + */ +/** * Jaeger Tracer instance configured via environment variables * * @return Tracer implementation - */ + *//* + @Bean public io.opentracing.Tracer jaegerTracer() { return io.jaegertracing.Configuration.fromEnv() - .getTracer(); + .getTracer(); } - /** + */ +/** * Use span decorator to add a correlation id span tag - * + *

* Filter order configured to run after Tracer Filter * * @return span decorators - */ + *//* + @Bean - public List spanDecorator(){ + public List spanDecorator() { List decorators = new ArrayList<>(); decorators.add(ServletFilterSpanDecorator.STANDARD_TAGS); decorators.add(new ServletFilterSpanDecorator() { @@ -79,3 +84,4 @@ public void onTimeout(HttpServletRequest httpServletRequest, HttpServletResponse } } +*/ diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/TracerConfiguration.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/TracerConfiguration.java index 34cc99b1dac..d547354d6dc 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/TracerConfiguration.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/TracerConfiguration.java @@ -19,7 +19,7 @@ @ComponentScan(basePackages = {"org.egov.tracer"}) @PropertySource("classpath:tracer.properties") @EnableConfigurationProperties({TracerProperties.class}) -@Import(OpenTracingConfiguration.class) +//@Import(OpenTracingConfiguration.class) public class TracerConfiguration { @Bean @@ -32,7 +32,7 @@ public RestTemplate logAwareRestTemplate(TracerProperties tracerProperties) { SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); requestFactory.setOutputStreaming(false); RestTemplate restTemplate = - new RestTemplate(new BufferingClientHttpRequestFactory(requestFactory)); + new RestTemplate(new BufferingClientHttpRequestFactory(requestFactory)); restTemplate.setInterceptors(Collections.singletonList(new RestTemplateLoggingInterceptor(tracerProperties))); return restTemplate; } @@ -41,14 +41,14 @@ public RestTemplate logAwareRestTemplate(TracerProperties tracerProperties) { * Configure tracer filter with order one * * @param objectMapperFactory Object mapper - * @param tracerProperties configuration for the filter + * @param tracerProperties configuration for the filter * @return Filter */ @Bean @ConditionalOnProperty(name = "tracer.filter.enabled", - havingValue = "true", matchIfMissing = true) + havingValue = "true", matchIfMissing = true) public FilterRegistrationBean tracerFilter(ObjectMapperFactory objectMapperFactory, - TracerProperties tracerProperties) { + TracerProperties tracerProperties) { final TracerFilter tracerFilter = new TracerFilter(tracerProperties, objectMapperFactory); FilterRegistrationBean registration = new FilterRegistrationBean(tracerFilter); registration.addUrlPatterns("/*"); @@ -64,9 +64,9 @@ public FilterRegistrationBean tracerFilter(ObjectMapperFactory objectMapperFacto */ @Bean @ConditionalOnProperty( - name = {"tracer.opentracing.enabled"}, - havingValue = "false", - matchIfMissing = true + name = {"tracer.opentracing.enabled"}, + havingValue = "false", + matchIfMissing = true ) public io.opentracing.Tracer tracer() { return NoopTracerFactory.create(); diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/TracerProperties.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/TracerProperties.java index 3d8cb4b5ff9..bce68831410 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/TracerProperties.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/config/TracerProperties.java @@ -24,8 +24,14 @@ public class TracerProperties { // Topic to which errors need to be published private String errorsTopic; + // Topic to which error details need to be published + private String errorDetailsTopic; + // Exclusion list for tracer filter private String filterSkipPattern; + // Flag to enable exceptions caught on tracer interceptor to be persisted on ElasticSearch. + private boolean shouldPublishErrorDetailsFlag; + } diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/constants/TracerConstants.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/constants/TracerConstants.java index 626dca16859..a5ca257e42c 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/constants/TracerConstants.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/constants/TracerConstants.java @@ -3,12 +3,19 @@ public class TracerConstants { public static final String CORRELATION_ID_HEADER = "x-correlation-id"; + public static final String TENANT_ID_HEADER = "tenantId"; public static final String CORRELATION_ID_FIELD_NAME= "correlationId"; public static final String CORRELATION_ID_MDC = "CORRELATION_ID"; + public static final String TENANTID_MDC = "TENANTID"; public static final String CORRELATION_ID_OPENTRACING_FORMAT = "correlation.id"; public static final String TIME_ZONE_PROPERTY = "app.timezone"; public static final String REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE = "RequestInfo"; public static final String REQUEST_INFO_IN_CAMEL_CASE = "requestInfo"; + public static final String UNHANDLED_EXCEPTION_ERROR_CODE = "UNHANDLED_EXCEPTION_ERROR"; + public static final String UNABLE_TO_RETRIEVE_REQUEST_BODY_MSG = "Unable to retrieve request body"; + public static final String UTF_8_CODE = "UTF-8"; + public static final String EXCEPTION_CAUGHT_IN_TRACER_MSG = "Exception caught in tracer "; - private TracerConstants(){} + private TracerConstants() { + } } diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/HttpUtils.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/HttpUtils.java index d7811316ca5..88baafbc300 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/HttpUtils.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/HttpUtils.java @@ -6,7 +6,8 @@ public class HttpUtils { private static final String PASS_THROUGH_GATEWAY_HEADER_NAME = "x-pass-through-gateway"; - private HttpUtils(){} + private HttpUtils() { + } public static boolean isInterServiceCall(HttpHeaders headers) { String x_pass_through_gatewayStr = headers.getFirst(PASS_THROUGH_GATEWAY_HEADER_NAME); diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/RestTemplateLoggingInterceptor.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/RestTemplateLoggingInterceptor.java index 08adcef5e54..c7691e9dccc 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/RestTemplateLoggingInterceptor.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/RestTemplateLoggingInterceptor.java @@ -1,6 +1,16 @@ package org.egov.tracer.http; -import lombok.extern.slf4j.Slf4j; +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_HEADER; +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_MDC; +import static org.egov.tracer.constants.TracerConstants.TENANTID_MDC; +import static org.egov.tracer.constants.TracerConstants.TENANT_ID_HEADER; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + import org.apache.commons.io.IOUtils; import org.egov.tracer.config.TracerProperties; import org.slf4j.MDC; @@ -10,13 +20,9 @@ import org.springframework.http.client.ClientHttpRequestExecution; import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.http.client.ClientHttpResponse; +import org.springframework.util.CollectionUtils; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; - -import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_HEADER; -import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_MDC; +import lombok.extern.slf4j.Slf4j; @Slf4j public class RestTemplateLoggingInterceptor implements ClientHttpRequestInterceptor { @@ -30,7 +36,7 @@ public class RestTemplateLoggingInterceptor implements ClientHttpRequestIntercep private static final String RESPONSE_BODY_ERROR_MESSAGE = "Error reading response body"; private static final String EMPTY_BODY = ""; private static final List JSON_MEDIA_TYPES = - Arrays.asList(MediaType.APPLICATION_JSON_UTF8_VALUE, MediaType.APPLICATION_JSON_VALUE); + Arrays.asList(MediaType.APPLICATION_JSON_UTF8_VALUE, MediaType.APPLICATION_JSON_VALUE); private TracerProperties tracerProperties; @@ -40,11 +46,11 @@ public RestTemplateLoggingInterceptor(TracerProperties tracerProperties) { /** * Intercept all rest template calls - * - Add correlation id header from MDC - * - Log request and responses based on config + * - Add correlation id header from MDC + * - Log request and responses based on config * - * @param request being made - * @param body of the request + * @param request being made + * @param body of the request * @param execution execute the rest template call * @return response of the rest call * @throws IOException @@ -53,13 +59,18 @@ public RestTemplateLoggingInterceptor(TracerProperties tracerProperties) { public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { try { request.getHeaders().add(CORRELATION_ID_HEADER, MDC.get(CORRELATION_ID_MDC)); + + List tenantId = request.getHeaders().get(TENANT_ID_HEADER); + if (CollectionUtils.isEmpty(tenantId)) + request.getHeaders().add(TENANT_ID_HEADER, MDC.get(TENANTID_MDC)); + logRequest(request, body); final ClientHttpResponse rawResponse = execution.execute(request, body); - if(tracerProperties.isRestTemplateDetailedLoggingEnabled() && isBodyCompatibleForParsing(request)){ + if (tracerProperties.isRestTemplateDetailedLoggingEnabled() && isBodyCompatibleForParsing(request)) { logResponse(rawResponse, request); - } else{ + } else { log.info(RESPONSE_MESSAGE, request.getURI()); } return rawResponse; @@ -71,20 +82,19 @@ public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttp private void logResponse(ClientHttpResponse response, HttpRequest httpRequest) throws IOException { - if(tracerProperties.isRestTemplateDetailedLoggingEnabled() && isBodyCompatibleForParsing(httpRequest)){ + if (tracerProperties.isRestTemplateDetailedLoggingEnabled() && isBodyCompatibleForParsing(httpRequest)) { String body = getBodyString(response); log.info(RESPONSE_MESSAGE_WITH_BODY, httpRequest.getURI(), response.getStatusCode(), body); - } else{ + } else { log.info(RESPONSE_MESSAGE, httpRequest.getURI()); } } private void logRequest(HttpRequest httpRequest, byte[] body) { - if(tracerProperties.isRestTemplateDetailedLoggingEnabled() && isBodyCompatibleForParsing(httpRequest)){ + if (tracerProperties.isRestTemplateDetailedLoggingEnabled() && isBodyCompatibleForParsing(httpRequest)) { log.info(REQUEST_MESSAGE_WITH_BODY, httpRequest.getURI(), httpRequest.getMethod().name(), getBody(body)); - } - else { + } else { log.info(REQUEST_MESSAGE, httpRequest.getURI(), httpRequest.getMethod().name()); } } @@ -102,6 +112,8 @@ private boolean isBodyCompatibleForParsing(HttpMessage httpMessage) { private String getBodyString(ClientHttpResponse response) { try { if (response != null && response.getBody() != null) { + InputStream bodyStream = response.getBody(); + //return new String(bodyStream.readAllBytes(), StandardCharsets.UTF_8); return IOUtils.toString(response.getBody(), UTF_8); } else { return EMPTY_BODY; diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/filters/MultiReadRequestWrapper.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/filters/MultiReadRequestWrapper.java index 66cd9c5a512..272e8eca196 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/filters/MultiReadRequestWrapper.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/filters/MultiReadRequestWrapper.java @@ -1,12 +1,14 @@ package org.egov.tracer.http.filters; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.io.IOUtils; import javax.servlet.ReadListener; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; + +import org.apache.commons.io.IOUtils; + import java.io.*; @Slf4j @@ -41,13 +43,14 @@ public void update(ByteArrayOutputStream newBytes) { // } @Override - public BufferedReader getReader() throws IOException{ + public BufferedReader getReader() throws IOException { return new BufferedReader(new InputStreamReader(getInputStream())); } private void cacheInputStream() throws IOException { cachedBytes = new ByteArrayOutputStream(); IOUtils.copy(super.getInputStream(), cachedBytes); + //super.getInputStream().transferTo(cachedBytes); } public class CachedServletInputStream extends ServletInputStream { diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/filters/TracerFilter.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/filters/TracerFilter.java index 6565bdc915b..8f61d263d0b 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/filters/TracerFilter.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/http/filters/TracerFilter.java @@ -1,29 +1,43 @@ package org.egov.tracer.http.filters; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.extern.slf4j.Slf4j; +import static java.util.Objects.isNull; +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_FIELD_NAME; +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_HEADER; +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_MDC; +import static org.egov.tracer.constants.TracerConstants.REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE; +import static org.egov.tracer.constants.TracerConstants.REQUEST_INFO_IN_CAMEL_CASE; +import static org.egov.tracer.constants.TracerConstants.TENANTID_MDC; +import static org.egov.tracer.constants.TracerConstants.TENANT_ID_HEADER; +import static org.springframework.util.ObjectUtils.isEmpty; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.regex.Pattern; + +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + import org.apache.commons.io.IOUtils; import org.egov.tracer.config.ObjectMapperFactory; import org.egov.tracer.config.TracerProperties; import org.slf4j.MDC; import org.springframework.http.MediaType; -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.*; -import java.util.regex.Pattern; +import com.fasterxml.jackson.databind.ObjectMapper; -import static java.util.Objects.isNull; -import static org.egov.tracer.constants.TracerConstants.*; -import static org.springframework.util.StringUtils.isEmpty; +import lombok.extern.slf4j.Slf4j; @Slf4j public class TracerFilter implements Filter { private static final List JSON_MEDIA_TYPES = - Arrays.asList(MediaType.APPLICATION_JSON_UTF8_VALUE, MediaType.APPLICATION_JSON_VALUE); + Arrays.asList(MediaType.APPLICATION_JSON_VALUE); private static final String POST = "POST"; private static final String REQUEST_BODY_LOG_MESSAGE = "Request body - {}"; private static final String FAILED_TO_LOG_REQUEST_MESSAGE = "Failed to log request body"; @@ -40,7 +54,7 @@ public TracerFilter(TracerProperties tracerProperties, ObjectMapperFactory objec this.tracerProperties = tracerProperties; this.objectMapper = objectMapperFactory.getObjectMapper(); this.skipPattern = isNull(tracerProperties.getFilterSkipPattern()) ? null : - Pattern.compile(tracerProperties.getFilterSkipPattern()); + Pattern.compile(tracerProperties.getFilterSkipPattern()); } @Override @@ -59,27 +73,28 @@ public void init(FilterConfig filterConfig) { * Set correlation id in MDC for future use, like logging etc * Log Request and Response depending on configuration * - * @param servletRequest HTTP request + * @param servletRequest HTTP request * @param servletResponse HTTP response - * @param filterChain pass control to the chain + * @param filterChain pass control to the chain * @throws IOException * @throws ServletException */ @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { - String correlationId = null; HttpServletRequest httpRequest = (HttpServletRequest) servletRequest; if (!this.isTraced(httpRequest)) { filterChain.doFilter(httpRequest, servletResponse); - } - else { + } else { if (isBodyCompatibleForParsing(httpRequest)) { final MultiReadRequestWrapper wrappedRequest = new MultiReadRequestWrapper(httpRequest); - correlationId = getCorrelationId(wrappedRequest); - MDC.put(CORRELATION_ID_MDC, correlationId); + + Map headerParamMap = getCorrelationId(wrappedRequest); + MDC.put(CORRELATION_ID_MDC, headerParamMap.get(CORRELATION_ID_MDC)); + MDC.put(TENANTID_MDC, headerParamMap.get(TENANTID_MDC)); + logRequestURI(httpRequest); if (tracerProperties.isRequestLoggingEnabled()) { @@ -89,8 +104,10 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo filterChain.doFilter(wrappedRequest, servletResponse); } else { - correlationId = getCorrelationId(httpRequest); - MDC.put(CORRELATION_ID_MDC, correlationId); + + Map headerParamMap = getCorrelationId(httpRequest); + MDC.put(CORRELATION_ID_MDC, headerParamMap.get(CORRELATION_ID_MDC)); + MDC.put(TENANTID_MDC, headerParamMap.get(TENANTID_MDC)); logRequestURI(httpRequest); filterChain.doFilter(httpRequest, servletResponse); } @@ -123,35 +140,29 @@ private void logRequestURI(HttpServletRequest httpRequest) { log.info(REQUEST_URI_LOG_MESSAGE, url); } - private String getCorrelationId(HttpServletRequest httpRequest) { - String correlationId = getCorrelationIdFromHeader(httpRequest); - if (isNull(correlationId) && httpRequest instanceof MultiReadRequestWrapper) { - correlationId = getCorrelationIdFromBody(httpRequest); - } + private Map getCorrelationId(HttpServletRequest httpRequest) { + return getParamMapFromHeader(httpRequest); - if(isNull(correlationId)) - correlationId = getRandomCorrelationId(); - - return correlationId; - - } + } private boolean isBodyCompatibleForParsing(HttpServletRequest httpRequest) { return POST.equals(httpRequest.getMethod()) - && JSON_MEDIA_TYPES.contains(httpRequest.getContentType()); + && JSON_MEDIA_TYPES.contains(httpRequest.getContentType()); } private void logRequestBodyAndParams(HttpServletRequest requestWrapper) { try { final String requestBody = IOUtils.toString(requestWrapper.getInputStream(), UTF_8); + final ServletInputStream inputStream = requestWrapper.getInputStream(); + // String requestBody = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8); String requestParams = requestWrapper.getQueryString(); - if(!isEmpty(requestParams)) + if (!isEmpty(requestParams)) log.info(REQUEST_PARAMS_LOG_MESSAGE, requestParams); - if(!isEmpty(requestBody)) + if (!isEmpty(requestBody)) log.info(REQUEST_BODY_LOG_MESSAGE, requestBody); } catch (IOException e) { @@ -159,19 +170,32 @@ private void logRequestBodyAndParams(HttpServletRequest requestWrapper) { } } - private String getCorrelationIdFromHeader(HttpServletRequest httpRequest) { - return httpRequest.getHeader(CORRELATION_ID_HEADER); - } + private Map getParamMapFromHeader(HttpServletRequest httpRequest) { + + Map keyMap = new HashMap<>(); + String correlationId = httpRequest.getHeader(CORRELATION_ID_HEADER); + + if (isNull(correlationId) && httpRequest instanceof MultiReadRequestWrapper) { + correlationId = getCorrelationIdFromBody(httpRequest); + } + + if (isNull(correlationId)) + correlationId = getRandomCorrelationId(); + + keyMap.put(CORRELATION_ID_MDC, correlationId); + keyMap.put(TENANTID_MDC, httpRequest.getHeader(TENANT_ID_HEADER)); + return keyMap; + } @SuppressWarnings("unchecked") private String getCorrelationIdFromBody(HttpServletRequest httpServletRequest) { String correlationId = null; try { final HashMap requestMap = (HashMap) - objectMapper.readValue(httpServletRequest.getInputStream(), HashMap.class); + objectMapper.readValue(httpServletRequest.getInputStream(), HashMap.class); Object requestInfo = requestMap.containsKey(REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE) ? requestMap.get - (REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE) : requestMap.get(REQUEST_INFO_IN_CAMEL_CASE); + (REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE) : requestMap.get(REQUEST_INFO_IN_CAMEL_CASE); if (isNull(requestInfo)) return null; diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/CustomKafkaTemplate.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/CustomKafkaTemplate.java index f9213d5eca7..c2e5592c0a6 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/CustomKafkaTemplate.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/CustomKafkaTemplate.java @@ -12,12 +12,10 @@ @Slf4j public class CustomKafkaTemplate { - private KafkaTemplate kafkaTemplate; - private static final String KAFKA_SEND_ERROR_CODE = "EVENT_BUS_FAILURE"; private static final String KAFKA_SEND_ERROR_MSG = "Failed to push event onto the event bus"; - private static final String KAFKA_ERROR_LOG = "Failed to push data to kafka queue"; + private KafkaTemplate kafkaTemplate; @Autowired public CustomKafkaTemplate(KafkaTemplate kafkaTemplate) { diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/DeadLetterQueueConfiguration.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/DeadLetterQueueConfiguration.java new file mode 100644 index 00000000000..d3016bc79a1 --- /dev/null +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/DeadLetterQueueConfiguration.java @@ -0,0 +1,38 @@ +/* +package org.egov.tracer.kafka; + +import org.apache.kafka.clients.consumer.ConsumerRecord; +import org.apache.kafka.common.TopicPartition; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.kafka.core.KafkaOperations; +import org.springframework.kafka.listener.DeadLetterPublishingRecoverer; +import org.springframework.kafka.listener.DefaultErrorHandler; + +import java.util.function.BiFunction; + +@Configuration +public class DeadLetterQueueConfiguration { + + + + @Bean + @ConditionalOnProperty(name = "tracer.errorsPublish", havingValue = "true") + public DeadLetterPublishingRecoverer deadLetterPublishingRecoverer(KafkaOperations kafkaTemplate) { + BiFunction, Exception, TopicPartition> destinationResolver = (cr, e) -> + new TopicPartition(cr.topic() + ".dlt", cr.partition()); + + return new DeadLetterPublishingRecoverer(kafkaTemplate, destinationResolver); + } + + @Bean + @ConditionalOnProperty(name = "tracer.errorsPublish", havingValue = "true") + public DefaultErrorHandler errorHandler(DeadLetterPublishingRecoverer recoverer) { + return new DefaultErrorHandler(recoverer); + } + + + +} +*/ diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/ErrorQueueProducer.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/ErrorQueueProducer.java index a3e5012748b..d8e4f473cfc 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/ErrorQueueProducer.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/ErrorQueueProducer.java @@ -5,11 +5,14 @@ import org.apache.kafka.common.errors.SerializationException; import org.egov.tracer.config.ObjectMapperFactory; import org.egov.tracer.config.TracerProperties; +import org.egov.tracer.model.ErrorDetailDTO; import org.egov.tracer.model.ErrorQueueContract; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.kafka.core.KafkaTemplate; import org.springframework.stereotype.Component; +import java.util.List; + @Component @Slf4j public class ErrorQueueProducer { @@ -25,12 +28,13 @@ public class ErrorQueueProducer { public void sendMessage(ErrorQueueContract errorQueueContract) { try { + log.info("Sending message to topic - " + tracerProperties.getErrorsTopic()); kafkaTemplate.send(tracerProperties.getErrorsTopic(), errorQueueContract); } catch (SerializationException serializationException) { log.info("SerializationException exception occurred while sending exception to error queue"); try { kafkaTemplate.send(tracerProperties.getErrorsTopic(), objectMapperFactory.getObjectMapper().writeValueAsString - (errorQueueContract)); + (errorQueueContract)); } catch (JsonProcessingException e) { log.info("exception occurred while converting ErrorQueueContract to json string"); } @@ -39,4 +43,20 @@ public void sendMessage(ErrorQueueContract errorQueueContract) { } } + public void sendErrorDetails(List errorDetailList) { + try { + log.info("Sending message to topic - " + "error-details-indexer-topic"); + kafkaTemplate.send(tracerProperties.getErrorDetailsTopic(), errorDetailList); + } catch (SerializationException serializationException) { + log.info("SerializationException exception occurred while sending exception to error queue"); + try { + kafkaTemplate.send(tracerProperties.getErrorDetailsTopic(), objectMapperFactory.getObjectMapper().writeValueAsString(errorDetailList)); + } catch (JsonProcessingException e) { + log.info("exception occurred while converting error details to json string"); + } + } catch (Exception ex) { + log.error("exception occurred while sending exception to error queue"); + } + } + } diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/KafkaTemplateLoggingInterceptors.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/KafkaTemplateLoggingInterceptors.java index 15dca03c7b2..cb37f29865a 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/KafkaTemplateLoggingInterceptors.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/KafkaTemplateLoggingInterceptors.java @@ -21,15 +21,15 @@ import static org.springframework.util.StringUtils.isEmpty; @Slf4j -public class KafkaTemplateLoggingInterceptors implements ConsumerInterceptor, ProducerInterceptor { +public class KafkaTemplateLoggingInterceptors implements ConsumerInterceptor, ProducerInterceptor { private static final String EMPTY_BODY = ""; private static final String SEND_SUCCESS_MESSAGE = - "Sending message to topic: {}, partition: {} with key: {} ."; + "Sending message to topic: {}, partition: {} with key: {} ."; private static final String BODY_JSON_SERIALIZATION_ERROR = "Serialization of body failed while attempting to log" + - " the body"; + " the body"; private static final String SEND_SUCCESS_MESSAGE_WITH_BODY = - "Sending message to topic: {}, partition: {}, body: {} with key: {} ."; + "Sending message to topic: {}, partition: {}, body: {} with key: {} ."; private static final String SEND_FAILURE_MESSAGE = "Sending of message to topic: %s, partition %s failed."; private static final String RECEIVED_MESSAGE_WITH_BODY = "Received message from topic: {}, partition: {}, body: {} with key: {}"; @@ -46,13 +46,13 @@ public ConsumerRecords onConsume(ConsumerRecords consumerRecords) { final String keyAsString = ObjectUtils.nullSafeToString(consumerRecord.key()); String correlationId = getCorrelationIdFromBody(consumerRecord.value()); - if(!isEmpty(correlationId)) + if (!isEmpty(correlationId)) MDC.put(CORRELATION_ID_MDC, correlationId); if (log.isDebugEnabled()) { final String bodyAsJsonString = getMessageBodyAsJsonString(consumerRecord.value()); log.debug(RECEIVED_MESSAGE_WITH_BODY, consumerRecord.topic(), consumerRecord.partition(), bodyAsJsonString, - keyAsString); + keyAsString); } else { log.info(RECEIVED_MESSAGE, consumerRecord.topic(), consumerRecord.topic(), consumerRecord.key()); } @@ -72,7 +72,7 @@ public ProducerRecord onSend(ProducerRecord producerRecord) { if (log.isDebugEnabled()) { final String bodyAsJsonString = getMessageBodyAsJsonString(producerRecord.value()); log.debug(SEND_SUCCESS_MESSAGE_WITH_BODY, producerRecord.topic(), producerRecord.partition(), bodyAsJsonString, - keyAsString); + keyAsString); } else { log.info(SEND_SUCCESS_MESSAGE, producerRecord.topic(), producerRecord.partition(), keyAsString); } @@ -83,7 +83,7 @@ public ProducerRecord onSend(ProducerRecord producerRecord) { public void onAcknowledgement(RecordMetadata recordMetadata, Exception e) { if (!isNull(e)) { final String message = - String.format(SEND_FAILURE_MESSAGE, recordMetadata.topic(), recordMetadata.partition()); + String.format(SEND_FAILURE_MESSAGE, recordMetadata.topic(), recordMetadata.partition()); log.error(message, e); } } @@ -114,7 +114,7 @@ private String getCorrelationIdFromBody(Object value) { Map requestMap = objectMapper.convertValue(value, Map.class); Object requestInfo = requestMap.containsKey(REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE) ? requestMap.get - (REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE) : requestMap.get(REQUEST_INFO_IN_CAMEL_CASE); + (REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE) : requestMap.get(REQUEST_INFO_IN_CAMEL_CASE); if (isNull(requestInfo)) return null; @@ -123,7 +123,8 @@ private String getCorrelationIdFromBody(Object value) { correlationId = (String) ((Map) requestInfo).get(CORRELATION_ID_FIELD_NAME); } } - } catch (Exception ignored){} + } catch (Exception ignored) { + } return correlationId; } diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/LogAwareKafkaTemplate.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/LogAwareKafkaTemplate.java index 9d128fbc548..8a161f54485 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/LogAwareKafkaTemplate.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/kafka/LogAwareKafkaTemplate.java @@ -18,16 +18,16 @@ public class LogAwareKafkaTemplate { private static final String EMPTY_BODY = ""; private static final String SEND_SUCCESS_MESSAGE = - "Sending of message to topic: {}, partition: {} with key: {} succeeded."; + "Sending of message to topic: {}, partition: {} with key: {} succeeded."; private static final String BODY_JSON_SERIALIZATION_ERROR = "Serialization of body failed"; private static final String SEND_SUCCESS_MESSAGE_WITH_BODY = - "Sending of message to topic: {}, partition: {}, body: {} with key: {} succeeded."; + "Sending of message to topic: {}, partition: {}, body: {} with key: {} succeeded."; private static final String SEND_FAILURE_MESSAGE_WITH_TOPIC = - "Sending of message to topic: %s failed."; + "Sending of message to topic: %s failed."; private static final String SEND_FAILURE_MESSAGE_WITH_TOPIC_KEY = - "Sending of message to topic: %s, key: %s failed."; + "Sending of message to topic: %s, key: %s failed."; private static final String SEND_FAILURE_MESSAGE_WITH_TOPIC_KEY_PARTITION = - "Sending of message to topic: %s, partition: %s, key: %s failed."; + "Sending of message to topic: %s, partition: %s, key: %s failed."; private TracerProperties tracerProperties; private KafkaTemplate kafkaTemplate; private ObjectMapper objectMapper; @@ -78,11 +78,11 @@ private void logSuccessMessage(V message, SendResult result) { final Integer partition = result.getProducerRecord().partition(); final String key = ObjectUtils.nullSafeToString(result.getProducerRecord().key()); if (tracerProperties.isKafkaMessageLoggingEnabled()) { - final String bodyAsJsonString = getMessageBodyAsJsonString(message); - log.info(SEND_SUCCESS_MESSAGE_WITH_BODY, topic, partition, bodyAsJsonString, key); - } else { - log.info(SEND_SUCCESS_MESSAGE, topic, partition, key); - } + final String bodyAsJsonString = getMessageBodyAsJsonString(message); + log.info(SEND_SUCCESS_MESSAGE_WITH_BODY, topic, partition, bodyAsJsonString, key); + } else { + log.info(SEND_SUCCESS_MESSAGE, topic, partition, key); + } } private String getMessageBodyAsJsonString(Object value) { diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ApiDetails.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ApiDetails.java new file mode 100644 index 00000000000..4a6205f77d2 --- /dev/null +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ApiDetails.java @@ -0,0 +1,35 @@ +package org.egov.tracer.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +import java.util.Map; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ApiDetails { + + @JsonProperty("id") + private String id = null; + + @JsonProperty("url") + private String url = null; + + @JsonProperty("contentType") + private String contentType = null; + + @JsonProperty("methodType") + private String methodType = null; + + @JsonProperty("requestBody") + private String requestBody = null; + + @JsonProperty("requestHeaders") + private Map requestHeaders = null; + + @JsonProperty("additionalDetails") + private Object additionalDetails = null; + +} diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/AuditDetails.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/AuditDetails.java new file mode 100644 index 00000000000..0488946e374 --- /dev/null +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/AuditDetails.java @@ -0,0 +1,25 @@ +package org.egov.tracer.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class AuditDetails { + @JsonProperty("createdBy") + private String createdBy = null; + + @JsonProperty("lastModifiedBy") + private String lastModifiedBy = null; + + @JsonProperty("createdTime") + private Long createdTime = null; + + @JsonProperty("lastModifiedTime") + private Long lastModifiedTime = null; + + +} diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/CustomBindingResultExceprion.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/CustomBindingResultExceprion.java index 69977bcbcdb..f0eded94fdc 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/CustomBindingResultExceprion.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/CustomBindingResultExceprion.java @@ -1,21 +1,18 @@ package org.egov.tracer.model; -import java.util.Map; - -import org.springframework.validation.BindingResult; - import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; +import org.springframework.validation.BindingResult; @Setter @Getter @NoArgsConstructor @AllArgsConstructor -public class CustomBindingResultExceprion extends RuntimeException{ +public class CustomBindingResultExceprion extends RuntimeException { + + private static final long serialVersionUID = 4581677752337709974L; - private static final long serialVersionUID = 4581677752337709974L; - - private BindingResult bindingResult; + private BindingResult bindingResult; } diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/CustomException.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/CustomException.java index 1c07cd38034..b0184408765 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/CustomException.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/CustomException.java @@ -7,27 +7,29 @@ @Setter @Getter -public class CustomException extends RuntimeException{ - - private static final long serialVersionUID = 8859144435338793971L; - - private String code; - private String message; - private Map errors; - - public CustomException() { - super(); - } - public CustomException(String code, String message) { - super(); - this.code = code; - this.message = message; - } - public CustomException(Map errors) { - super(); - this.message = errors.toString(); - this.errors = errors; - } - - +public class CustomException extends RuntimeException { + + private static final long serialVersionUID = 8859144435338793971L; + + private String code; + private String message; + private Map errors; + + public CustomException() { + super(); + } + + public CustomException(String code, String message) { + super(); + this.code = code; + this.message = message; + } + + public CustomException(Map errors) { + super(); + this.message = errors.toString(); + this.errors = errors; + } + + } diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/Error.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/Error.java index 127ebc0cd31..6a902aa9d7f 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/Error.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/Error.java @@ -1,19 +1,14 @@ package org.egov.tracer.model; -import java.util.List; - import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; +import java.util.List; /** * Error object will be returned as a part of reponse body in conjunction with * ResponseInfo as part of ErrorResponse whenever the request processing status - * in the ResponseInfo is FAILED. + * in the ResponseInfo is FAILED. */ @Setter @Getter @@ -21,16 +16,29 @@ @AllArgsConstructor @ToString public class Error { - @JsonProperty("code") - private String code = null; + @JsonProperty("id") + private String id = null; + + @JsonProperty("parentId") + private String parentId = null; + + @JsonProperty("code") + private String code = null; + + @JsonProperty("message") + private String message = null; - @JsonProperty("message") - private String message = null; + @JsonProperty("description") + private String description = null; - @JsonProperty("description") - private String description = null; + @JsonProperty("params") + private List params = null; - @JsonProperty("params") - private List params = null; + public Error(String id, String code, String message, String description){ + this.id = id; + this.code = code; + this.message = message; + this.description = description; + } } diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorDetail.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorDetail.java new file mode 100644 index 00000000000..68acfca84ec --- /dev/null +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorDetail.java @@ -0,0 +1,20 @@ +package org.egov.tracer.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ErrorDetail { + + @JsonProperty("apiDetails") + private ApiDetails apiDetails = null; + + @JsonProperty("errors") + private List errors = null; + +} diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorDetailDTO.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorDetailDTO.java new file mode 100644 index 00000000000..9db1dd41957 --- /dev/null +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorDetailDTO.java @@ -0,0 +1,17 @@ +package org.egov.tracer.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +@Setter +@Getter +@ToString +@NoArgsConstructor +@AllArgsConstructor +public class ErrorDetailDTO extends ErrorDetail{ + private String uuid; + private AuditDetails auditDetails; + private Integer retryCount; + private Status status; + +} diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorEntity.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorEntity.java new file mode 100644 index 00000000000..5bafe9b07ac --- /dev/null +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorEntity.java @@ -0,0 +1,25 @@ +package org.egov.tracer.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ErrorEntity { + @JsonProperty("exception") + private Exception exception = null; + + @JsonProperty("type") + private ErrorType errorType = null; + + @JsonProperty("errorCode") + private String errorCode = null; + + @JsonProperty("errorMessage") + private String errorMessage = null; + + @JsonProperty("additionalDetails") + private Object additionalDetails = null; +} diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorQueueContract.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorQueueContract.java index c236108b4ad..8f79e23b32f 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorQueueContract.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorQueueContract.java @@ -13,14 +13,14 @@ public class ErrorQueueContract { private String id; - private String source; - private Object body; - private Long ts; - private ErrorRes errorRes; - private List exception; - //private String couse; - private String message; - //private Exception exception; + private String source; + private Object body; + private Long ts; + private ErrorRes errorRes; + private List exception; + //private String couse; + private String message; + //private Exception exception; private String correlationId; } diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorRes.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorRes.java index cf7f83d8a5b..c77cd62bc6f 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorRes.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorRes.java @@ -1,14 +1,12 @@ package org.egov.tracer.model; -import java.util.List; - -import org.egov.common.contract.response.ResponseInfo; - import com.fasterxml.jackson.annotation.JsonProperty; - import lombok.Getter; import lombok.Setter; import lombok.ToString; +import org.egov.common.contract.response.ResponseInfo; + +import java.util.List; /** * All APIs will return ErrorRes in case of failure which will carry ResponseInfo as metadata and Error object as actual representation of error. In case of bulk apis, some apis may chose to return the array of Error objects to indicate individual failure. @@ -16,12 +14,12 @@ @Setter @Getter @ToString -public class ErrorRes { - - @JsonProperty("ResponseInfo") - private ResponseInfo responseInfo = null; +public class ErrorRes { + + @JsonProperty("ResponseInfo") + private ResponseInfo responseInfo = null; - @JsonProperty("Errors") - private List errors = null; + @JsonProperty("Errors") + private List errors = null; } diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorType.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorType.java new file mode 100644 index 00000000000..ec0c9052111 --- /dev/null +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ErrorType.java @@ -0,0 +1,33 @@ +package org.egov.tracer.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public enum ErrorType { + + RECOVERABLE("RECOVERABLE"), + + NON_RECOVERABLE("NON_RECOVERABLE"); + + private String value; + + ErrorType(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ErrorType fromValue(String text) { + for (ErrorType b : ErrorType.values()) { + if (String.valueOf(b.value).equalsIgnoreCase(text)) { + return b; + } + } + return null; + } +} diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ServiceCallException.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ServiceCallException.java index 40db6b2b93e..c5120c297f7 100644 --- a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ServiceCallException.java +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/ServiceCallException.java @@ -1,20 +1,16 @@ package org.egov.tracer.model; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; +import lombok.*; @Setter @Getter @ToString @NoArgsConstructor @AllArgsConstructor -public class ServiceCallException extends RuntimeException{ - /** - * - */ - private static final long serialVersionUID = 1L; - private String error; +public class ServiceCallException extends RuntimeException { + /** + * + */ + private static final long serialVersionUID = 1L; + private String error; } diff --git a/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/Status.java b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/Status.java new file mode 100644 index 00000000000..d3f11ac2ea8 --- /dev/null +++ b/core-services/libraries/tracer/src/main/java/org/egov/tracer/model/Status.java @@ -0,0 +1,34 @@ +package org.egov.tracer.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public enum Status { + SUCCESS("SUCCESS"), + + FAILED("FAILED"), + + PENDING("PENDING"); + + private String value; + + Status(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Status fromValue(String text) { + for (Status b : Status.values()) { + if (String.valueOf(b.value).equalsIgnoreCase(text)) { + return b; + } + } + return null; + } +} diff --git a/core-services/libraries/tracer/src/main/resources/logback-spring.xml b/core-services/libraries/tracer/src/main/resources/logback-spring.xml index a956e297303..dc708b6c05b 100644 --- a/core-services/libraries/tracer/src/main/resources/logback-spring.xml +++ b/core-services/libraries/tracer/src/main/resources/logback-spring.xml @@ -1,53 +1,53 @@ - - - + + + - + - - - - - - { - "logger": "%logger{30}", - "message": "%message", - "level": "%level", - "thread": "%thread{10}" - } - - - - - - 30 - 2048 - 20 - ^sun\.reflect\..*\.invoke - ^net\.sf\.cglib\.proxy\.MethodProxy\.invoke - true - - - - + + + + + + { + "logger": "%logger{30}", + "message": "%message", + "level": "%level", + "thread": "%thread{10}" + } + + + + + + 30 + 2048 + 20 + ^sun\.reflect\..*\.invoke + ^net\.sf\.cglib\.proxy\.MethodProxy\.invoke + true + + + + - + - - - - + + + + - - - + + + - - - + + + \ No newline at end of file diff --git a/core-services/libraries/tracer/src/main/resources/tracer.properties b/core-services/libraries/tracer/src/main/resources/tracer.properties index af6055f7d98..84a88389fea 100644 --- a/core-services/libraries/tracer/src/main/resources/tracer.properties +++ b/core-services/libraries/tracer/src/main/resources/tracer.properties @@ -6,6 +6,8 @@ tracer.kafkaMessageLoggingEnabled=false tracer.restTemplateDetailedLoggingEnabled=false tracer.errorsPublish=false tracer.errorsTopic=egov-error +tracer.errorDetailsTopic=error-details-indexer-topic +tracer.errorDetailsPublishFlag=false tracer.filterSkipPattern=/api-docs.*|/autoconfig|/configprops|/dump|/health|/info|/metrics\ .*|/mappings|/swagger.*|.*\.png|.*\.css|.*\.js|.*\.html|/favicon.ico|/hystrix.stream|/prometheus|/manage/* diff --git a/core-services/libraries/tracer/src/test/java/org/egov/ObjectMapperTest.java b/core-services/libraries/tracer/src/test/java/org/egov/ObjectMapperTest.java index 8efe117e19a..67d7a2929a9 100644 --- a/core-services/libraries/tracer/src/test/java/org/egov/ObjectMapperTest.java +++ b/core-services/libraries/tracer/src/test/java/org/egov/ObjectMapperTest.java @@ -1,3 +1,4 @@ +/* package org.egov; import com.fasterxml.jackson.databind.ObjectMapper; @@ -19,9 +20,8 @@ public void test_should_convert_class_instance_to_map() { assertNotNull(hashMap); assertEquals("value1", hashMap.get("bar1")); - @SuppressWarnings("unchecked") - final HashMap subFoo = - (HashMap)hashMap.get("subFoo"); + @SuppressWarnings("unchecked") final HashMap subFoo = + (HashMap) hashMap.get("subFoo"); assertNotNull(subFoo); assertEquals("value2", subFoo.get("bar2")); } @@ -37,9 +37,8 @@ public void test_should_convert_map_to_map() { assertNotNull(hashMap); assertEquals("value1", hashMap.get("bar1")); - @SuppressWarnings("unchecked") - final HashMap subFooMap = - (HashMap)hashMap.get("subFoo"); + @SuppressWarnings("unchecked") final HashMap subFooMap = + (HashMap) hashMap.get("subFoo"); assertNotNull(subFooMap); assertEquals("value2", subFooMap.get("bar2")); } @@ -58,3 +57,4 @@ private class SubFoo { } } +*/ diff --git a/core-services/libraries/tracer/src/test/java/org/egov/Resources.java b/core-services/libraries/tracer/src/test/java/org/egov/Resources.java index 8bbbf6cf211..22a51961208 100644 --- a/core-services/libraries/tracer/src/test/java/org/egov/Resources.java +++ b/core-services/libraries/tracer/src/test/java/org/egov/Resources.java @@ -1,15 +1,24 @@ package org.egov; -import org.apache.commons.io.IOUtils; - import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; + +import org.apache.commons.io.IOUtils; public class Resources { public String getFileContents(String fileName) { try { return IOUtils.toString(this.getClass().getClassLoader() - .getResourceAsStream(fileName), "UTF-8") - .replace(" ", "").replace("\n", ""); + .getResourceAsStream(fileName), "UTF-8") + .replace(" ", "").replace("\n", ""); + /* + * String content; try (InputStream stream = + * this.getClass().getClassLoader().getResourceAsStream(fileName)) { if (stream + * == null) { throw new IllegalArgumentException("File not found: " + fileName); + * } content = new String(stream.readAllBytes(), StandardCharsets.UTF_8); } + * return content.replace(" ", "").replace("\n", ""); + */ } catch (IOException e) { throw new RuntimeException(e); } diff --git a/core-services/libraries/tracer/src/test/java/org/egov/tracer/kafka/KafkaListenerLoggingAspectTest.java b/core-services/libraries/tracer/src/test/java/org/egov/tracer/kafka/KafkaListenerLoggingAspectTest.java index a79166ff9a5..86efdf2fca7 100644 --- a/core-services/libraries/tracer/src/test/java/org/egov/tracer/kafka/KafkaListenerLoggingAspectTest.java +++ b/core-services/libraries/tracer/src/test/java/org/egov/tracer/kafka/KafkaListenerLoggingAspectTest.java @@ -1,3 +1,4 @@ +/* package org.egov.tracer.kafka; import org.egov.tracer.config.TracerConfiguration; @@ -41,11 +42,11 @@ public class KafkaListenerLoggingAspectTest { @Autowired private KafkaListenerWithoutPayloadAnnotationAndWithoutTopicHeaderAnnotation - kafkaListenerWithoutPayloadAnnotationAndWithoutTopicHeaderAnnotation; + kafkaListenerWithoutPayloadAnnotationAndWithoutTopicHeaderAnnotation; @Autowired private KafkaListenerStringPayloadWithNonTopicHeaderAnnotation - kafkaListenerStringPayloadWithNonTopicHeaderAnnotation; + kafkaListenerStringPayloadWithNonTopicHeaderAnnotation; @Autowired private TracerProperties tracerProperties; @@ -244,3 +245,4 @@ public void bar(@Payload String payload, @Header(KafkaHeaders.RECEIVED_PARTITION } } +*/ diff --git a/core-services/libraries/tracer/src/test/resources/requestBodyWithCorrelationIdPresentInRequestInfo.json b/core-services/libraries/tracer/src/test/resources/requestBodyWithCorrelationIdPresentInRequestInfo.json index 3942753ecf0..b3c32bd7d12 100644 --- a/core-services/libraries/tracer/src/test/resources/requestBodyWithCorrelationIdPresentInRequestInfo.json +++ b/core-services/libraries/tracer/src/test/resources/requestBodyWithCorrelationIdPresentInRequestInfo.json @@ -1,6 +1,6 @@ { - "RequestInfo": { - "correlationId": "someCorrelationId" - }, - "foo": "bar" + "RequestInfo": { + "correlationId": "someCorrelationId" + }, + "foo": "bar" } \ No newline at end of file diff --git a/core-services/libraries/tracer/src/test/resources/requestBodyWithoutCorrelationIdPresentInRequestInfo.json b/core-services/libraries/tracer/src/test/resources/requestBodyWithoutCorrelationIdPresentInRequestInfo.json index 36d818f65e1..87377638518 100644 --- a/core-services/libraries/tracer/src/test/resources/requestBodyWithoutCorrelationIdPresentInRequestInfo.json +++ b/core-services/libraries/tracer/src/test/resources/requestBodyWithoutCorrelationIdPresentInRequestInfo.json @@ -1,6 +1,6 @@ { - "RequestInfo": { - "foo": "bar" - }, + "RequestInfo": { "foo": "bar" + }, + "foo": "bar" } \ No newline at end of file diff --git a/core-services/libraries/tracer/src/test/resources/requestBodyWithoutRequestInfoField.json b/core-services/libraries/tracer/src/test/resources/requestBodyWithoutRequestInfoField.json index 8a79687628f..b42f309e7ae 100644 --- a/core-services/libraries/tracer/src/test/resources/requestBodyWithoutRequestInfoField.json +++ b/core-services/libraries/tracer/src/test/resources/requestBodyWithoutRequestInfoField.json @@ -1,3 +1,3 @@ { - "foo": "bar" + "foo": "bar" } \ No newline at end of file diff --git a/core-services/libraries2/digit-models/.gitignore b/core-services/libraries2/digit-models/.gitignore new file mode 100644 index 00000000000..2af7cefb0a3 --- /dev/null +++ b/core-services/libraries2/digit-models/.gitignore @@ -0,0 +1,24 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +nbproject/private/ +build/ +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ \ No newline at end of file diff --git a/core-services/libraries2/digit-models/CHANGELOG.md b/core-services/libraries2/digit-models/CHANGELOG.md new file mode 100644 index 00000000000..8336d84b5a5 --- /dev/null +++ b/core-services/libraries2/digit-models/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 1.0.0 + +- Base version \ No newline at end of file diff --git a/core-services/libraries2/digit-models/Dockerfile b/core-services/libraries2/digit-models/Dockerfile new file mode 100644 index 00000000000..cd50dd4120d --- /dev/null +++ b/core-services/libraries2/digit-models/Dockerfile @@ -0,0 +1,17 @@ +FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build +ARG WORK_DIR +ARG nexusUsername +ARG nexusPassword +WORKDIR /app +# copy the project files +COPY ${WORK_DIR}/pom.xml ./pom.xml +COPY ${WORK_DIR}/settings.xml ./settings.xml +# COPY build/maven/settings.xml ./settings.xml +# COPY build/maven/start.sh ./start.sh +COPY ${WORK_DIR}/src ./src +# not useful for stateless builds +# RUN mvn -B dependency:go-offline +RUN cd ${WORK_DIR} \ + && mvn -B -f /app/pom.xml test verify deploy -s settings.xml \ + -Dnexus.user=${nexusUsername} -Dnexus.password=${nexusPassword} +FROM scratch \ No newline at end of file diff --git a/core-services/libraries2/digit-models/README.md b/core-services/libraries2/digit-models/README.md new file mode 100644 index 00000000000..2b38486e14c --- /dev/null +++ b/core-services/libraries2/digit-models/README.md @@ -0,0 +1,3 @@ +# Digit Models + +Digit Models is a library to store common classes needed by many services. diff --git a/core-services/libraries2/digit-models/pom.xml b/core-services/libraries2/digit-models/pom.xml new file mode 100644 index 00000000000..5d874c771ea --- /dev/null +++ b/core-services/libraries2/digit-models/pom.xml @@ -0,0 +1,115 @@ + + + 4.0.0 + org.egov.services + digit-models + 1.0.0-SNAPSHOT + digit-models + Shared classes among services + + + repo.digit.org + eGov ERP Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/releases/ + + + repo.digit.org + eGov ERP Snapshots Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + + + repo.digit.org + eGov ERP Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/releases/ + + + snapshots.repo.digit.org + eGov ERP Snapshots Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + + 2.17.1 + UTF-8 + 1.8 + UTF-8 + + + + org.apache.commons + commons-lang3 + 3.0 + + + net.minidev + json-smart + 2.2.1 + + + org.projectlombok + lombok + 1.18.24 + true + + + com.fasterxml.jackson.core + jackson-annotations + 2.8.7 + + + com.fasterxml.jackson.core + jackson-databind + 2.8.7 + + + org.springframework + spring-core + 5.2.5.RELEASE + + + org.egov.services + services-common + 1.1.1-SNAPSHOT + + + jakarta.validation + jakarta.validation-api + 2.0.2 + compile + + + + + + maven-compiler-plugin + + 8 + 8 + + + + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + + + + diff --git a/core-services/libraries2/digit-models/settings.xml b/core-services/libraries2/digit-models/settings.xml new file mode 100644 index 00000000000..f65f9dd2bfa --- /dev/null +++ b/core-services/libraries2/digit-models/settings.xml @@ -0,0 +1,23 @@ + + + + + nexus + central + https://nexus-repo.digit.org/nexus/content/groups/public/ + + + + + repo.digit.org + ${nexus.user} + ${nexus.password} + + + + com.versioneye + + diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Action.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Action.java new file mode 100644 index 00000000000..1957c73144b --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Action.java @@ -0,0 +1,56 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +import javax.validation.Valid; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +@EqualsAndHashCode(of = {"tenantId", "currentState", "action"}) +public class Action { + + @Size(max = 256) + @JsonProperty("uuid") + private String uuid; + + @Size(max = 256) + @JsonProperty("tenantId") + private String tenantId; + + @Size(max = 256) + @JsonProperty("currentState") + private String currentState; + + @Size(max = 256) + @JsonProperty("action") + private String action; + + @Size(max = 256) + @JsonProperty("nextState") + private String nextState; + + @Size(max = 1024) + @JsonProperty("roles") + @Valid + private List roles; + + private AuditDetails auditDetails; + + + public Action addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/AuditDetails.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/AuditDetails.java new file mode 100644 index 00000000000..c84fe7f74b1 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/AuditDetails.java @@ -0,0 +1,31 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + + +/** + * Collection of audit related fields used by most models + */ + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class AuditDetails { + @JsonProperty("createdBy") + private String createdBy = null; + + @JsonProperty("lastModifiedBy") + private String lastModifiedBy = null; + + @JsonProperty("createdTime") + private Long createdTime = null; + + @JsonProperty("lastModifiedTime") + private Long lastModifiedTime = null; + + +} + diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Bill.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Bill.java new file mode 100644 index 00000000000..61f645d777b --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Bill.java @@ -0,0 +1,158 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.*; +import org.springframework.util.CollectionUtils; + +import javax.validation.Valid; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +public class Bill { + // TODO some of the fields are mandatory in yml, lets discuss billdetail and billaccountdetail also for more clarity + + @JsonProperty("id") + private String id; + + @JsonProperty("mobileNumber") + private String mobileNumber; + + @JsonProperty("paidBy") + private String paidBy; + + @JsonProperty("payerName") + private String payerName; + + @JsonProperty("payerAddress") + private String payerAddress; + + @JsonProperty("payerEmail") + private String payerEmail; + + @JsonProperty("payerId") + private String payerId; + + @JsonProperty("status") + private StatusEnum status; + + @JsonProperty("reasonForCancellation") + private String reasonForCancellation; + + @JsonProperty("isCancelled") + private Boolean isCancelled; + + @JsonProperty("additionalDetails") + private JsonNode additionalDetails; + + @JsonProperty("billDetails") + @Valid + private List billDetails; + + @JsonProperty("tenantId") + private String tenantId; + + @JsonProperty("auditDetails") + private AuditDetails auditDetails; + + @JsonProperty("collectionModesNotAllowed") + private List collectionModesNotAllowed; + + @JsonProperty("partPaymentAllowed") + private Boolean partPaymentAllowed; + + @JsonProperty("isAdvanceAllowed") + private Boolean isAdvanceAllowed; + + @JsonProperty("minimumAmountToBePaid") + private BigDecimal minimumAmountToBePaid; + + @JsonProperty("businessService") + private String businessService; + + @JsonProperty("totalAmount") + private BigDecimal totalAmount; + + @JsonProperty("consumerCode") + private String consumerCode; + + @JsonProperty("billNumber") + private String billNumber; + + @JsonProperty("billDate") + private Long billDate; + + @JsonProperty("amountPaid") + private BigDecimal amountPaid; + + + public enum StatusEnum { + ACTIVE("ACTIVE"), + + CANCELLED("CANCELLED"), + + PAID("PAID"), + + EXPIRED("EXPIRED"); + + private final String value; + + StatusEnum(String value) { + this.value = value; + } + + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + public static boolean contains(String test) { + for (StatusEnum val : StatusEnum.values()) { + if (val.name().equalsIgnoreCase(test)) { + return true; + } + } + return false; + } + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + } + + public Boolean addBillDetail(BillDetail billDetail) { + + if (CollectionUtils.isEmpty(billDetails)) { + + billDetails = new ArrayList<>(); + return billDetails.add(billDetail); + } else { + + if (!billDetails.contains(billDetail)) + return billDetails.add(billDetail); + else + return false; + } + } + + +} \ No newline at end of file diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BillAccountDetail.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BillAccountDetail.java new file mode 100644 index 00000000000..64a10ed3564 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BillAccountDetail.java @@ -0,0 +1,56 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.*; + +import javax.validation.constraints.Size; +import java.math.BigDecimal; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +public class BillAccountDetail { + + @Size(max = 64) + @JsonProperty("id") + private String id; + + @Size(max = 64) + @JsonProperty("tenantId") + private String tenantId; + + @Size(max = 64) + @JsonProperty("billDetailId") + private String billDetailId; + + @Size(max = 64) + @JsonProperty("demandDetailId") + private String demandDetailId; + + @JsonProperty("order") + private Integer order; + + @JsonProperty("amount") + private BigDecimal amount; + + @JsonProperty("adjustedAmount") + private BigDecimal adjustedAmount; + + @JsonProperty("isActualDemand") + private Boolean isActualDemand; + + @Size(max = 64) + @JsonProperty("taxHeadCode") + private String taxHeadCode; + + @JsonProperty("additionalDetails") + private JsonNode additionalDetails; + + @JsonProperty("auditDetails") + private AuditDetails auditDetails; +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BillDetail.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BillDetail.java new file mode 100644 index 00000000000..2ee333ea675 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BillDetail.java @@ -0,0 +1,99 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.*; +import org.springframework.util.CollectionUtils; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(of = {"id"}) +public class BillDetail { + + @JsonProperty("id") + private String id; + + @JsonProperty("tenantId") + private String tenantId; + + @JsonProperty("demandId") + private String demandId; + + @JsonProperty("billId") + private String billId; + + @JsonProperty("amount") + @NotNull + private BigDecimal amount; + + @JsonProperty("amountPaid") + private BigDecimal amountPaid; + + @NotNull + @JsonProperty("fromPeriod") + private Long fromPeriod; + + @NotNull + @JsonProperty("toPeriod") + private Long toPeriod; + + @JsonProperty("additionalDetails") + private JsonNode additionalDetails; + + @JsonProperty("channel") + private String channel; + + @JsonProperty("voucherHeader") + private String voucherHeader; + + @JsonProperty("boundary") + private String boundary; + + @JsonProperty("manualReceiptNumber") + private String manualReceiptNumber; + + @JsonProperty("manualReceiptDate") + private Long manualReceiptDate; + + @JsonProperty("billAccountDetails") + private List billAccountDetails; + + @NotNull + @JsonProperty("collectionType") + private String collectionType; + + @JsonProperty("auditDetails") + private AuditDetails auditDetails; + + private String billDescription; + + @NotNull + @JsonProperty("expiryDate") + private Long expiryDate; + + + public Boolean addBillAccountDetail(BillAccountDetail billAccountDetail) { + + if (CollectionUtils.isEmpty(billAccountDetails)) { + + billAccountDetails = new ArrayList<>(); + return billAccountDetails.add(billAccountDetail); + } else { + + if (!billAccountDetails.contains(billAccountDetail)) + return billAccountDetails.add(billAccountDetail); + else + return false; + } + } + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BusinessService.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BusinessService.java new file mode 100644 index 00000000000..5309583efa5 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BusinessService.java @@ -0,0 +1,88 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +@EqualsAndHashCode(of = {"tenantId", "businessService"}) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class BusinessService { + + @Size(max = 256) + @JsonProperty("tenantId") + private String tenantId = null; + + @Size(max = 256) + @JsonProperty("uuid") + private String uuid = null; + + @Size(max = 256) + @JsonProperty("businessService") + private String businessService = null; + + @Size(max = 256) + @JsonProperty("business") + private String business = null; + + @Size(max = 1024) + @JsonProperty("getUri") + private String getUri = null; + + @Size(max = 1024) + @JsonProperty("postUri") + private String postUri = null; + + @JsonProperty("businessServiceSla") + private Long businessServiceSla = null; + + @NotNull + @Valid + @JsonProperty("states") + private List states = null; + + @JsonProperty("auditDetails") + private AuditDetails auditDetails = null; + + + public BusinessService addStatesItem(State statesItem) { + if (this.states == null) { + this.states = new ArrayList<>(); + } + this.states.add(statesItem); + return this; + } + + + /** + * Returns the currentState with the given uuid if not present returns null + * + * @param uuid the uuid of the currentState to be returned + * @return + */ + public State getStateFromUuid(String uuid) { + State state = null; + if (this.states != null) { + for (State s : this.states) { + if (s.getUuid().equalsIgnoreCase(uuid)) { + state = s; + break; + } + } + } + return state; + } + + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BusinessServiceResponse.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BusinessServiceResponse.java new file mode 100644 index 00000000000..52ca27917ec --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/BusinessServiceResponse.java @@ -0,0 +1,37 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.response.ResponseInfo; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.util.ArrayList; +import java.util.List; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +@ToString +public class BusinessServiceResponse { + + @JsonProperty("ResponseInfo") + private ResponseInfo responseInfo; + + @JsonProperty("BusinessServices") + @Valid + @NotNull + private List businessServices; + + + public BusinessServiceResponse addBusinessServiceItem(BusinessService businessServiceItem) { + if (this.businessServices == null) { + this.businessServices = new ArrayList<>(); + } + this.businessServices.add(businessServiceItem); + return this; + } + + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/CreateUserRequest.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/CreateUserRequest.java new file mode 100644 index 00000000000..e47e43cd800 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/CreateUserRequest.java @@ -0,0 +1,21 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.contract.request.User; + +@AllArgsConstructor +@Getter +@NoArgsConstructor +public class CreateUserRequest { + + @JsonProperty("requestInfo") + private RequestInfo requestInfo; + + @JsonProperty("user") + private User user; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Document.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Document.java new file mode 100644 index 00000000000..8377243b6b0 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Document.java @@ -0,0 +1,27 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class Document { + @JsonProperty("id") + private String id = null; + + @JsonProperty("documentType") + private String documentType = null; + + @JsonProperty("fileStore") + private String fileStore = null; + + @JsonProperty("documentUid") + private String documentUid = null; + + @JsonProperty("additionalDetails") + private Object additionalDetails = null; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdGenerationRequest.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdGenerationRequest.java new file mode 100644 index 00000000000..7157fb5291d --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdGenerationRequest.java @@ -0,0 +1,23 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.request.RequestInfo; + +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class IdGenerationRequest { + + @JsonProperty("RequestInfo") + private RequestInfo requestInfo; + + private List idRequests; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdGenerationResponse.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdGenerationResponse.java new file mode 100644 index 00000000000..bb92f357a5d --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdGenerationResponse.java @@ -0,0 +1,21 @@ +package digit.models.coremodels; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.response.ResponseInfo; + +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class IdGenerationResponse { + + private ResponseInfo responseInfo; + + private List idResponses; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdRequest.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdRequest.java new file mode 100644 index 00000000000..6340e1ac43f --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdRequest.java @@ -0,0 +1,28 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class IdRequest { + + @JsonProperty("idName") + @NotNull + private String idName; + + @NotNull + @JsonProperty("tenantId") + private String tenantId; + + @JsonProperty("format") + private String format; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdResponse.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdResponse.java new file mode 100644 index 00000000000..808b6ffbba9 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/IdResponse.java @@ -0,0 +1,16 @@ +package digit.models.coremodels; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class IdResponse { + + private String id; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Payment.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Payment.java new file mode 100644 index 00000000000..697cb80cd8c --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/Payment.java @@ -0,0 +1,109 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.*; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +@EqualsAndHashCode +public class Payment { + + @Size(max = 64) + @JsonProperty("id") + private String id; + + @NotNull + @Size(max = 64) + @JsonProperty("tenantId") + private String tenantId; + + @JsonProperty("totalDue") + private BigDecimal totalDue; + + @NotNull + @JsonProperty("totalAmountPaid") + private BigDecimal totalAmountPaid; + + @Size(max = 128) + @JsonProperty("transactionNumber") + private String transactionNumber; + + @JsonProperty("transactionDate") + private Long transactionDate; + + @NotNull + @JsonProperty("paymentMode") + private String paymentMode; + + @JsonProperty("instrumentDate") + private Long instrumentDate; + + @Size(max = 128) + @JsonProperty("instrumentNumber") + private String instrumentNumber; + + @JsonProperty("instrumentStatus") + private String instrumentStatus; + + @Size(max = 64) + @JsonProperty("ifscCode") + private String ifscCode; + + @JsonProperty("auditDetails") + private AuditDetails auditDetails; + + @JsonProperty("additionalDetails") + private JsonNode additionalDetails; + + @JsonProperty("paymentDetails") + @Valid + private List paymentDetails; + + @Size(max = 128) + @NotNull + @JsonProperty("paidBy") + private String paidBy; + + @Size(max = 64) + @NotNull + @JsonProperty("mobileNumber") + private String mobileNumber; + + @Size(max = 128) + @JsonProperty("payerName") + private String payerName; + + @Size(max = 1024) + @JsonProperty("payerAddress") + private String payerAddress; + + @Size(max = 64) + @JsonProperty("payerEmail") + private String payerEmail; + + @Size(max = 64) + @JsonProperty("payerId") + private String payerId; + + @JsonProperty("paymentStatus") + private String paymentStatus; + + public Payment addpaymentDetailsItem(PaymentDetail paymentDetail) { + if (this.paymentDetails == null) { + this.paymentDetails = new ArrayList<>(); + } + this.paymentDetails.add(paymentDetail); + return this; + } + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/PaymentDetail.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/PaymentDetail.java new file mode 100644 index 00000000000..68a127f42c9 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/PaymentDetail.java @@ -0,0 +1,67 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.*; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.math.BigDecimal; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@Builder +@EqualsAndHashCode +public class PaymentDetail { + + @Size(max = 64) + @JsonProperty("id") + private String id; + + @Size(max = 64) + @JsonProperty("tenantId") + private String tenantId; + + @JsonProperty("totalDue") + private BigDecimal totalDue; + + @NotNull + @JsonProperty("totalAmountPaid") + private BigDecimal totalAmountPaid; + + @Size(max = 64) + @JsonProperty("receiptNumber") + private String receiptNumber; + + @Size(max = 64) + @JsonProperty("manualReceiptNumber") + private String manualReceiptNumber; + + @JsonProperty("manualReceiptDate") + private Long manualReceiptDate; + + @JsonProperty("receiptDate") + private Long receiptDate; + + @JsonProperty("receiptType") + private String receiptType; + + @JsonProperty("businessService") + private String businessService; + + @NotNull + @Size(max = 64) + @JsonProperty("billId") + private String billId; + + @JsonProperty("bill") + private Bill bill; + + @JsonProperty("additionalDetails") + private JsonNode additionalDetails; + + @JsonProperty("auditDetails") + private AuditDetails auditDetails; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/PaymentRequest.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/PaymentRequest.java new file mode 100644 index 00000000000..a42345bf357 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/PaymentRequest.java @@ -0,0 +1,27 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.request.RequestInfo; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class PaymentRequest { + + @NotNull + @Valid + @JsonProperty("RequestInfo") + private RequestInfo requestInfo; + + @NotNull + @Valid + @JsonProperty("Payment") + private Payment payment; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/ProcessInstance.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/ProcessInstance.java new file mode 100644 index 00000000000..c2e054fb4ce --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/ProcessInstance.java @@ -0,0 +1,75 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.request.User; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@EqualsAndHashCode(of = {"id"}) +@ToString +public class ProcessInstance { + + @Size(max = 64) + @JsonProperty("id") + private String id; + + @NotNull + @Size(max = 128) + @JsonProperty("tenantId") + private String tenantId; + + @NotNull + @Size(max = 128) + @JsonProperty("businessService") + private String businessService; + + @NotNull + @Size(max = 128) + @JsonProperty("businessId") + private String businessId; + + @NotNull + @Size(max = 128) + @JsonProperty("action") + private String action; + + @NotNull + @Size(max = 64) + @JsonProperty("moduleName") + private String moduleName; + + @JsonProperty("state") + private State state; + + + @JsonProperty("comment") + private String comment; + + @JsonProperty("documents") + @Valid + private List documents; + + @JsonProperty("assignes") + private List assignes; + + public ProcessInstance addDocumentsItem(Document documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + if (!this.documents.contains(documentsItem)) + this.documents.add(documentsItem); + + return this; + } + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/ProcessInstanceRequest.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/ProcessInstanceRequest.java new file mode 100644 index 00000000000..d2ef94e77da --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/ProcessInstanceRequest.java @@ -0,0 +1,36 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.request.RequestInfo; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +public class ProcessInstanceRequest { + @JsonProperty("RequestInfo") + private RequestInfo requestInfo; + + @JsonProperty("ProcessInstances") + @Valid + @NotNull + private List processInstances; + + + public ProcessInstanceRequest addProcessInstanceItem(ProcessInstance processInstanceItem) { + if (this.processInstances == null) { + this.processInstances = new ArrayList<>(); + } + this.processInstances.add(processInstanceItem); + return this; + } + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/ProcessInstanceResponse.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/ProcessInstanceResponse.java new file mode 100644 index 00000000000..9aebacb3951 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/ProcessInstanceResponse.java @@ -0,0 +1,33 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.response.ResponseInfo; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ProcessInstanceResponse { + @JsonProperty("ResponseInfo") + private ResponseInfo responseInfo; + + @JsonProperty("ProcessInstances") + @Valid + private List processInstances; + + + public ProcessInstanceResponse addProcessInstanceItem(ProcessInstance proceInstanceItem) { + if (this.processInstances == null) { + this.processInstances = new ArrayList<>(); + } + this.processInstances.add(proceInstanceItem); + return this; + } + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/RequestInfoWrapper.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/RequestInfoWrapper.java new file mode 100644 index 00000000000..3eda053bc35 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/RequestInfoWrapper.java @@ -0,0 +1,16 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.request.RequestInfo; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class RequestInfoWrapper { + + @JsonProperty("RequestInfo") + private RequestInfo requestInfo; +} \ No newline at end of file diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/SMSRequest.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/SMSRequest.java new file mode 100644 index 00000000000..7989fadc218 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/SMSRequest.java @@ -0,0 +1,13 @@ +package digit.models.coremodels; + +import lombok.*; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +public class SMSRequest { + private String mobileNumber; + private String message; +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/State.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/State.java new file mode 100644 index 00000000000..a101de62036 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/State.java @@ -0,0 +1,70 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +import javax.validation.Valid; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +@EqualsAndHashCode(of = {"tenantId", "businessServiceId", "state"}) +public class State { + + @Size(max = 256) + @JsonProperty("uuid") + private String uuid; + + @Size(max = 256) + @JsonProperty("tenantId") + private String tenantId; + + @Size(max = 256) + @JsonProperty("businessServiceId") + private String businessServiceId; + + @JsonProperty("sla") + private Long sla; + + @Size(max = 256) + @JsonProperty("state") + private String state; + + @Size(max = 256) + @JsonProperty("applicationStatus") + private String applicationStatus; + + @JsonProperty("docUploadRequired") + private Boolean docUploadRequired; + + @JsonProperty("isStartState") + private Boolean isStartState; + + @JsonProperty("isTerminateState") + private Boolean isTerminateState; + + @JsonProperty("isStateUpdatable") + private Boolean isStateUpdatable; + + @JsonProperty("actions") + @Valid + private List actions; + + private AuditDetails auditDetails; + + + public State addActionsItem(Action actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } + this.actions.add(actionsItem); + return this; + } + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/UserDetailResponse.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/UserDetailResponse.java new file mode 100644 index 00000000000..f54dd38b97f --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/UserDetailResponse.java @@ -0,0 +1,21 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.egov.common.contract.request.User; +import org.egov.common.contract.response.ResponseInfo; + +import java.util.List; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +public class UserDetailResponse { + @JsonProperty("responseInfo") + ResponseInfo responseInfo; + + @JsonProperty("user") + List user; +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/UserSearchRequest.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/UserSearchRequest.java new file mode 100644 index 00000000000..e6f1add6616 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/UserSearchRequest.java @@ -0,0 +1,68 @@ +package digit.models.coremodels; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; +import org.egov.common.contract.request.RequestInfo; + +import java.util.Collections; +import java.util.List; + +@Getter +@Setter +public class UserSearchRequest { + + @JsonProperty("RequestInfo") + private RequestInfo requestInfo; + + @JsonProperty("uuid") + private List uuid; + + @JsonProperty("id") + private List id; + + @JsonProperty("userName") + private String userName; + + @JsonProperty("name") + private String name; + + @JsonProperty("mobileNumber") + private String mobileNumber; + + @JsonProperty("aadhaarNumber") + private String aadhaarNumber; + + @JsonProperty("pan") + private String pan; + + @JsonProperty("emailId") + private String emailId; + + @JsonProperty("fuzzyLogic") + private boolean fuzzyLogic; + + @JsonProperty("active") + @Setter + private Boolean active; + + @JsonProperty("tenantId") + private String tenantId; + + @JsonProperty("pageSize") + private int pageSize; + + @JsonProperty("pageNumber") + private int pageNumber = 0; + + @JsonProperty("sort") + private List sort = Collections.singletonList("name"); + + @JsonProperty("userType") + private String userType; + + @JsonProperty("roleCodes") + private List roleCodes; + + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MDMSCreateErrorResponse.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MDMSCreateErrorResponse.java new file mode 100644 index 00000000000..cfffdeacb47 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MDMSCreateErrorResponse.java @@ -0,0 +1,23 @@ +package digit.models.coremodels.mdms; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.response.ResponseInfo; + +@Getter +@Setter +@ToString +@AllArgsConstructor +@NoArgsConstructor +public class MDMSCreateErrorResponse { + + @JsonProperty("ResponseInfo") + private ResponseInfo responseInfo; + + @JsonProperty("Message") + private String message; + + @JsonProperty("Data") + private Object data; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MDMSCreateRequest.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MDMSCreateRequest.java new file mode 100644 index 00000000000..7aa3f3646d0 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MDMSCreateRequest.java @@ -0,0 +1,20 @@ +package digit.models.coremodels.mdms; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.request.RequestInfo; + +@Getter +@Setter +@ToString +@AllArgsConstructor +@NoArgsConstructor +public class MDMSCreateRequest { + + @JsonProperty("RequestInfo") + public RequestInfo requestInfo; + + @JsonProperty("MasterMetaData") + public MasterMetaData masterMetaData; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MasterDetail.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MasterDetail.java new file mode 100644 index 00000000000..27b72526e1c --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MasterDetail.java @@ -0,0 +1,18 @@ +package digit.models.coremodels.mdms; + +import lombok.*; + +import javax.validation.constraints.Size; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MasterDetail { + @Size(max=256) + private String name; + + private String filter; +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MasterMetaData.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MasterMetaData.java new file mode 100644 index 00000000000..a63f428aa75 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MasterMetaData.java @@ -0,0 +1,26 @@ +package digit.models.coremodels.mdms; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +import java.util.List; + +@Getter +@Setter +@ToString +@AllArgsConstructor +@NoArgsConstructor +public class MasterMetaData { + + @JsonProperty("tenantId") + public String tenantId; + + @JsonProperty("moduleName") + public String moduleName; + + @JsonProperty("masterName") + public String masterName; + + @JsonProperty("masterData") + public List masterData; +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsCreateResponse.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsCreateResponse.java new file mode 100644 index 00000000000..2d9c6179e53 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsCreateResponse.java @@ -0,0 +1,20 @@ +package digit.models.coremodels.mdms; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.response.ResponseInfo; + +@Getter +@Setter +@ToString +@AllArgsConstructor +@NoArgsConstructor +public class MdmsCreateResponse { + + @JsonProperty("ResponseInfo") + public ResponseInfo responseInfo; + + @JsonProperty("Data") + public Object data; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsCriteria.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsCriteria.java new file mode 100644 index 00000000000..6e01d6ad364 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsCriteria.java @@ -0,0 +1,25 @@ +package digit.models.coremodels.mdms; + +import lombok.*; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.List; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MdmsCriteria { + + @NotNull + @Size(max=256) + private String tenantId; + + @NotNull + @Valid + private List moduleDetails; +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsCriteriaReq.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsCriteriaReq.java new file mode 100644 index 00000000000..5ebdc3d59ff --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsCriteriaReq.java @@ -0,0 +1,28 @@ +package digit.models.coremodels.mdms; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.request.RequestInfo; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MdmsCriteriaReq { + + @JsonProperty("RequestInfo") + @Valid + @NotNull + private RequestInfo requestInfo; + + @JsonProperty("MdmsCriteria") + @Valid + @NotNull + private MdmsCriteria mdmsCriteria; + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsResponse.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsResponse.java new file mode 100644 index 00000000000..f3bfdc9f461 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/MdmsResponse.java @@ -0,0 +1,23 @@ +package digit.models.coremodels.mdms; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.common.contract.response.ResponseInfo; +import net.minidev.json.JSONArray; + +import java.util.Map; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MdmsResponse { + + @JsonProperty("ResponseInfo") + private ResponseInfo responseInfo; + + @JsonProperty("MdmsRes") + private Map> mdmsRes; +} \ No newline at end of file diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/ModuleDetail.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/ModuleDetail.java new file mode 100644 index 00000000000..6a935790872 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/mdms/ModuleDetail.java @@ -0,0 +1,23 @@ +package digit.models.coremodels.mdms; + +import lombok.*; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.List; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ModuleDetail { + + @NotNull + @Size(max=256) + private String moduleName; + + private List masterDetails; + +} \ No newline at end of file diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/Address.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/Address.java new file mode 100644 index 00000000000..ebdd3417b6c --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/Address.java @@ -0,0 +1,50 @@ +package digit.models.coremodels.user; + +import digit.models.coremodels.user.enums.AddressType; +import lombok.*; +import org.apache.commons.lang3.StringUtils; + +import java.util.Date; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@EqualsAndHashCode(of = {"id"}) +public class Address { + private String pinCode; + private String city; + private String address; + private AddressType type; + private Long id; + private String tenantId; + private Long userId; + private String addressType; + private Long LastModifiedBy; + private Date LastModifiedDate; + + boolean isInvalid() { + return isPinCodeInvalid() + || isCityInvalid() + || isAddressInvalid(); + } + + + boolean isNotEmpty() { + return StringUtils.isNotEmpty(pinCode) + || StringUtils.isNotEmpty(city) + || StringUtils.isNotEmpty(address); + } + + boolean isPinCodeInvalid() { + return pinCode != null && pinCode.length() > 10; + } + + boolean isCityInvalid() { + return city != null && city.length() > 300; + } + + boolean isAddressInvalid() { + return address != null && address.length() > 300; + } +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/OtpValidationRequest.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/OtpValidationRequest.java new file mode 100644 index 00000000000..e47b6d6e390 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/OtpValidationRequest.java @@ -0,0 +1,17 @@ +package digit.models.coremodels.user; + + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@AllArgsConstructor +@Builder +@Getter +@EqualsAndHashCode +public class OtpValidationRequest { + private String otpReference; + private String mobileNumber; + protected String tenantId; +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/Role.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/Role.java new file mode 100644 index 00000000000..290503083f9 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/Role.java @@ -0,0 +1,27 @@ +package digit.models.coremodels.user; + +import lombok.*; + +import java.util.Date; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@ToString +@EqualsAndHashCode(of = {"code", "tenantId"}) +public class Role { + private static final String CITIZEN = "CITIZEN"; + private String name; + private String code; + private String description; + private Long createdBy; + private Date createdDate; + private Long lastModifiedBy; + private Date lastModifiedDate; + private String tenantId; + + public static Role getCitizenRole() { + return Role.builder().code(CITIZEN).build(); + } +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/User.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/User.java new file mode 100644 index 00000000000..50cd910da8b --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/User.java @@ -0,0 +1,241 @@ +package digit.models.coremodels.user; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import digit.models.coremodels.user.config.UserServiceConstants; +import digit.models.coremodels.user.enums.BloodGroup; +import digit.models.coremodels.user.enums.Gender; +import digit.models.coremodels.user.enums.GuardianRelation; +import digit.models.coremodels.user.enums.UserType; +import digit.models.coremodels.user.exception.InvalidUserCreateException; +import digit.models.coremodels.user.exception.InvalidUserUpdateException; +import lombok.*; +import org.apache.commons.lang3.time.DateUtils; +import org.springframework.util.CollectionUtils; + +import javax.validation.constraints.Email; +import javax.validation.constraints.Pattern; +import javax.validation.constraints.Size; +import java.util.*; + +import static org.springframework.util.ObjectUtils.isEmpty; + +@AllArgsConstructor +@Getter +@Setter +@ToString +@Builder(toBuilder = true) +public class User { + + private Long id; + private String uuid; + + @Pattern(regexp = UserServiceConstants.PATTERN_TENANT) + @Size(max = 50) + private String tenantId; + private String username; + private String title; + private String password; + private String salutation; + + @Pattern(regexp = UserServiceConstants.PATTERN_NAME) + private String guardian; + + private GuardianRelation guardianRelation; + + @Pattern(regexp = UserServiceConstants.PATTERN_NAME) + @Size(max = 50) + private String name; + private Gender gender; + private String mobileNumber; + + @Email + private String emailId; + private String altContactNumber; + private String pan; + private String aadhaarNumber; + private Address permanentAddress; + private Address correspondenceAddress; + private Set
addresses; + private Boolean active; + private Set roles; + private Date dob; + private Date passwordExpiryDate; + private String locale = "en_IN"; + private UserType type; + private BloodGroup bloodGroup; + private String identificationMark; + private String signature; + private String photo; + private Boolean accountLocked; + private Long accountLockedDate; + private Date lastModifiedDate; + private Date createdDate; + private String otpReference; + private Long createdBy; + private Long lastModifiedBy; + private Long loggedInUserId; + private boolean otpValidationMandatory; + private boolean mobileValidationMandatory = true; + private String alternateMobileNumber; + + public User addAddressItem(Address addressItem) { + if (this.addresses == null) { + this.addresses = new HashSet<>(); + } + this.addresses.add(addressItem); + return this; + } + + public User addRolesItem(Role roleItem) { + if (this.roles == null) { + this.roles = new HashSet<>(); + } + this.roles.add(roleItem); + return this; + } + + public void validateNewUser() { + validateNewUser(true); + } + + public void validateNewUser(boolean createUserValidateName) { + if (isUsernameAbsent() + || (createUserValidateName && isNameAbsent()) + || isMobileNumberAbsent() + || isActiveIndicatorAbsent() + || isTypeAbsent() + || isPermanentAddressInvalid() + || isCorrespondenceAddressInvalid() + || isRolesAbsent() + || isOtpReferenceAbsent() + || isTenantIdAbsent()) { + throw new InvalidUserCreateException(this); + } + } + + public void validateUserModification() { + if (isPermanentAddressInvalid() + || isCorrespondenceAddressInvalid() + || isTenantIdAbsent() + ) { + throw new InvalidUserUpdateException(this); + } + } + + @JsonIgnore + public boolean isCorrespondenceAddressInvalid() { + return correspondenceAddress != null && correspondenceAddress.isInvalid(); + } + + @JsonIgnore + public boolean isPermanentAddressInvalid() { + return permanentAddress != null && permanentAddress.isInvalid(); + } + + @JsonIgnore + public boolean isOtpReferenceAbsent() { + return otpValidationMandatory && isEmpty(otpReference); + } + + @JsonIgnore + public boolean isTypeAbsent() { + return isEmpty(type); + } + + @JsonIgnore + public boolean isActiveIndicatorAbsent() { + return isEmpty(active); + } + + @JsonIgnore + public boolean isMobileNumberAbsent() { + return mobileValidationMandatory && isEmpty(mobileNumber); + } + + @JsonIgnore + public boolean isNameAbsent() { + return isEmpty(name); + } + + @JsonIgnore + public boolean isUsernameAbsent() { + return isEmpty(username); + } + + @JsonIgnore + public boolean isTenantIdAbsent() { + return isEmpty(tenantId); + } + + @JsonIgnore + public boolean isPasswordAbsent() { + return isEmpty(password); + } + + @JsonIgnore + public boolean isRolesAbsent() { + return CollectionUtils.isEmpty(roles) || roles.stream().anyMatch(r -> isEmpty(r.getCode())); + } + + @JsonIgnore + public boolean isIdAbsent() { + return id == null; + } + + public void nullifySensitiveFields() { + username = null; + type = null; + mobileNumber = null; + password = null; + passwordExpiryDate = null; + roles = null; + accountLocked = null; + accountLockedDate = null; + } + + @JsonIgnore + public boolean isLoggedInUserDifferentFromUpdatedUser() { + return !id.equals(loggedInUserId); + } + + public void setRoleToCitizen() { + type = UserType.CITIZEN; + roles = Collections.singleton(Role.getCitizenRole()); + } + + public void updatePassword(String newPassword) { + password = newPassword; + } + + @JsonIgnore + public OtpValidationRequest getOtpValidationRequest() { + return OtpValidationRequest.builder() + .mobileNumber(mobileNumber) + .tenantId(tenantId) + .otpReference(otpReference) + .build(); + } + + @JsonIgnore + public List
getPermanentAndCorrespondenceAddresses() { + final ArrayList
addresses = new ArrayList<>(); + if (correspondenceAddress != null && correspondenceAddress.isNotEmpty()) { + addresses.add(correspondenceAddress); + } + if (permanentAddress != null && permanentAddress.isNotEmpty()) { + addresses.add(permanentAddress); + } + return addresses; + } + + public void setDefaultPasswordExpiry(int expiryInDays) { + if (passwordExpiryDate == null) { + passwordExpiryDate = DateUtils.addDays(new Date(), expiryInDays); + } + } + + public void setActive(boolean isActive) { + active = isActive; + } +} + diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/config/UserServiceConstants.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/config/UserServiceConstants.java new file mode 100644 index 00000000000..66463a5ded3 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/config/UserServiceConstants.java @@ -0,0 +1,24 @@ +package digit.models.coremodels.user.config; + +public class UserServiceConstants { + + public static final String EMAIL_UPDATION_CODE = "EMAIL_UPDATED"; + + public static final String INVALID_USER_REQUEST = "UserRequest is Invalid"; + + public static final String ROLECODE_MISSING_CODE = "egs_001"; + public static final String ROLECODE_MISSING_FIELD = "roles"; + public static final String ROLECODE_MISSING_MESSAGE = "Atleast One Role Is Required."; + public static final String USER_CLIENT_ID = "egov-user-client"; + public static final String IP_HEADER_NAME = "x-real-ip"; + + + public static final String PATTERN_NAME = "^[^\\\\$\\\"<>?\\\\\\\\~`!@#$%^()+={}\\\\[\\\\]*,:;“”‘’]*$"; + + + public static final String PATTERN_GENDER = "^[a-zA-Z ]*$"; + public static final String PATTERN_MOBILE = "(^$|[0-9]{10})"; + public static final String PATTERN_CITY = "^[a-zA-Z. ]*$"; + public static final String PATTERN_TENANT = "^[a-zA-Z. ]*$"; + public static final String PATTERN_PINCODE = "^[1-9][0-9]{5}$"; +} \ No newline at end of file diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/AddressType.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/AddressType.java new file mode 100644 index 00000000000..5954f4b866d --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/AddressType.java @@ -0,0 +1,25 @@ +package digit.models.coremodels.user.enums; + +import com.fasterxml.jackson.annotation.JsonCreator; + +public enum AddressType { + // This order should not be interrupted + PERMANENT("PERMANENT"), CORRESPONDENCE("CORRESPONDENCE"), USUALADDRESS("CORRESPONDENCE"), EVENTADDRESS("CORRESPONDENCE"), PRESENTADDRESS("CORRESPONDENCE"), PROPERTYADDRESS("CORRESPONDENCE"); + + @JsonCreator + public static AddressType fromValue(String text) { + for (AddressType b : AddressType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + private String value; + + AddressType(String value) { + this.value = value; + } + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/BloodGroup.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/BloodGroup.java new file mode 100644 index 00000000000..629e09c5005 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/BloodGroup.java @@ -0,0 +1,32 @@ +package digit.models.coremodels.user.enums; + +import com.fasterxml.jackson.annotation.JsonCreator; +import lombok.Getter; + +@Getter +public enum BloodGroup { + A_POSITIVE("A+"), + B_POSITIVE("B+"), + O_POSITIVE("O+"), + AB_POSITIVE("AB+"), + A_NEGATIVE("A-"), + B_NEGATIVE("B-"), + AB_NEGATIVE("AB-"), + O_NEGATIVE("O-"); + + private String value; + + BloodGroup(String value) { + this.value = value; + } + + @JsonCreator + public static BloodGroup fromValue(String text) { + for (BloodGroup b : BloodGroup.values()) { + if (String.valueOf(b.value).equalsIgnoreCase(text) || String.valueOf(b.name()).equalsIgnoreCase(text)) { + return b; + } + } + return null; + } +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/Gender.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/Gender.java new file mode 100644 index 00000000000..58f1b1b440b --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/Gender.java @@ -0,0 +1,46 @@ +/* + * eGov suite of products aim to improve the internal efficiency,transparency, + * accountability and the service delivery of the government organizations. + * + * Copyright (C) 2016 eGovernments Foundation + * + * The updated version of eGov suite of products as by eGovernments Foundation + * is available at http://www.egovernments.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/ or + * http://www.gnu.org/licenses/gpl.html . + * + * In addition to the terms of the GPL license to be adhered to in using this + * program, the following additional terms are to be complied with: + * + * 1) All versions of this program, verbatim or modified must carry this + * Legal Notice. + * + * 2) Any misrepresentation of the origin of the material is prohibited. It + * is required that all modified versions of this material be marked in + * reasonable ways as different from the original version. + * + * 3) This license does not grant any rights to any user of the program + * with regards to rights under trademark law for use of the trade names + * or trademarks of eGovernments Foundation. + * + * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. + */ + +package digit.models.coremodels.user.enums; + +public enum Gender { + //This order should not be interrupted + FEMALE, MALE, OTHERS, TRANSGENDER; +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/GuardianRelation.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/GuardianRelation.java new file mode 100644 index 00000000000..34859c66fb5 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/GuardianRelation.java @@ -0,0 +1,45 @@ +/* + * eGov suite of products aim to improve the internal efficiency,transparency, + * accountability and the service delivery of the government organizations. + * + * Copyright (C) 2016 eGovernments Foundation + * + * The updated version of eGov suite of products as by eGovernments Foundation + * is available at http://www.egovernments.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/ or + * http://www.gnu.org/licenses/gpl.html . + * + * In addition to the terms of the GPL license to be adhered to in using this + * program, the following additional terms are to be complied with: + * + * 1) All versions of this program, verbatim or modified must carry this + * Legal Notice. + * + * 2) Any misrepresentation of the origin of the material is prohibited. It + * is required that all modified versions of this material be marked in + * reasonable ways as different from the original version. + * + * 3) This license does not grant any rights to any user of the program + * with regards to rights under trademark law for use of the trade names + * or trademarks of eGovernments Foundation. + * + * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. + */ + +package digit.models.coremodels.user.enums; + +public enum GuardianRelation { + FATHER, MOTHER, HUSBAND, OTHER; +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/UserType.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/UserType.java new file mode 100644 index 00000000000..ac6c5820f01 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/enums/UserType.java @@ -0,0 +1,57 @@ +/* + * eGov suite of products aim to improve the internal efficiency,transparency, + * accountability and the service delivery of the government organizations. + * + * Copyright (C) 2016 eGovernments Foundation + * + * The updated version of eGov suite of products as by eGovernments Foundation + * is available at http://www.egovernments.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/ or + * http://www.gnu.org/licenses/gpl.html . + * + * In addition to the terms of the GPL license to be adhered to in using this + * program, the following additional terms are to be complied with: + * + * 1) All versions of this program, verbatim or modified must carry this + * Legal Notice. + * + * 2) Any misrepresentation of the origin of the material is prohibited. It + * is required that all modified versions of this material be marked in + * reasonable ways as different from the original version. + * + * 3) This license does not grant any rights to any user of the program + * with regards to rights under trademark law for use of the trade names + * or trademarks of eGovernments Foundation. + * + * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. + */ + +package digit.models.coremodels.user.enums; + +import com.fasterxml.jackson.annotation.JsonCreator; + +public enum UserType { + CITIZEN, EMPLOYEE, SYSTEM, BUSINESS; + + @JsonCreator + public static UserType fromValue(String text) { + for (UserType userType : UserType.values()) { + if (String.valueOf(userType).equalsIgnoreCase(text)) { + return userType; + } + } + return null; + } +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/exception/InvalidUserCreateException.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/exception/InvalidUserCreateException.java new file mode 100644 index 00000000000..1ed89944466 --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/exception/InvalidUserCreateException.java @@ -0,0 +1,16 @@ +package digit.models.coremodels.user.exception; + +import digit.models.coremodels.user.User; +import lombok.Getter; + +@Getter +public class InvalidUserCreateException extends RuntimeException { + + private static final long serialVersionUID = -761312648494992125L; + private User user; + + public InvalidUserCreateException(User user) { + this.user = user; + } + +} diff --git a/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/exception/InvalidUserUpdateException.java b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/exception/InvalidUserUpdateException.java new file mode 100644 index 00000000000..2d56ad8b0db --- /dev/null +++ b/core-services/libraries2/digit-models/src/main/java/digit/models/coremodels/user/exception/InvalidUserUpdateException.java @@ -0,0 +1,16 @@ +package digit.models.coremodels.user.exception; + +import digit.models.coremodels.user.User; +import lombok.Getter; + +public class InvalidUserUpdateException extends RuntimeException { + + private static final long serialVersionUID = 580361940613077431L; + @Getter + private User user; + + public InvalidUserUpdateException(User user) { + this.user = user; + } + +} diff --git a/core-services/libraries2/enc-client/Dockerfile b/core-services/libraries2/enc-client/Dockerfile new file mode 100644 index 00000000000..cd50dd4120d --- /dev/null +++ b/core-services/libraries2/enc-client/Dockerfile @@ -0,0 +1,17 @@ +FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build +ARG WORK_DIR +ARG nexusUsername +ARG nexusPassword +WORKDIR /app +# copy the project files +COPY ${WORK_DIR}/pom.xml ./pom.xml +COPY ${WORK_DIR}/settings.xml ./settings.xml +# COPY build/maven/settings.xml ./settings.xml +# COPY build/maven/start.sh ./start.sh +COPY ${WORK_DIR}/src ./src +# not useful for stateless builds +# RUN mvn -B dependency:go-offline +RUN cd ${WORK_DIR} \ + && mvn -B -f /app/pom.xml test verify deploy -s settings.xml \ + -Dnexus.user=${nexusUsername} -Dnexus.password=${nexusPassword} +FROM scratch \ No newline at end of file diff --git a/core-services/libraries2/enc-client/README.md b/core-services/libraries2/enc-client/README.md new file mode 100644 index 00000000000..b54a14d9aa4 --- /dev/null +++ b/core-services/libraries2/enc-client/README.md @@ -0,0 +1,2 @@ +# eGov-Enc-Client-APIs + diff --git a/core-services/libraries2/enc-client/pom.xml b/core-services/libraries2/enc-client/pom.xml new file mode 100644 index 00000000000..0eb339505bb --- /dev/null +++ b/core-services/libraries2/enc-client/pom.xml @@ -0,0 +1,144 @@ + + + 4.0.0 + org.egov + enc-client + 2.0.4-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-parent + 2.2.6.RELEASE + + + + + repo.digit.org + eGov ERP Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/releases/ + + + repo.digit.org + eGov ERP Snapshots Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + + + 2.17.1 + UTF-8 + 1.8 + UTF-8 + + + + + org.egov.services + services-common + 1.1.1-SNAPSHOT + + + org.egov.services + tracer + 2.1.1-SNAPSHOT + + + org.egov + mdms-client + 0.0.4-SNAPSHOT + + + com.fasterxml.jackson.core + jackson-databind + 2.9.8 + + + com.fasterxml.jackson.core + jackson-annotations + 2.9.8 + + + org.reflections + reflections + 0.9.11 + + + junit + junit + test + + + org.mockito + mockito-all + 1.9.5 + test + + + org.springframework + spring-core + + + org.egov.services + services-common + 1.1.1-SNAPSHOT + + + org.springframework + spring-test + test + + + org.springframework.boot + spring-boot-test + test + + + org.projectlombok + lombok + 1.18.22 + + + + + + repo.egovernments.org + eGov ERP Releases Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/releases/ + + + snapshots.repo.egovernments.org + eGov ERP Snapshots Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/ + + + repo.digit.org.snapshot + eGov DIGIT Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + + + + + maven-compiler-plugin + + 8 + 8 + + + + maven-source-plugin + + + attach-sources + + jar + + + + + + + diff --git a/core-services/libraries2/enc-client/settings.xml b/core-services/libraries2/enc-client/settings.xml new file mode 100644 index 00000000000..b22e0147ddb --- /dev/null +++ b/core-services/libraries2/enc-client/settings.xml @@ -0,0 +1,23 @@ + + + + + nexus + central + https://nexus-repo.egovernments.org/nexus/content/groups/public/ + + + + + repo.digit.org + ${nexus.user} + ${nexus.password} + + + + com.versioneye + + \ No newline at end of file diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/EncryptionService.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/EncryptionService.java new file mode 100644 index 00000000000..f49b4b5ff48 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/EncryptionService.java @@ -0,0 +1,27 @@ +package org.egov.encryption; + +import com.fasterxml.jackson.databind.JsonNode; +import org.egov.common.contract.request.RequestInfo; + +import java.io.IOException; +import java.util.List; + +public interface EncryptionService { + + public JsonNode encryptJson(Object plaintextJson, String model, String tenantId) throws IOException; + + public P encryptJson(Object plaintextJson, String model, String tenantId, Class valueType) throws IOException; + + public JsonNode decryptJson(RequestInfo requestInfo, Object ciphertextJson, String model, + String purpose) throws IOException; + + public P decryptJson(RequestInfo requestInfo, Object ciphertextJson, String model, String purpose, + Class valueType) throws IOException; + + public String encryptValue(Object plaintext, String tenantId) throws IOException; + + public String encryptValue(Object plaintext, String tenantId, String type) throws IOException; + + public List encryptValue(List plaintext, String tenantId, String type) throws IOException; + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/EncryptionServiceImpl.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/EncryptionServiceImpl.java new file mode 100644 index 00000000000..b967e4afa91 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/EncryptionServiceImpl.java @@ -0,0 +1,176 @@ +package org.egov.encryption; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import lombok.extern.slf4j.Slf4j; +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.contract.request.Role; +import org.egov.encryption.audit.AuditService; +import org.egov.encryption.config.DecryptionPolicyConfiguration; +import org.egov.encryption.config.EncClientConstants; +import org.egov.encryption.config.EncProperties; +import org.egov.encryption.config.EncryptionPolicyConfiguration; +import org.egov.encryption.masking.MaskingService; +import org.egov.encryption.models.Attribute; +import org.egov.encryption.models.UniqueIdentifier; +import org.egov.encryption.models.Visibility; +import org.egov.encryption.util.ConvertClass; +import org.egov.encryption.util.JSONBrowseUtil; +import org.egov.encryption.util.JacksonUtils; +import org.egov.encryption.util.JsonPathConverter; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class EncryptionServiceImpl implements EncryptionService { + + @Autowired + private EncProperties encProperties; + @Autowired + private EncryptionServiceRestConnection encryptionServiceRestConnection; + @Autowired + private EncryptionPolicyConfiguration encryptionPolicyConfiguration; + @Autowired + private DecryptionPolicyConfiguration decryptionPolicyConfiguration; + @Autowired + private MaskingService maskingService; + @Autowired + private AuditService auditService; + @Autowired + private ObjectMapper objectMapper; + + private JsonNode encryptJsonArray(JsonNode plaintextNode, String model, String tenantId) throws IOException { + JsonNode encryptNode = plaintextNode.deepCopy(); + List attributes = encryptionPolicyConfiguration.getAttributeDetailsForModel(model); + List attributesToEncrypt = attributes.stream().map(Attribute::getJsonPath).collect(Collectors.toList()); + attributesToEncrypt = JsonPathConverter.convertToArrayJsonPaths(attributesToEncrypt); + JsonNode jsonNode = JacksonUtils.filterJsonNodeForPaths(plaintextNode, attributesToEncrypt); + + if (!jsonNode.isEmpty(objectMapper.getSerializerProvider())) { + JsonNode returnedEncryptedNode = objectMapper.valueToTree(encryptionServiceRestConnection.callEncrypt(tenantId, + encProperties.getDefaultEncryptDataType(), jsonNode)); + encryptNode = JacksonUtils.merge(returnedEncryptedNode, encryptNode); + } + + return encryptNode; + } + + public JsonNode encryptJson(Object plaintextJson, String model, String tenantId) throws IOException { + JsonNode plaintextNode = createJsonNode(plaintextJson); + JsonNode plaintextNodeCopy = plaintextNode.deepCopy(); + + // Convert input to array if it isn't already + if (!plaintextNodeCopy.isArray()) { + ArrayNode arrayNode = objectMapper.createArrayNode(); + arrayNode.add(plaintextNodeCopy); + plaintextNodeCopy = arrayNode; + } + JsonNode encryptedNode = encryptJsonArray(plaintextNodeCopy, model, tenantId); + + if (!plaintextNode.isArray()) { + return encryptedNode.get(0); + } + return encryptedNode; + } + + public P encryptJson(Object plaintextJson, String model, String tenantId, Class valueType) throws IOException { + return ConvertClass.convertTo(encryptJson(plaintextJson, model, tenantId), valueType); + } + + private JsonNode decryptJson(RequestInfo requestInfo, Object ciphertextJson, + Map attributesVisibilityMap, + String model, String purpose, UniqueIdentifier uniqueIdentifier) throws IOException { + JsonNode ciphertextNode = createJsonNode(ciphertextJson); + JsonNode decryptNode = ciphertextNode.deepCopy(); + + // Convert input to array if it isn't already + if (!decryptNode.isArray()) { + ArrayNode arrayNode = objectMapper.createArrayNode(); + arrayNode.add(decryptNode); + decryptNode = arrayNode; + } + + if (attributesVisibilityMap.containsValue(Visibility.NONE)) { + List attributesToBeRemoved = attributesVisibilityMap.keySet().stream() + .filter(attribute -> attributesVisibilityMap.get(attribute) == Visibility.NONE).collect(Collectors.toList()); + List pathToBeRemoved = attributesToBeRemoved.stream().map(Attribute::getJsonPath).collect(Collectors.toList()); + JsonNode nodeToBeEmptied = JacksonUtils.filterJsonNodeForPaths(decryptNode, pathToBeRemoved); + JsonNode emptyNode = JSONBrowseUtil.mapValues(nodeToBeEmptied, __ -> EncClientConstants.STRING_FOR_NONE_ACCESS); + decryptNode = JacksonUtils.merge(emptyNode, decryptNode); + } + + List attributesToBeDecrypted = attributesVisibilityMap.keySet().stream() + .filter(attribute -> attributesVisibilityMap.get(attribute) != Visibility.NONE).collect(Collectors.toList()); + + List pathsToBeDecrypted = attributesToBeDecrypted.stream().map(Attribute::getJsonPath).collect(Collectors.toList()); + pathsToBeDecrypted = JsonPathConverter.convertToArrayJsonPaths(pathsToBeDecrypted); + JsonNode jsonNode = JacksonUtils.filterJsonNodeForPaths(ciphertextNode, pathsToBeDecrypted); + + if (!jsonNode.isEmpty(objectMapper.getSerializerProvider())) { + JsonNode returnedDecryptedNode = encryptionServiceRestConnection.callDecrypt(jsonNode); + decryptNode = JacksonUtils.merge(returnedDecryptedNode, decryptNode); + } + + if (attributesVisibilityMap.containsValue(Visibility.MASKED)) { + List attributesToBeMasked = attributesVisibilityMap.keySet().stream() + .filter(attribute -> attributesVisibilityMap.get(attribute) == Visibility.MASKED).collect(Collectors.toList()); + decryptNode = maskingService.maskData(decryptNode, attributesToBeMasked, uniqueIdentifier, requestInfo); + } + + auditService.audit(decryptNode, model, purpose, requestInfo); + + return decryptNode; + } + + @Override + public JsonNode decryptJson(RequestInfo requestInfo, Object ciphertextJson, String model, String purpose) throws IOException { + List roles = requestInfo.getUserInfo().getRoles().stream().map(Role::getCode).collect(Collectors.toList()); + Map attributesVisibilityMap = decryptionPolicyConfiguration.getRoleAttributeAccessListForModel(requestInfo, model, roles); + + UniqueIdentifier uniqueIdentifier = decryptionPolicyConfiguration.getSecurityPolicyUniqueIdentifier(model); + JsonNode decryptedNode = decryptJson(requestInfo, ciphertextJson, attributesVisibilityMap, model, purpose, uniqueIdentifier); + + return decryptedNode; + } + + public P decryptJson(RequestInfo requestInfo, Object ciphertextJson, String model, String purpose + , Class valueType) throws IOException { + return ConvertClass.convertTo(decryptJson(requestInfo, ciphertextJson, model, purpose), valueType); + } + + + JsonNode createJsonNode(Object json) throws IOException { + JsonNode jsonNode; + if (json instanceof JsonNode) + jsonNode = (JsonNode) json; + else if (json instanceof String) + jsonNode = objectMapper.readTree((String) json); //JsonNode from JSON String + else + jsonNode = objectMapper.valueToTree(json); //JsonNode from POJO or Map + return jsonNode; + } + + + public String encryptValue(Object plaintext, String tenantId) throws IOException { + return encryptValue(plaintext, tenantId, encProperties.getDefaultEncryptDataType()); + } + + public String encryptValue(Object plaintext, String tenantId, String type) throws IOException { + return encryptValue(new ArrayList<>(Collections.singleton(plaintext)), tenantId, type).get(0); + } + + public List encryptValue(List plaintext, String tenantId, String type) throws IOException { + Object encryptionResponse = encryptionServiceRestConnection.callEncrypt(tenantId, type, plaintext); + return ConvertClass.convertTo(objectMapper.valueToTree(encryptionResponse), List.class); + } + +} \ No newline at end of file diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/EncryptionServiceRestConnection.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/EncryptionServiceRestConnection.java new file mode 100644 index 00000000000..ed3bfec8f93 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/EncryptionServiceRestConnection.java @@ -0,0 +1,57 @@ +package org.egov.encryption; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.egov.encryption.config.EncProperties; +import org.egov.encryption.config.ErrorConstants; +import org.egov.encryption.web.contract.EncReqObject; +import org.egov.encryption.web.contract.EncryptionRequest; +import org.egov.tracer.model.CustomException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; + +@Slf4j +@Component +class EncryptionServiceRestConnection { + + @Autowired + private EncProperties encProperties; + @Autowired + private RestTemplate restTemplate; + @Autowired + private ObjectMapper objectMapper; + + + Object callEncrypt(String tenantId, String type, Object value) throws IOException { + EncReqObject encReqObject = new EncReqObject(tenantId, type, value); + EncryptionRequest encryptionRequest = new EncryptionRequest(); + encryptionRequest.setEncryptionRequests(new ArrayList<>(Collections.singleton(encReqObject))); + + try { + ResponseEntity response = restTemplate.postForEntity(encProperties.getEgovEncHost() + encProperties.getEgovEncEncryptPath(), + encryptionRequest, String.class); + return objectMapper.readTree(response.getBody()).get(0); + } catch (Exception e) { + log.error(ErrorConstants.ENCRYPTION_SERVICE_ERROR_MESSAGE, e); + throw new CustomException(ErrorConstants.ENCRYPTION_SERVICE_ERROR, ErrorConstants.ENCRYPTION_SERVICE_ERROR_MESSAGE); + } + } + + JsonNode callDecrypt(Object ciphertext) { + try { + ResponseEntity response = restTemplate.postForEntity( + encProperties.getEgovEncHost() + encProperties.getEgovEncDecryptPath(), ciphertext, JsonNode.class); + return response.getBody(); + } catch (Exception e) { + throw new CustomException(ErrorConstants.ENCRYPTION_SERVICE_ERROR, ErrorConstants.ENCRYPTION_SERVICE_ERROR_MESSAGE); + } + } + +} \ No newline at end of file diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/accesscontrol/AbacFilter.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/accesscontrol/AbacFilter.java similarity index 100% rename from core-services/libraries/enc-client/src/main/java/org/egov/encryption/accesscontrol/AbacFilter.java rename to core-services/libraries2/enc-client/src/main/java/org/egov/encryption/accesscontrol/AbacFilter.java diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/audit/AuditService.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/audit/AuditService.java new file mode 100644 index 00000000000..0a6cd3af0a4 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/audit/AuditService.java @@ -0,0 +1,57 @@ +package org.egov.encryption.audit; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.contract.request.User; +import org.egov.encryption.config.DecryptionPolicyConfiguration; +import org.egov.encryption.config.EncProperties; +import org.egov.encryption.models.AuditObject; +import org.egov.encryption.models.UniqueIdentifier; +import org.egov.encryption.producer.Producer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +@Service +public class AuditService { + + @Autowired + private Producer producer; + @Autowired + private EncProperties encProperties; + @Autowired + private ObjectMapper objectMapper; + @Autowired + private DecryptionPolicyConfiguration decryptionPolicyConfiguration; + + public void audit(JsonNode json, String model, String purpose, RequestInfo requestInfo) { + User user = requestInfo.getUserInfo(); + + AuditObject auditObject = AuditObject.builder().build(); + auditObject.setId(UUID.randomUUID().toString()); + auditObject.setTimestamp(System.currentTimeMillis()); + auditObject.setUserId(user.getUuid()); + auditObject.setModel(model); + auditObject.setPurpose(purpose); + + if (requestInfo.getPlainAccessRequest() != null) { + auditObject.setPlainAccessRequest(requestInfo.getPlainAccessRequest()); + } + + UniqueIdentifier uniqueIdentifier = + decryptionPolicyConfiguration.getUniqueIdentifierForModel(model); + List entityIds = new ArrayList<>(); + for (JsonNode node : json) { + String nodeUuid = node.at(uniqueIdentifier.getJsonPath()).asText(); + entityIds.add(nodeUuid); + } + auditObject.setEntityIds(entityIds); + + producer.push(encProperties.getAuditTopicName(), auditObject.getId(), auditObject); + } + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/AbacConfiguration.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/AbacConfiguration.java similarity index 100% rename from core-services/libraries/enc-client/src/main/java/org/egov/encryption/config/AbacConfiguration.java rename to core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/AbacConfiguration.java diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/DecryptionPolicyConfiguration.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/DecryptionPolicyConfiguration.java new file mode 100644 index 00000000000..d36140852f0 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/DecryptionPolicyConfiguration.java @@ -0,0 +1,199 @@ +package org.egov.encryption.config; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectReader; +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; +import org.egov.common.contract.request.RequestInfo; +import org.egov.encryption.models.*; +import org.egov.encryption.util.MdmsFetcher; +import org.egov.tracer.model.CustomException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import org.springframework.web.client.RestTemplate; + +import javax.annotation.PostConstruct; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Slf4j +@Component +public class DecryptionPolicyConfiguration { + + @Autowired + private EncProperties encProperties; + + @Autowired + private MdmsFetcher mdmsFetcher; + @Autowired + private RestTemplate restTemplate; + @Autowired + private ObjectMapper objectMapper; + + private Map> modelAttributeAccessMap; + + private Map>> modelRoleBasedDecryptionPolicyMap; + + private Map uniqueIdentifierMap; + + + void initializeModelAttributeAccessMap(List modelRoleAttributeAccessList) { + modelAttributeAccessMap = modelRoleAttributeAccessList.stream() + .collect(Collectors.toMap(SecurityPolicy::getModel, + SecurityPolicy::getAttributes)); + } + + void initializeRoleBasedDecryptionPolicyMap(List modelRoleAttributeAccessList) { + modelRoleBasedDecryptionPolicyMap = new HashMap<>(); + for (SecurityPolicy securityPolicy : modelRoleAttributeAccessList) { + modelRoleBasedDecryptionPolicyMap.put(securityPolicy.getModel(), + makeRoleAttributeAccessMapping(securityPolicy.getRoleBasedDecryptionPolicy())); + } + } + + void initializeUniqueIdentifierMap(List modelRoleAttributeAccessList) { + uniqueIdentifierMap = modelRoleAttributeAccessList.stream() + .collect(Collectors.toMap(SecurityPolicy::getModel, + SecurityPolicy::getUniqueIdentifier)); + } + + @PostConstruct + void initializeModelAttributeAccessMapFromMdms() { + List securityPolicyList = null; + try { + JSONArray securityPolicyJson = mdmsFetcher.getSecurityMdmsForFilter(null); + ObjectReader reader = objectMapper.readerFor(objectMapper.getTypeFactory().constructCollectionType(List.class, + SecurityPolicy.class)); + securityPolicyList = reader.readValue(securityPolicyJson.toString()); + } catch (IOException e) { + log.error(ErrorConstants.SECURITY_POLICY_READING_ERROR_MESSAGE, e); + throw new CustomException(ErrorConstants.SECURITY_POLICY_READING_ERROR, ErrorConstants.SECURITY_POLICY_READING_ERROR_MESSAGE); + } + + initializeModelAttributeAccessMap(securityPolicyList); + initializeRoleBasedDecryptionPolicyMap(securityPolicyList); + initializeUniqueIdentifierMap(securityPolicyList); + } + + public UniqueIdentifier getUniqueIdentifierForModel(String model) { + return uniqueIdentifierMap.get(model); + } + + public Map getRoleAttributeAccessListForModel(RequestInfo requestInfo, String model, List roles) { + Map mapping = new HashMap<>(); + try { + List attributesList = modelAttributeAccessMap.get(model); + Map> roleAttributeAccessMap = + modelRoleBasedDecryptionPolicyMap.get(model); + + boolean isAttributeListEmpty = CollectionUtils.isEmpty(attributesList); + boolean isRoleAttributeAccessMapEmpty = CollectionUtils.isEmpty(roleAttributeAccessMap); + + if (isAttributeListEmpty) { + throw new CustomException("DECRYPTION_NULL_ERROR", "Attribute list is empty"); + } + + + if (!isAttributeListEmpty && !isRoleAttributeAccessMapEmpty) { + Map attributesMap = makeAttributeMap(attributesList); + + List secondLevelVisibility = new ArrayList<>(); + + for (String role : roles) { + if (!roleAttributeAccessMap.containsKey(role)) + continue; + + List attributeList = roleAttributeAccessMap.get(role); + + for (AttributeAccess attributeAccess : attributeList) { + String attributeName = attributeAccess.getAttribute().getName(); + Attribute attribute = attributesMap.get(attributeName); + if (requestInfo.getPlainAccessRequest() != null && !CollectionUtils.isEmpty(requestInfo.getPlainAccessRequest().getPlainRequestFields()) + && requestInfo.getPlainAccessRequest().getPlainRequestFields().contains(attributeName) + && attributeAccess.getSecondLevelVisibility() != null && !secondLevelVisibility.contains(attributeName)) { + secondLevelVisibility.add(attributeName); + } + String firstLevelVisibility = attributeAccess.getFirstLevelVisibility() != null ? + String.valueOf(attributeAccess.getFirstLevelVisibility()) : String.valueOf(attribute.getDefaultVisibility()); + Visibility visibility = Visibility.valueOf(firstLevelVisibility); + if (mapping.containsKey(attribute)) { + if (mapping.get(attribute).ordinal() > visibility.ordinal()) { + mapping.remove(attribute); + mapping.put(attribute, visibility); + } + } else { + mapping.put(attribute, visibility); + } + } + } + + if (requestInfo.getPlainAccessRequest() != null) + requestInfo.getPlainAccessRequest().setPlainRequestFields(secondLevelVisibility); + } + + List mappingAttributesList = new ArrayList<>(mapping.keySet()); + List attributesToAvoidlist = new ArrayList<>(); + for (Attribute attribute : mappingAttributesList) + attributesToAvoidlist.add(attribute.getName()); + + + if (!isAttributeListEmpty) + getDefaultVisibilityMapping(attributesList, mapping, attributesToAvoidlist); + + + return mapping; + } catch (Exception e) { + throw new CustomException("DECRYPTION_NULL_ERROR", "Error in decryption process"); + } + } + + private Map> makeRoleAttributeAccessMapping(List roleBasedDecryptionPolicyList) { + Map> roleAttributeAccessMap = new HashMap<>(); + for (RoleBasedDecryptionPolicy roleBasedDecryptionPolicy : roleBasedDecryptionPolicyList) { + List roles = roleBasedDecryptionPolicy.getRoles(); + List attributeAccessList = roleBasedDecryptionPolicy.getAttributeAccessList(); + for (String role : roles) { + roleAttributeAccessMap.put(role, attributeAccessList); + } + } + return roleAttributeAccessMap; + } + + private Map makeAttributeMap(List attributesList) { + Map atrributesMap = new HashMap<>(); + + for (Attribute attribute : attributesList) { + String filedName = attribute.getName(); + atrributesMap.put(filedName, attribute); + } + return atrributesMap; + } + + public UniqueIdentifier getSecurityPolicyUniqueIdentifier(String model) { + return uniqueIdentifierMap.get(model); + } + + private void getDefaultVisibilityMapping(List attributesList, Map mapping, List attributesToAvoidlist) { + + for (Attribute attribute : attributesList) { + String defaultVisibility = String.valueOf(attribute.getDefaultVisibility()); + Visibility visibility = Visibility.valueOf(defaultVisibility); + if (!attributesToAvoidlist.contains(attribute.getName())) { + if (mapping.containsKey(attribute)) { + if (mapping.get(attribute).ordinal() > visibility.ordinal()) { + mapping.remove(attribute); + mapping.put(attribute, visibility); + } + } else { + mapping.put(attribute, visibility); + } + } + } + } + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncClientConstants.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncClientConstants.java new file mode 100644 index 00000000000..e5f32a657db --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncClientConstants.java @@ -0,0 +1,19 @@ +package org.egov.encryption.config; + +public class EncClientConstants { + + public static final String MDMS_MODULE_NAME = "DataSecurity"; + + public static final String MDMS_ENCRYPTION_MASTER_NAME = "EncryptionPolicy"; + + public static final String MDMS_DECRYPTION_MASTER_NAME = "DecryptionABAC"; + + public static final String MDMS_SECURITY_POLICY_MASTER_NAME = "SecurityPolicy"; + + public static final String MDMS_MASKING_PATTERN_MASTER_NAME = "MaskingPatterns"; + + public static final String STRING_FOR_NONE_ACCESS = "Confidential Information"; + + public static final String TENANTID_MDC = "TENANTID"; + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncProperties.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncProperties.java new file mode 100644 index 00000000000..ca408934242 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncProperties.java @@ -0,0 +1,37 @@ +package org.egov.encryption.config; + + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; + +import lombok.Getter; + +@Getter +@Configuration +@PropertySource("classpath:enc.properties") +public class EncProperties { + + @Value("${kafka.topic.audit}") + private String auditTopicName; + + @Value("${egov.mdms.host}") + private String egovMdmsHost; + + @Value("${egov.mdms.search.endpoint}") + private String egovMdmsSearchEndpoint; + + @Value("${state.level.tenant.id}") + private String stateLevelTenantId; + @Value("${default.encrypt.data.type}") + private String defaultEncryptDataType; + + @Value("${egov.enc.host}") + private String egovEncHost; + + @Value("${egov.enc.encrypt.endpoint}") + private String egovEncEncryptPath; + + @Value("${egov.enc.decrypt.endpoint}") + private String egovEncDecryptPath; +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncryptionConfiguration.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncryptionConfiguration.java new file mode 100644 index 00000000000..cdce12df813 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncryptionConfiguration.java @@ -0,0 +1,21 @@ +package org.egov.encryption.config; + +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.egov.common.utils.MultiStateInstanceUtil; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +@Configuration +@ComponentScan(basePackages = {"org.egov.encryption"}) +@Import({MultiStateInstanceUtil.class}) +public class EncryptionConfiguration { + + @Bean + public ObjectMapper objectMapper() { + return new ObjectMapper(new JsonFactory()); + } + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncryptionPolicyConfiguration.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncryptionPolicyConfiguration.java new file mode 100644 index 00000000000..a1ee893b4b9 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/EncryptionPolicyConfiguration.java @@ -0,0 +1,56 @@ +package org.egov.encryption.config; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectReader; +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; +import org.egov.encryption.models.Attribute; +import org.egov.encryption.models.SecurityPolicy; +import org.egov.encryption.util.MdmsFetcher; +import org.egov.tracer.model.CustomException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Slf4j +@Component +public class EncryptionPolicyConfiguration { + + @Autowired + private MdmsFetcher mdmsFetcher; + @Autowired + private ObjectMapper objectMapper; + + private Map> encryptionPolicyAttributesMap; + + @PostConstruct + void initializeEncryptionPolicyAttributesMapFromMdms() throws JsonProcessingException { + try { + JSONArray attributesDetailsJSON = mdmsFetcher.getSecurityMdmsForFilter(null); + ObjectReader reader = objectMapper.readerFor(objectMapper.getTypeFactory().constructCollectionType(List.class, + SecurityPolicy.class)); + List securityPolicies = reader.readValue(attributesDetailsJSON.toString()); + encryptionPolicyAttributesMap = securityPolicies.stream() + .collect(Collectors.toMap(SecurityPolicy::getModel, SecurityPolicy::getAttributes)); + } catch (IOException e) { + log.error(ErrorConstants.SECURITY_POLICY_READING_ERROR_MESSAGE, e); + throw new CustomException(ErrorConstants.SECURITY_POLICY_READING_ERROR, ErrorConstants.SECURITY_POLICY_READING_ERROR_MESSAGE); + } + } + + public List getAttributeDetailsForModel(String modelName) { + try { + return encryptionPolicyAttributesMap.get(modelName); + } catch (Exception e) { + throw new CustomException("DECRYPTION_ERROR", "Error in retrieving MDMS data"); + } + + } + +} \ No newline at end of file diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/ErrorConstants.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/ErrorConstants.java new file mode 100644 index 00000000000..e54d570c954 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/config/ErrorConstants.java @@ -0,0 +1,20 @@ +package org.egov.encryption.config; + +public class ErrorConstants { + + public static final String MDMS_FETCH_ERROR = "MDMS_FETCH_ERROR"; + public static final String MDMS_FETCH_ERROR_MESSAGE = "Error occurred while fetching MDMS Configs"; + + public static final String ENCRYPTION_SERVICE_ERROR = "ENCRYPTION_SERVICE_ERROR"; + public static final String ENCRYPTION_SERVICE_ERROR_MESSAGE + = "Error occurred while calling Encryption Service"; + + public static final String SECURITY_POLICY_READING_ERROR = "SECURITY_POLICY_READING_ERROR"; + public static final String SECURITY_POLICY_READING_ERROR_MESSAGE + = "Error occurred while reading Security Policy from MDMS Config"; + + public static final String MASKING_PATTERN_READING_ERROR = "MASKING_PATTER_READING_ERROR"; + public static final String MASKING_PATTER_READING_ERROR_MESSAGE + = "Error occurred while reading Masking Pattern from MDMS Config"; + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/masking/Masking.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/masking/Masking.java similarity index 100% rename from core-services/libraries/enc-client/src/main/java/org/egov/encryption/masking/Masking.java rename to core-services/libraries2/enc-client/src/main/java/org/egov/encryption/masking/Masking.java diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/masking/MaskingService.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/masking/MaskingService.java new file mode 100644 index 00000000000..093fabf7a59 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/masking/MaskingService.java @@ -0,0 +1,109 @@ +package org.egov.encryption.masking; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; +import org.egov.common.contract.request.RequestInfo; +import org.egov.encryption.config.EncProperties; +import org.egov.encryption.config.ErrorConstants; +import org.egov.encryption.models.Attribute; +import org.egov.encryption.models.UniqueIdentifier; +import org.egov.encryption.util.JSONBrowseUtil; +import org.egov.encryption.util.JacksonUtils; +import org.egov.encryption.util.JsonPathConverter; +import org.egov.encryption.util.MdmsFetcher; +import org.egov.tracer.model.CustomException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.web.client.RestTemplate; + +import javax.annotation.PostConstruct; +import java.util.*; + +@Slf4j +@Service +public class MaskingService { + + Map maskingPatternMap = new HashMap<>(); + @Autowired + private EncProperties encProperties; + @Autowired + private RestTemplate restTemplate; + @Autowired + private ObjectMapper objectMapper; + @Autowired + private MdmsFetcher mdmsFetcher; + + @PostConstruct + private void initMaskingPatternMap() { + try { + JSONArray maskingPatternListJSON = mdmsFetcher.getMaskingMdmsForFilter(null); + for (int i = 0; i < maskingPatternListJSON.size(); i++) { + Map obj = objectMapper.convertValue(maskingPatternListJSON.get(i), Map.class); + maskingPatternMap.put(obj.get("patternId"), obj.get("pattern")); + } + } catch (Exception e) { + log.error(ErrorConstants.MASKING_PATTER_READING_ERROR_MESSAGE, e); + throw new CustomException(ErrorConstants.MASKING_PATTERN_READING_ERROR, ErrorConstants.MASKING_PATTER_READING_ERROR_MESSAGE); + } + } + + public T maskData(T data, Attribute attribute) { + String value = String.valueOf(data); + String patternId = attribute.getPatternId(); + String maskingRegex = maskingPatternMap.get(patternId); + value = value.replaceAll(maskingRegex, "*"); + + return (T) value; + } + + public JsonNode maskData(JsonNode decryptedNode, List attributes, UniqueIdentifier uniqueIdentifier, RequestInfo requestInfo) { + JsonNode maskedNode = decryptedNode.deepCopy(); + for (Attribute attribute : attributes) { + JsonNode jsonNode = JacksonUtils.filterJsonNodeForPaths(maskedNode, + JsonPathConverter.convertToArrayJsonPaths(Arrays.asList(attribute.getJsonPath()))); + jsonNode = JSONBrowseUtil.mapValues(jsonNode, value -> maskData(value, attribute)); + maskedNode = JacksonUtils.merge(jsonNode, maskedNode); + } + if (requestInfo.getPlainAccessRequest() != null && requestInfo.getPlainAccessRequest().getRecordId() != null) { + maskedNode = addPlainRequestAccessValues((ArrayNode) maskedNode, (ArrayNode) decryptedNode, attributes, uniqueIdentifier, requestInfo); + } + return maskedNode; + } + + private JsonNode addPlainRequestAccessValues(ArrayNode maskedArray, ArrayNode decryptedArray, + List attributes, + UniqueIdentifier uniqueIdentifier, + RequestInfo requestInfo) { + String recordId = requestInfo.getPlainAccessRequest().getRecordId(); + List plainRequestFields = requestInfo.getPlainAccessRequest().getPlainRequestFields(); + for (int i = 0; i < maskedArray.size(); i++) { + JsonNode maskedNode = maskedArray.get(i); + JsonNode decryptedNode = decryptedArray.get(i); + String nodeUuid = maskedNode.at(uniqueIdentifier.getJsonPath()).asText(); + if (recordId.equals(nodeUuid)) { + JsonNode plainNode = createPlainNode(decryptedNode, plainRequestFields, attributes); + plainNode = JacksonUtils.merge(plainNode, maskedNode); + maskedArray.remove(i); + maskedArray.insert(i, plainNode); + } + } + return maskedArray; + } + + private JsonNode createPlainNode(JsonNode decryptedNode, List plainRequestFields, + List attributes) { + JsonNode plainNode = decryptedNode.deepCopy(); + List plainPaths = new ArrayList<>(); + for (Attribute attribute : attributes) { + if (plainRequestFields.contains(attribute.getName())) { + plainPaths.add(attribute.getJsonPath()); + } + } + plainNode = JacksonUtils.filterJsonNodeForPaths(plainNode, plainPaths); + return plainNode; + } + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/masking/techniques/MobileMasking.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/masking/techniques/MobileMasking.java similarity index 100% rename from core-services/libraries/enc-client/src/main/java/org/egov/encryption/masking/techniques/MobileMasking.java rename to core-services/libraries2/enc-client/src/main/java/org/egov/encryption/masking/techniques/MobileMasking.java diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AccessType.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/AccessType.java similarity index 100% rename from core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/AccessType.java rename to core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/AccessType.java diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/Attribute.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/Attribute.java new file mode 100644 index 00000000000..5beca1a8f66 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/Attribute.java @@ -0,0 +1,20 @@ +package org.egov.encryption.models; + +import lombok.*; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Attribute { + + private String name = null; + + private String jsonPath = null; + + private String patternId = null; + + private Visibility defaultVisibility = null; + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/AttributeAccess.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/AttributeAccess.java new file mode 100644 index 00000000000..06c2e4f3635 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/AttributeAccess.java @@ -0,0 +1,19 @@ +package org.egov.encryption.models; + +import lombok.*; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class AttributeAccess { + + private Attribute attribute = null; + + private AccessType accessType = null; + private Visibility firstLevelVisibility = null; + + private Visibility secondLevelVisibility = null; + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/AttributeVisibility.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/AttributeVisibility.java new file mode 100644 index 00000000000..f5dcfe8d085 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/AttributeVisibility.java @@ -0,0 +1,15 @@ +package org.egov.encryption.models; + +import lombok.*; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class AttributeVisibility { + + private Attribute attribute; + private Visibility visibility; + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/AuditObject.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/AuditObject.java new file mode 100644 index 00000000000..80449ace194 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/AuditObject.java @@ -0,0 +1,32 @@ +package org.egov.encryption.models; + +import com.fasterxml.jackson.databind.JsonNode; +import lombok.*; +import org.egov.common.contract.request.PlainAccessRequest; + +import java.util.List; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class AuditObject { + + private String id; + + private String userId; + + private Long timestamp; + + private String purpose; + + private String model; + + private List entityIds; + + private PlainAccessRequest plainAccessRequest; + + private JsonNode additionalInfo; + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/EncryptionPolicy.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/EncryptionPolicy.java similarity index 100% rename from core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/EncryptionPolicy.java rename to core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/EncryptionPolicy.java diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/KeyRoleAttributeAccess.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/KeyRoleAttributeAccess.java similarity index 100% rename from core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/KeyRoleAttributeAccess.java rename to core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/KeyRoleAttributeAccess.java diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/MaskingPattern.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/MaskingPattern.java new file mode 100644 index 00000000000..aaa9f4e3c77 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/MaskingPattern.java @@ -0,0 +1,16 @@ +package org.egov.encryption.models; + +import lombok.*; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class MaskingPattern { + + private String id = null; + + private String pattern = null; + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/RoleAttributeAccess.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/RoleAttributeAccess.java similarity index 100% rename from core-services/libraries/enc-client/src/main/java/org/egov/encryption/models/RoleAttributeAccess.java rename to core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/RoleAttributeAccess.java diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/RoleBasedDecryptionPolicy.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/RoleBasedDecryptionPolicy.java new file mode 100644 index 00000000000..21e40f0ce39 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/RoleBasedDecryptionPolicy.java @@ -0,0 +1,18 @@ +package org.egov.encryption.models; + +import lombok.*; + +import java.util.List; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class RoleBasedDecryptionPolicy { + + private List roles = null; + + private List attributeAccessList = null; + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/SecurityPolicy.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/SecurityPolicy.java new file mode 100644 index 00000000000..bff9e97724e --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/SecurityPolicy.java @@ -0,0 +1,22 @@ +package org.egov.encryption.models; + +import lombok.*; + +import java.util.List; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SecurityPolicy { + + private String model = null; + + private UniqueIdentifier uniqueIdentifier = null; + + private List attributes = null; + + private List roleBasedDecryptionPolicy = null; + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/UniqueIdentifier.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/UniqueIdentifier.java new file mode 100644 index 00000000000..f9551bd143c --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/UniqueIdentifier.java @@ -0,0 +1,16 @@ +package org.egov.encryption.models; + +import lombok.*; + +@Getter +@Setter +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class UniqueIdentifier { + + private String name = null; + + private String jsonPath = null; + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/Visibility.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/Visibility.java new file mode 100644 index 00000000000..395c380ab50 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/models/Visibility.java @@ -0,0 +1,33 @@ +package org.egov.encryption.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + + +public enum Visibility { + PLAIN("PLAIN"), + MASKED("MASKED"), + NONE("NONE"); + + private final String value; + + Visibility(String value) { + this.value = value; + } + + @JsonCreator + public static Visibility fromValue(String text) { + for (Visibility b : Visibility.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/producer/Producer.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/producer/Producer.java new file mode 100644 index 00000000000..e8940ff036b --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/producer/Producer.java @@ -0,0 +1,17 @@ +package org.egov.encryption.producer; + +import org.egov.tracer.kafka.CustomKafkaTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class Producer { + + @Autowired + private CustomKafkaTemplate kafkaTemplate; + + public void push(String topic, String key, Object data) { + kafkaTemplate.send(topic, key, data); + } + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/ConvertClass.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/ConvertClass.java new file mode 100644 index 00000000000..3adadfc55a0 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/ConvertClass.java @@ -0,0 +1,25 @@ +package org.egov.encryption.util; + +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectReader; + +import java.io.IOException; +import java.util.List; + +public class ConvertClass { + + public static P convertTo(JsonNode jsonNode, Class valueType) throws IOException { + ObjectMapper objectMapper = new ObjectMapper(new JsonFactory()); + + if (jsonNode.isArray()) { + ObjectReader reader = + objectMapper.readerFor(objectMapper.getTypeFactory().constructCollectionType(List.class, valueType)); + return reader.readValue(jsonNode); + } else { + return (P) objectMapper.treeToValue(jsonNode, valueType); + } + } + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/JSONBrowseUtil.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/JSONBrowseUtil.java new file mode 100644 index 00000000000..417c602b351 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/JSONBrowseUtil.java @@ -0,0 +1,44 @@ +package org.egov.encryption.util; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.*; + +import java.util.Iterator; +import java.util.function.Function; + +public class JSONBrowseUtil { + + public static JsonNode mapValues(JsonNode jsonNode, Function valueMapper) { + if (jsonNode.isArray()) { + jsonNode = mapValuesForArrayNode((ArrayNode) jsonNode, valueMapper); + } else if (jsonNode.isObject()) { + jsonNode = mapValuesForObjectNode((ObjectNode) jsonNode, valueMapper); + } else if (jsonNode.isValueNode()) { + jsonNode = mapValuesForValueNode((ValueNode) jsonNode, valueMapper); + } + return jsonNode; + } + + private static ArrayNode mapValuesForArrayNode(ArrayNode arrayNode, Function valueMapper) { + for (int i = 0; i < arrayNode.size(); i++) { + arrayNode.set(i, mapValues(arrayNode.get(i), valueMapper)); + } + return arrayNode; + } + + private static ObjectNode mapValuesForObjectNode(ObjectNode objectNode, Function valueMapper) { + Iterator fields = objectNode.fieldNames(); + while (fields.hasNext()) { + String field = fields.next(); + objectNode.set(field, mapValues(objectNode.get(field), valueMapper)); + } + return objectNode; + } + + private static ValueNode mapValuesForValueNode(ValueNode valueNode, Function valueMapper) { + if (valueNode.isNull()) + return NullNode.getInstance(); + return new TextNode(String.valueOf(valueMapper.apply((T) valueNode.asText()))); + } + +} diff --git a/core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JSONUtils.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/JSONUtils.java similarity index 100% rename from core-services/libraries/enc-client/src/main/java/org/egov/encryption/util/JSONUtils.java rename to core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/JSONUtils.java diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/JacksonUtils.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/JacksonUtils.java new file mode 100644 index 00000000000..10617f435a2 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/JacksonUtils.java @@ -0,0 +1,188 @@ +package org.egov.encryption.util; + +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.NullNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import lombok.extern.slf4j.Slf4j; + +import java.util.Iterator; +import java.util.List; + +@Slf4j +public class JacksonUtils { + + public static JsonNode merge(JsonNode newNode, JsonNode originalNode) { + if (newNode == null || newNode.isNull()) + return originalNode; + else if (originalNode == null || originalNode.isNull()) + return newNode; + + if (newNode.isObject()) + newNode = mergeObjectNodes((ObjectNode) newNode, (ObjectNode) originalNode); + else if (newNode.isArray()) + newNode = mergeArrayNode((ArrayNode) newNode, (ArrayNode) originalNode); + + return newNode; + } + + static ArrayNode mergeArrayNode(ArrayNode newNode, ArrayNode originalNode) { + int size = newNode.size(); + if (newNode.size() < originalNode.size()) + size = originalNode.size(); + for (int i = 0; i < size; i++) { + JsonNode jsonNode = merge(newNode.get(i), originalNode.get(i)); + if (i < newNode.size()) + newNode.set(i, jsonNode); + else + newNode.add(jsonNode); + } + return newNode; + } + + static ObjectNode mergeObjectNodes(ObjectNode newNode, ObjectNode originalNode) { + Iterator fieldNames = originalNode.fieldNames(); + + while (fieldNames.hasNext()) { + + String fieldName = fieldNames.next(); + JsonNode jsonNode = newNode.get(fieldName); + + if (jsonNode != null) { + merge(jsonNode, originalNode.get(fieldName)); + } else { + if (newNode instanceof ObjectNode) { + JsonNode value = originalNode.get(fieldName); + newNode.set(fieldName, value); + } + } + } + + return newNode; + } + + public static JsonNode filterJsonNodeForPaths(JsonNode jsonNode, List filterPaths) { + ObjectMapper mapper = new ObjectMapper(new JsonFactory()); + + JsonNode filteredNode; + if (jsonNode instanceof ArrayNode) + filteredNode = mapper.createArrayNode(); + else if (jsonNode instanceof ObjectNode) + filteredNode = mapper.createObjectNode(); + else + return null; + + for (String path : filterPaths) { + JsonNode singlePathFilterNode = filterJsonNodeForPath(jsonNode, path); + filteredNode = merge(singlePathFilterNode, filteredNode); + } + + return filteredNode; + } + + static JsonNode filterJsonNodeForPath(JsonNode jsonNode, String filterPath) { + ObjectMapper objectMapper = new ObjectMapper(new JsonFactory()); + + if (filterPath == null) + return jsonNode; + else if (jsonNode == null) + return null; + + String key = getFirstJsonKeyForPath(filterPath); + JsonNode newNode = null; + + try { + if (key.contains("*")) { //ArrayNode + ArrayNode arrayNode = (ArrayNode) jsonNode; + newNode = objectMapper.createArrayNode(); + for (JsonNode value : arrayNode) { + JsonNode filteredNode = filterJsonNodeForPath(value, getRemainingJsonKeyForPath(filterPath)); + if (filteredNode != null && !filteredNode.isNull()) + ((ArrayNode) newNode).add(filteredNode); + } + } else { //ObjectNode + ObjectNode objectNode = (ObjectNode) jsonNode; + newNode = objectMapper.createObjectNode(); + JsonNode value = objectNode.get(key); + JsonNode filteredNode = filterJsonNodeForPath(value, getRemainingJsonKeyForPath(filterPath)); + if (filteredNode != null && !filteredNode.isNull()) + ((ObjectNode) newNode).set(key, filteredNode); + } + } catch (ClassCastException e) { + log.error("Cannot find value for path : " + filterPath); + } + + return newNode; + } + + static String getFirstJsonKeyForPath(String path) { + String keys[] = path.split("/", 2); + return keys[0]; + } + + static String getRemainingJsonKeyForPath(String path) { + String keys[] = path.split("/", 2); + if (keys.length == 1) + return null; + return keys[1]; + } + + + public static JsonNode filterJsonNodeWithFields(JsonNode jsonNode, List filterFields) { + if (checkIfNoFieldExistsInJsonNode(jsonNode, filterFields)) + return null; + + ObjectMapper mapper = new ObjectMapper(new JsonFactory()); + + + if (jsonNode.isObject()) { + ObjectNode objectNode = (ObjectNode) jsonNode; + ObjectNode filteredObjectNode = mapper.createObjectNode(); + Iterator fieldIterator = objectNode.fieldNames(); + while (fieldIterator.hasNext()) { + String field = fieldIterator.next(); + if (filterFields.contains(field) && !objectNode.get(field).isNull()) { + filteredObjectNode.set(field, objectNode.get(field)); + } else { + JsonNode filteredJsonNode = filterJsonNodeWithFields(objectNode.get(field), filterFields); + if (filteredJsonNode != null) { + filteredObjectNode.set(field, filteredJsonNode); + } + } + } + if (filteredObjectNode.isEmpty(mapper.getSerializerProvider())) + return null; + return filteredObjectNode; + } else if (jsonNode.isArray()) { + ArrayNode arrayNode = (ArrayNode) jsonNode; + ArrayNode filteredArrayNode = mapper.createArrayNode(); + for (int i = 0; i < arrayNode.size(); i++) { + JsonNode filteredJsonNode = filterJsonNodeWithFields(arrayNode.get(i), filterFields); + if (filteredJsonNode == null) { + if (arrayNode.get(i).isArray()) + filteredJsonNode = mapper.createArrayNode(); + else if (arrayNode.get(i).isObject()) + filteredJsonNode = mapper.createObjectNode(); + else + filteredJsonNode = NullNode.getInstance(); + } + filteredArrayNode.add(filteredJsonNode); + } + return filteredArrayNode; + } + + return null; + } + + + static boolean checkIfNoFieldExistsInJsonNode(JsonNode jsonNode, List fields) { + for (String field : fields) { + if (!String.valueOf(jsonNode.findPath(field)).isEmpty()) + return false; + } + return true; + } + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/JsonPathConverter.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/JsonPathConverter.java new file mode 100644 index 00000000000..3ba904dbd8f --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/JsonPathConverter.java @@ -0,0 +1,15 @@ +package org.egov.encryption.util; + + +import java.util.ArrayList; +import java.util.List; + +public class JsonPathConverter { + + public static List convertToArrayJsonPaths(List jsonPaths) { + List arrayJsonPaths = new ArrayList<>(); + jsonPaths.stream().map(path -> "*/" + path).forEach(arrayJsonPaths::add); + return arrayJsonPaths; + } + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/MdmsFetcher.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/MdmsFetcher.java new file mode 100644 index 00000000000..8fb96ff471e --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/util/MdmsFetcher.java @@ -0,0 +1,68 @@ +package org.egov.encryption.util; + +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.utils.MultiStateInstanceUtil; +import org.egov.encryption.config.EncClientConstants; +import org.egov.encryption.config.EncProperties; +import org.egov.encryption.config.ErrorConstants; +import org.egov.mdms.model.*; +import org.egov.tracer.model.CustomException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; +import org.slf4j.MDC; + +import java.util.Arrays; + +@Slf4j +@Component +public class MdmsFetcher { + + @Autowired + private EncProperties encProperties; + @Autowired + private RestTemplate restTemplate; + + @Autowired + private MultiStateInstanceUtil multiStateInstanceUtil; + + public static final String TENANTID_MDC_STRING = "TENANTID"; + + public JSONArray getSecurityMdmsForFilter(String filter) { + return getMdmsForFilter(filter, EncClientConstants.MDMS_SECURITY_POLICY_MASTER_NAME); + } + + public JSONArray getMaskingMdmsForFilter(String filter) { + return getMdmsForFilter(filter, EncClientConstants.MDMS_MASKING_PATTERN_MASTER_NAME); + } + + public JSONArray getMdmsForFilter(String filter, String masterName) { + MasterDetail masterDetail = MasterDetail.builder().name(masterName) + .filter(filter).build(); + ModuleDetail moduleDetail = ModuleDetail.builder().moduleName(EncClientConstants.MDMS_MODULE_NAME) + .masterDetails(Arrays.asList(masterDetail)).build(); + MdmsCriteria mdmsCriteria = MdmsCriteria.builder().tenantId(encProperties.getStateLevelTenantId()) + .moduleDetails(Arrays.asList(moduleDetail)).build(); + + MdmsCriteriaReq mdmsCriteriaReq = MdmsCriteriaReq.builder().requestInfo(RequestInfo.builder().build()) + .mdmsCriteria(mdmsCriteria).build(); + if(multiStateInstanceUtil.getIsEnvironmentCentralInstance()){ + MDC.put(TENANTID_MDC_STRING, encProperties.getStateLevelTenantId()); + } + + try { + ResponseEntity response = + restTemplate.postForEntity(encProperties.getEgovMdmsHost() + encProperties.getEgovMdmsSearchEndpoint(), + mdmsCriteriaReq, MdmsResponse.class); + return response.getBody().getMdmsRes().get(EncClientConstants.MDMS_MODULE_NAME) + .get(masterName); + } catch (Exception e) { + log.error(ErrorConstants.MDMS_FETCH_ERROR_MESSAGE, e); + throw new CustomException(ErrorConstants.MDMS_FETCH_ERROR, ErrorConstants.MDMS_FETCH_ERROR_MESSAGE); + } + } + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/web/contract/EncReqObject.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/web/contract/EncReqObject.java new file mode 100644 index 00000000000..ddc7fe910e0 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/web/contract/EncReqObject.java @@ -0,0 +1,27 @@ +package org.egov.encryption.web.contract; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +/** + * Encryption / Decryption Request Meta-data and Values + */ +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2018-10-11T17:31:52.360+05:30") + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class EncReqObject { + + @JsonProperty("tenantId") + private String tenantId = null; + + @JsonProperty("type") + private String type = null; + + @JsonProperty("value") + private Object value = null; + +} diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/web/contract/EncryptionRequest.java b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/web/contract/EncryptionRequest.java new file mode 100644 index 00000000000..2bd7bd7bba2 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/encryption/web/contract/EncryptionRequest.java @@ -0,0 +1,18 @@ +package org.egov.encryption.web.contract; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +import java.util.List; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class EncryptionRequest { + + @JsonProperty("encryptionRequests") + private List encryptionRequests; + +} \ No newline at end of file diff --git a/core-services/libraries2/enc-client/src/main/java/org/egov/hash/HashService.java b/core-services/libraries2/enc-client/src/main/java/org/egov/hash/HashService.java new file mode 100644 index 00000000000..8705a916154 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/java/org/egov/hash/HashService.java @@ -0,0 +1,29 @@ +package org.egov.hash; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.binary.Base64; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +@Slf4j +@Service +public class HashService { + + private MessageDigest messageDigest; + + @PostConstruct + public void init() throws NoSuchAlgorithmException { + messageDigest = MessageDigest.getInstance("SHA-256"); + } + + public String getHashValue(Object object) { + String value = object.toString(); + byte[] bytes = messageDigest.digest(value.getBytes(StandardCharsets.UTF_8)); + return Base64.encodeBase64URLSafeString(bytes); + } + +} diff --git a/core-services/libraries2/enc-client/src/main/resources/enc.properties b/core-services/libraries2/enc-client/src/main/resources/enc.properties new file mode 100644 index 00000000000..f756a7c6675 --- /dev/null +++ b/core-services/libraries2/enc-client/src/main/resources/enc.properties @@ -0,0 +1,19 @@ +#------------egov-enc-service config----------------# +egov.enc.host=https://msewapunjab.niua.org/ +egov.enc.encrypt.endpoint=/egov-enc-service/crypto/v1/_encrypt +egov.enc.decrypt.endpoint=/egov-enc-service/crypto/v1/_decrypt + +#----------------MDMS config---------------------# +egov.mdms.host=https://msewapunjab.niua.org/ +egov.mdms.search.endpoint=/egov-mdms-service/v1/_search + +state.level.tenant.id=pb +default.encrypt.data.type=Normal + +#-----------Kafka Audit Topic Name------------# +kafka.topic.audit=audit_data + +#------------Kafka Config----------------------# +kafka.config.bootstrap_server_config=localhost:9092 +spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer +spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer diff --git a/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/EncryptionServiceImplTest.java b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/EncryptionServiceImplTest.java new file mode 100644 index 00000000000..0fe09c2691b --- /dev/null +++ b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/EncryptionServiceImplTest.java @@ -0,0 +1,105 @@ +package org.egov.encryption; + +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.contract.request.Role; +import org.egov.common.contract.request.User; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +@Slf4j +//@RunWith(SpringJUnit4ClassRunner.class) +//@EnableConfigurationProperties +//@SpringBootTest(classes = TestConfiguration.class) +public class EncryptionServiceImplTest { + + ObjectMapper mapper; + User user; + @Autowired + private EncryptionServiceImpl encryptionServiceImpl; + + @Before + public void init() throws InstantiationException, IllegalAccessException, IOException { + Role role1 = Role.builder().code("GRO").build(); + Role role2 = Role.builder().code("LME").build(); + user = User.builder().roles(Arrays.asList(role1, role2)).build(); + + mapper = new ObjectMapper(new JsonFactory()); + + } + + + @Ignore + @Test + public void encryptValueTest() throws IOException { + log.info(encryptionServiceImpl.encryptValue(1, "pb", "Normal")); + } + + @Ignore + @Test + public void encryptJsonUsingKey() throws IOException { + JsonNode plaintext = mapper.readTree("{\"RequestInfo\":{\"api_id\":\"1\",\"ver\":\"1\",\"ts\":null," + + "\"action\":\"create\",\"did\":\"\",\"key\":\"\",\"msg_id\":\"\",\"requester_id\":\"\"," + + "\"auth_token\":null},\"User\":{\"userName\":\"ajay\",\"name\":\"ajay\",\"gender\":\"male\"," + + "\"mobileNumber\":\"12312312\",\"active\":true,\"type\":\"CITIZEN\",\"password\":\"password\"}}"); + + JsonNode ciphertext = encryptionServiceImpl.encryptJson(plaintext, "User", "pb"); + log.info(ciphertext.toString()); + } + + + @Ignore + @Test + public void decryptJsonArrayUsingRoles() throws IOException { + RequestInfo requestInfo = new RequestInfo(); + JsonNode ciphertext = mapper.readTree("[{\"User\":{\"mobileNumber\":\"341642|WfYfJPRug15R2wFh17PlQr5d9YhNkFk1" + + "\",\"name\":\"341642|Ca5NbGHu3aB2ufjrNfZarW1VGBA=\"," + + "\"userName\":\"341642|Ca5NbGHu3aB2ufjrNfZarW1VGBA=\",\"gender\":\"male\",\"active\":true," + + "\"type\":\"CITIZEN\",\"password\":\"password\"}}]"); + User user = User.builder().roles(Arrays.asList(Role.builder().code("GRO").build())).build(); + requestInfo.setUserInfo(user); + JsonNode plaintext = encryptionServiceImpl.decryptJson(requestInfo, ciphertext, "PGR-Complaints-Report", + "Report"); + log.info(plaintext.toString()); + } + + @Ignore + @Test + public void decryptJsonObjectUsingRoles() throws IOException { + RequestInfo requestInfo = new RequestInfo(); + JsonNode ciphertext = mapper.readTree("{\"User\":{\"mobileNumber\":\"341642|WfYfJPRug15R2wFh17PlQr5d9YhNkFk1" + + "\",\"name\":\"341642|Ca5NbGHu3aB2ufjrNfZarW1VGBA=\"," + + "\"userName\":\"341642|Ca5NbGHu3aB2ufjrNfZarW1VGBA=\",\"gender\":\"male\",\"active\":true," + + "\"type\":\"CITIZEN\",\"password\":\"password\"}}"); + User user = User.builder().roles(Arrays.asList(Role.builder().code("GRO").build())).build(); + requestInfo.setUserInfo(user); + JsonNode plaintext = encryptionServiceImpl.decryptJson(requestInfo, ciphertext, "PGR-Complaints-Report", + "Report", JsonNode.class); + log.info(plaintext.toString()); + } + + @Ignore + @Test + public void test() throws IOException { + RequestInfo requestInfo = new RequestInfo(); + Map data = new HashMap<>(); + data.put("name", "341642|Ca5NbGHu3aB2ufjrNfZarW1VGBA="); + data.put("mobileNumber", "341642|WfYfJPRug15R2wFh17PlQr5d9YhNkFk1"); + user.setRoles(Arrays.asList(Role.builder().code("CITIZEN").build())); + requestInfo.setUserInfo(user); + data = encryptionServiceImpl.decryptJson(requestInfo, data, "User", "UserSearch", Map.class); + log.info(String.valueOf(data)); + } + + +} \ No newline at end of file diff --git a/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/EncryptionServiceRestConnectionTest.java b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/EncryptionServiceRestConnectionTest.java new file mode 100644 index 00000000000..7d8d8c85fa4 --- /dev/null +++ b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/EncryptionServiceRestConnectionTest.java @@ -0,0 +1,22 @@ +package org.egov.encryption; + +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.Before; +import org.mockito.Mock; + +public class EncryptionServiceRestConnectionTest { + + @Mock + private EncryptionServiceRestConnection encryptionServiceRestConnection; + + private ObjectMapper mapper; + + @Before + public void initialize() { + encryptionServiceRestConnection = new EncryptionServiceRestConnection(); + mapper = new ObjectMapper(new JsonFactory()); + } + + +} \ No newline at end of file diff --git a/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/TestConfiguration.java b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/TestConfiguration.java new file mode 100644 index 00000000000..b4f48f5a2c6 --- /dev/null +++ b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/TestConfiguration.java @@ -0,0 +1,14 @@ +package org.egov.encryption; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class TestConfiguration { + + @Bean + public EncryptionServiceImpl encryptionService() { + return new EncryptionServiceImpl(); + } + +} diff --git a/core-services/libraries/enc-client/src/test/java/org/egov/encryption/accesscontrol/AbacFilterTest.java b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/accesscontrol/AbacFilterTest.java similarity index 100% rename from core-services/libraries/enc-client/src/test/java/org/egov/encryption/accesscontrol/AbacFilterTest.java rename to core-services/libraries2/enc-client/src/test/java/org/egov/encryption/accesscontrol/AbacFilterTest.java diff --git a/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/masking/MaskingServiceTest.java b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/masking/MaskingServiceTest.java new file mode 100644 index 00000000000..22f79165c72 --- /dev/null +++ b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/masking/MaskingServiceTest.java @@ -0,0 +1,21 @@ +package org.egov.encryption.masking; + +import lombok.extern.slf4j.Slf4j; +import org.junit.Before; +import org.junit.Test; + +@Slf4j +public class MaskingServiceTest { + + @Before + public void init() { + + } + + @Test + public void test() throws IllegalAccessException, InstantiationException { + + } + + +} \ No newline at end of file diff --git a/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/util/JSONBrowseUtilTest.java b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/util/JSONBrowseUtilTest.java new file mode 100644 index 00000000000..4bdb9050d81 --- /dev/null +++ b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/util/JSONBrowseUtilTest.java @@ -0,0 +1,34 @@ +package org.egov.encryption.util; + +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +import static org.junit.Assert.assertEquals; + +@Slf4j +public class JSONBrowseUtilTest { + + ObjectMapper mapper; + + @Before + public void init() { + mapper = new ObjectMapper(new JsonFactory()); + } + + @Test + public void test() throws IOException { + JsonNode jsonNode = mapper.readTree("{\"asd\" : \"qwe\"}"); + jsonNode = JSONBrowseUtil.mapValues(jsonNode, v -> ((String) v).length()); + + JsonNode expectedNode = mapper.readTree("{\"asd\" : \"3\"}"); + + assertEquals(expectedNode, jsonNode); + } + +} \ No newline at end of file diff --git a/core-services/libraries/enc-client/src/test/java/org/egov/encryption/util/JSONUtilsTest.java b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/util/JSONUtilsTest.java similarity index 100% rename from core-services/libraries/enc-client/src/test/java/org/egov/encryption/util/JSONUtilsTest.java rename to core-services/libraries2/enc-client/src/test/java/org/egov/encryption/util/JSONUtilsTest.java diff --git a/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/util/JacksonUtilsTest.java b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/util/JacksonUtilsTest.java new file mode 100644 index 00000000000..93c474420dd --- /dev/null +++ b/core-services/libraries2/enc-client/src/test/java/org/egov/encryption/util/JacksonUtilsTest.java @@ -0,0 +1,217 @@ +package org.egov.encryption.util; + +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +@Slf4j +public class JacksonUtilsTest { + + ObjectMapper mapper; + + @Before + public void initializeCommonObjects() { + JsonFactory jsonFactory = new JsonFactory(); + mapper = new ObjectMapper(jsonFactory); + } + + @Test + public void superimposeEncryptedDataOnOriginalNodeTest() throws IOException { + JsonNode originalNode = mapper.readTree("{\"RequestInfo\":{\"api_id\":\"1\",\"ver\":\"1\",\"ts\":null," + + "\"action\":\"create\",\"did\":\"\",\"key\":\"\",\"msg_id\":\"\",\"requester_id\":\"\"," + + "\"auth_token\":null},\"User\":{\"userName\":\"ajay\",\"name\":\"ajay\",\"gender\":\"male\"," + + "\"mobileNumber\":\"12312312\",\"active\":true,\"type\":\"CITIZEN\",\"password\":\"password\"}}"); + + JsonNode encryptedNode = mapper.readTree("{\"User\":{\"userName\":\"123|jkafsdhkjhalfsj\",\"name\":\"123|" + + "jkafsdhkjhalfsj\",\"mobileNumber\":\"123|hdskjahkjfk\"}}"); + + JsonNode outputNode = JacksonUtils.merge(encryptedNode, originalNode); + + JsonNode expectedNode = mapper.readTree("{\"RequestInfo\":{\"api_id\":\"1\",\"ver\":\"1\",\"ts\":null," + + "\"action\":\"create\",\"did\":\"\",\"key\":\"\",\"msg_id\":\"\",\"requester_id\":\"\"," + + "\"auth_token\":null},\"User\":{\"userName\":\"123|jkafsdhkjhalfsj\"," + + "\"name\":\"123|jkafsdhkjhalfsj\",\"gender\":\"male\",\"mobileNumber\":\"123|hdskjahkjfk\"," + + "\"active\":true,\"type\":\"CITIZEN\",\"password\":\"password\"}}"); + + assertEquals(expectedNode, outputNode); + + } + + @Test + public void filterJsonNode() throws IOException { + + JsonNode originalNode = mapper.readTree("{\"RequestInfo\":{\"api_id\":\"1\",\"ver\":\"1\",\"ts\":null," + + "\"action\":\"create\",\"did\":\"\",\"key\":\"\",\"msg_id\":\"\",\"requester_id\":\"\"," + + "\"auth_token\":null},\"User\":{\"userName\":\"ajay\",\"name\":\"ajay\",\"gender\":\"male\"," + + "\"mobileNumber\":\"12312312\",\"active\":true,\"type\":\"CITIZEN\",\"password\":\"password\"}}"); + + List fieldsToBeEncrypted = Arrays.asList("userName", "name", "mobileNumber"); + + JsonNode outputNode = JacksonUtils.filterJsonNodeWithFields(originalNode, fieldsToBeEncrypted); + + JsonNode expectedNode = mapper.readTree("{\"User\":{\"userName\":\"ajay\",\"name\":\"ajay\"," + + "\"mobileNumber\":\"12312312\"}}"); + + assertEquals(expectedNode, outputNode); + } + + @Test + public void filterJsonNodeWithNoMatchingFields() throws IOException { + JsonNode originalNode = mapper.readTree("{\"RequestInfo\":{\"api_id\":\"1\",\"ver\":\"1\",\"ts\":null," + + "\"action\":\"create\",\"did\":\"\",\"key\":\"\",\"msg_id\":\"\",\"requester_id\":\"\"," + + "\"auth_token\":null},\"User\":{\"userName\":\"ajay\",\"name\":\"ajay\",\"gender\":\"male\"," + + "\"mobileNumber\":\"12312312\",\"active\":true,\"type\":\"CITIZEN\",\"password\":\"password\"}}"); + + List fieldsToBeEncrypted = Arrays.asList(); + + JsonNode outputNode = JacksonUtils.filterJsonNodeWithFields(originalNode, fieldsToBeEncrypted); + + assertEquals(null, outputNode); + + } + + @Test + public void checkIfAnyFieldExistsInJsonNode() throws IOException { + JsonNode originalNode = mapper.readTree("{\"tenantDetails\":{\"tenantId\":\"pb.amritsar\"}," + + "\"name\":{\"firstName\":\"Customer Name\"}}"); + List fields = Arrays.asList("firstName"); + assertEquals(false, JacksonUtils.checkIfNoFieldExistsInJsonNode(originalNode, fields)); + } + + @Test + public void checkIfNoFieldExistsInJsonNode() throws IOException { + JsonNode originalNode = mapper.readTree("{\"tenantDetails\":{\"tenantId\":\"pb.amritsar\"}," + + "\"name\":{\"firstName\":\"Customer Name\"}}"); + List fields = Arrays.asList("asd"); + assertEquals(true, JacksonUtils.checkIfNoFieldExistsInJsonNode(originalNode, fields)); + } + + + @Test + public void filterJsonNodeForPathTest() throws IOException { + JsonNode jsonNode = mapper.readTree("{\"RequestInfo\":{\"api_id\":\"1\",\"ver\":\"1\",\"ts\":null," + + "\"action\":\"create\",\"did\":\"\",\"key\":\"\",\"msg_id\":\"\",\"requester_id\":\"\"," + + "\"auth_token\":null},\"User\":[{\"userName\":\"ajay\",\"gender\":\"male\"," + + "\"mobileNumber\":\"12312312\",\"active\":true,\"type\":\"CITIZEN\",\"password\":\"password\"}," + + "{\"userName\":\"ajay\",\"name\":\"ajay\",\"gender\":\"male\",\"mobileNumber\":\"12312312\"," + + "\"active\":true,\"type\":\"CITIZEN\",\"password\":\"password\"}]}"); + + + JsonNode newNode = JacksonUtils.filterJsonNodeForPaths(jsonNode, Arrays.asList("User/*/name", "RequestInfo" + + "/api_id", "asd/qwe")); + + JsonNode expectedNode = mapper.readTree("{\"RequestInfo\":{\"api_id\":\"1\"},\"User\":[{},{\"name\":\"ajay\"}]}"); + + assertEquals(expectedNode, newNode); + } + + @Test + public void test() throws IOException { + + JsonNode jsonNode = mapper.readTree("[{\"key\":126,\"uuid\":\"bb67df56-3a2d-4892-9e0a-b6f02cc525d8\"," + + "\"tenantId\":\"pb.amritsar\",\"username\":\"785515|BxWK0HrbI2iyfcGyqEO3wovO8IsyIAnU\"," + + "\"title\":null,\"password\":\"$2a$10$d2wVj8WZgVDv2rGkmCWskOUMR3lwB6u5itnIn1Fdf9SkmITk7UGmu\"," + + "\"salutation\":null,\"guardian\":\"785515|IhuDk17SYzKwDptHupfwUWkv7Vf7WO+PRJk=\"," + + "\"guardianRelation\":null,\"name\":\"785515|HheDx0fddjewkpIXq8AJOByREfokf6c1Xw==\"," + + "\"gender\":\"MALE\",\"mobileNumber\":\"785515|W0DDgiqKISfHRkC0NdtJaubFLRRNpcE=\"," + + "\"emailId\":\"785515|EguK83/edjO5Ug2GH2rax9xyzGGwec0BaePMsJs=\"," + + "\"altContactNumber\":\"785515|U0vJhCCLL2PtSrBrhHHxnfIaFu7HbwqVpT8=\"," + + "\"pan\":\"785515|CxyT23DbfzK9nnp0M8puv2zuHBBP+PNydg==\"," + + "\"aadhaarNumber\":\"785515|XUDHgC+FJG3nSl3eQIcoWKc57lX/QLpPvcx7Rvg=\"," + + "\"permanentAddress\":{\"pinCode\":\"454040\",\"city\":\"Mumbai\"," + + "\"address\":\"785515|Bx2Y0nTfdnqyHQKAUs6+0WAFy0PgJY7CpVpvyhkoACD7ZTI=\",\"type\":\"PERMANENT\"," + + "\"key\":70,\"tenantId\":\"pb.amritsar\",\"userId\":126,\"addressType\":\"PERMANENT\"," + + "\"lastModifiedBy\":null,\"lastModifiedDate\":null}," + + "\"correspondenceAddress\":{\"pinCode\":\"111111\",\"city\":\"bangalore\"," + + "\"address\":\"785515|DxWfxTjAYyiwGU6ME8mgROhcA2g6ARrCO+5Yj9Ha\",\"type\":\"CORRESPONDENCE\"," + + "\"key\":69,\"tenantId\":\"pb.amritsar\",\"userId\":126,\"addressType\":\"CORRESPONDENCE\"," + + "\"lastModifiedBy\":null,\"lastModifiedDate\":null},\"addresses\":[{\"pinCode\":\"111111\"," + + "\"city\":\"bangalore\",\"address\":\"785515|DxWfxTjAYyiwGU6ME8mgROhcA2g6ARrCO+5Yj9Ha\"," + + "\"type\":\"CORRESPONDENCE\",\"key\":69,\"tenantId\":\"pb.amritsar\",\"userId\":126," + + "\"addressType\":\"CORRESPONDENCE\",\"lastModifiedBy\":null,\"lastModifiedDate\":null}," + + "{\"pinCode\":\"454040\",\"city\":\"Mumbai\"," + + "\"address\":\"785515|Bx2Y0nTfdnqyHQKAUs6+0WAFy0PgJY7CpVpvyhkoACD7ZTI=\",\"type\":\"PERMANENT\"," + + "\"key\":70,\"tenantId\":\"pb.amritsar\",\"userId\":126,\"addressType\":\"PERMANENT\"," + + "\"lastModifiedBy\":null,\"lastModifiedDate\":null}],\"active\":true," + + "\"roles\":[{\"name\":\"Employee\",\"code\":\"EMPLOYEE\",\"description\":\"Default role for all " + + "employees\",\"createdBy\":null,\"createdDate\":null,\"lastModifiedBy\":null," + + "\"lastModifiedDate\":null,\"tenantId\":\"pb.amritsar\"}],\"dob\":\"1990-07-23\"," + + "\"passwordExpiryDate\":1559548533586,\"locale\":\"en_us\",\"type\":\"EMPLOYEE\",\"bloodGroup\":null," + + "\"identificationMark\":null,\"signature\":null,\"photo\":null,\"accountLocked\":false," + + "\"lastModifiedDate\":1551772534229,\"createdDate\":1551772534229,\"otpReference\":null," + + "\"createdBy\":0,\"lastModifiedBy\":0,\"loggedInUserId\":null,\"otpValidationMandatory\":false," + + "\"mobileValidationMandatory\":false}]"); + + List paths = Arrays.asList("*/name", "*/mobileNumber", "*/emailId", "*/username", "*/guardian", + "*/altContactNumber", "*/pan", "*/aadhaarNumber", "*/guardianRelation", "*/permanentAddress/address", + "*/correspondenceAddress/address", "*/addresses/*/address"); + + paths = Arrays.asList("*/name", "*/mobileNumber", "*/guardianRelation"); + + JsonNode outputNode = JacksonUtils.filterJsonNodeForPaths(jsonNode, paths); + + log.info(String.valueOf(outputNode)); + + } + + + @Test + public void test1() throws IOException { + + JsonNode jsonNode = mapper.readTree("{\"key\":126,\"uuid\":\"bb67df56-3a2d-4892-9e0a-b6f02cc525d8\"," + + "\"tenantId\":\"pb.amritsar\",\"username\":\"785515|BxWK0HrbI2iyfcGyqEO3wovO8IsyIAnU\"," + + "\"title\":null,\"password\":\"$2a$10$d2wVj8WZgVDv2rGkmCWskOUMR3lwB6u5itnIn1Fdf9SkmITk7UGmu\"," + + "\"salutation\":null,\"guardian\":\"785515|IhuDk17SYzKwDptHupfwUWkv7Vf7WO+PRJk=\"," + + "\"guardianRelation\":null,\"name\":\"785515|HheDx0fddjewkpIXq8AJOByREfokf6c1Xw==\"," + + "\"gender\":\"MALE\",\"mobileNumber\":\"785515|W0DDgiqKISfHRkC0NdtJaubFLRRNpcE=\"," + + "\"emailId\":\"785515|EguK83/edjO5Ug2GH2rax9xyzGGwec0BaePMsJs=\"," + + "\"altContactNumber\":\"785515|U0vJhCCLL2PtSrBrhHHxnfIaFu7HbwqVpT8=\"," + + "\"pan\":\"785515|CxyT23DbfzK9nnp0M8puv2zuHBBP+PNydg==\"," + + "\"aadhaarNumber\":\"785515|XUDHgC+FJG3nSl3eQIcoWKc57lX/QLpPvcx7Rvg=\"," + + "\"permanentAddress\":{\"pinCode\":\"454040\",\"city\":\"Mumbai\"," + + "\"address\":\"785515|Bx2Y0nTfdnqyHQKAUs6+0WAFy0PgJY7CpVpvyhkoACD7ZTI=\",\"type\":\"PERMANENT\"," + + "\"key\":70,\"tenantId\":\"pb.amritsar\",\"userId\":126,\"addressType\":\"PERMANENT\"," + + "\"lastModifiedBy\":null,\"lastModifiedDate\":null}," + + "\"correspondenceAddress\":{\"pinCode\":\"111111\",\"city\":\"bangalore\"," + + "\"address\":\"785515|DxWfxTjAYyiwGU6ME8mgROhcA2g6ARrCO+5Yj9Ha\",\"type\":\"CORRESPONDENCE\"," + + "\"key\":69,\"tenantId\":\"pb.amritsar\",\"userId\":126,\"addressType\":\"CORRESPONDENCE\"," + + "\"lastModifiedBy\":null,\"lastModifiedDate\":null},\"addresses\":[{\"pinCode\":\"111111\"," + + "\"city\":\"bangalore\",\"address\":\"785515|DxWfxTjAYyiwGU6ME8mgROhcA2g6ARrCO+5Yj9Ha\"," + + "\"type\":\"CORRESPONDENCE\",\"key\":69,\"tenantId\":\"pb.amritsar\",\"userId\":126," + + "\"addressType\":\"CORRESPONDENCE\",\"lastModifiedBy\":null,\"lastModifiedDate\":null}," + + "{\"pinCode\":\"454040\",\"city\":\"Mumbai\"," + + "\"address\":\"785515|Bx2Y0nTfdnqyHQKAUs6+0WAFy0PgJY7CpVpvyhkoACD7ZTI=\",\"type\":\"PERMANENT\"," + + "\"key\":70,\"tenantId\":\"pb.amritsar\",\"userId\":126,\"addressType\":\"PERMANENT\"," + + "\"lastModifiedBy\":null,\"lastModifiedDate\":null}],\"active\":true," + + "\"roles\":[{\"name\":\"Employee\",\"code\":\"EMPLOYEE\",\"description\":\"Default role for all " + + "employees\",\"createdBy\":null,\"createdDate\":null,\"lastModifiedBy\":null," + + "\"lastModifiedDate\":null,\"tenantId\":\"pb.amritsar\"}],\"dob\":\"1990-07-23\"," + + "\"passwordExpiryDate\":1559548533586,\"locale\":\"en_us\",\"type\":\"EMPLOYEE\",\"bloodGroup\":null," + + "\"identificationMark\":null,\"signature\":null,\"photo\":null,\"accountLocked\":false," + + "\"lastModifiedDate\":1551772534229,\"createdDate\":1551772534229,\"otpReference\":null," + + "\"createdBy\":0,\"lastModifiedBy\":0,\"loggedInUserId\":null,\"otpValidationMandatory\":false," + + "\"mobileValidationMandatory\":false}"); + + List paths = Arrays.asList("*/name", "*/mobileNumber", "*/emailId", "*/username", "*/guardian", + "*/altContactNumber", "*/pan", "*/aadhaarNumber", "*/guardianRelation", "*/permanentAddress/address", + "*/correspondenceAddress/address", "*/addresses/*/address"); + + paths = Arrays.asList("name", "mobileNumber", "guardianRelation"); + + JsonNode outputNode = JacksonUtils.filterJsonNodeForPaths(jsonNode, paths); + + log.info(String.valueOf(outputNode)); + + } + + +} \ No newline at end of file diff --git a/core-services/libraries2/enc-client/src/test/resources/DecryptionABAC.json b/core-services/libraries2/enc-client/src/test/resources/DecryptionABAC.json new file mode 100644 index 00000000000..89c5e206a6b --- /dev/null +++ b/core-services/libraries2/enc-client/src/test/resources/DecryptionABAC.json @@ -0,0 +1,365 @@ +[ + { + "key": "PGR-Complaints-Report", + "roleAttributeAccessList": [ + { + "roleCode": "LME", + "attributeAccessList": [ + { + "attribute": { + "jsonPath": "User/name" + }, + "accessType": "PLAIN" + }, + { + "attribute": { + "jsonPath": "User/mobileNumber" + }, + "accessType": "PLAIN" + } + ] + }, + { + "roleCode": "GRO", + "attributeAccessList": [ + { + "attribute": { + "jsonPath": "User/name" + }, + "accessType": "PLAIN" + }, + { + "attribute": { + "jsonPath": "User/mobileNumber", + "maskingTechnique": "mobile" + }, + "accessType": "MASK" + }, + { + "attribute" : { + "jsonPath" : "User/userName" + }, + "accessType": "NONE" + } + ] + } + ] + }, + { + "key": "PT-Report", + "roleAttributeAccessList": [ + { + "roleCode" : "PTCOL", + "attributeAccessList" : [ + { + "attribute": { + "jsonPath": "*/owner/name" + }, + "accessType": "PLAIN" + }, + { + "attribute": { + "jsonPath": "*/owner/mobileNumber", + "maskingTechnique": "mobile" + }, + "accessType": "MASK" + } + ] + } + ] + }, + { + "key" : "User", + "roleAttributeAccessList" : [ + { + "roleCode" : "CITIZEN", + "attributeAccessList" : [ + { + "attribute" : { + "jsonPath" : "name" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "mobileNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "emailId" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "username" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "altContactNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "pan" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "aadhaarNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "guardian" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "permanentAddress/address" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "correspondenceAddress/address" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "addresses/*/address" + }, + "accessType" : "PLAIN" + } + ] + }, + { + "roleCode" : "EMPLOYEE", + "attributeAccessList" : [ + { + "attribute" : { + "jsonPath" : "name" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "mobileNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "emailId" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "username" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "altContactNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "pan" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "aadhaarNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "guardian" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "permanentAddress/address" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "correspondenceAddress/address" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "addresses/*/address" + }, + "accessType" : "PLAIN" + } + ] + } + ] + }, + { + "key" : "UserList", + "roleAttributeAccessList" : [ + { + "roleCode" : "CITIZEN", + "attributeAccessList" : [ + { + "attribute" : { + "jsonPath" : "*/name" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/mobileNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/emailId" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/username" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/altContactNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/pan" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/aadhaarNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/guardian" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/permanentAddress/address" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/correspondenceAddress/address" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/addresses/*/address" + }, + "accessType" : "PLAIN" + } + ] + }, + { + "roleCode" : "EMPLOYEE", + "attributeAccessList" : [ + { + "attribute" : { + "jsonPath" : "*/name" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/mobileNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/emailId" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/username" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/altContactNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/pan" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/aadhaarNumber" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/guardian" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/permanentAddress/address" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/correspondenceAddress/address" + }, + "accessType" : "PLAIN" + }, + { + "attribute" : { + "jsonPath" : "*/addresses/*/address" + }, + "accessType" : "PLAIN" + } + ] + } + ] + } +] diff --git a/core-services/libraries2/enc-client/src/test/resources/EncryptionPolicy.json b/core-services/libraries2/enc-client/src/test/resources/EncryptionPolicy.json new file mode 100644 index 00000000000..fed137b8292 --- /dev/null +++ b/core-services/libraries2/enc-client/src/test/resources/EncryptionPolicy.json @@ -0,0 +1,80 @@ +[ + { + "key" : "User", + "attributeList" : [ + { + "jsonPath" : "name", + "type" : "Normal" + }, + { + "jsonPath" : "mobileNumber", + "type" : "Normal" + }, + { + "jsonPath" : "emailId", + "type" : "Normal" + }, + { + "jsonPath" : "username", + "type" : "Normal" + }, + { + "jsonPath" : "altContactNumber", + "type" : "Normal" + }, + { + "jsonPath" : "pan", + "type" : "Normal" + }, + { + "jsonPath" : "aadhaarNumber", + "type" : "Normal" + }, + { + "jsonPath" : "guardian", + "type" : "Normal" + }, + { + "jsonPath" : "permanentAddress/address", + "type" : "Normal" + }, + { + "jsonPath" : "correspondenceAddress/address", + "type" : "Normal" + }, + { + "jsonPath" : "addresses/*/address", + "type" : "Normal" + } + ] + }, + { + "key" : "UserSearchCriteria", + "attributeList" : [ + { + "jsonPath" : "userName", + "type" : "Normal" + }, + { + "jsonPath" : "name", + "type" : "Normal" + }, + { + "jsonPath" : "mobileNumber", + "type" : "Normal" + }, + { + "jsonPath" : "aadhaarNumber", + "type" : "Normal" + }, + { + "jsonPath" : "pan", + "type" : "Normal" + }, + { + "jsonPath" : "emailId", + "type" : "Normal" + } + ] + } +] \ No newline at end of file diff --git a/core-services/libraries2/mdms-client/pom.xml b/core-services/libraries2/mdms-client/pom.xml new file mode 100644 index 00000000000..58d876a0e45 --- /dev/null +++ b/core-services/libraries2/mdms-client/pom.xml @@ -0,0 +1,145 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 1.5.22.RELEASE + + + org.egov + mdms-client + 0.0.4-SNAPSHOT + + + repo.digit.org + eGov DIGIT Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + + repo.egovernments.org + eGov ERP Snapshots Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/ + + + + + 2.17.1 + UTF-8 + 1.8 + UTF-8 + 3.3.9 + 1.18.8 + 2.6 + + + + org.springframework.boot + spring-boot-starter-web + + + commons-lang + commons-lang + ${commons-lang-version} + + + org.apache.commons + commons-lang3 + 3.0 + + + org.springframework.boot + spring-boot-devtools + runtime + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.egov.services + services-common + 1.1.0-SNAPSHOT + + + com.jayway.jsonpath + json-path + 2.2.0 + + + org.json + json + 20160810 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + 2.7.9 + + + com.fasterxml.jackson.core + jackson-databind + 2.7.9 + + + org.egov.services + tracer + 2.1.1-SNAPSHOT + + + + + repo.egovernments.org.snapshots + eGov ERP Snapshots Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/ + + + repo.egovernments.org + eGov ERP Releases Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/releases/ + + + repo.digit.org + eGov DIGIT Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + exec + + + + + + + org.projectlombok + lombok + + + org.springframework.boot + spring-boot-devtools + + + + + + + diff --git a/core-services/libraries2/mdms-client/settings.xml b/core-services/libraries2/mdms-client/settings.xml new file mode 100644 index 00000000000..092c5ee4b49 --- /dev/null +++ b/core-services/libraries2/mdms-client/settings.xml @@ -0,0 +1,23 @@ + + + + + nexus + central + https://nexus-repo.egovernments.org/nexus/content/groups/public/ + + + + + repo.egovernments.org + ${nexus.user} + ${nexus.password} + + + + com.versioneye + + diff --git a/core-services/libraries2/mdms-client/src/main/java/org/egov/MdmsClientApplication.java b/core-services/libraries2/mdms-client/src/main/java/org/egov/MdmsClientApplication.java new file mode 100644 index 00000000000..9ac7f2998b7 --- /dev/null +++ b/core-services/libraries2/mdms-client/src/main/java/org/egov/MdmsClientApplication.java @@ -0,0 +1,13 @@ +package org.egov; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MdmsClientApplication { + + public static void main(String[] args) { + SpringApplication.run(MdmsClientApplication.class, args); + } + +} diff --git a/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MDMSCreateErrorResponse.java b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MDMSCreateErrorResponse.java new file mode 100644 index 00000000000..a9666549e0c --- /dev/null +++ b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MDMSCreateErrorResponse.java @@ -0,0 +1,28 @@ +package org.egov.mdms.model; + +import org.egov.common.contract.response.ResponseInfo; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +@Getter +@Setter +@ToString +@AllArgsConstructor +@NoArgsConstructor +public class MDMSCreateErrorResponse { + + @JsonProperty("ResponseInfo") + private ResponseInfo responseInfo; + + @JsonProperty("Message") + private String message; + + @JsonProperty("Data") + private Object data; +} diff --git a/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MDMSCreateRequest.java b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MDMSCreateRequest.java new file mode 100644 index 00000000000..0ac08230f81 --- /dev/null +++ b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MDMSCreateRequest.java @@ -0,0 +1,26 @@ +package org.egov.mdms.model; + +import org.egov.common.contract.request.RequestInfo; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +@Getter +@Setter +@ToString +@AllArgsConstructor +@NoArgsConstructor +public class MDMSCreateRequest { + + @JsonProperty("RequestInfo") + public RequestInfo requestInfo; + + @JsonProperty("MasterMetaData") + public MasterMetaData masterMetaData; + +} diff --git a/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MasterDetail.java b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MasterDetail.java new file mode 100644 index 00000000000..35d6f80aa1b --- /dev/null +++ b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MasterDetail.java @@ -0,0 +1,25 @@ +package org.egov.mdms.model; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MasterDetail { + + @Size(max=256) + private String name; + + private String filter; +} diff --git a/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MasterMetaData.java b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MasterMetaData.java new file mode 100644 index 00000000000..8568c826e1e --- /dev/null +++ b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MasterMetaData.java @@ -0,0 +1,32 @@ +package org.egov.mdms.model; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +@Getter +@Setter +@ToString +@AllArgsConstructor +@NoArgsConstructor +public class MasterMetaData { + + @JsonProperty("tenantId") + public String tenantId; + + @JsonProperty("moduleName") + public String moduleName; + + @JsonProperty("masterName") + public String masterName; + + @JsonProperty("masterData") + public List masterData; + +} diff --git a/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsCreateResponse.java b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsCreateResponse.java new file mode 100644 index 00000000000..6637f330b9b --- /dev/null +++ b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsCreateResponse.java @@ -0,0 +1,26 @@ +package org.egov.mdms.model; + +import org.egov.common.contract.response.ResponseInfo; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +@Getter +@Setter +@ToString +@AllArgsConstructor +@NoArgsConstructor +public class MdmsCreateResponse { + + @JsonProperty("ResponseInfo") + public ResponseInfo responseInfo; + + @JsonProperty("Data") + public Object data; + +} diff --git a/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsCriteria.java b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsCriteria.java new file mode 100644 index 00000000000..4f2f3658411 --- /dev/null +++ b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsCriteria.java @@ -0,0 +1,34 @@ +package org.egov.mdms.model; + +import java.util.List; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +import org.egov.mdms.model.MasterDetail.MasterDetailBuilder; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MdmsCriteria { + + @NotNull + @Size(max=256) + private String tenantId; + + @NotNull + @Valid + private List moduleDetails; + +} diff --git a/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsCriteriaReq.java b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsCriteriaReq.java new file mode 100644 index 00000000000..b1f03f82fe3 --- /dev/null +++ b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsCriteriaReq.java @@ -0,0 +1,36 @@ +package org.egov.mdms.model; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +import org.egov.common.contract.request.RequestInfo; +import org.egov.mdms.model.MasterDetail.MasterDetailBuilder; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MdmsCriteriaReq { + + @JsonProperty("RequestInfo") + @Valid + @NotNull + private RequestInfo requestInfo; + + @JsonProperty("MdmsCriteria") + @Valid + @NotNull + private MdmsCriteria mdmsCriteria; + +} diff --git a/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsResponse.java b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsResponse.java new file mode 100644 index 00000000000..6a33a93d1db --- /dev/null +++ b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/MdmsResponse.java @@ -0,0 +1,30 @@ +package org.egov.mdms.model; + +import java.util.Map; + +import org.egov.common.contract.response.ResponseInfo; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import net.minidev.json.JSONArray; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MdmsResponse { + + @JsonProperty("ResponseInfo") + private ResponseInfo responseInfo; + + @JsonProperty("MdmsRes") + private Map> mdmsRes; +} diff --git a/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/ModuleDetail.java b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/ModuleDetail.java new file mode 100644 index 00000000000..bc655c7517d --- /dev/null +++ b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/model/ModuleDetail.java @@ -0,0 +1,32 @@ +package org.egov.mdms.model; + +import java.util.List; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +import org.egov.mdms.model.MasterDetail.MasterDetailBuilder; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.ToString; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ModuleDetail { + + @NotNull + @Size(max=256) + private String moduleName; + + private List masterDetails; + +} diff --git a/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/service/MdmsClientService.java b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/service/MdmsClientService.java new file mode 100644 index 00000000000..11515440181 --- /dev/null +++ b/core-services/libraries2/mdms-client/src/main/java/org/egov/mdms/service/MdmsClientService.java @@ -0,0 +1,72 @@ +package org.egov.mdms.service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.egov.common.contract.request.RequestInfo; +import org.egov.mdms.model.MasterDetail; +import org.egov.mdms.model.MdmsCriteria; +import org.egov.mdms.model.MdmsCriteriaReq; +import org.egov.mdms.model.MdmsResponse; +import org.egov.mdms.model.ModuleDetail; +import org.egov.tracer.model.CustomException; +import org.egov.tracer.model.ServiceCallException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.RestTemplate; + +import lombok.extern.slf4j.Slf4j; + +@Service +@Slf4j +public class MdmsClientService { + + @Autowired + private RestTemplate restTemplate; + + @Value("${mdms.service.host:http://localhost:8080/}") + private String mdmsHost; + + @Value("${mdms.service.search.uri:egov-mdms-service/v1/_search}") + private String mdmsSearchUri; + + public MdmsResponse getMaster(RequestInfo requestInfo, String tenantId, + Map> masterDetails) { + log.info("MdmsClientService masterDetails:" + masterDetails); + MdmsCriteriaReq mdmsCriteriaReq = new MdmsCriteriaReq(); + mdmsCriteriaReq.setRequestInfo(requestInfo); + List moduleDetails = new ArrayList<>(); + for (Map.Entry> entry : masterDetails.entrySet()) { + ModuleDetail moduleDetail = ModuleDetail.builder().moduleName(entry.getKey()) + .masterDetails(entry.getValue()).build(); + + moduleDetails.add(moduleDetail); + + MdmsCriteria mdmsCriteria = MdmsCriteria.builder().tenantId(tenantId).moduleDetails(moduleDetails).build(); + mdmsCriteriaReq.setMdmsCriteria(mdmsCriteria); + + } + return getMaster(mdmsCriteriaReq); + } + + public MdmsResponse getMaster(MdmsCriteriaReq mdmsCriteriaReq) { + log.info("mdmsCriteriaReq:" + mdmsCriteriaReq); + MdmsResponse mdmsResponse = null; + try { + mdmsResponse = restTemplate.postForObject(mdmsHost.concat(mdmsSearchUri), mdmsCriteriaReq, MdmsResponse.class); + } catch (HttpClientErrorException ex) { + ex.printStackTrace(); + String excep = ex.getResponseBodyAsString(); + log.info("HttpClientErrorException:" + excep); + throw new ServiceCallException(excep); + } catch (Exception ex) { + log.error("Exception: " + ex.getMessage()); + throw new CustomException("MDMS_RESPONSE_ERROR", "Error while fetching data from MDMS: " + ex.getMessage()); + + } + return mdmsResponse; + } +} \ No newline at end of file diff --git a/core-services/libraries2/services-common/.gitignore b/core-services/libraries2/services-common/.gitignore new file mode 100644 index 00000000000..2af7cefb0a3 --- /dev/null +++ b/core-services/libraries2/services-common/.gitignore @@ -0,0 +1,24 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +nbproject/private/ +build/ +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ \ No newline at end of file diff --git a/core-services/libraries2/services-common/Dockerfile b/core-services/libraries2/services-common/Dockerfile new file mode 100644 index 00000000000..cd50dd4120d --- /dev/null +++ b/core-services/libraries2/services-common/Dockerfile @@ -0,0 +1,17 @@ +FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build +ARG WORK_DIR +ARG nexusUsername +ARG nexusPassword +WORKDIR /app +# copy the project files +COPY ${WORK_DIR}/pom.xml ./pom.xml +COPY ${WORK_DIR}/settings.xml ./settings.xml +# COPY build/maven/settings.xml ./settings.xml +# COPY build/maven/start.sh ./start.sh +COPY ${WORK_DIR}/src ./src +# not useful for stateless builds +# RUN mvn -B dependency:go-offline +RUN cd ${WORK_DIR} \ + && mvn -B -f /app/pom.xml test verify deploy -s settings.xml \ + -Dnexus.user=${nexusUsername} -Dnexus.password=${nexusPassword} +FROM scratch \ No newline at end of file diff --git a/core-services/libraries2/services-common/pom.xml b/core-services/libraries2/services-common/pom.xml new file mode 100644 index 00000000000..c121b18d8a7 --- /dev/null +++ b/core-services/libraries2/services-common/pom.xml @@ -0,0 +1,123 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 1.5.22.RELEASE + + + org.egov.services + services-common + 1.1.1-SNAPSHOT + services-common + Shared classes among services + + + repo.digit.org + eGov DIGIT Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + + repo.digit.org + eGov ERP Snapshots Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + + 2.17.1 + UTF-8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-starter-web + + + org.projectlombok + lombok + 1.18.24 + true + + + org.powermock + powermock-api-mockito + 1.6.5 + test + + + org.powermock + powermock-module-junit4 + 1.6.5 + test + + + com.fasterxml.jackson.core + jackson-annotations + 2.8.7 + + + jakarta.validation + jakarta.validation-api + 2.0.2 + compile + + + + + repo.egovernments.org + eGov DIGIT Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + snapshots.repo.egovernments.org + eGov ERP Snapshots Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/ + + + + + + maven-pmd-plugin + 3.7 + + + verify + + check + + + + + false + false + + + + maven-deploy-plugin + 2.8.2 + + + default-deploy + deploy + + deploy + + + + + + maven-compiler-plugin + + 8 + 8 + + + + + diff --git a/core-services/libraries2/services-common/settings.xml b/core-services/libraries2/services-common/settings.xml new file mode 100644 index 00000000000..89280a1cee7 --- /dev/null +++ b/core-services/libraries2/services-common/settings.xml @@ -0,0 +1,24 @@ + + + + + + nexus + central + https://nexus-repo.egovernments.org/nexus/content/groups/public/ + + + + + repo.digit.org + ${nexus.user} + ${nexus.password} + + + + com.versioneye + + diff --git a/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/PlainAccessRequest.java b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/PlainAccessRequest.java new file mode 100644 index 00000000000..06d33720163 --- /dev/null +++ b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/PlainAccessRequest.java @@ -0,0 +1,17 @@ +package org.egov.common.contract.request; + +import lombok.*; + +import java.util.List; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +@EqualsAndHashCode +public class PlainAccessRequest { + private String recordId; + + private List plainRequestFields; +} diff --git a/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/RequestInfo.java b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/RequestInfo.java new file mode 100644 index 00000000000..1ad4c2dde99 --- /dev/null +++ b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/RequestInfo.java @@ -0,0 +1,36 @@ +package org.egov.common.contract.request; + +import lombok.*; + + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +@EqualsAndHashCode +public class RequestInfo { + + private String apiId; + + private String ver; + + private Long ts; + + private String action; + + private String did; + + private String key; + + private String msgId; + + private String authToken; + + private String correlationId; + + private PlainAccessRequest plainAccessRequest; + + private User userInfo; +} \ No newline at end of file diff --git a/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/Role.java b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/Role.java new file mode 100644 index 00000000000..adc1b9f4b55 --- /dev/null +++ b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/Role.java @@ -0,0 +1,24 @@ +package org.egov.common.contract.request; + +import lombok.*; + +import javax.validation.constraints.Size; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +@EqualsAndHashCode +public class Role { + private Long id; + + @Size(max = 128) + private String name; + + @Size(max = 50) + private String code; + + @Size(max = 256) + private String tenantId; +} diff --git a/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/User.java b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/User.java new file mode 100644 index 00000000000..57f623d86e8 --- /dev/null +++ b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/request/User.java @@ -0,0 +1,41 @@ +package org.egov.common.contract.request; + +import lombok.*; + +import javax.validation.constraints.Size; +import java.util.List; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +@ToString +@EqualsAndHashCode +public class User { + private Long id; + + @Size(max = 180) + private String userName; + + @Size(max = 250) + private String name; + + @Size(max = 50) + private String type; + + @Size(max = 150) + private String mobileNumber; + + @Size(max = 300) + private String emailId; + + private List roles; + + @Size(max = 256) + private String tenantId; + + @Size(max = 36) + private String uuid; +} + diff --git a/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/Error.java b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/Error.java new file mode 100644 index 00000000000..77125360487 --- /dev/null +++ b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/Error.java @@ -0,0 +1,18 @@ +package org.egov.common.contract.response; + +import lombok.*; + +import java.util.List; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +@EqualsAndHashCode +public class Error { + private int code; + private String message; + private String description; + private List fields; +} diff --git a/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/ErrorField.java b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/ErrorField.java new file mode 100644 index 00000000000..32f2aef1418 --- /dev/null +++ b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/ErrorField.java @@ -0,0 +1,19 @@ +package org.egov.common.contract.response; + +import lombok.*; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +@EqualsAndHashCode +public class ErrorField { + @NonNull + private String code; + @NonNull + private String message; + @NonNull + private String field; +} + diff --git a/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/ErrorResponse.java b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/ErrorResponse.java new file mode 100644 index 00000000000..dbc11e1d53d --- /dev/null +++ b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/ErrorResponse.java @@ -0,0 +1,15 @@ +package org.egov.common.contract.response; + +import lombok.*; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +@EqualsAndHashCode +public class ErrorResponse { + private ResponseInfo responseInfo; + private Error error; +} + diff --git a/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/ResponseInfo.java b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/ResponseInfo.java new file mode 100644 index 00000000000..5e2a8ed2f66 --- /dev/null +++ b/core-services/libraries2/services-common/src/main/java/org/egov/common/contract/response/ResponseInfo.java @@ -0,0 +1,25 @@ +package org.egov.common.contract.response; + +import lombok.*; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +@ToString +@EqualsAndHashCode +public class ResponseInfo { + + private String apiId; + + private String ver; + + private Long ts; + + private String resMsgId; + + private String msgId; + + private String status; +} \ No newline at end of file diff --git a/core-services/libraries2/services-common/src/main/java/org/egov/common/exception/InvalidTenantIdException.java b/core-services/libraries2/services-common/src/main/java/org/egov/common/exception/InvalidTenantIdException.java new file mode 100644 index 00000000000..73da025d6c8 --- /dev/null +++ b/core-services/libraries2/services-common/src/main/java/org/egov/common/exception/InvalidTenantIdException.java @@ -0,0 +1,15 @@ +package org.egov.common.exception; + +public class InvalidTenantIdException extends Exception { + + + public InvalidTenantIdException(String message){ + super(message); + } + + /** + * + */ + private static final long serialVersionUID = 1L; + +} diff --git a/core-services/libraries2/services-common/src/main/java/org/egov/common/utils/MultiStateInstanceUtil.java b/core-services/libraries2/services-common/src/main/java/org/egov/common/utils/MultiStateInstanceUtil.java new file mode 100644 index 00000000000..9dfa75898cc --- /dev/null +++ b/core-services/libraries2/services-common/src/main/java/org/egov/common/utils/MultiStateInstanceUtil.java @@ -0,0 +1,137 @@ +package org.egov.common.utils; + +import java.util.regex.Pattern; + +import org.egov.common.exception.InvalidTenantIdException; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Configuration +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class MultiStateInstanceUtil { + + // central-instance configs + public static String SCHEMA_REPLACE_STRING = "{schema}"; + /* + * Represents the length of the tenantId array when it's split by "." + * + * if the array length is equal or lesser than, then the tennatId belong to state level + * + * else it's tenant level + */ + @Value("${state.level.tenantid.length:1}") + private Integer stateLevelTenantIdLength; + + /* + * Boolean field informing whether the deployed server is a multi-state/central-instance + * + */ + @Value("${is.environment.central.instance:false}") + private Boolean isEnvironmentCentralInstance; + + /* + * Index in which to find the schema name in a tenantId split by "." + */ + @Value("${state.schema.index.position.tenantid:1}") + private Integer stateSchemaIndexPositionInTenantId; + + /** + * Method to fetch the state name from the tenantId + * + * @param query + * @param tenantId + * @return + */ + public String replaceSchemaPlaceholder(String query, String tenantId) throws InvalidTenantIdException { + + String finalQuery = null; + if (tenantId.contains(".") && getIsEnvironmentCentralInstance()) { + + if (stateSchemaIndexPositionInTenantId >= tenantId.length()) { + throw new InvalidTenantIdException( + "The tenantId length is smaller than the defined schema index in tenantId for central instance"); + } + String schemaName = tenantId.split("\\.")[getStateSchemaIndexPositionInTenantId()]; + finalQuery = query.replaceAll("(?i)" + Pattern.quote(SCHEMA_REPLACE_STRING), schemaName); + } else { + finalQuery = query.replaceAll("(?i)" + Pattern.quote(SCHEMA_REPLACE_STRING.concat(".")), ""); + } + return finalQuery; + } + + /** + * Method to determine if the given tenantId belong to tenant or state level in + * the current environment + * + * @param tenantId + * @return + */ + public Boolean isTenantIdStateLevel(String tenantId) { + + if (getIsEnvironmentCentralInstance()) { + + int tenantLevel = tenantId.split("\\.").length; + return tenantLevel <= stateLevelTenantIdLength; + } else { + /* + * if the instance is not multi-state/central-instance then tenant is always + * two level + * + * if tenantId contains "." then it is tenant level + */ + return !tenantId.contains("."); + } + } + + /** + * For central instance if the tenantId size is lesser than state level + * length the same will be returned without splitting + * + * if the tenant-id is longer than the given stateTenantlength then the length of tenant-id + * till state-level index will be returned + * (for example if statetenantlength is 1 and tenant-id is 'in.statea.tenantx'. the returned tenant-id will be in.statea) + * + * @param tenantId + * @return + */ + public String getStateLevelTenant(String tenantId) { + + String[] tenantArray = tenantId.split("\\."); + String stateTenant = tenantArray[0]; + + if (getIsEnvironmentCentralInstance()) { + if (getStateLevelTenantIdLength() < tenantArray.length) { + for (int i = 1; i < getStateLevelTenantIdLength(); i++) + stateTenant = stateTenant.concat(".").concat(tenantArray[i]); + } else { + stateTenant = tenantId; + } + } + return stateTenant; + } + + /** + * method to prefix the state specific tag to the topic names + * + * @param tenantId + * @param topic + * @return + */ + public String getStateSpecificTopicName(String tenantId, String topic) { + + String updatedTopic = topic; + if (getIsEnvironmentCentralInstance()) { + + String[] tenants = tenantId.split("\\."); + if (tenants.length > 1) + updatedTopic = tenants[stateSchemaIndexPositionInTenantId].concat("-").concat(topic); + } + return updatedTopic; + } +} diff --git a/core-services/libraries2/services-common/src/test/java/org/egov/common/utils/MultiStateInstanceUtilTest.java b/core-services/libraries2/services-common/src/test/java/org/egov/common/utils/MultiStateInstanceUtilTest.java new file mode 100644 index 00000000000..51754289c44 --- /dev/null +++ b/core-services/libraries2/services-common/src/test/java/org/egov/common/utils/MultiStateInstanceUtilTest.java @@ -0,0 +1,46 @@ +package org.egov.common.utils; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; + +@RunWith(MockitoJUnitRunner.class) +public class MultiStateInstanceUtilTest { + + @Test + public void testIfStateLevelTenantIdIsReturnedForCentralDeployment(){ + + MultiStateInstanceUtil centralUtil = new MultiStateInstanceUtil(2, true, 1); + String InputTenantId = "in.statea.tenantx"; + String outputTenant = "in.statea"; + String actualOutputTenantId = centralUtil.getStateLevelTenant(InputTenantId); + + assertEquals(actualOutputTenantId, outputTenant); + } + + @Test + public void testIfSameTenantIdIsReturnedIfStateLengthIslargerThanActualTenantLength(){ + + MultiStateInstanceUtil centralUtil = new MultiStateInstanceUtil(3, true, 1); + String InputTenantId = "in.statea.tenantx"; + String outputTenant = "in.statea.tenantx"; + String actualOutputTenantId = centralUtil.getStateLevelTenant(InputTenantId); + + assertEquals(actualOutputTenantId, outputTenant); + } + + @Test + public void testIfStateLevelTenantIdIsReturnedForIsolatedDeployment(){ + + MultiStateInstanceUtil centralUtil = new MultiStateInstanceUtil(2, false, 1); + String InputTenantId = "in.statea.tenantx"; + String outputTenant = "in"; + + String actualOutputTenantId = centralUtil.getStateLevelTenant(InputTenantId); + + assertEquals(actualOutputTenantId, outputTenant); + } + +} diff --git a/core-services/libraries2/tracer/.gitignore b/core-services/libraries2/tracer/.gitignore new file mode 100644 index 00000000000..2af7cefb0a3 --- /dev/null +++ b/core-services/libraries2/tracer/.gitignore @@ -0,0 +1,24 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +nbproject/private/ +build/ +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ \ No newline at end of file diff --git a/core-services/libraries2/tracer/CHANGELOG.md b/core-services/libraries2/tracer/CHANGELOG.md new file mode 100644 index 00000000000..77823ad3ac9 --- /dev/null +++ b/core-services/libraries2/tracer/CHANGELOG.md @@ -0,0 +1,29 @@ + +## 2.1.3 +- Removed critical vulnerabilities library + +## 2.1.2 +- Added changes for privacy feature. + +## 2.1.1 +- update tenantid only if header tenant value is empty during intercept + +## 2.1.0 +- Tenant-id added to MDC for logging in central instance + +## 2.0.0 +- Upgraded to Spring Boot 2.2.6 RELASE + +> Note: When upgrading to Spring Boot 2.2.6 in your libraries use the below dependency + +```xml + + org.egov.services + tracer + 2.0.0-SNAPSHOT + +``` + +## 1.1.5 + +- Latest version \ No newline at end of file diff --git a/core-services/libraries2/tracer/Dockerfile b/core-services/libraries2/tracer/Dockerfile new file mode 100644 index 00000000000..cd50dd4120d --- /dev/null +++ b/core-services/libraries2/tracer/Dockerfile @@ -0,0 +1,17 @@ +FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build +ARG WORK_DIR +ARG nexusUsername +ARG nexusPassword +WORKDIR /app +# copy the project files +COPY ${WORK_DIR}/pom.xml ./pom.xml +COPY ${WORK_DIR}/settings.xml ./settings.xml +# COPY build/maven/settings.xml ./settings.xml +# COPY build/maven/start.sh ./start.sh +COPY ${WORK_DIR}/src ./src +# not useful for stateless builds +# RUN mvn -B dependency:go-offline +RUN cd ${WORK_DIR} \ + && mvn -B -f /app/pom.xml test verify deploy -s settings.xml \ + -Dnexus.user=${nexusUsername} -Dnexus.password=${nexusPassword} +FROM scratch \ No newline at end of file diff --git a/core-services/libraries2/tracer/pom.xml b/core-services/libraries2/tracer/pom.xml new file mode 100644 index 00000000000..fb55c9f71b8 --- /dev/null +++ b/core-services/libraries2/tracer/pom.xml @@ -0,0 +1,153 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.2.13.RELEASE + + org.egov.services + tracer + 2.1.3-SNAPSHOT + tracer + Assist in tracing http and message queue flows + + + repo.digit.org + eGov ERP Snapshots Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + + 2.17.1 + UTF-8 + 1.8 + UTF-8 + + + + org.springframework + spring-beans + 5.2.20.RELEASE + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.kafka + spring-kafka + + + org.apache.kafka + kafka-clients + + + org.projectlombok + lombok + 1.18.24 + true + + + commons-io + commons-io + 2.5 + + + org.egov.services + services-common + 1.1.1-SNAPSHOT + + + com.jayway.jsonpath + json-path + + + org.aspectj + aspectjweaver + + + org.springframework.boot + spring-boot-starter-actuator + + + io.opentracing.contrib + opentracing-spring-web-starter + 0.3.3 + + + io.opentracing.contrib + opentracing-spring-cloud-jdbc-starter + 0.2.1 + + + io.opentracing.contrib + opentracing-spring-jaeger-starter + 0.2.2 + + + io.jaegertracing + jaeger-client + 0.31.0 + + + net.logstash.logback + logstash-logback-encoder + 5.2 + + + ch.qos.logback + logback-classic + + + org.springframework.boot + spring-boot-starter-test + test + + + com.github.stefanbirkner + system-rules + 1.16.1 + test + + + + + repo.egovernments.org.public + eGov Public Repository Group + https://nexus-repo.egovernments.org/nexus/content/groups/public/ + + + repo.egovernments.org + eGov ERP Releases Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/releases/ + + + repo.egovernments.org.snapshots + eGov ERP Releases Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/ + + + repo.digit.org + eGov DIGIT Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/release/ + + + + + + maven-source-plugin + + + attach-sources + + jar + + + + + + + diff --git a/core-services/libraries2/tracer/readme.md b/core-services/libraries2/tracer/readme.md new file mode 100644 index 00000000000..d03d20bf86e --- /dev/null +++ b/core-services/libraries2/tracer/readme.md @@ -0,0 +1,169 @@ +# Tracer + +### Distributed tracing library + +Correlation id and logging support addons to Spring Web and Spring Kafka. + +#### Features supported + +###### Logging of the below mentioned scenarios - + +- Incoming http request URI, query strings and payload. +- Message payload and topic name when pushing message to Kafka. +- Success & failure response from Kafka when pushing of message fails. +- Message payload and topic name for messages received by Kafka consumer using the KafkaListener annotation. +- Outgoing http request URI and payload along with response code and response body when using RestTemplate. +- Format validator & error queue + +###### Format Validator & Error Queue + +- Format validator & ErrorQ are the part of new version of tracer library +- Include Version 1.1.3 in pom.xml + ####### How to use it: +- Do not keep the "bindingresult" as an argument in the controller + eg. ``` throw new CustomBindingResultExceprion(bindingResult); ``` + +- throw customException which takes 2 arguments ErrorCode & ErrorMsg. + eg. ``` throw new CustomException("usr_001","invalid user role"); ``` +- Throw customException if you want to throw multiple errors at a time by passing an argument Map.Map + key is representing the ErrorCode & value is ErrorMsg. eg. + +``` +Map map = new HashMap<>(); + map.put("asset_001", "Invalid user"); + map.put("asset_002", "invalid name"); + + throw new CustomException(map); +``` + +###### Toggle logging detail - + +The logging of the http request/response body and Kakfa message body can be toggled on/off using +"tracer.detailed.tracing.enabled" application property. + +###### Correlation id retrieval and forwarding - + +The library takes care of retrieving the correlation id from - + +- Incoming http request body or header +- Kafka message payload + +For an outgoing http request the correlation id is sent as a custom request header "x-correlation-id". + +###### Setting the correlation id in the MDC - + +Given the library takes care of placing the correlation id into the MDC, any custom logging done in the +application would seamlessly include the correlation id in the log message. + +Note - See the "logging.pattern" mentioned in the "Tracer integration" section. + +#### Steps to integrate Tracer to your Spring application - + +- In the pom.xml add the below repository section + + ``` + + + repo.egovernments.org + eGov ERP Releases Repository + http://repo.egovernments.org/nexus/content/repositories/releases/ + + + ``` + +- In the pom.xml add the below dependency and replace version accordingly. + + ``` + + org.egov.services + tracer + X.Y.Z + + ``` + +- Add the below entry to application.properties + + ``` + logging.pattern.console=%clr(%X{CORRELATION_ID:-}) %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} + ``` + +- In the main Spring application class file add the below annotation to the class. + + ``` + @Import({TracerConfiguration.class}) +``` + +- To make http requests, in your class component autowire Spring's RestTemplate. +- To push messages to Kafka, in your class component autowire LogAwareKafkaTemplate. +- To receive messages via Kafka consumer annotate your bean method with KafkaListener annotation. Add the + payload annotation to the message payload parameter (any data type is supported) and topic header to the topic String + parameter. + +#### Tracer implementation details - + +- A Spring filter is used to retrieve the correlation id from the incoming http request. +- If the incoming http request is a POST and the content type is compatible with application/json then the library + makes an attempt to retrieve the correlation id from the request body. + The json path searched for the correlation id are RequestInfo.correlationId and requestInfo.correlationId. +- If the correlation id is not present in the request body or the http verb is not POST or the content type is not json + compatible then an attempt is made to retrieve the correlation id from the http request header "x-correlation-id". +- If the correlation id is not present in the request body or header then a new correlation id (UUID v4) is generated. +- For the RestTemplate an interceptor is used for adding the correlation id as a custom header + to the outgoing request, logging the corresponding request and response sent and received. +- A subclass of Spring's RestTemplate is registered as a Spring bean to perform the correlation id forwarding and + logging. +- The LogAwareKafkaTemplate is a wrapper Spring bean class for Spring Kafka's KafkaTemplate that performs the logging + of messages sent to Kafka. +- For a Kafka consumer implemented using Spring Kafka's KafkaListener annotation an AspectJ's aspect is used to log and + retrieve the correlation id from the received payload. +- The correlation id retrieved via the filter or aspect is then stored in a thread local variable to + forward as necessary. + +#### Change log - + +1.1.14 +Handles new exceptions: + +- JSON Parsing Error (When JSON body has errors) +- JSON Mapping Error (When object type is wrong) +- Wrong media Type Error +- Handle tracer's internal exception (if tracer code raises exception) +- Handle resource exception exception when one of the dependent services is down + +Other changes + +- Code optimization +- Fixed bug where body is set to null on JSON parsing error + +1.1.0 + +- Correlation id filter enriches RequestInfo with the newly generated correlation id. + +1.0.2 + +- Fixed JSON content type check in LogAwareRestTemplate + +1.0.1 + +- Only log RestTemplate's request/response body when content type is JSON compatible. + +1.0.0 + +- For Kafka Listener the @Payload annotation is used to identify the payload parameter. +- For Kafka Listener @Header(KafkaHeaders.RECEIVED_TOPIC) is used to identify the topic name. + +0.18.1 + +- Added IST time zone json serializer - org.egov.tracer.kafka.serializer.ISTTimeZoneJsonSerializer +- Added UTC hash map deserializer - org.egov.tracer.kafka.deserializer.HashMapDeserializer +- Added IST time zone hash map deserializer - org.egov.tracer.kafka.deserializer.ISTTimeZoneHashMapDeserializer +- tracer.detailed.tracing.enabled can be set to "true" or "false" to toggle request body logging. Default value is " + true". + +Versions older than 0.18.0 + +- For Kafka Listener the first method parameter that is not of type + String or org.springframework.kafka.support.Acknowledgment is identified as the payload parameter. + + + diff --git a/core-services/libraries2/tracer/settings.xml b/core-services/libraries2/tracer/settings.xml new file mode 100644 index 00000000000..b22e0147ddb --- /dev/null +++ b/core-services/libraries2/tracer/settings.xml @@ -0,0 +1,23 @@ + + + + + nexus + central + https://nexus-repo.egovernments.org/nexus/content/groups/public/ + + + + + repo.digit.org + ${nexus.user} + ${nexus.password} + + + + com.versioneye + + \ No newline at end of file diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/ExceptionAdvise.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/ExceptionAdvise.java new file mode 100644 index 00000000000..b84f959c65a --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/ExceptionAdvise.java @@ -0,0 +1,248 @@ +package org.egov.tracer; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.jayway.jsonpath.DocumentContext; +import com.jayway.jsonpath.JsonPath; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; +import org.egov.tracer.config.TracerProperties; +import org.egov.tracer.http.filters.MultiReadRequestWrapper; +import org.egov.tracer.kafka.ErrorQueueProducer; +import org.egov.tracer.model.Error; +import org.egov.tracer.model.*; +import org.slf4j.MDC; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.HttpMessageNotReadableException; +import org.springframework.validation.BindException; +import org.springframework.validation.BindingResult; +import org.springframework.validation.ObjectError; +import org.springframework.web.HttpMediaTypeNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.client.ResourceAccessException; + +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_MDC; + + +@ControllerAdvice +@Slf4j +@Order(Ordered.LOWEST_PRECEDENCE) +@EnableConfigurationProperties({TracerProperties.class}) +public class ExceptionAdvise { + + @Value("${tracer.errors.provideExceptionInDetails:false}") + private boolean provideExceptionInDetails; + + @Autowired + private ErrorQueueProducer errorQueueProducer; + + @Autowired + private TracerProperties tracerProperties; + + @ExceptionHandler(value = Exception.class) + @ResponseBody + public ResponseEntity exceptionHandler(HttpServletRequest request, Exception ex) { + + String contentType = request.getContentType(); + boolean isJsonContentType = (contentType != null && contentType.toLowerCase().contains("application/json")); + log.error("Exception caught in tracer ", ex); + String body = ""; + + try { + if (request instanceof MultiReadRequestWrapper) { + ServletInputStream stream = request.getInputStream(); + body = IOUtils.toString(stream, "UTF-8"); + } else + body = "Unable to retrieve request body"; + + } catch (IOException ignored) { + body = "Unable to retrieve request body"; + } + + ErrorRes errorRes = new ErrorRes(); + List errors = new ArrayList<>(); + + try { + if (ex instanceof HttpMediaTypeNotSupportedException) { + errorRes.setErrors(new ArrayList<>(Collections.singletonList(new Error("UnsupportedMediaType", "An " + + "unsupported media Type was used - " + request.getContentType(), null, null)))); + } else if (ex instanceof ResourceAccessException) { + Error err = new Error(); + err.setCode("ResourceAccessError"); + err.setMessage("An error occurred while accessing a underlying resource"); + errors.add(err); + errorRes.setErrors(errors); + } else if (ex instanceof HttpMessageNotReadableException) { + Error err = new Error(); + String message = ex.getMessage(); + + if (ex.getCause() instanceof JsonMappingException) { + + Pattern pattern = Pattern.compile("(.+)Can not deserialize instance of ([a-z]+\\.){1,}(?[^ ]+).*\\[\"(?[^\"]+)\"\\].*", + Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Matcher match = pattern.matcher(message); + boolean matched = match.find(); + if (matched) { + err.setMessage("Failed to parse field - " + match.group("objectname") + ". Expected type is " + match.group("objecttype")); + } else { + err.setMessage("Failed to deserialize certain JSON fields"); + } + + err.setCode("JsonMappingException"); + + } else if (ex.getCause() instanceof JsonParseException) { + err.setCode("JsonParseException"); + message = ex.getCause().getMessage().replaceAll("Source: [^;]+; ", "").replaceAll(" \\(code \\d+\\)", "").replaceAll("\\n", ""); + err.setMessage(message); + } else { + try { + err.setMessage("JSON body has errors or is missing"); + JsonPath.parse(request).json(); + } catch (Exception jsonParseException) { + log.error("Error while parsing JSON", jsonParseException); + } + err.setCode("MissingJsonException"); + } + errors.add(err); + errorRes.setErrors(errors); + } else if (ex instanceof MethodArgumentNotValidException) { + MethodArgumentNotValidException argumentNotValidException = (MethodArgumentNotValidException) ex; + errorRes.setErrors(getBindingErrors(argumentNotValidException.getBindingResult(), errors)); + + } else if (ex instanceof CustomBindingResultExceprion) { + CustomBindingResultExceprion customBindingResultExceprion = (CustomBindingResultExceprion) ex; + errorRes.setErrors(getBindingErrors(customBindingResultExceprion.getBindingResult(), errors)); + } else if (ex instanceof CustomException) { + CustomException customException = (CustomException) ex; + populateCustomErrors(customException, errors); + errorRes.setErrors(errors); + } else if (ex instanceof ServiceCallException) { + ServiceCallException serviceCallException = (ServiceCallException) ex; + sendErrorMessage(body, ex, request.getRequestURL().toString(), errorRes, isJsonContentType); + DocumentContext documentContext = JsonPath.parse(serviceCallException.getError()); + LinkedHashMap linkedHashMap = documentContext.json(); + return new ResponseEntity<>(linkedHashMap, HttpStatus.BAD_REQUEST); + + } else if (ex instanceof MissingServletRequestParameterException) { + MissingServletRequestParameterException exception = (MissingServletRequestParameterException) ex; + Error error = new Error(); + error.setCode(""); + error.setMessage(exception.getMessage()); + //error.setDescription(exception.getCause().toString()); + List params = new ArrayList<>(); + params.add(exception.getParameterName()); + error.setParams(params); + errors.add(error); + errorRes.setErrors(errors); + } else if (ex instanceof BindException) { + BindException bindException = (BindException) ex; + + errorRes.setErrors(getBindingErrors(bindException.getBindingResult(), errors)); + + //errorRes.setErrors(errors); + } + + String exceptionName = ex.getClass().getSimpleName(); + String exceptionMessage = ex.getMessage(); + + if (errorRes.getErrors() == null || errorRes.getErrors().size() == 0) { + errorRes.setErrors(new ArrayList<>(Collections.singletonList(new Error(exceptionName, "An unhandled exception occurred on the server", exceptionMessage, null)))); + } else if (provideExceptionInDetails && errorRes.getErrors() != null && errorRes.getErrors().size() > 0) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + errorRes.getErrors().get(0).setDescription(sw.toString()); + } + + sendErrorMessage(body, ex, request.getRequestURL().toString(), errorRes, isJsonContentType); + } catch (Exception tracerException) { + log.error("Error in tracer", tracerException); + errorRes.setErrors(new ArrayList<>(Collections.singletonList(new Error("TracerException", "An unhandled exception occurred in tracer handler", null, null)))); + } + return new ResponseEntity<>(errorRes, HttpStatus.BAD_REQUEST); + } + + private List getBindingErrors(BindingResult bindingResult, List errors) { + + List objectErrors = bindingResult.getAllErrors(); + + for (ObjectError objectError : objectErrors) { + Error error = new Error(); + String[] codes = objectError.getCodes(); + error.setCode(codes[0]); + error.setMessage(objectError.getDefaultMessage()); + errors.add(error); + } + + return errors; + } + + private void populateCustomErrors(CustomException customException, List errors) { + Map map = customException.getErrors(); + if (map != null && !map.isEmpty()) { + for (Map.Entry entry : map.entrySet()) { + Error error = new Error(); + error.setCode(entry.getKey()); + error.setMessage(entry.getValue()); + errors.add(error); + } + } else { + Error error = new Error(); + error.setCode(customException.getCode()); + error.setMessage(customException.getMessage()); + errors.add(error); + } + + } + + void sendErrorMessage(String body, Exception ex, String source, ErrorRes errorRes, boolean isJsonContentType) { + DocumentContext documentContext; + + if (tracerProperties.isErrorsPublish()) { + Object requestBody = body; + if (isJsonContentType) { + try { + documentContext = JsonPath.parse(body); + requestBody = documentContext.json(); + } catch (Exception exception) { + requestBody = body; + } + } + + StackTraceElement elements[] = ex.getStackTrace(); + + ErrorQueueContract errorQueueContract = ErrorQueueContract.builder() + .id(UUID.randomUUID().toString()) + .correlationId(MDC.get(CORRELATION_ID_MDC)) + .body(requestBody) + .source(source) + .ts(new Date().getTime()) + .errorRes(errorRes) + .exception(Arrays.asList(elements)) + .message(ex.getMessage()) + .build(); + + errorQueueProducer.sendMessage(errorQueueContract); + } + + } + +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/KafkaConsumerErrorHandler.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/KafkaConsumerErrorHandler.java new file mode 100644 index 00000000000..431231266aa --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/KafkaConsumerErrorHandler.java @@ -0,0 +1,36 @@ +package org.egov.tracer; + +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.apache.kafka.clients.consumer.ConsumerRecord; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.kafka.listener.LoggingErrorHandler; +import org.springframework.stereotype.Component; +import org.springframework.util.ObjectUtils; + +@Component +@Slf4j +public class KafkaConsumerErrorHandler extends LoggingErrorHandler { + + @Autowired + private ExceptionAdvise exceptionAdvise; + + @Value("${tracer.errorsPublish}") + private boolean sendErrorsToKafka; + + @Override + public void handle(Exception thrownException, ConsumerRecord record) { + if (sendErrorsToKafka) { + log.error("Error while processing1: " + ObjectUtils.nullSafeToString(record), thrownException); + ObjectMapper objectMapper = new ObjectMapper(); + String body = null; + try { + body = objectMapper.writeValueAsString(record.value()); + } catch (Exception ex) { + log.error("KafkaConsumerErrorHandller Kafka consumer can not parse json data " + ex.getMessage()); + } + exceptionAdvise.sendErrorMessage(body, thrownException, record.topic(), null, false); + } + } +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/ObjectMapperFactory.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/ObjectMapperFactory.java new file mode 100644 index 00000000000..cefddc59b95 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/ObjectMapperFactory.java @@ -0,0 +1,25 @@ +package org.egov.tracer.config; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.core.env.Environment; + +import java.util.TimeZone; + +import static org.egov.tracer.constants.TracerConstants.TIME_ZONE_PROPERTY; + +public class ObjectMapperFactory { + + private TracerProperties tracerProperties; + + private ObjectMapper objectMapper; + + public ObjectMapperFactory(TracerProperties tracerProperties, Environment environment) { + this.tracerProperties = tracerProperties; + this.objectMapper = new ObjectMapper(); + objectMapper.setTimeZone(TimeZone.getTimeZone(environment.getProperty(TIME_ZONE_PROPERTY, "UTC"))); + } + + public ObjectMapper getObjectMapper() { + return objectMapper; + } +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/OpenTracingConfiguration.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/OpenTracingConfiguration.java new file mode 100644 index 00000000000..9194b1faabb --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/OpenTracingConfiguration.java @@ -0,0 +1,81 @@ +package org.egov.tracer.config; + +import io.opentracing.Span; +import io.opentracing.contrib.spring.tracer.configuration.TracerAutoConfiguration; +import io.opentracing.contrib.web.servlet.filter.ServletFilterSpanDecorator; +import org.slf4j.MDC; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.List; + +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_MDC; +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_OPENTRACING_FORMAT; + +@Configuration +@ConditionalOnWebApplication +@AutoConfigureAfter({TracerAutoConfiguration.class}) +@ConditionalOnClass({WebMvcConfigurerAdapter.class}) +@ConditionalOnProperty( + name = {"tracer.opentracing.enabled"}, + havingValue = "true", + matchIfMissing = false +) +public class OpenTracingConfiguration { + + /** + * Jaeger Tracer instance configured via environment variables + * + * @return Tracer implementation + */ + @Bean + public io.opentracing.Tracer jaegerTracer() { + return io.jaegertracing.Configuration.fromEnv() + .getTracer(); + } + + /** + * Use span decorator to add a correlation id span tag + *

+ * Filter order configured to run after Tracer Filter + * + * @return span decorators + */ + @Bean + public List spanDecorator() { + List decorators = new ArrayList<>(); + decorators.add(ServletFilterSpanDecorator.STANDARD_TAGS); + decorators.add(new ServletFilterSpanDecorator() { + @Override + public void onRequest(HttpServletRequest httpServletRequest, Span span) { + span.setTag(CORRELATION_ID_OPENTRACING_FORMAT, MDC.get(CORRELATION_ID_MDC)); + } + + @Override + public void onResponse(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Span span) { + + } + + @Override + public void onError(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Throwable throwable, Span span) { + + } + + @Override + public void onTimeout(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, long l, Span span) { + + } + }); + + return decorators; + } + +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/TracerConfiguration.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/TracerConfiguration.java new file mode 100644 index 00000000000..28266bd8079 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/TracerConfiguration.java @@ -0,0 +1,78 @@ +package org.egov.tracer.config; + +import io.opentracing.noop.NoopTracerFactory; +import org.egov.tracer.http.RestTemplateLoggingInterceptor; +import org.egov.tracer.http.filters.TracerFilter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.*; +import org.springframework.core.env.Environment; +import org.springframework.http.client.BufferingClientHttpRequestFactory; +import org.springframework.http.client.SimpleClientHttpRequestFactory; +import org.springframework.web.client.RestTemplate; + +import java.util.Collections; + +@Configuration +@EnableAspectJAutoProxy +@ComponentScan(basePackages = {"org.egov.tracer"}) +@PropertySource("classpath:tracer.properties") +@EnableConfigurationProperties({TracerProperties.class}) +@Import(OpenTracingConfiguration.class) +public class TracerConfiguration { + + @Bean + public ObjectMapperFactory objectMapperFactory(TracerProperties tracerProperties, Environment environment) { + return new ObjectMapperFactory(tracerProperties, environment); + } + + @Bean(name = "logAwareRestTemplate") + public RestTemplate logAwareRestTemplate(TracerProperties tracerProperties) { + SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); + requestFactory.setOutputStreaming(false); + RestTemplate restTemplate = + new RestTemplate(new BufferingClientHttpRequestFactory(requestFactory)); + restTemplate.setInterceptors(Collections.singletonList(new RestTemplateLoggingInterceptor(tracerProperties))); + return restTemplate; + } + + /** + * Configure tracer filter with order one + * + * @param objectMapperFactory Object mapper + * @param tracerProperties configuration for the filter + * @return Filter + */ + @Bean + @ConditionalOnProperty(name = "tracer.filter.enabled", + havingValue = "true", matchIfMissing = true) + public FilterRegistrationBean tracerFilter(ObjectMapperFactory objectMapperFactory, + TracerProperties tracerProperties) { + final TracerFilter tracerFilter = new TracerFilter(tracerProperties, objectMapperFactory); + FilterRegistrationBean registration = new FilterRegistrationBean(tracerFilter); + registration.addUrlPatterns("/*"); + registration.setName("TracerFilter"); + registration.setOrder(1); + return registration; + } + + /** + * Disable open tracing by injecting a Noop + * + * @return Noop tracer + */ + @Bean + @ConditionalOnProperty( + name = {"tracer.opentracing.enabled"}, + havingValue = "false", + matchIfMissing = true + ) + public io.opentracing.Tracer tracer() { + return NoopTracerFactory.create(); + } + + +} + + diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/TracerProperties.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/TracerProperties.java new file mode 100644 index 00000000000..3d8cb4b5ff9 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/config/TracerProperties.java @@ -0,0 +1,31 @@ +package org.egov.tracer.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Data +@ConfigurationProperties("tracer") +@Configuration +public class TracerProperties { + + // Enable request body and query parameters logging + private boolean requestLoggingEnabled; + + // Enable kafka message body logging on send + private boolean kafkaMessageLoggingEnabled; + + // Enable request and response body logging on all rest template calls + private boolean restTemplateDetailedLoggingEnabled; + + // Enable errors publishing on a kafka topic + private boolean errorsPublish; + + // Topic to which errors need to be published + private String errorsTopic; + + // Exclusion list for tracer filter + private String filterSkipPattern; + +} + diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/constants/TracerConstants.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/constants/TracerConstants.java new file mode 100644 index 00000000000..7d312fabb19 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/constants/TracerConstants.java @@ -0,0 +1,17 @@ +package org.egov.tracer.constants; + +public class TracerConstants { + + public static final String CORRELATION_ID_HEADER = "x-correlation-id"; + public static final String TENANT_ID_HEADER = "tenantId"; + public static final String CORRELATION_ID_FIELD_NAME= "correlationId"; + public static final String CORRELATION_ID_MDC = "CORRELATION_ID"; + public static final String TENANTID_MDC = "TENANTID"; + public static final String CORRELATION_ID_OPENTRACING_FORMAT = "correlation.id"; + public static final String TIME_ZONE_PROPERTY = "app.timezone"; + public static final String REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE = "RequestInfo"; + public static final String REQUEST_INFO_IN_CAMEL_CASE = "requestInfo"; + + private TracerConstants() { + } +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/HttpUtils.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/HttpUtils.java new file mode 100644 index 00000000000..88baafbc300 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/HttpUtils.java @@ -0,0 +1,18 @@ +package org.egov.tracer.http; + +import org.springframework.http.HttpHeaders; + +public class HttpUtils { + + private static final String PASS_THROUGH_GATEWAY_HEADER_NAME = "x-pass-through-gateway"; + + private HttpUtils() { + } + + public static boolean isInterServiceCall(HttpHeaders headers) { + String x_pass_through_gatewayStr = headers.getFirst(PASS_THROUGH_GATEWAY_HEADER_NAME); + + return x_pass_through_gatewayStr == null || !x_pass_through_gatewayStr.equalsIgnoreCase("true"); + } + +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/RestTemplateLoggingInterceptor.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/RestTemplateLoggingInterceptor.java new file mode 100644 index 00000000000..b32a85cf28a --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/RestTemplateLoggingInterceptor.java @@ -0,0 +1,123 @@ +package org.egov.tracer.http; + +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_HEADER; +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_MDC; +import static org.egov.tracer.constants.TracerConstants.TENANTID_MDC; +import static org.egov.tracer.constants.TracerConstants.TENANT_ID_HEADER; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.io.IOUtils; +import org.egov.tracer.config.TracerProperties; +import org.slf4j.MDC; +import org.springframework.http.HttpMessage; +import org.springframework.http.HttpRequest; +import org.springframework.http.MediaType; +import org.springframework.http.client.ClientHttpRequestExecution; +import org.springframework.http.client.ClientHttpRequestInterceptor; +import org.springframework.http.client.ClientHttpResponse; +import org.springframework.util.CollectionUtils; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class RestTemplateLoggingInterceptor implements ClientHttpRequestInterceptor { + + private static final String REQUEST_MESSAGE_WITH_BODY = "Sending request to {} with verb {} with body {}"; + private static final String REQUEST_MESSAGE = "Sending request to {} with verb {}"; + private static final String RESPONSE_MESSAGE_WITH_BODY = "Received from {} response code {} and body {}: "; + private static final String RESPONSE_MESSAGE = "Received response from {}"; + private static final String FAILED_RESPONSE_MESSAGE = "Received error response from %s"; + private static final String UTF_8 = "UTF-8"; + private static final String RESPONSE_BODY_ERROR_MESSAGE = "Error reading response body"; + private static final String EMPTY_BODY = ""; + private static final List JSON_MEDIA_TYPES = + Arrays.asList(MediaType.APPLICATION_JSON_UTF8_VALUE, MediaType.APPLICATION_JSON_VALUE); + + private TracerProperties tracerProperties; + + public RestTemplateLoggingInterceptor(TracerProperties tracerProperties) { + this.tracerProperties = tracerProperties; + } + + /** + * Intercept all rest template calls + * - Add correlation id header from MDC + * - Log request and responses based on config + * + * @param request being made + * @param body of the request + * @param execution execute the rest template call + * @return response of the rest call + * @throws IOException + */ + @Override + public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { + try { + request.getHeaders().add(CORRELATION_ID_HEADER, MDC.get(CORRELATION_ID_MDC)); + + List tenantId = request.getHeaders().get(TENANT_ID_HEADER); + if (CollectionUtils.isEmpty(tenantId)) + request.getHeaders().add(TENANT_ID_HEADER, MDC.get(TENANTID_MDC)); + + logRequest(request, body); + + final ClientHttpResponse rawResponse = execution.execute(request, body); + + if (tracerProperties.isRestTemplateDetailedLoggingEnabled() && isBodyCompatibleForParsing(request)) { + logResponse(rawResponse, request); + } else { + log.info(RESPONSE_MESSAGE, request.getURI()); + } + return rawResponse; + } catch (Exception e) { + log.warn(String.format(FAILED_RESPONSE_MESSAGE, request.getURI()), e); + throw e; + } + } + + private void logResponse(ClientHttpResponse response, HttpRequest httpRequest) throws IOException { + + if (tracerProperties.isRestTemplateDetailedLoggingEnabled() && isBodyCompatibleForParsing(httpRequest)) { + String body = getBodyString(response); + log.info(RESPONSE_MESSAGE_WITH_BODY, httpRequest.getURI(), response.getStatusCode(), body); + } else { + log.info(RESPONSE_MESSAGE, httpRequest.getURI()); + } + + } + + private void logRequest(HttpRequest httpRequest, byte[] body) { + if (tracerProperties.isRestTemplateDetailedLoggingEnabled() && isBodyCompatibleForParsing(httpRequest)) { + log.info(REQUEST_MESSAGE_WITH_BODY, httpRequest.getURI(), httpRequest.getMethod().name(), getBody(body)); + } else { + log.info(REQUEST_MESSAGE, httpRequest.getURI(), httpRequest.getMethod().name()); + } + } + + + private String getBody(byte[] body) { + return body == null ? EMPTY_BODY : new String(body); + } + + private boolean isBodyCompatibleForParsing(HttpMessage httpMessage) { + final MediaType contentType = httpMessage.getHeaders().getContentType(); + return contentType != null && JSON_MEDIA_TYPES.contains(contentType.toString()); + } + + private String getBodyString(ClientHttpResponse response) { + try { + if (response != null && response.getBody() != null) { + return IOUtils.toString(response.getBody(), UTF_8); + } else { + return EMPTY_BODY; + } + } catch (IOException e) { + log.error(RESPONSE_BODY_ERROR_MESSAGE, e); + return EMPTY_BODY; + } + } + +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/filters/MultiReadRequestWrapper.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/filters/MultiReadRequestWrapper.java new file mode 100644 index 00000000000..a476f2f7515 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/filters/MultiReadRequestWrapper.java @@ -0,0 +1,81 @@ +package org.egov.tracer.http.filters; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; + +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import java.io.*; + +@Slf4j +public class MultiReadRequestWrapper extends HttpServletRequestWrapper { + + private ByteArrayOutputStream cachedBytes; + + MultiReadRequestWrapper(HttpServletRequest request) { + super(request); + } + + @Override + public ServletInputStream getInputStream() throws IOException { + if (cachedBytes == null) + cacheInputStream(); + + return new CachedServletInputStream(); + } + + public void update(ByteArrayOutputStream newBytes) { + this.cachedBytes = newBytes; + } + +// @Override +// public int getContentLength() { +// return this.cachedBytes.size(); +// } +// +// @Override +// public long getContentLengthLong() { +// return this.cachedBytes.size(); +// } + + @Override + public BufferedReader getReader() throws IOException { + return new BufferedReader(new InputStreamReader(getInputStream())); + } + + private void cacheInputStream() throws IOException { + cachedBytes = new ByteArrayOutputStream(); + IOUtils.copy(super.getInputStream(), cachedBytes); + } + + public class CachedServletInputStream extends ServletInputStream { + private ByteArrayInputStream input; + + CachedServletInputStream() { + input = new ByteArrayInputStream(cachedBytes.toByteArray()); + } + + @Override + public boolean isFinished() { + return input.available() != 0; + } + + @Override + public boolean isReady() { + return true; + } + + @Override + public void setReadListener(ReadListener readListener) { + + } + + @Override + public int read() throws IOException { + return input.read(); + } + } +} + diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/filters/TracerFilter.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/filters/TracerFilter.java new file mode 100644 index 00000000000..b3052dc0d4c --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/http/filters/TracerFilter.java @@ -0,0 +1,219 @@ +package org.egov.tracer.http.filters; + +import static java.util.Objects.isNull; +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_FIELD_NAME; +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_HEADER; +import static org.egov.tracer.constants.TracerConstants.CORRELATION_ID_MDC; +import static org.egov.tracer.constants.TracerConstants.REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE; +import static org.egov.tracer.constants.TracerConstants.REQUEST_INFO_IN_CAMEL_CASE; +import static org.egov.tracer.constants.TracerConstants.TENANTID_MDC; +import static org.egov.tracer.constants.TracerConstants.TENANT_ID_HEADER; +import static org.springframework.util.StringUtils.isEmpty; + +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.regex.Pattern; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.IOUtils; +import org.egov.tracer.config.ObjectMapperFactory; +import org.egov.tracer.config.TracerProperties; +import org.slf4j.MDC; +import org.springframework.http.MediaType; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class TracerFilter implements Filter { + + private static final List JSON_MEDIA_TYPES = + Arrays.asList(MediaType.APPLICATION_JSON_UTF8_VALUE, MediaType.APPLICATION_JSON_VALUE); + private static final String POST = "POST"; + private static final String REQUEST_BODY_LOG_MESSAGE = "Request body - {}"; + private static final String FAILED_TO_LOG_REQUEST_MESSAGE = "Failed to log request body"; + private static final String UTF_8 = "UTF-8"; + private static final String REQUEST_URI_LOG_MESSAGE = "Received request URI: {} "; + private static final String REQUEST_PARAMS_LOG_MESSAGE = "Request Query params: {} "; + private static final String LOG_RESPONSE_CODE_MESSAGE = "Response code sent: {}"; + + private final ObjectMapper objectMapper; + private TracerProperties tracerProperties; + private Pattern skipPattern; + + public TracerFilter(TracerProperties tracerProperties, ObjectMapperFactory objectMapperFactory) { + this.tracerProperties = tracerProperties; + this.objectMapper = objectMapperFactory.getObjectMapper(); + this.skipPattern = isNull(tracerProperties.getFilterSkipPattern()) ? null : + Pattern.compile(tracerProperties.getFilterSkipPattern()); + } + + @Override + public void init(FilterConfig filterConfig) { + + } + + /** + * + * Cache the request for future body reads in case the body is compatible [json] + * Retrieves correlation id + * - From header + * - if not exists, attempt to retrieve from body RequestInfo + * - if not exists, generate a uuid + * + * Set correlation id in MDC for future use, like logging etc + * Log Request and Response depending on configuration + * + * @param servletRequest HTTP request + * @param servletResponse HTTP response + * @param filterChain pass control to the chain + * @throws IOException + * @throws ServletException + */ + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) + throws IOException, ServletException { + HttpServletRequest httpRequest = (HttpServletRequest) servletRequest; + + if (!this.isTraced(httpRequest)) { + filterChain.doFilter(httpRequest, servletResponse); + } else { + + if (isBodyCompatibleForParsing(httpRequest)) { + final MultiReadRequestWrapper wrappedRequest = new MultiReadRequestWrapper(httpRequest); + + Map headerParamMap = getCorrelationId(wrappedRequest); + MDC.put(CORRELATION_ID_MDC, headerParamMap.get(CORRELATION_ID_MDC)); + MDC.put(TENANTID_MDC, headerParamMap.get(TENANTID_MDC)); + + logRequestURI(httpRequest); + + if (tracerProperties.isRequestLoggingEnabled()) { + logRequestBodyAndParams(wrappedRequest); + } + + filterChain.doFilter(wrappedRequest, servletResponse); + + } else { + + Map headerParamMap = getCorrelationId(httpRequest); + MDC.put(CORRELATION_ID_MDC, headerParamMap.get(CORRELATION_ID_MDC)); + MDC.put(TENANTID_MDC, headerParamMap.get(TENANTID_MDC)); + logRequestURI(httpRequest); + filterChain.doFilter(httpRequest, servletResponse); + } + + logResponse(servletResponse); + } + } + + @Override + public void destroy() { + MDC.clear(); + } + + private boolean isTraced(HttpServletRequest httpServletRequest) { + if (this.skipPattern != null) { + String url = httpServletRequest.getRequestURI().substring(httpServletRequest.getContextPath().length()); + return !this.skipPattern.matcher(url).matches(); + } else { + return true; + } + } + + private void logResponse(ServletResponse servletResponse) { + HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; + log.info(LOG_RESPONSE_CODE_MESSAGE, httpServletResponse.getStatus()); + } + + private void logRequestURI(HttpServletRequest httpRequest) { + String url = httpRequest.getRequestURL().toString(); + log.info(REQUEST_URI_LOG_MESSAGE, url); + } + + + private Map getCorrelationId(HttpServletRequest httpRequest) { + return getParamMapFromHeader(httpRequest); + + } + + private boolean isBodyCompatibleForParsing(HttpServletRequest httpRequest) { + return POST.equals(httpRequest.getMethod()) + && JSON_MEDIA_TYPES.contains(httpRequest.getContentType()); + } + + + private void logRequestBodyAndParams(HttpServletRequest requestWrapper) { + try { + final String requestBody = IOUtils.toString(requestWrapper.getInputStream(), UTF_8); + String requestParams = requestWrapper.getQueryString(); + + if (!isEmpty(requestParams)) + log.info(REQUEST_PARAMS_LOG_MESSAGE, requestParams); + + if (!isEmpty(requestBody)) + log.info(REQUEST_BODY_LOG_MESSAGE, requestBody); + + } catch (IOException e) { + log.error(FAILED_TO_LOG_REQUEST_MESSAGE, e); + } + } + + + private Map getParamMapFromHeader(HttpServletRequest httpRequest) { + + Map keyMap = new HashMap<>(); + String correlationId = httpRequest.getHeader(CORRELATION_ID_HEADER); + + if (isNull(correlationId) && httpRequest instanceof MultiReadRequestWrapper) { + correlationId = getCorrelationIdFromBody(httpRequest); + } + + if (isNull(correlationId)) + correlationId = getRandomCorrelationId(); + + keyMap.put(CORRELATION_ID_MDC, correlationId); + keyMap.put(TENANTID_MDC, httpRequest.getHeader(TENANT_ID_HEADER)); + return keyMap; + } + + @SuppressWarnings("unchecked") + private String getCorrelationIdFromBody(HttpServletRequest httpServletRequest) { + String correlationId = null; + try { + final HashMap requestMap = (HashMap) + objectMapper.readValue(httpServletRequest.getInputStream(), HashMap.class); + Object requestInfo = requestMap.containsKey(REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE) ? requestMap.get + (REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE) : requestMap.get(REQUEST_INFO_IN_CAMEL_CASE); + + if (isNull(requestInfo)) + return null; + else { + if (requestInfo instanceof Map) { + correlationId = (String) ((Map) requestInfo).get(CORRELATION_ID_FIELD_NAME); + } + } + } catch (IOException ignored){} + + return correlationId; + } + + private String getRandomCorrelationId() { + return UUID.randomUUID().toString(); + } + + +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/CustomKafkaTemplate.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/CustomKafkaTemplate.java new file mode 100644 index 00000000000..c2e5592c0a6 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/CustomKafkaTemplate.java @@ -0,0 +1,55 @@ +package org.egov.tracer.kafka; + +import lombok.extern.slf4j.Slf4j; +import org.egov.tracer.model.CustomException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.kafka.core.KafkaTemplate; +import org.springframework.kafka.support.SendResult; +import org.springframework.stereotype.Component; + + +@Component("customKafkaTemplate") +@Slf4j +public class CustomKafkaTemplate { + + private static final String KAFKA_SEND_ERROR_CODE = "EVENT_BUS_FAILURE"; + private static final String KAFKA_SEND_ERROR_MSG = "Failed to push event onto the event bus"; + private static final String KAFKA_ERROR_LOG = "Failed to push data to kafka queue"; + private KafkaTemplate kafkaTemplate; + + @Autowired + public CustomKafkaTemplate(KafkaTemplate kafkaTemplate) { + this.kafkaTemplate = kafkaTemplate; + } + + public SendResult send(String topic, V value) { + try { + final SendResult result = kafkaTemplate.send(topic, value).get(); + return result; + } catch (Exception e) { + log.error(KAFKA_ERROR_LOG, e); + throw new CustomException(KAFKA_SEND_ERROR_CODE, KAFKA_SEND_ERROR_MSG); + } + } + + public SendResult send(String topic, K key, V value) { + try { + final SendResult result = kafkaTemplate.send(topic, key, value).get(); + return result; + } catch (Exception e) { + log.error(KAFKA_ERROR_LOG, e); + throw new CustomException(KAFKA_SEND_ERROR_CODE, KAFKA_SEND_ERROR_MSG); + } + } + + public SendResult send(String topic, K key, int partition, V value) { + try { + final SendResult result = kafkaTemplate.send(topic, partition, key, value).get(); + return result; + } catch (Exception e) { + log.error(KAFKA_ERROR_LOG, e); + throw new CustomException(KAFKA_SEND_ERROR_CODE, KAFKA_SEND_ERROR_MSG); + } + } + +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/ErrorQueueProducer.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/ErrorQueueProducer.java new file mode 100644 index 00000000000..f1feab4d774 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/ErrorQueueProducer.java @@ -0,0 +1,42 @@ +package org.egov.tracer.kafka; + +import com.fasterxml.jackson.core.JsonProcessingException; +import lombok.extern.slf4j.Slf4j; +import org.apache.kafka.common.errors.SerializationException; +import org.egov.tracer.config.ObjectMapperFactory; +import org.egov.tracer.config.TracerProperties; +import org.egov.tracer.model.ErrorQueueContract; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.kafka.core.KafkaTemplate; +import org.springframework.stereotype.Component; + +@Component +@Slf4j +public class ErrorQueueProducer { + + @Autowired + private KafkaTemplate kafkaTemplate; + + @Autowired + private TracerProperties tracerProperties; + + @Autowired + private ObjectMapperFactory objectMapperFactory; + + public void sendMessage(ErrorQueueContract errorQueueContract) { + try { + kafkaTemplate.send(tracerProperties.getErrorsTopic(), errorQueueContract); + } catch (SerializationException serializationException) { + log.info("SerializationException exception occurred while sending exception to error queue"); + try { + kafkaTemplate.send(tracerProperties.getErrorsTopic(), objectMapperFactory.getObjectMapper().writeValueAsString + (errorQueueContract)); + } catch (JsonProcessingException e) { + log.info("exception occurred while converting ErrorQueueContract to json string"); + } + } catch (Exception ex) { + log.error("exception occurred while sending exception to error queue"); + } + } + +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/KafkaTemplateLoggingInterceptors.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/KafkaTemplateLoggingInterceptors.java new file mode 100644 index 00000000000..cb37f29865a --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/KafkaTemplateLoggingInterceptors.java @@ -0,0 +1,132 @@ +package org.egov.tracer.kafka; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.apache.kafka.clients.consumer.ConsumerInterceptor; +import org.apache.kafka.clients.consumer.ConsumerRecord; +import org.apache.kafka.clients.consumer.ConsumerRecords; +import org.apache.kafka.clients.consumer.OffsetAndMetadata; +import org.apache.kafka.clients.producer.ProducerInterceptor; +import org.apache.kafka.clients.producer.ProducerRecord; +import org.apache.kafka.clients.producer.RecordMetadata; +import org.apache.kafka.common.TopicPartition; +import org.slf4j.MDC; +import org.springframework.util.ObjectUtils; + +import java.util.Map; + +import static java.util.Objects.isNull; +import static org.egov.tracer.constants.TracerConstants.*; +import static org.springframework.util.StringUtils.isEmpty; + +@Slf4j +public class KafkaTemplateLoggingInterceptors implements ConsumerInterceptor, ProducerInterceptor { + + private static final String EMPTY_BODY = ""; + private static final String SEND_SUCCESS_MESSAGE = + "Sending message to topic: {}, partition: {} with key: {} ."; + private static final String BODY_JSON_SERIALIZATION_ERROR = "Serialization of body failed while attempting to log" + + " the body"; + private static final String SEND_SUCCESS_MESSAGE_WITH_BODY = + "Sending message to topic: {}, partition: {}, body: {} with key: {} ."; + private static final String SEND_FAILURE_MESSAGE = "Sending of message to topic: %s, partition %s failed."; + + private static final String RECEIVED_MESSAGE_WITH_BODY = "Received message from topic: {}, partition: {}, body: {} with key: {}"; + private static final String RECEIVED_MESSAGE = "Received message from topic: {}, partition: {}, with key: {}"; + + private final ObjectMapper objectMapper = new ObjectMapper(); + + public KafkaTemplateLoggingInterceptors() { + } + + @Override + public ConsumerRecords onConsume(ConsumerRecords consumerRecords) { + for (ConsumerRecord consumerRecord : consumerRecords) { + final String keyAsString = ObjectUtils.nullSafeToString(consumerRecord.key()); + String correlationId = getCorrelationIdFromBody(consumerRecord.value()); + + if (!isEmpty(correlationId)) + MDC.put(CORRELATION_ID_MDC, correlationId); + + if (log.isDebugEnabled()) { + final String bodyAsJsonString = getMessageBodyAsJsonString(consumerRecord.value()); + log.debug(RECEIVED_MESSAGE_WITH_BODY, consumerRecord.topic(), consumerRecord.partition(), bodyAsJsonString, + keyAsString); + } else { + log.info(RECEIVED_MESSAGE, consumerRecord.topic(), consumerRecord.topic(), consumerRecord.key()); + } + } + return consumerRecords; + } + + @Override + public void onCommit(Map map) { + + } + + @Override + public ProducerRecord onSend(ProducerRecord producerRecord) { + final String keyAsString = ObjectUtils.nullSafeToString(producerRecord.key()); + + if (log.isDebugEnabled()) { + final String bodyAsJsonString = getMessageBodyAsJsonString(producerRecord.value()); + log.debug(SEND_SUCCESS_MESSAGE_WITH_BODY, producerRecord.topic(), producerRecord.partition(), bodyAsJsonString, + keyAsString); + } else { + log.info(SEND_SUCCESS_MESSAGE, producerRecord.topic(), producerRecord.partition(), keyAsString); + } + return producerRecord; + } + + @Override + public void onAcknowledgement(RecordMetadata recordMetadata, Exception e) { + if (!isNull(e)) { + final String message = + String.format(SEND_FAILURE_MESSAGE, recordMetadata.topic(), recordMetadata.partition()); + log.error(message, e); + } + } + + @Override + public void close() { + + } + + @Override + public void configure(Map map) { + + } + + private String getMessageBodyAsJsonString(Object value) { + try { + return objectMapper.writeValueAsString(value); + } catch (JsonProcessingException e) { + log.warn(BODY_JSON_SERIALIZATION_ERROR); + return EMPTY_BODY; + } + } + + @SuppressWarnings("unchecked") + private String getCorrelationIdFromBody(Object value) { + String correlationId = null; + try { + Map requestMap = objectMapper.convertValue(value, Map.class); + + Object requestInfo = requestMap.containsKey(REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE) ? requestMap.get + (REQUEST_INFO_FIELD_NAME_IN_JAVA_CLASS_CASE) : requestMap.get(REQUEST_INFO_IN_CAMEL_CASE); + + if (isNull(requestInfo)) + return null; + else { + if (requestInfo instanceof Map) { + correlationId = (String) ((Map) requestInfo).get(CORRELATION_ID_FIELD_NAME); + } + } + } catch (Exception ignored) { + } + + return correlationId; + } + +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/LogAwareKafkaTemplate.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/LogAwareKafkaTemplate.java new file mode 100644 index 00000000000..8a161f54485 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/LogAwareKafkaTemplate.java @@ -0,0 +1,97 @@ +package org.egov.tracer.kafka; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.egov.tracer.config.ObjectMapperFactory; +import org.egov.tracer.config.TracerProperties; +import org.springframework.kafka.core.KafkaTemplate; +import org.springframework.kafka.support.SendResult; +import org.springframework.stereotype.Component; +import org.springframework.util.ObjectUtils; + +import java.util.concurrent.ExecutionException; + +@Slf4j +@Component +public class LogAwareKafkaTemplate { + + private static final String EMPTY_BODY = ""; + private static final String SEND_SUCCESS_MESSAGE = + "Sending of message to topic: {}, partition: {} with key: {} succeeded."; + private static final String BODY_JSON_SERIALIZATION_ERROR = "Serialization of body failed"; + private static final String SEND_SUCCESS_MESSAGE_WITH_BODY = + "Sending of message to topic: {}, partition: {}, body: {} with key: {} succeeded."; + private static final String SEND_FAILURE_MESSAGE_WITH_TOPIC = + "Sending of message to topic: %s failed."; + private static final String SEND_FAILURE_MESSAGE_WITH_TOPIC_KEY = + "Sending of message to topic: %s, key: %s failed."; + private static final String SEND_FAILURE_MESSAGE_WITH_TOPIC_KEY_PARTITION = + "Sending of message to topic: %s, partition: %s, key: %s failed."; + private TracerProperties tracerProperties; + private KafkaTemplate kafkaTemplate; + private ObjectMapper objectMapper; + + public LogAwareKafkaTemplate(TracerProperties tracerProperties, + KafkaTemplate kafkaTemplate, + ObjectMapperFactory objectMapperFactory) { + this.tracerProperties = tracerProperties; + this.kafkaTemplate = kafkaTemplate; + this.objectMapper = objectMapperFactory.getObjectMapper(); + } + + public SendResult send(String topic, V value) { + try { + final SendResult result = kafkaTemplate.send(topic, value).get(); + logSuccessMessage(value, result); + return result; + } catch (InterruptedException | ExecutionException e) { + log.error(String.format(SEND_FAILURE_MESSAGE_WITH_TOPIC, topic), e); + throw new RuntimeException(e); + } + } + + public SendResult send(String topic, K key, V value) { + try { + final SendResult result = kafkaTemplate.send(topic, key, value).get(); + logSuccessMessage(value, result); + return result; + } catch (InterruptedException | ExecutionException e) { + log.error(String.format(SEND_FAILURE_MESSAGE_WITH_TOPIC_KEY, topic, key), e); + throw new RuntimeException(e); + } + } + + public SendResult send(String topic, K key, int partition, V value) { + try { + final SendResult result = kafkaTemplate.send(topic, partition, key, value).get(); + logSuccessMessage(value, result); + return result; + } catch (InterruptedException | ExecutionException e) { + log.error(String.format(SEND_FAILURE_MESSAGE_WITH_TOPIC_KEY_PARTITION, topic, key, partition), e); + throw new RuntimeException(e); + } + } + + private void logSuccessMessage(V message, SendResult result) { + final String topic = result.getProducerRecord().topic(); + final Integer partition = result.getProducerRecord().partition(); + final String key = ObjectUtils.nullSafeToString(result.getProducerRecord().key()); + if (tracerProperties.isKafkaMessageLoggingEnabled()) { + final String bodyAsJsonString = getMessageBodyAsJsonString(message); + log.info(SEND_SUCCESS_MESSAGE_WITH_BODY, topic, partition, bodyAsJsonString, key); + } else { + log.info(SEND_SUCCESS_MESSAGE, topic, partition, key); + } + } + + private String getMessageBodyAsJsonString(Object value) { + try { + return objectMapper.writeValueAsString(value); + } catch (JsonProcessingException e) { + log.error(BODY_JSON_SERIALIZATION_ERROR); + return EMPTY_BODY; + } + } + +} \ No newline at end of file diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/deserializer/HashMapDeserializer.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/deserializer/HashMapDeserializer.java new file mode 100644 index 00000000000..7e736c4a797 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/deserializer/HashMapDeserializer.java @@ -0,0 +1,14 @@ +package org.egov.tracer.kafka.deserializer; + +import org.springframework.kafka.support.serializer.JsonDeserializer; + +import java.util.HashMap; + +public class HashMapDeserializer extends JsonDeserializer { + + public HashMapDeserializer() { + super(HashMap.class); + } + +} + diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/deserializer/ISTTimeZoneHashMapDeserializer.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/deserializer/ISTTimeZoneHashMapDeserializer.java new file mode 100644 index 00000000000..004c5ad3a82 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/deserializer/ISTTimeZoneHashMapDeserializer.java @@ -0,0 +1,23 @@ +package org.egov.tracer.kafka.deserializer; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.kafka.support.serializer.JsonDeserializer; + +import java.util.HashMap; +import java.util.TimeZone; + +public class ISTTimeZoneHashMapDeserializer extends JsonDeserializer { + + private static final String IST = "Asia/Kolkata"; + + public ISTTimeZoneHashMapDeserializer() { + super(HashMap.class, getObjectMapper()); + } + + private static ObjectMapper getObjectMapper() { + final ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.setTimeZone(TimeZone.getTimeZone(IST)); + return objectMapper; + } +} + diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/serializer/ISTTimeZoneJsonSerializer.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/serializer/ISTTimeZoneJsonSerializer.java new file mode 100644 index 00000000000..1dfccf0521f --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/kafka/serializer/ISTTimeZoneJsonSerializer.java @@ -0,0 +1,22 @@ +package org.egov.tracer.kafka.serializer; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.kafka.support.serializer.JsonSerializer; + +import java.util.HashMap; +import java.util.TimeZone; + +public class ISTTimeZoneJsonSerializer extends JsonSerializer { + + private static final String IST = "Asia/Kolkata"; + + public ISTTimeZoneJsonSerializer() { + super(getObjectMapper()); + } + + private static ObjectMapper getObjectMapper() { + final ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.setTimeZone(TimeZone.getTimeZone(IST)); + return objectMapper; + } +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/CustomBindingResultExceprion.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/CustomBindingResultExceprion.java new file mode 100644 index 00000000000..f0eded94fdc --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/CustomBindingResultExceprion.java @@ -0,0 +1,18 @@ +package org.egov.tracer.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.validation.BindingResult; + +@Setter +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class CustomBindingResultExceprion extends RuntimeException { + + private static final long serialVersionUID = 4581677752337709974L; + + private BindingResult bindingResult; +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/CustomException.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/CustomException.java new file mode 100644 index 00000000000..b0184408765 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/CustomException.java @@ -0,0 +1,35 @@ +package org.egov.tracer.model; + +import lombok.Getter; +import lombok.Setter; + +import java.util.Map; + +@Setter +@Getter +public class CustomException extends RuntimeException { + + private static final long serialVersionUID = 8859144435338793971L; + + private String code; + private String message; + private Map errors; + + public CustomException() { + super(); + } + + public CustomException(String code, String message) { + super(); + this.code = code; + this.message = message; + } + + public CustomException(Map errors) { + super(); + this.message = errors.toString(); + this.errors = errors; + } + + +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/Error.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/Error.java new file mode 100644 index 00000000000..62a6f5bb39b --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/Error.java @@ -0,0 +1,31 @@ +package org.egov.tracer.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +import java.util.List; + +/** + * Error object will be returned as a part of reponse body in conjunction with + * ResponseInfo as part of ErrorResponse whenever the request processing status + * in the ResponseInfo is FAILED. + */ +@Setter +@Getter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Error { + @JsonProperty("code") + private String code = null; + + @JsonProperty("message") + private String message = null; + + @JsonProperty("description") + private String description = null; + + @JsonProperty("params") + private List params = null; + +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/ErrorQueueContract.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/ErrorQueueContract.java new file mode 100644 index 00000000000..8f79e23b32f --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/ErrorQueueContract.java @@ -0,0 +1,26 @@ +package org.egov.tracer.model; + +import lombok.*; + +import java.util.List; + +@Setter +@Getter +@ToString +@NoArgsConstructor +@Builder +@AllArgsConstructor +public class ErrorQueueContract { + + private String id; + private String source; + private Object body; + private Long ts; + private ErrorRes errorRes; + private List exception; + //private String couse; + private String message; + //private Exception exception; + private String correlationId; + +} diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/ErrorRes.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/ErrorRes.java new file mode 100644 index 00000000000..c77cd62bc6f --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/ErrorRes.java @@ -0,0 +1,25 @@ +package org.egov.tracer.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import org.egov.common.contract.response.ResponseInfo; + +import java.util.List; + +/** + * All APIs will return ErrorRes in case of failure which will carry ResponseInfo as metadata and Error object as actual representation of error. In case of bulk apis, some apis may chose to return the array of Error objects to indicate individual failure. + */ +@Setter +@Getter +@ToString +public class ErrorRes { + + @JsonProperty("ResponseInfo") + private ResponseInfo responseInfo = null; + + @JsonProperty("Errors") + private List errors = null; +} + diff --git a/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/ServiceCallException.java b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/ServiceCallException.java new file mode 100644 index 00000000000..c5120c297f7 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/java/org/egov/tracer/model/ServiceCallException.java @@ -0,0 +1,16 @@ +package org.egov.tracer.model; + +import lombok.*; + +@Setter +@Getter +@ToString +@NoArgsConstructor +@AllArgsConstructor +public class ServiceCallException extends RuntimeException { + /** + * + */ + private static final long serialVersionUID = 1L; + private String error; +} diff --git a/core-services/libraries2/tracer/src/main/resources/logback-spring.xml b/core-services/libraries2/tracer/src/main/resources/logback-spring.xml new file mode 100644 index 00000000000..dc708b6c05b --- /dev/null +++ b/core-services/libraries2/tracer/src/main/resources/logback-spring.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + { + "logger": "%logger{30}", + "message": "%message", + "level": "%level", + "thread": "%thread{10}" + } + + + + + + 30 + 2048 + 20 + ^sun\.reflect\..*\.invoke + ^net\.sf\.cglib\.proxy\.MethodProxy\.invoke + true + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core-services/libraries2/tracer/src/main/resources/tracer.properties b/core-services/libraries2/tracer/src/main/resources/tracer.properties new file mode 100644 index 00000000000..af6055f7d98 --- /dev/null +++ b/core-services/libraries2/tracer/src/main/resources/tracer.properties @@ -0,0 +1,30 @@ +app.timezone=UTC +tracer.filter.enabled=true +tracer.opentracing.enabled=false +tracer.requestLoggingEnabled=false +tracer.kafkaMessageLoggingEnabled=false +tracer.restTemplateDetailedLoggingEnabled=false +tracer.errorsPublish=false +tracer.errorsTopic=egov-error +tracer.filterSkipPattern=/api-docs.*|/autoconfig|/configprops|/dump|/health|/info|/metrics\ + .*|/mappings|/swagger.*|.*\.png|.*\.css|.*\.js|.*\.html|/favicon.ico|/hystrix.stream|/prometheus|/manage/* + + +#Logging config +spring.kafka.properties.interceptor.classes=org.egov.tracer.kafka.KafkaTemplateLoggingInterceptors + +# Actuator Configs +endpoints.enabled=false +endpoints.health.enabled=true +endpoints.prometheus.enabled=true + +# Open Tracing / Jaeger Configs +opentracing.spring.web.skipPattern=/api-docs.*|/autoconfig|/configprops|/dump|/health|/info|/metrics\ + .*|/mappings|/swagger.*|.*\.png|.*\.css|.*\.js|.*\.html|/favicon.ico|/hystrix.stream|/prometheus|/manage/* +opentracing.spring.web.order=2 +opentracing.spring.cloud.jdbc.withActiveSpanOnly=true +opentracing.spring.cloud.jdbc.ignoreStatements=SELECT 1 + +# Kafka Configs +spring.kafka.producer.acks=all +spring.kafka.producer.linger.ms=100 diff --git a/core-services/libraries2/tracer/src/test/java/org/egov/ObjectMapperTest.java b/core-services/libraries2/tracer/src/test/java/org/egov/ObjectMapperTest.java new file mode 100644 index 00000000000..3e926bd67e7 --- /dev/null +++ b/core-services/libraries2/tracer/src/test/java/org/egov/ObjectMapperTest.java @@ -0,0 +1,58 @@ +package org.egov; + +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.junit.Test; + +import java.util.HashMap; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class ObjectMapperTest { + + @Test + public void test_should_convert_class_instance_to_map() { + final Foo foo = new Foo("value1", new SubFoo("value2")); + final HashMap hashMap = new ObjectMapper().convertValue(foo, HashMap.class); + + assertNotNull(hashMap); + assertEquals("value1", hashMap.get("bar1")); + @SuppressWarnings("unchecked") final HashMap subFoo = + (HashMap) hashMap.get("subFoo"); + assertNotNull(subFoo); + assertEquals("value2", subFoo.get("bar2")); + } + + @Test + public void test_should_convert_map_to_map() { + final HashMap foo = new HashMap<>(); + foo.put("bar1", "value1"); + final HashMap subFoo = new HashMap<>(); + subFoo.put("bar2", "value2"); + foo.put("subFoo", subFoo); + final HashMap hashMap = new ObjectMapper().convertValue(foo, HashMap.class); + + assertNotNull(hashMap); + assertEquals("value1", hashMap.get("bar1")); + @SuppressWarnings("unchecked") final HashMap subFooMap = + (HashMap) hashMap.get("subFoo"); + assertNotNull(subFooMap); + assertEquals("value2", subFooMap.get("bar2")); + } + + @Getter + @AllArgsConstructor + private class Foo { + private String bar1; + private SubFoo subFoo; + } + + @Getter + @AllArgsConstructor + private class SubFoo { + private String bar2; + } +} + diff --git a/core-services/libraries2/tracer/src/test/java/org/egov/Resources.java b/core-services/libraries2/tracer/src/test/java/org/egov/Resources.java new file mode 100644 index 00000000000..f838c49af2b --- /dev/null +++ b/core-services/libraries2/tracer/src/test/java/org/egov/Resources.java @@ -0,0 +1,17 @@ +package org.egov; + +import org.apache.commons.io.IOUtils; + +import java.io.IOException; + +public class Resources { + public String getFileContents(String fileName) { + try { + return IOUtils.toString(this.getClass().getClassLoader() + .getResourceAsStream(fileName), "UTF-8") + .replace(" ", "").replace("\n", ""); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/core-services/libraries2/tracer/src/test/java/org/egov/tracer/kafka/KafkaListenerLoggingAspectTest.java b/core-services/libraries2/tracer/src/test/java/org/egov/tracer/kafka/KafkaListenerLoggingAspectTest.java new file mode 100644 index 00000000000..18dbee304e1 --- /dev/null +++ b/core-services/libraries2/tracer/src/test/java/org/egov/tracer/kafka/KafkaListenerLoggingAspectTest.java @@ -0,0 +1,246 @@ +package org.egov.tracer.kafka; + +import org.egov.tracer.config.TracerConfiguration; +import org.egov.tracer.config.TracerProperties; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.contrib.java.lang.system.SystemOutRule; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.kafka.annotation.KafkaListener; +import org.springframework.kafka.core.KafkaTemplate; +import org.springframework.kafka.support.KafkaHeaders; +import org.springframework.messaging.handler.annotation.Header; +import org.springframework.messaging.handler.annotation.Payload; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.HashMap; + +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +@RunWith(SpringRunner.class) +@ContextConfiguration(classes = {TracerConfiguration.class, TestConfiguration.class}) +public class KafkaListenerLoggingAspectTest { + + private static final String TEST_CORRELATION_ID = "testCorrelationId"; + @Rule + public final SystemOutRule systemOutRule = new SystemOutRule().enableLog(); + + @Autowired + private KafkaListenerWithOnlyPayloadAnnotatedHashMap kafkaListenerWithOnlyPayloadAnnotatedHashMap; + + @Autowired + private KafkaListenerStringPayloadWithTopicHeaderAnnotation kafkaListenerStringPayloadWithTopicHeaderAnnotation; + + @Autowired + private KafkaListenerWithoutPayloadAnnotationAndWithoutTopicHeaderAnnotation + kafkaListenerWithoutPayloadAnnotationAndWithoutTopicHeaderAnnotation; + + @Autowired + private KafkaListenerStringPayloadWithNonTopicHeaderAnnotation + kafkaListenerStringPayloadWithNonTopicHeaderAnnotation; + + @Autowired + private TracerProperties tracerProperties; + + @Before + public void before() { + systemOutRule.clearLog(); + } + + @Test + public void test_should_retrieve_correlation_id_from_hash_map_payload_and_set_to_context() { + final HashMap payload = new HashMap<>(); + final HashMap requestInfo = new HashMap<>(); + requestInfo.put("correlationId", TEST_CORRELATION_ID); + payload.put("RequestInfo", requestInfo); + + kafkaListenerWithOnlyPayloadAnnotatedHashMap.bar(payload); + + } + + @Test + public void test_should_set_context_with_random_correlation_id_when_hash_map_payload_does_not_have_correlation_id_field() { + final HashMap payload = new HashMap<>(); + final HashMap requestInfo = new HashMap<>(); + requestInfo.put("foo", "abc"); + payload.put("RequestInfo", requestInfo); + + kafkaListenerWithOnlyPayloadAnnotatedHashMap.bar(payload); + + } + + @Test + @Ignore + public void test_simple_log_message_should_mention_topic_name_is_unavailable_when_topic_header_annotation_is_not_present() { + final HashMap payload = new HashMap<>(); + final HashMap requestInfo = new HashMap<>(); + requestInfo.put("foo", "abc"); + payload.put("RequestInfo", requestInfo); + when(tracerProperties.isRequestLoggingEnabled()).thenReturn(false); + + kafkaListenerWithOnlyPayloadAnnotatedHashMap.bar(payload); + + assertTrue(systemOutRule.getLog().contains("Received message from topic: ")); + } + + @Test + @Ignore + public void test_detail_message_should_print_unavailable_topic_name_and_stringified_payload() { + final HashMap payload = new HashMap<>(); + final HashMap requestInfo = new HashMap<>(); + requestInfo.put("foo", "abc"); + payload.put("RequestInfo", requestInfo); + when(tracerProperties.isRequestLoggingEnabled()).thenReturn(true); + + kafkaListenerWithOnlyPayloadAnnotatedHashMap.bar(payload); + + final String expectedBody = "{\"RequestInfo\":{\"foo\":\"abc\"}}"; + final String expectedMessage = "Received message from topic: with body " + expectedBody; + assertTrue(systemOutRule.getLog().contains(expectedMessage)); + } + + @Test + public void test_should_retrieve_correlation_id_from_string_payload_and_set_to_context() { + final String payload = "{\"RequestInfo\": { \"correlationId\": \"testCorrelationId\"}}"; + + kafkaListenerStringPayloadWithTopicHeaderAnnotation.bar(payload, "actualTopic"); + + } + + @Test + public void test_should_set_random_correlation_id_to_context_when_string_payload_does_not_have_correlation_id_field() { + final String payload = "{\"RequestInfo\": { \"foo\": \"bar\"}}"; + + kafkaListenerStringPayloadWithTopicHeaderAnnotation.bar(payload, "actualTopic"); + + } + + @Test + @Ignore + public void test_should_print_detailed_log_with_stringified_body_and_topic_name() { + final String payload = "{\"RequestInfo\": { \"foo\": \"bar\"}}"; + when(tracerProperties.isRequestLoggingEnabled()).thenReturn(true); + kafkaListenerStringPayloadWithTopicHeaderAnnotation.bar(payload, "actualTopic"); + + final String expectedMessage = "Received message from topic: actualTopic with body " + payload; + assertTrue(systemOutRule.getLog().contains(expectedMessage)); + } + + @Test + @Ignore + public void test_should_set_random_correlation_id_when_payload_parameter_is_not_annotated() { + final HashMap payload = new HashMap<>(); + final HashMap requestInfo = new HashMap<>(); + requestInfo.put("foo", "abc"); + payload.put("RequestInfo", requestInfo); + + kafkaListenerWithoutPayloadAnnotationAndWithoutTopicHeaderAnnotation.bar(payload); + + } + + @Test + @Ignore + public void test_should_print_detailed_log_with_unavailable_body_and_unavailable_topic_name() { + final HashMap payload = new HashMap<>(); + final HashMap requestInfo = new HashMap<>(); + requestInfo.put("foo", "abc"); + payload.put("RequestInfo", requestInfo); + + kafkaListenerWithoutPayloadAnnotationAndWithoutTopicHeaderAnnotation.bar(payload); + + final String expectedMessage = "Received message from topic: with body "; + assertTrue(systemOutRule.getLog().contains(expectedMessage)); + } + + @Test + @Ignore + public void test_should_print_detailed_log_with_stringified_body_and_unavailable_topic_name() { + final String payload = "{\"RequestInfo\": { \"foo\": \"bar\"}}"; + when(tracerProperties.isRequestLoggingEnabled()).thenReturn(true); + + kafkaListenerStringPayloadWithNonTopicHeaderAnnotation.bar(payload, 3); + + final String expectedMessage = "Received message from topic: with body " + payload; + assertTrue(systemOutRule.getLog().contains(expectedMessage)); + } + +} + +@Configuration +class TestConfiguration { + + @Bean + public KafkaTemplate kafkaTemplate() { + return mock(KafkaTemplate.class); + } + + @Bean + public KafkaListenerWithOnlyPayloadAnnotatedHashMap kafkaListenerWithOnlyHashMapPayload() { + return new KafkaListenerWithOnlyPayloadAnnotatedHashMap(); + } + + @Bean + public KafkaListenerStringPayloadWithTopicHeaderAnnotation kafkaListenerStringPayloadWithAnnotation() { + return new KafkaListenerStringPayloadWithTopicHeaderAnnotation(); + } + + @Bean + public KafkaListenerWithoutPayloadAnnotationAndWithoutTopicHeaderAnnotation + kafkaListenerWithPayloadNotHavingPayloadAnnotation() { + return new KafkaListenerWithoutPayloadAnnotationAndWithoutTopicHeaderAnnotation(); + } + + @Bean + public KafkaListenerStringPayloadWithNonTopicHeaderAnnotation + kafkaListenerStringPayloadWithNonTopicHeaderAnnotation() { + return new KafkaListenerStringPayloadWithNonTopicHeaderAnnotation(); + } + + @Bean + public TracerProperties tracerProperties() { + final TracerProperties tracerProperties = mock(TracerProperties.class); + when(tracerProperties.isRequestLoggingEnabled()).thenReturn(true); + return tracerProperties; + } +} + +class KafkaListenerWithOnlyPayloadAnnotatedHashMap { + + @KafkaListener(topics = "${my.topics1}") + public void bar(@Payload HashMap payload) { + + } +} + +class KafkaListenerStringPayloadWithTopicHeaderAnnotation { + + @KafkaListener(topics = "${my.topics2}") + public void bar(@Payload String payload, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic) { + + } +} + +class KafkaListenerWithoutPayloadAnnotationAndWithoutTopicHeaderAnnotation { + + @KafkaListener(topics = "${my.topics1}") + public void bar(HashMap payload) { + + } +} + +class KafkaListenerStringPayloadWithNonTopicHeaderAnnotation { + + @KafkaListener(topics = "${my.topics2}") + public void bar(@Payload String payload, @Header(KafkaHeaders.RECEIVED_PARTITION_ID) int partition) { + + } +} + diff --git a/core-services/libraries2/tracer/src/test/resources/requestBodyWithCorrelationIdPresentInRequestInfo.json b/core-services/libraries2/tracer/src/test/resources/requestBodyWithCorrelationIdPresentInRequestInfo.json new file mode 100644 index 00000000000..b3c32bd7d12 --- /dev/null +++ b/core-services/libraries2/tracer/src/test/resources/requestBodyWithCorrelationIdPresentInRequestInfo.json @@ -0,0 +1,6 @@ +{ + "RequestInfo": { + "correlationId": "someCorrelationId" + }, + "foo": "bar" +} \ No newline at end of file diff --git a/core-services/libraries2/tracer/src/test/resources/requestBodyWithoutCorrelationIdPresentInRequestInfo.json b/core-services/libraries2/tracer/src/test/resources/requestBodyWithoutCorrelationIdPresentInRequestInfo.json new file mode 100644 index 00000000000..87377638518 --- /dev/null +++ b/core-services/libraries2/tracer/src/test/resources/requestBodyWithoutCorrelationIdPresentInRequestInfo.json @@ -0,0 +1,6 @@ +{ + "RequestInfo": { + "foo": "bar" + }, + "foo": "bar" +} \ No newline at end of file diff --git a/core-services/libraries2/tracer/src/test/resources/requestBodyWithoutRequestInfoField.json b/core-services/libraries2/tracer/src/test/resources/requestBodyWithoutRequestInfoField.json new file mode 100644 index 00000000000..b42f309e7ae --- /dev/null +++ b/core-services/libraries2/tracer/src/test/resources/requestBodyWithoutRequestInfoField.json @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} \ No newline at end of file diff --git a/core-services/libraries2/tracer/verify.sh b/core-services/libraries2/tracer/verify.sh new file mode 100644 index 00000000000..d9db414fe82 --- /dev/null +++ b/core-services/libraries2/tracer/verify.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +./mvnw clean test verify diff --git a/core-services/mdms-v2/CHANGELOG.md b/core-services/mdms-v2/CHANGELOG.md new file mode 100644 index 00000000000..91d931292ae --- /dev/null +++ b/core-services/mdms-v2/CHANGELOG.md @@ -0,0 +1,42 @@ + + +# Changelog +All notable changes to this module will be documented in this file. + +## 1.3.2 - 2022-01-13 +- Updated to log4j2 version 2.17.1 + +## 1.3.1 - 2021-05-11 +- Added finally blocked wherever missing +- Changes to error handling + + +## 1.3.0 - 2020-05-29 + +- Added typescript definition generation plugin +- Upgraded to `tracer:2.0.0-SNAPSHOT` +- Upgraded to spring boot `2.2.6-RELEASE` +- Upgraded to spring-kafka `2.3.7.RELEASE` +- Upgraded to spring-integration-kafka `3.2.0.RELEASE` +- Upgraded to jackson-dataformat-yaml `2.10.0` +- Upgraded to jackson-databind `2.10.0` +- Removed the spring-integration-java-dsl because from Spring Integration 5.0, the + 'spring-integration-java-dsl' dependency is no longer needed. The Java DSL has + been merged into the core project. + +## 1.2.0 + +- Removed reload consumers +- Removed `start.sh` and `Dockerfile` +- Remove reload endpoints +- Remove all unused dependencies +- Migrated to the latest Spring Boot `2.2.6` +- Upgraded to tracer `2.0.0` + +## 1.1.0 + +- Added support for partial files using `isMergeAllowed` flag in the config file. By default, merge is `false` + +## 1.0.0 + +- Base version diff --git a/core-services/mdms-v2/LOCALSETUP.md b/core-services/mdms-v2/LOCALSETUP.md new file mode 100644 index 00000000000..5decabe365b --- /dev/null +++ b/core-services/mdms-v2/LOCALSETUP.md @@ -0,0 +1,30 @@ +# Local Setup + +To setup the MDMS service in your local system, clone the [Core Service repository](https://github.com/egovernments/core-services). + +## Dependencies + +### Infra Dependency + +- [ ] Postgres DB +- [ ] Redis +- [ ] Elasticsearch +- [ ] Kafka + - [ ] Consumer + - [ ] Producer + +## Running Locally + +To run the MDMS services locally, update below listed properties in `application.properties` before running the project: + +```ini +egov.mdms.conf.path = +masters.config.url = +``` +- Update `egov.mdms.conf.path` and `masters.config.url` to point to the folder/file where the master configuration/data is stored. You can put the folder path present in your local system or put the git hub link of MDMS config folder/file [Sample data](https://github.com/egovernments/egov-mdms-data/blob/master/data/pb/) and [Sample config](https://raw.githubusercontent.com/egovernments/egov-mdms-data/master/master-config.json) + +>**Note:** +If you are mentioning local folder path in above mention property, then add `file://` as prefix. +`file://` +egov.mdms.conf.path = file:///home/abc/xyz/egov-mdms-data/data/pb +>If there are multiple file seperate it with `,` . \ No newline at end of file diff --git a/core-services/mdms-v2/README.md b/core-services/mdms-v2/README.md new file mode 100644 index 00000000000..b2fc7a24cc1 --- /dev/null +++ b/core-services/mdms-v2/README.md @@ -0,0 +1,87 @@ +# Master Data Management service + +Master Data Management Service is a core service that is made available on the DIGIT platform. It encapsulates the functionality surrounding Master Data Management. The service fetches Master Data pertaining to different modules. The functionality is exposed via REST API. + +### DB UML Diagram + +- NA + +### Service Dependencies +- NA + +### Swagger API Contract + +Please refer to the below Swagger API contarct for MDMS service to understand the structure of APIs and to have visualization of all internal APIs. +http://editor.swagger.io/?url=https://raw.githubusercontent.com/egovernments/egov-services/master/docs/mdms/contract/v1-0-0.yml#!/ + + +## Service Details + +The MDM service reads the data from a set of JSON files from a pre-specified location. It can either be an online location (readable JSON files from online) or offline (JSON files stored in local memory). The JSON files should conform to a prescribed format. The data is stored in a map and tenantID of the file serves as a key. +Once the data is stored in the map the same can be retrieved by making an API request to the MDM service. Filters can be applied in the request to retrieve data based on the existing fields of JSON. + +#### Master data management files check in location and details - + +1. Data folder parallel to docs (https://github.com/egovernments/egov-mdms-data/tree/master/data/pb). +2. Under data folder there will be a folder `` which is a state specific master folder. +3. Under `` folder there will `` folders where ulb specific master data will be checked in. for example `pb.testing` +4. Each module will have one file each for statewise and ulb wise master data. Keep the file name as module name itself. + +### Sample Config + +Each master has three key parameters `tenantId`, `moduleName`, `masterName`. A sample master would look like below + +```json +{ + "tenantId": "pb", + "moduleName": "common-masters", + "OwnerType": [ + { + "code": "FREEDOMFIGHTER", + "active": true + }, + { + "code": "WIDOW", + "active": true + }, + { + "code": "HANDICAPPED", + "active": true + } + ] +} +``` +Suppose there are huge data to be store in one config file, the data can be store in seperate files. And these seperated config file data can be use under one master name, if `isMergeAllowed` +flag is `true` in [mdms-masters-config.json](https://raw.githubusercontent.com/egovernments/punjab-mdms-data/UAT/mdms-masters-config.json) +### API Details + +`BasePath` /mdms/v1/[API endpoint] + +##### Method +a) `POST /_search` + +This method fetches a list of masters for a specified module and tenantId. +- `MDMSCriteriaReq (mdms request)` : Request Info + MdmsCriteria — Details of module and master which need to be searched using MDMS. + +- `MdmsCriteria` + + | Input Field | Description | Mandatory | Data Type | + | ----------------------------------------- | ------------------------------------------------------------------| -----------|------------------| + | `tenantId` | Unique id for a tenant. | Yes | String | + | `moduleDetails` | module for which master data is required | Yes | String | + +- `MdmsResponse` Response Info + Mdms + +- `Mdms` + + | Input Field | Description | Mandatory | Data Type | + | ----------------------------------------- | ------------------------------------------------------------------| -----------|------------------| + | `mdms` | Array of modules | Yes | String | + +### Kafka Consumers + +- NA + +### Kafka Producers + +- NA \ No newline at end of file diff --git a/core-services/mdms-v2/pom.xml b/core-services/mdms-v2/pom.xml new file mode 100644 index 00000000000..cbf1480b11d --- /dev/null +++ b/core-services/mdms-v2/pom.xml @@ -0,0 +1,129 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.2.13.RELEASE + + + org.egov.mdms + mdms-v2 + 1.3.2-SNAPSHOT + egov-infra-mdms-v2 + http://maven.apache.org + + 2.17.1 + UTF-8 + 1.8 + UTF-8 + ${java.version} + ${java.version} + + + + org.projectlombok + lombok + 1.18.22 + provided + + + com.jayway.jsonpath + json-path + + + com.fasterxml.jackson.core + jackson-databind + + + org.egov.services + tracer + 2.1.0-SNAPSHOT + + + + org.everit.json + org.everit.json.schema + 1.5.1 + + + + + + io.swagger + swagger-core + 1.5.18 + + + io.swagger.core.v3 + swagger-annotations + 2.2.8 + + + + org.flywaydb + flyway-core + + + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.postgresql + postgresql + 42.2.2 + + + org.egov.services + services-common + 2.0.0-SNAPSHOT + + + org.springframework.boot + spring-boot-devtools + + + org.springframework.boot + spring-boot-starter-aop + + + + + repo.egovernments.org + eGov ERP Releases Repository + https://nexus-repo.egovernments.org/nexus/content/repositories/releases/ + + + repo.egovernments.org.snapshots + eGov ERP Releases Repository + https://nexus-repo.digit.org/nexus/content/repositories/snapshots/ + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + org.springframework.boot + spring-boot-devtools + + + + + + + + + diff --git a/core-services/mdms-v2/sample/data/Level1/Level2/level2Master.json b/core-services/mdms-v2/sample/data/Level1/Level2/level2Master.json new file mode 100644 index 00000000000..f20cd824103 --- /dev/null +++ b/core-services/mdms-v2/sample/data/Level1/Level2/level2Master.json @@ -0,0 +1,11 @@ +{ + "tenantId": "Level1.Level2", + "moduleName": "Level2Module", + "masterName": "Level2Master", + "Level2Master": [ + { + "code": "ABC", + "data": "data-ABC" + } + ] +} \ No newline at end of file diff --git a/core-services/mdms-v2/sample/data/Level1/level1Master.json b/core-services/mdms-v2/sample/data/Level1/level1Master.json new file mode 100644 index 00000000000..005050baa35 --- /dev/null +++ b/core-services/mdms-v2/sample/data/Level1/level1Master.json @@ -0,0 +1,11 @@ +{ + "tenantId": "Level1", + "moduleName": "Level1Module", + "masterName": "Level2Master", + "Level2Master": [ + { + "code": "ABC", + "data": "data-ABC" + } + ] +} \ No newline at end of file diff --git a/core-services/mdms-v2/sample/master-config.json b/core-services/mdms-v2/sample/master-config.json new file mode 100644 index 00000000000..efa73116b22 --- /dev/null +++ b/core-services/mdms-v2/sample/master-config.json @@ -0,0 +1,5 @@ +{ + "Level1": { + + } +} \ No newline at end of file diff --git a/core-services/mdms-v2/src/main/java/org/egov/MDMSApplication.java b/core-services/mdms-v2/src/main/java/org/egov/MDMSApplication.java new file mode 100644 index 00000000000..de224d8fd25 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/MDMSApplication.java @@ -0,0 +1,16 @@ +package org.egov; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + + +@ComponentScan +@SpringBootApplication +public class MDMSApplication { + + public static void main(String[] args) { + SpringApplication.run(MDMSApplication.class, args); + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/config/ApplicationConfig.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/config/ApplicationConfig.java new file mode 100644 index 00000000000..8cea5ca6da9 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/config/ApplicationConfig.java @@ -0,0 +1,33 @@ +package org.egov.infra.mdms.config; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import org.egov.common.utils.MultiStateInstanceUtil; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +@Configuration +@ToString +@Setter +@Getter +@Import({MultiStateInstanceUtil.class}) +public class ApplicationConfig { + + @Value("${egov.mdms.schema.definition.save.topic}") + private String saveSchemaDefinitionTopicName; + + @Value("${egov.mdms.data.save.topic}") + private String saveMdmsDataTopicName; + + @Value("${egov.mdms.data.update.topic}") + private String updateMdmsDataTopicName; + + @Value("${mdms.default.offset}") + private Integer defaultOffset; + + @Value("${mdms.default.limit}") + private Integer defaultLimit; + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/constants/SchemaDefinitionConstant.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/constants/SchemaDefinitionConstant.java new file mode 100644 index 00000000000..965b891dea5 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/constants/SchemaDefinitionConstant.java @@ -0,0 +1,4 @@ +package org.egov.infra.mdms.constants; + +public class SchemaDefinitionConstant { +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/controller/MDMSController.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/controller/MDMSController.java new file mode 100644 index 00000000000..86d5549a61b --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/controller/MDMSController.java @@ -0,0 +1,41 @@ +package org.egov.infra.mdms.controller; + +import java.util.Map; + +import javax.validation.Valid; +import org.egov.infra.mdms.model.*; +import org.egov.infra.mdms.service.MDMSService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; + +@RestController +@Slf4j +@RequestMapping(value = "/v1") +public class MDMSController { + + private MDMSService mdmsService; + + @Autowired + public MDMSController(MDMSService mdmsService) { + this.mdmsService = mdmsService; + } + + /** + * Request handler for serving v1 search requests. + * @param body + * @return + */ + @RequestMapping(value="_search", method = RequestMethod.POST) + public ResponseEntity search(@Valid @RequestBody MdmsCriteriaReq body) { + Map> moduleMasterMap = mdmsService.search(body); + MdmsResponse mdmsResponse = MdmsResponse.builder() + .mdmsRes(moduleMasterMap) + .build(); + return new ResponseEntity<>(mdmsResponse, HttpStatus.OK); + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/controller/MDMSControllerV2.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/controller/MDMSControllerV2.java new file mode 100644 index 00000000000..cfacaeee95a --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/controller/MDMSControllerV2.java @@ -0,0 +1,61 @@ +package org.egov.infra.mdms.controller; + +import lombok.extern.slf4j.Slf4j; +import org.egov.common.contract.request.RequestInfo; +import org.egov.infra.mdms.model.*; +import org.egov.infra.mdms.service.MDMSServiceV2; +import org.egov.infra.mdms.utils.ResponseUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import javax.validation.Valid; +import java.util.List; + +@RestController +@Slf4j +@RequestMapping(value = "/v2") +public class MDMSControllerV2 { + + private MDMSServiceV2 mdmsServiceV2; + + @Autowired + public MDMSControllerV2(MDMSServiceV2 mdmsServiceV2) { + this.mdmsServiceV2 = mdmsServiceV2; + } + + /** + * Request handler for serving create requests + * @param mdmsRequest + * @param schemaCode + * @return + */ + @RequestMapping(value="_create/{schemaCode}", method = RequestMethod.POST) + public ResponseEntity create(@Valid @RequestBody MdmsRequest mdmsRequest, @PathVariable("schemaCode") String schemaCode) { + List masterDataList = mdmsServiceV2.create(mdmsRequest); + return new ResponseEntity<>(ResponseUtil.getMasterDataV2Response(mdmsRequest.getRequestInfo(), masterDataList), HttpStatus.ACCEPTED); + } + + /** + * Request handler for serving search requests + * @param masterDataSearchCriteria + * @return + */ + @RequestMapping(value="_search", method = RequestMethod.POST) + public ResponseEntity search(@Valid @RequestBody MdmsCriteriaReqV2 masterDataSearchCriteria) { + List masterDataList = mdmsServiceV2.search(masterDataSearchCriteria); + return new ResponseEntity<>(ResponseUtil.getMasterDataV2Response(RequestInfo.builder().build(), masterDataList), HttpStatus.OK); + } + + /** + * Request handler for serving update requests + * @param mdmsRequest + * @param schemaCode + * @return + */ + @RequestMapping(value="_update/{schemaCode}", method = RequestMethod.POST) + public ResponseEntity update(@Valid @RequestBody MdmsRequest mdmsRequest, @PathVariable("schemaCode") String schemaCode) { + List masterDataList = mdmsServiceV2.update(mdmsRequest); + return new ResponseEntity<>(ResponseUtil.getMasterDataV2Response(mdmsRequest.getRequestInfo(), masterDataList), HttpStatus.ACCEPTED); + } +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/controller/SchemaDefinitionController.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/controller/SchemaDefinitionController.java new file mode 100644 index 00000000000..22ea306c69e --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/controller/SchemaDefinitionController.java @@ -0,0 +1,63 @@ +package org.egov.infra.mdms.controller; + + +import lombok.extern.slf4j.Slf4j; +import org.egov.infra.mdms.model.*; +import org.egov.infra.mdms.service.SchemaDefinitionService; +import org.egov.infra.mdms.utils.ResponseUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import javax.validation.Valid; +import java.util.List; + +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Controller +@RequestMapping("schema/v1") +@Slf4j +public class SchemaDefinitionController { + + private SchemaDefinitionService schemaDefinitionService; + + @Autowired + public SchemaDefinitionController(SchemaDefinitionService schemaDefinitionService) { + this.schemaDefinitionService = schemaDefinitionService; + } + + /** + * Request handler for serving schema create requests. + * @param schemaDefinitionRequest + * @return + */ + @RequestMapping(value = "_create", method = RequestMethod.POST) + public ResponseEntity create(@Valid @RequestBody SchemaDefinitionRequest schemaDefinitionRequest) { + List schemaDefinitions = schemaDefinitionService.create(schemaDefinitionRequest); + return new ResponseEntity<>(ResponseUtil.getSchemaDefinitionResponse(schemaDefinitionRequest.getRequestInfo(), schemaDefinitions), HttpStatus.ACCEPTED); + } + + /** + * Request handler for serving schema search requests. + * @param schemaDefinitionSearchRequest + * @return + */ + @RequestMapping(value = "_search", method = RequestMethod.POST) + public ResponseEntity search(@Valid @RequestBody SchemaDefSearchRequest schemaDefinitionSearchRequest) { + List schemaDefinitions = schemaDefinitionService.search(schemaDefinitionSearchRequest); + return new ResponseEntity<>(ResponseUtil.getSchemaDefinitionResponse(schemaDefinitionSearchRequest.getRequestInfo(), schemaDefinitions), HttpStatus.ACCEPTED); + } + + /** + * Request handler for serving schema update requests - NOT implemented as of now. + * @param schemaDefinitionUpdateRequest + * @return + */ + @RequestMapping(value = "_update", method = RequestMethod.POST) + public ResponseEntity update(@Valid @RequestBody SchemaDefinitionRequest schemaDefinitionUpdateRequest) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/errors/ErrorCodes.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/errors/ErrorCodes.java new file mode 100644 index 00000000000..1037b947730 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/errors/ErrorCodes.java @@ -0,0 +1,30 @@ +package org.egov.infra.mdms.errors; + +import org.springframework.stereotype.Component; + +@Component +public class ErrorCodes { + + public static final String DUPLICATE_SCHEMA_CODE = "DUPLICATE_SCHEMA_CODE"; + + public static final String DUPLICATE_SCHEMA_CODE_MSG = "Schema code already exists"; + + public static final String INVALID_REQUEST_JSON = "INVALID_REQUEST_JSON"; + + public static final String INVALID_JSON = "INVALID_JSON"; + + public static final String INVALID_JSON_MSG = "Failed to deserialize json"; + + public static final String REQUIRED_ATTRIBUTE_LIST_ERR_CODE = "REQUIRED_ATTRIBUTE_LIST_ERR"; + + public static final String REQUIRED_ATTRIBUTE_LIST_EMPTY_MSG = "Required attribute list cannot be empty"; + + public static final String UNIQUE_ATTRIBUTE_LIST_ERR_CODE = "UNIQUE_ATTRIBUTE_LIST_ERR"; + + public static final String UNIQUE_ATTRIBUTE_LIST_EMPTY_MSG = "Unique attribute list cannot be empty"; + + public static final String UNIQUE_ATTRIBUTE_LIST_INVALID_MSG = "Fields provided under unique fields must be a subset of required attributes list"; + + + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MasterDetail.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MasterDetail.java new file mode 100644 index 00000000000..58f178efd03 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MasterDetail.java @@ -0,0 +1,35 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.validation.annotation.Validated; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +/** + * MasterDetail + */ +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MasterDetail { + @JsonProperty("name") + @NotNull + + @Size(min = 1, max = 100) + private String name = null; + + @JsonProperty("filter") + + @Size(min = 1, max = 500) + private String filter = null; + + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/Mdms.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/Mdms.java new file mode 100644 index 00000000000..2eba84d0c1b --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/Mdms.java @@ -0,0 +1,58 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.models.AuditDetails; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +/** + * Bind the request meta data(RequestInfo) and Schema defination + */ +@Schema(description = "Bind the request meta data(RequestInfo) and Schema defination") +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class Mdms { + + @JsonProperty("id") + @Size(min = 2, max = 64) + private String id; + + @JsonProperty("tenantId") + @NotNull + @Size(min = 2, max = 128) + private String tenantId = null; + + @JsonProperty("schemaCode") + @NotNull + @Size(min = 2, max = 128) + private String schemaCode = null; + + @JsonProperty("uniqueIdentifier") + @Size(min = 1, max = 128) + private String uniqueIdentifier = null; + + @JsonProperty("data") + @NotNull + private JsonNode data = null; + + @JsonProperty("isActive") + private Boolean isActive = true; + + @JsonProperty("auditDetails") + @Valid + private AuditDetails auditDetails = null; + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteria.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteria.java new file mode 100644 index 00000000000..a9aebca91d5 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteria.java @@ -0,0 +1,61 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * MdmsCriteria + */ +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MdmsCriteria { + @JsonProperty("tenantId") + @Size(min = 1, max = 100) + @NotNull + private String tenantId = null; + + @JsonProperty("ids") + private Set ids = null; + + @JsonProperty("uniqueIdentifier") + @Size(min = 1, max = 64) + private String uniqueIdentifier = null; + + @JsonProperty("moduleDetails") + @Valid + @NotNull + private List moduleDetails = null; + + @JsonIgnore + private Map schemaCodeFilterMap = null; + + @JsonIgnore + private Boolean isActive = Boolean.TRUE; + + + public MdmsCriteria addModuleDetailsItem(ModuleDetail moduleDetailsItem) { + if (this.moduleDetails == null) { + this.moduleDetails = new ArrayList<>(); + } + this.moduleDetails.add(moduleDetailsItem); + return this; + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteriaReq.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteriaReq.java new file mode 100644 index 00000000000..f5b6f3b05bf --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteriaReq.java @@ -0,0 +1,34 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.request.RequestInfo; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; + +/** + * MdmsCriteriaReq + */ +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MdmsCriteriaReq { + @JsonProperty("RequestInfo") + + @Valid + private RequestInfo requestInfo = null; + + @JsonProperty("MdmsCriteria") + + @Valid + private MdmsCriteria mdmsCriteria = null; + + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteriaReqV2.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteriaReqV2.java new file mode 100644 index 00000000000..88110d63d52 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteriaReqV2.java @@ -0,0 +1,32 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.request.RequestInfo; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; + +/** + * MdmsCriteriaReq + */ +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MdmsCriteriaReqV2 { + + @JsonProperty("RequestInfo") + @Valid + private RequestInfo requestInfo = null; + + @JsonProperty("MdmsCriteria") + @Valid + private MdmsCriteriaV2 mdmsCriteria = null; + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteriaV2.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteriaV2.java new file mode 100644 index 00000000000..f8998e5406b --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsCriteriaV2.java @@ -0,0 +1,64 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * MdmsCriteria + */ +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MdmsCriteriaV2 { + + @JsonProperty("tenantId") + @Size(min = 1, max = 100) + @NotNull + private String tenantId = null; + + @JsonProperty("ids") + private Set ids = null; + + @JsonProperty("uniqueIdentifiers") + @Size(min = 1, max = 64) + private Set uniqueIdentifiers = null; + + @JsonProperty("schemaCode") + private String schemaCode = null; + + @JsonProperty("filters") + private Map filterMap = null; + + @JsonProperty("isActive") + private Boolean isActive = null; + + @JsonIgnore + private Map schemaCodeFilterMap = null; + + @JsonIgnore + private Set uniqueIdentifiersForRefVerification = null; + + @JsonProperty("offset") + private Integer offset; + + @JsonProperty("limit") + private Integer limit; + + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsDataRedisWrapper.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsDataRedisWrapper.java new file mode 100644 index 00000000000..0e67592d9ff --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsDataRedisWrapper.java @@ -0,0 +1,22 @@ +package org.egov.infra.mdms.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import net.minidev.json.JSONArray; +import org.springframework.validation.annotation.Validated; + +import java.util.Map; + +@Validated +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MdmsDataRedisWrapper { + + private String tenantSchemaCode; + + private Map schemaCodeData; +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsRequest.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsRequest.java new file mode 100644 index 00000000000..958c1cb8848 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsRequest.java @@ -0,0 +1,40 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.request.RequestInfo; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.util.Map; + +/** + * MdmsRequest + */ +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MdmsRequest { + @JsonProperty("RequestInfo") + @Valid + private RequestInfo requestInfo = null; + + @JsonProperty("Mdms") + @Valid + @NotNull + private Mdms mdms = null; + + /*@JsonProperty("Workflow") + + @Valid + private Workflow workflow = null;*/ + + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsResponse.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsResponse.java new file mode 100644 index 00000000000..dd3b2eed203 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsResponse.java @@ -0,0 +1,33 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import net.minidev.json.JSONArray; +import org.egov.common.contract.response.ResponseInfo; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import java.util.Map; + +/** + * MdmsResponse + */ +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MdmsResponse { + + @JsonProperty("ResponseInfo") + @Valid + private ResponseInfo responseInfo = null; + + @JsonProperty("MdmsRes") + private Map> mdmsRes = null; + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsResponseV2.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsResponseV2.java new file mode 100644 index 00000000000..f6ad544466c --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsResponseV2.java @@ -0,0 +1,25 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.response.ResponseInfo; + +import javax.validation.Valid; +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class MdmsResponseV2 { + + @JsonProperty("ResponseInfo") + @Valid + private ResponseInfo responseInfo = null; + + @JsonProperty("mdms") + private List mdms = null; +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsTenantMasterCriteria.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsTenantMasterCriteria.java new file mode 100644 index 00000000000..ee11473e303 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/MdmsTenantMasterCriteria.java @@ -0,0 +1,17 @@ +package org.egov.infra.mdms.model; + +import lombok.*; + +@Setter +@Getter +@ToString +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MdmsTenantMasterCriteria { + + private String tenantId; + + private String schemaCode; + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/ModuleDetail.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/ModuleDetail.java new file mode 100644 index 00000000000..57326a83991 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/ModuleDetail.java @@ -0,0 +1,43 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; + +/** + * ModuleDetail + */ +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ModuleDetail { + @JsonProperty("moduleName") + @NotNull + + @Size(min = 1, max = 100) + private String moduleName = null; + + @JsonProperty("masterDetails") + @NotNull + @Valid + private List masterDetails = new ArrayList<>(); + + + public ModuleDetail addMasterDetailsItem(MasterDetail masterDetailsItem) { + this.masterDetails.add(masterDetailsItem); + return this; + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefCriteria.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefCriteria.java new file mode 100644 index 00000000000..abfe8844106 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefCriteria.java @@ -0,0 +1,49 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.validation.annotation.Validated; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.util.ArrayList; +import java.util.List; + +/** + * SchemaDefCriteria + */ +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class SchemaDefCriteria { + + @JsonProperty("tenantId") + @Size(min = 1, max = 100) + @NotNull + private String tenantId = null; + + @JsonProperty("codes") + private List codes = null; + + @JsonProperty("offset") + private Integer offset; + + @JsonProperty("limit") + private Integer limit; + + + public SchemaDefCriteria addCodesItem(String codesItem) { + if (this.codes == null) { + this.codes = new ArrayList<>(); + } + this.codes.add(codesItem); + return this; + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefSearchRequest.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefSearchRequest.java new file mode 100644 index 00000000000..d7d7620773b --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefSearchRequest.java @@ -0,0 +1,35 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import org.egov.common.contract.request.RequestInfo; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +/** + * Bind the request meta data(RequestInfo) and Schema defination + */ +@Schema(description = "Bind the request meta data(RequestInfo) and Schema defination") +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +public class SchemaDefSearchRequest { + @JsonProperty("RequestInfo") + @NotNull + @Valid + private RequestInfo requestInfo = null; + + @JsonProperty("SchemaDefCriteria") + @NotNull + @Valid + private SchemaDefCriteria schemaDefCriteria = null; + + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefinition.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefinition.java new file mode 100644 index 00000000000..a42c03511c4 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefinition.java @@ -0,0 +1,58 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import org.egov.common.contract.models.AuditDetails; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; + +/** + * Bind the request meta data(RequestInfo) and Schema defination + */ +@Schema(description = "Bind the request meta data(RequestInfo) and Schema defination") +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +public class SchemaDefinition implements Serializable{ + + @JsonProperty("id") + @Size(min = 2, max = 128) + private String id = null; + + @JsonProperty("tenantId") + @NotNull + @Size(min = 2, max = 128) + private String tenantId = null; + + @JsonProperty("code") + @NotNull + @Size(min = 2, max = 128) + private String code = null; + + @JsonProperty("description") + + @Size(min = 2, max = 512) + private String description = null; + + @JsonProperty("definition") + @NotNull + private JsonNode definition = null; + + @JsonProperty("isActive") + private Boolean isActive = true; + + @JsonProperty("auditDetails") + @Valid + private AuditDetails auditDetails = null; + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefinitionRequest.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefinitionRequest.java new file mode 100644 index 00000000000..963fad06ae0 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefinitionRequest.java @@ -0,0 +1,35 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import org.egov.common.contract.request.RequestInfo; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +/** + * Bind the request meta data(RequestInfo) and Schema defination + */ +@Schema(description = "Bind the request meta data(RequestInfo) and Schema defination") +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@ToString +public class SchemaDefinitionRequest { + @JsonProperty("RequestInfo") + @NotNull + @Valid + private RequestInfo requestInfo = null; + + @JsonProperty("SchemaDefinition") + @NotNull + @Valid + private SchemaDefinition schemaDefinition = null; + + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefinitionResponse.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefinitionResponse.java new file mode 100644 index 00000000000..be83829ecb0 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/model/SchemaDefinitionResponse.java @@ -0,0 +1,45 @@ +package org.egov.infra.mdms.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.response.ResponseInfo; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import java.util.ArrayList; +import java.util.List; + +/** + * Response from server + */ +@Schema(description = "Response from server") +@Validated +@javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-05-30T09:26:57.838+05:30[Asia/Kolkata]") +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class SchemaDefinitionResponse { + @JsonProperty("ResponseInfo") + + @Valid + private ResponseInfo responseInfo = null; + + @JsonProperty("SchemaDefinitions") + @Valid + private List schemaDefinitions = null; + + + public SchemaDefinitionResponse addSchemaDefinitionsItem(SchemaDefinition schemaDefinitionsItem) { + if (this.schemaDefinitions == null) { + this.schemaDefinitions = new ArrayList<>(); + } + this.schemaDefinitions.add(schemaDefinitionsItem); + return this; + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/producer/Producer.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/producer/Producer.java new file mode 100644 index 00000000000..9ea28d25c6c --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/producer/Producer.java @@ -0,0 +1,17 @@ +package org.egov.infra.mdms.producer; + +import org.egov.tracer.kafka.CustomKafkaTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class Producer { + + @Autowired + private CustomKafkaTemplate kafkaTemplate; + + public void push(String topic, Object value) { + kafkaTemplate.send(topic, value); + } + +} \ No newline at end of file diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/MdmsDataRepository.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/MdmsDataRepository.java new file mode 100644 index 00000000000..aebeb3aa9bf --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/MdmsDataRepository.java @@ -0,0 +1,19 @@ +package org.egov.infra.mdms.repository; + +import net.minidev.json.JSONArray; +import org.egov.infra.mdms.model.*; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +@Repository +public interface MdmsDataRepository { + public void create(MdmsRequest mdmsRequest); + + public void update(MdmsRequest mdmsRequest); + + public List searchV2(MdmsCriteriaV2 mdmsCriteriaV2); + + public Map> search(MdmsCriteria mdmsCriteria); +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/SchemaDefinitionRepository.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/SchemaDefinitionRepository.java new file mode 100644 index 00000000000..cf09ebd9fd7 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/SchemaDefinitionRepository.java @@ -0,0 +1,18 @@ +package org.egov.infra.mdms.repository; + +import org.egov.infra.mdms.model.SchemaDefCriteria; +import org.egov.infra.mdms.model.SchemaDefinition; +import org.egov.infra.mdms.model.SchemaDefinitionRequest; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface SchemaDefinitionRepository { + public void create(SchemaDefinitionRequest schemaDefinitionRequest); + + public void update(SchemaDefinitionRequest schemaDefinitionRequest); + + public List search(SchemaDefCriteria schemaDefCriteria); + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/impl/MdmsDataRepositoryImpl.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/impl/MdmsDataRepositoryImpl.java new file mode 100644 index 00000000000..ce126197922 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/impl/MdmsDataRepositoryImpl.java @@ -0,0 +1,90 @@ +package org.egov.infra.mdms.repository.impl; + +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; +import org.egov.infra.mdms.config.ApplicationConfig; +import org.egov.infra.mdms.model.Mdms; +import org.egov.infra.mdms.model.MdmsCriteria; +import org.egov.infra.mdms.model.MdmsCriteriaV2; +import org.egov.infra.mdms.model.MdmsRequest; +import org.egov.infra.mdms.producer.Producer; +import org.egov.infra.mdms.repository.MdmsDataRepository; +import org.egov.infra.mdms.repository.querybuilder.MdmsDataQueryBuilder; +import org.egov.infra.mdms.repository.querybuilder.MdmsDataQueryBuilderV2; +import org.egov.infra.mdms.repository.rowmapper.MdmsDataRowMapper; +import org.egov.infra.mdms.repository.rowmapper.MdmsDataRowMapperV2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Repository; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@Repository +@Slf4j +public class MdmsDataRepositoryImpl implements MdmsDataRepository { + + private Producer producer; + private JdbcTemplate jdbcTemplate; + private ApplicationConfig applicationConfig; + private MdmsDataQueryBuilder mdmsDataQueryBuilder; + private MdmsDataQueryBuilderV2 mdmsDataQueryBuilderV2; + private MdmsDataRowMapperV2 mdmsDataRowMapperV2; + private MdmsDataRowMapper mdmsDataRowMapper; + + @Autowired + public MdmsDataRepositoryImpl(Producer producer, JdbcTemplate jdbcTemplate, + ApplicationConfig applicationConfig, MdmsDataQueryBuilder mdmsDataQueryBuilder, + MdmsDataRowMapperV2 mdmsDataRowMapperV2, + MdmsDataQueryBuilderV2 mdmsDataQueryBuilderV2, + MdmsDataRowMapper mdmsDataRowMapper) { + this.producer = producer; + this.jdbcTemplate = jdbcTemplate; + this.applicationConfig = applicationConfig; + this.mdmsDataQueryBuilder = mdmsDataQueryBuilder; + this.mdmsDataRowMapper = mdmsDataRowMapper; + this.mdmsDataRowMapperV2 = mdmsDataRowMapperV2; + this.mdmsDataQueryBuilderV2 = mdmsDataQueryBuilderV2; + } + + /** + * @param mdmsRequest + */ + @Override + public void create(MdmsRequest mdmsRequest) { + producer.push(applicationConfig.getSaveMdmsDataTopicName(), mdmsRequest); + } + + /** + * @param mdmsRequest + */ + @Override + public void update(MdmsRequest mdmsRequest) { + producer.push(applicationConfig.getUpdateMdmsDataTopicName(), mdmsRequest); + } + + /** + * @param mdmsCriteriaV2 + * @return + */ + @Override + public List searchV2(MdmsCriteriaV2 mdmsCriteriaV2) { + List preparedStmtList = new ArrayList<>(); + String query = mdmsDataQueryBuilderV2.getMdmsDataSearchQuery(mdmsCriteriaV2, preparedStmtList); + log.info(query); + return jdbcTemplate.query(query, preparedStmtList.toArray(), mdmsDataRowMapperV2); + } + + /** + * @param mdmsCriteria + * @return + */ + @Override + public Map> search(MdmsCriteria mdmsCriteria) { + List preparedStmtList = new ArrayList<>(); + String query = mdmsDataQueryBuilder.getMdmsDataSearchQuery(mdmsCriteria, preparedStmtList); + log.info(query); + return jdbcTemplate.query(query, preparedStmtList.toArray(), mdmsDataRowMapper); + } +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/impl/SchemaDefinitionDbRepositoryImpl.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/impl/SchemaDefinitionDbRepositoryImpl.java new file mode 100644 index 00000000000..a4f265f25af --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/impl/SchemaDefinitionDbRepositoryImpl.java @@ -0,0 +1,77 @@ +package org.egov.infra.mdms.repository.impl; + +import lombok.extern.slf4j.Slf4j; +import org.egov.infra.mdms.config.ApplicationConfig; +import org.egov.infra.mdms.model.SchemaDefCriteria; +import org.egov.infra.mdms.model.SchemaDefinition; +import org.egov.infra.mdms.model.SchemaDefinitionRequest; +import org.egov.infra.mdms.producer.Producer; +import org.egov.infra.mdms.repository.SchemaDefinitionRepository; +import org.egov.infra.mdms.repository.querybuilder.SchemaDefinitionQueryBuilder; +import org.egov.infra.mdms.repository.rowmapper.SchemaDefinitionRowMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Repository; +import java.util.ArrayList; +import java.util.List; + +@Repository +@Slf4j +public class SchemaDefinitionDbRepositoryImpl implements SchemaDefinitionRepository { + + private Producer producer; + + private JdbcTemplate jdbcTemplate; + + private ApplicationConfig applicationConfig; + + private SchemaDefinitionQueryBuilder schemaDefinitionQueryBuilder; + + private SchemaDefinitionRowMapper rowMapper; + + @Autowired + public SchemaDefinitionDbRepositoryImpl(Producer producer, JdbcTemplate jdbcTemplate, + ApplicationConfig applicationConfig, SchemaDefinitionRowMapper rowMapper, SchemaDefinitionQueryBuilder schemaDefinitionQueryBuilder){ + this.producer = producer; + this.jdbcTemplate = jdbcTemplate; + this.applicationConfig = applicationConfig; + this.rowMapper = rowMapper; + this.schemaDefinitionQueryBuilder = schemaDefinitionQueryBuilder; + } + + + /** + * This method emits schema definition create request on kafka for async persistence + * @param schemaDefinitionRequest + */ + @Override + public void create(SchemaDefinitionRequest schemaDefinitionRequest) { + producer.push(applicationConfig.getSaveSchemaDefinitionTopicName(), schemaDefinitionRequest); + } + + /** + * This method queries the database and returns schema definition search response based on + * the provided criteria. + * @param schemaDefCriteria + */ + @Override + public List search(SchemaDefCriteria schemaDefCriteria) { + List preparedStatementList = new ArrayList<>(); + + // Invoke query builder to generate query based on the provided criteria + String query = schemaDefinitionQueryBuilder.getSchemaSearchQuery(schemaDefCriteria, preparedStatementList); + log.info("Schema definition search query: " + query); + + // Query the database to fetch schema definitions + return jdbcTemplate.query(query, preparedStatementList.toArray(), rowMapper); + } + + /** + * Skeleton method for update as update API has not been implemented + * @param schemaDefinitionRequest + */ + @Override + public void update(SchemaDefinitionRequest schemaDefinitionRequest) { + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/querybuilder/MdmsDataQueryBuilder.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/querybuilder/MdmsDataQueryBuilder.java new file mode 100644 index 00000000000..05c91a10690 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/querybuilder/MdmsDataQueryBuilder.java @@ -0,0 +1,66 @@ +package org.egov.infra.mdms.repository.querybuilder; + +import org.egov.infra.mdms.model.MdmsCriteria; +import org.egov.infra.mdms.utils.QueryUtil; +import org.springframework.stereotype.Component; + +import java.util.*; + +@Component +public class MdmsDataQueryBuilder { + + private static String SEARCH_MDMS_DATA_QUERY = "SELECT data.tenantid, data.uniqueidentifier, data.schemacode, data.data, data.isactive, data.createdby, data.lastmodifiedby, data.createdtime, data.lastmodifiedtime" + + " FROM eg_mdms_data data "; + + private static final String MDMS_DATA_QUERY_ORDER_BY_CLAUSE = " order by data.createdtime desc "; + + /** + * Method to handle request for fetching MDMS data search query + * @param mdmsCriteria + * @param preparedStmtList + * @return + */ + public String getMdmsDataSearchQuery(MdmsCriteria mdmsCriteria, List preparedStmtList) { + String query = buildQuery(mdmsCriteria, preparedStmtList); + query = QueryUtil.addOrderByClause(query, MDMS_DATA_QUERY_ORDER_BY_CLAUSE); + return query; + } + + /** + * Method to build query dynamically based on the criteria passed to the method + * @param mdmsCriteria + * @param preparedStmtList + * @return + */ + private String buildQuery(MdmsCriteria mdmsCriteria, List preparedStmtList) { + StringBuilder builder = new StringBuilder(SEARCH_MDMS_DATA_QUERY); + Map schemaCodeFilterMap = mdmsCriteria.getSchemaCodeFilterMap(); + if (!Objects.isNull(mdmsCriteria.getTenantId())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.tenantid LIKE ? "); + preparedStmtList.add(mdmsCriteria.getTenantId() + "%"); + } + if (!Objects.isNull(mdmsCriteria.getIds())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.id IN ( ").append(QueryUtil.createQuery(mdmsCriteria.getIds().size())).append(" )"); + QueryUtil.addToPreparedStatement(preparedStmtList, mdmsCriteria.getIds()); + } + if (!Objects.isNull(mdmsCriteria.getUniqueIdentifier())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.uniqueidentifier = ? "); + preparedStmtList.add(mdmsCriteria.getUniqueIdentifier()); + } + if (!Objects.isNull(mdmsCriteria.getSchemaCodeFilterMap())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.schemacode IN ( ").append(QueryUtil.createQuery(schemaCodeFilterMap.keySet().size())).append(" )"); + QueryUtil.addToPreparedStatement(preparedStmtList, schemaCodeFilterMap.keySet()); + } + if(!Objects.isNull(mdmsCriteria.getIsActive())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.isactive = ? "); + preparedStmtList.add(mdmsCriteria.getIsActive()); + } + return builder.toString(); + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/querybuilder/MdmsDataQueryBuilderV2.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/querybuilder/MdmsDataQueryBuilderV2.java new file mode 100644 index 00000000000..5985ba44883 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/querybuilder/MdmsDataQueryBuilderV2.java @@ -0,0 +1,104 @@ +package org.egov.infra.mdms.repository.querybuilder; + +import org.egov.infra.mdms.config.ApplicationConfig; +import org.egov.infra.mdms.model.MdmsCriteriaV2; +import org.egov.infra.mdms.utils.QueryUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; + +import java.util.*; + +@Component +public class MdmsDataQueryBuilderV2 { + + @Autowired + private ApplicationConfig config; + + private static final String SEARCH_MDMS_DATA_QUERY = "SELECT data.id, data.tenantid, data.uniqueidentifier, data.schemacode, data.data, data.isactive, data.createdby, data.lastmodifiedby, data.createdtime, data.lastmodifiedtime" + + " FROM eg_mdms_data data "; + + private static final String MDMS_DATA_QUERY_ORDER_BY_CLAUSE = " order by data.createdtime desc "; + + /** + * Method to handle request for fetching MDMS data search query + * @param mdmsCriteriaV2 + * @param preparedStmtList + * @return + */ + public String getMdmsDataSearchQuery(MdmsCriteriaV2 mdmsCriteriaV2, List preparedStmtList) { + String query = buildQuery(mdmsCriteriaV2, preparedStmtList); + query = QueryUtil.addOrderByClause(query, MDMS_DATA_QUERY_ORDER_BY_CLAUSE); + query = getPaginatedQuery(query, mdmsCriteriaV2, preparedStmtList); + return query; + } + + /** + * Method to build query dynamically based on the criteria passed to the method + * @param mdmsCriteriaV2 + * @param preparedStmtList + * @return + */ + private String buildQuery(MdmsCriteriaV2 mdmsCriteriaV2, List preparedStmtList) { + StringBuilder builder = new StringBuilder(SEARCH_MDMS_DATA_QUERY); + Map schemaCodeFilterMap = mdmsCriteriaV2.getSchemaCodeFilterMap(); + if (!Objects.isNull(mdmsCriteriaV2.getTenantId())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.tenantid = ? "); + preparedStmtList.add(mdmsCriteriaV2.getTenantId()); + } + if (!Objects.isNull(mdmsCriteriaV2.getIds())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.id IN ( ").append(QueryUtil.createQuery(mdmsCriteriaV2.getIds().size())).append(" )"); + QueryUtil.addToPreparedStatement(preparedStmtList, mdmsCriteriaV2.getIds()); + } + if (!Objects.isNull(mdmsCriteriaV2.getUniqueIdentifiers())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.uniqueidentifier IN ( ").append(QueryUtil.createQuery(mdmsCriteriaV2.getUniqueIdentifiers().size())).append(" )"); + QueryUtil.addToPreparedStatement(preparedStmtList, mdmsCriteriaV2.getUniqueIdentifiers()); + } + if (!Objects.isNull(mdmsCriteriaV2.getSchemaCodeFilterMap())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.schemacode IN ( ").append(QueryUtil.createQuery(schemaCodeFilterMap.keySet().size())).append(" )"); + QueryUtil.addToPreparedStatement(preparedStmtList, schemaCodeFilterMap.keySet()); + } + if(!Objects.isNull(mdmsCriteriaV2.getSchemaCode())){ + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.schemacode = ? "); + preparedStmtList.add(mdmsCriteriaV2.getSchemaCode()); + } + if(!CollectionUtils.isEmpty(mdmsCriteriaV2.getFilterMap())){ + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.data @> CAST( ? AS jsonb )"); + String partialQueryJsonString = QueryUtil.preparePartialJsonStringFromFilterMap(mdmsCriteriaV2.getFilterMap()); + preparedStmtList.add(partialQueryJsonString); + } + if(!CollectionUtils.isEmpty(mdmsCriteriaV2.getUniqueIdentifiersForRefVerification())){ + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.uniqueidentifier IN ( ").append(QueryUtil.createQuery(mdmsCriteriaV2.getUniqueIdentifiersForRefVerification().size())).append(" )"); + QueryUtil.addToPreparedStatement(preparedStmtList, mdmsCriteriaV2.getUniqueIdentifiersForRefVerification()); + } + if(!Objects.isNull(mdmsCriteriaV2.getIsActive())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" data.isactive = ? "); + preparedStmtList.add(mdmsCriteriaV2.getIsActive()); + } + return builder.toString(); + } + + private String getPaginatedQuery(String query, MdmsCriteriaV2 mdmsCriteriaV2, List preparedStmtList) { + StringBuilder paginatedQuery = new StringBuilder(query); + + // Append offset + paginatedQuery.append(" OFFSET ? "); + preparedStmtList.add(ObjectUtils.isEmpty(mdmsCriteriaV2.getOffset()) ? config.getDefaultOffset() : mdmsCriteriaV2.getOffset()); + + // Append limit + paginatedQuery.append(" LIMIT ? "); + preparedStmtList.add(ObjectUtils.isEmpty(mdmsCriteriaV2.getLimit()) ? config.getDefaultLimit() : mdmsCriteriaV2.getLimit()); + + return paginatedQuery.toString(); + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/querybuilder/SchemaDefinitionQueryBuilder.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/querybuilder/SchemaDefinitionQueryBuilder.java new file mode 100644 index 00000000000..43e29366ba4 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/querybuilder/SchemaDefinitionQueryBuilder.java @@ -0,0 +1,74 @@ +package org.egov.infra.mdms.repository.querybuilder; + +import org.egov.infra.mdms.config.ApplicationConfig; +import org.egov.infra.mdms.model.SchemaDefCriteria; +import org.egov.infra.mdms.utils.QueryUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.ObjectUtils; + +import java.util.*; + +@Component +public class SchemaDefinitionQueryBuilder { + + @Autowired + private ApplicationConfig config; + + private static final String SEARCH_SCHEMA_DEF_QUERY = "SELECT schema.id,schema.tenantid, schema.code, schema.description, schema.definition, schema.isactive, " + + "schema.createdby, schema.lastmodifiedby, schema.createdtime, schema.lastmodifiedtime FROM " + + "eg_mdms_schema_definition schema "; + + private static final String SEARCH_SCHEMA_DEF_ORDER_BY_CLAUSE = " order by schema.createdtime desc "; + + /** + * Method to handle request for fetching schema search query + * @param schemaDefCriteria + * @param preparedStmtList + * @return + */ + public String getSchemaSearchQuery(SchemaDefCriteria schemaDefCriteria, List preparedStmtList) { + String query = buildQuery(schemaDefCriteria, preparedStmtList); + query = QueryUtil.addOrderByClause(query, SEARCH_SCHEMA_DEF_ORDER_BY_CLAUSE); + query = getPaginatedQuery(query, schemaDefCriteria, preparedStmtList); + return query; + } + + /** + * Method to build query dynamically based on the criteria passed to the method + * @param schemaDefCriteria + * @param preparedStmtList + * @return + */ + private String buildQuery(SchemaDefCriteria schemaDefCriteria, List preparedStmtList) { + StringBuilder builder = new StringBuilder(SchemaDefinitionQueryBuilder.SEARCH_SCHEMA_DEF_QUERY); + + if (!Objects.isNull(schemaDefCriteria.getTenantId())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" schema.tenantid = ? "); + preparedStmtList.add(schemaDefCriteria.getTenantId()); + } + if (!Objects.isNull(schemaDefCriteria.getCodes())) { + QueryUtil.addClauseIfRequired(builder, preparedStmtList); + builder.append(" schema.code IN ( ").append(QueryUtil.createQuery(schemaDefCriteria.getCodes().size())).append(" )"); + QueryUtil.addToPreparedStatement(preparedStmtList, new HashSet<>(schemaDefCriteria.getCodes())); + } + + return builder.toString(); + } + + private String getPaginatedQuery(String query, SchemaDefCriteria schemaDefCriteria, List preparedStmtList) { + StringBuilder paginatedQuery = new StringBuilder(query); + + // Append offset + paginatedQuery.append(" OFFSET ? "); + preparedStmtList.add(ObjectUtils.isEmpty(schemaDefCriteria.getOffset()) ? config.getDefaultOffset() : schemaDefCriteria.getOffset()); + + // Append limit + paginatedQuery.append(" LIMIT ? "); + preparedStmtList.add(ObjectUtils.isEmpty(schemaDefCriteria.getLimit()) ? config.getDefaultLimit() : schemaDefCriteria.getLimit()); + + return paginatedQuery.toString(); + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/rowmapper/MdmsDataRowMapper.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/rowmapper/MdmsDataRowMapper.java new file mode 100644 index 00000000000..d5829ac662a --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/rowmapper/MdmsDataRowMapper.java @@ -0,0 +1,70 @@ +package org.egov.infra.mdms.repository.rowmapper; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; +import org.egov.common.contract.models.AuditDetails; +import org.egov.infra.mdms.model.Mdms; +import org.egov.infra.mdms.model.SchemaDefinition; +import static org.egov.infra.mdms.errors.ErrorCodes.*; +import org.egov.tracer.model.CustomException; +import org.postgresql.util.PGobject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataAccessException; +import org.springframework.jdbc.core.ResultSetExtractor; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.*; + +import static java.util.Objects.isNull; + +@Component +@Slf4j +public class MdmsDataRowMapper implements ResultSetExtractor>> { + + @Autowired + private ObjectMapper objectMapper; + + /** + * This method accepts a resultSet and extracts master data in JSONArray format + * and creates a map of schemaCode vs master data + * @param resultSet + * @return + * @throws SQLException + * @throws DataAccessException + */ + @Override + public Map> extractData(ResultSet resultSet) throws SQLException, DataAccessException { + Map> tenantMasterMap = new HashMap<>(); + + while(resultSet.next()){ + JSONArray jsonArray = null; + Map masterMap = new HashMap<>(); + LinkedHashMap data = null; + if( ! isNull(resultSet.getObject("data"))){ + String dataStr = ((PGobject) resultSet.getObject("data")).getValue(); + try { + data = objectMapper.readValue(dataStr, LinkedHashMap.class); + } catch (IOException e) { + throw new CustomException(INVALID_JSON, INVALID_JSON_MSG); + } + } + String schemaCode = resultSet.getString("schemacode"); + String tenantId = resultSet.getString("tenantid"); + jsonArray = tenantMasterMap.getOrDefault(tenantId, new HashMap<>()).getOrDefault(schemaCode, new JSONArray()); + jsonArray.add(data); + masterMap.put(schemaCode, jsonArray); + if(tenantMasterMap.containsKey(tenantId)) { + tenantMasterMap.get(tenantId).put(schemaCode, jsonArray); + } else { + tenantMasterMap.put(tenantId, masterMap); + } + } + + return tenantMasterMap; + } +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/rowmapper/MdmsDataRowMapperV2.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/rowmapper/MdmsDataRowMapperV2.java new file mode 100644 index 00000000000..c1a4d355d2e --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/rowmapper/MdmsDataRowMapperV2.java @@ -0,0 +1,75 @@ +package org.egov.infra.mdms.repository.rowmapper; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.egov.common.contract.models.AuditDetails; +import org.egov.infra.mdms.model.Mdms; +import org.egov.tracer.model.CustomException; +import org.postgresql.util.PGobject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataAccessException; +import org.springframework.jdbc.core.ResultSetExtractor; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import static java.util.Objects.isNull; +import static org.egov.infra.mdms.errors.ErrorCodes.INVALID_JSON; +import static org.egov.infra.mdms.errors.ErrorCodes.INVALID_JSON_MSG; + +@Component +@Slf4j +public class MdmsDataRowMapperV2 implements ResultSetExtractor> { + + @Autowired + private ObjectMapper objectMapper; + + /** + * This method accepts resultSet from the executed search query and extracts data out + * of the result set and maps it into master data POJO + * @param resultSet + * @return + * @throws SQLException + * @throws DataAccessException + */ + @Override + public List extractData(ResultSet resultSet) throws SQLException, DataAccessException { + + List mdmsList = new ArrayList<>(); + + while (resultSet.next()) { + AuditDetails auditDetails = AuditDetails.builder().createdBy(resultSet.getString("createdby")). + createdTime(resultSet.getLong("createdtime")). + lastModifiedBy(resultSet.getString("lastmodifiedby")). + lastModifiedTime(resultSet.getLong("lastmodifiedtime")).build(); + + JsonNode data = null; + if (!isNull(resultSet.getObject("data"))) { + String dataStr = ((PGobject) resultSet.getObject("data")).getValue(); + try { + data = objectMapper.readTree(dataStr); + } catch (IOException e) { + throw new CustomException(INVALID_JSON, INVALID_JSON_MSG); + } + } + + Mdms mdms = Mdms.builder() + .id(resultSet.getString("id")) + .tenantId(resultSet.getString("tenantid")) + .schemaCode(resultSet.getString("schemacode")) + .uniqueIdentifier(resultSet.getString("uniqueidentifier")) + .data(data) + .isActive(resultSet.getBoolean("isactive")) + .auditDetails(auditDetails).build(); + + mdmsList.add(mdms); + } + + return mdmsList; + } +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/rowmapper/SchemaDefinitionRowMapper.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/rowmapper/SchemaDefinitionRowMapper.java new file mode 100644 index 00000000000..b2a3f947c7f --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/repository/rowmapper/SchemaDefinitionRowMapper.java @@ -0,0 +1,78 @@ +package org.egov.infra.mdms.repository.rowmapper; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.egov.common.contract.models.AuditDetails; +import org.egov.infra.mdms.model.SchemaDefinition; +import org.egov.tracer.model.CustomException; +import org.postgresql.util.PGobject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataAccessException; +import org.springframework.jdbc.core.ResultSetExtractor; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@Component +public class SchemaDefinitionRowMapper implements ResultSetExtractor> { + + @Autowired + private ObjectMapper objectMapper; + + /** + * This method accepts resultSet from query execution, extracts the respective fields + * and maps it into SchemaDefinition POJO. + * @param resultSet + * @return + * @throws SQLException + * @throws DataAccessException + */ + @Override + public List extractData(ResultSet resultSet) throws SQLException, DataAccessException { + List schemaDefinitions = new ArrayList<>(); + while(resultSet.next()){ + + AuditDetails auditDetails = AuditDetails.builder().createdBy(resultSet.getString("createdby")). + createdTime(resultSet.getLong("createdtime")). + lastModifiedBy(resultSet.getString("lastmodifiedby")). + lastModifiedTime(resultSet.getLong("lastmodifiedtime")).build(); + + SchemaDefinition schemaDefinition = SchemaDefinition.builder() + .tenantId(resultSet.getString("tenantid")) + .id(resultSet.getString("id")) + .code(resultSet.getString("code")) + .description(resultSet.getString("description")) + .definition(getJsonValue((PGobject) resultSet.getObject("definition"))) + .isActive(resultSet.getBoolean("isactive")) + .auditDetails(auditDetails) + .build(); + + schemaDefinitions.add(schemaDefinition); + } + + return schemaDefinitions; + } + + /** + * This method accepts a PGobject and converts it into JsonNode. + * @param pGobject + * @return + */ + private JsonNode getJsonValue(PGobject pGobject) { + try { + if (Objects.isNull(pGobject) || Objects.isNull(pGobject.getValue())) + return null; + else + return objectMapper.readTree(pGobject.getValue()); + } catch (IOException e) { + throw new CustomException("SERVER_ERROR", "Exception occurred while parsing the additionalDetail json : " + e + .getMessage()); + } + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/MDMSService.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/MDMSService.java new file mode 100644 index 00000000000..227e8f629b2 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/MDMSService.java @@ -0,0 +1,150 @@ +package org.egov.infra.mdms.service; + +import java.util.*; + +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.jayway.jsonpath.JsonPath; +import org.egov.common.utils.MultiStateInstanceUtil; +import org.egov.infra.mdms.model.*; +import org.egov.infra.mdms.repository.MdmsDataRepository; +import org.egov.infra.mdms.service.enrichment.MdmsDataEnricher; +import org.egov.infra.mdms.service.validator.MdmsDataValidator; +import org.egov.infra.mdms.utils.FallbackUtil; +import org.egov.infra.mdms.utils.SchemaUtil; +import org.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; +import org.springframework.util.ObjectUtils; + +import static org.egov.infra.mdms.utils.MDMSConstants.*; + +@Service +@Slf4j +public class MDMSService { + + private MdmsDataValidator mdmsDataValidator; + + private MdmsDataEnricher mdmsDataEnricher; + + private MdmsDataRepository mdmsDataRepository; + + private SchemaUtil schemaUtil; + + private MultiStateInstanceUtil multiStateInstanceUtil; + + @Autowired + public MDMSService(MdmsDataValidator mdmsDataValidator, MdmsDataEnricher mdmsDataEnricher, + MdmsDataRepository mdmsDataRepository, SchemaUtil schemaUtil, MultiStateInstanceUtil multiStateInstanceUtil) { + this.mdmsDataValidator = mdmsDataValidator; + this.mdmsDataEnricher = mdmsDataEnricher; + this.mdmsDataRepository = mdmsDataRepository; + this.schemaUtil = schemaUtil; + this.multiStateInstanceUtil = multiStateInstanceUtil; + } + + /** + * This method processes the requests that come for master data creation. + * @param mdmsRequest + * @return + */ + public List create(MdmsRequest mdmsRequest) { + + // Fetch schema against which data is getting created + JSONObject schemaObject = schemaUtil.getSchema(mdmsRequest); + + // Validate incoming request + mdmsDataValidator.validateCreateRequest(mdmsRequest, schemaObject); + + // Enrich incoming request + mdmsDataEnricher.enrichCreateRequest(mdmsRequest, schemaObject); + + // Emit mdms creation request event + mdmsDataRepository.create(mdmsRequest); + + return Arrays.asList(mdmsRequest.getMdms()); + } + + /** + * This method processes the requests that come for master data search. + * @param mdmsCriteriaReq + * @return + */ + public Map> search(MdmsCriteriaReq mdmsCriteriaReq) { + Map> tenantMasterMap = new HashMap<>(); + + /* + * Set incoming tenantId as state level tenantId for fallback in case master data for + * concrete tenantId does not exist. + */ + String tenantId = new StringBuilder(mdmsCriteriaReq.getMdmsCriteria().getTenantId()).toString(); + mdmsCriteriaReq.getMdmsCriteria().setTenantId(multiStateInstanceUtil.getStateLevelTenant(tenantId)); + + Map schemaCodes = getSchemaCodes(mdmsCriteriaReq.getMdmsCriteria()); + mdmsCriteriaReq.getMdmsCriteria().setSchemaCodeFilterMap(schemaCodes); + + // Make a call to the repository layer to fetch data as per given criteria + tenantMasterMap = mdmsDataRepository.search(mdmsCriteriaReq.getMdmsCriteria()); + + // Apply filters to incoming data + tenantMasterMap = applyFilterToData(tenantMasterMap, mdmsCriteriaReq.getMdmsCriteria().getSchemaCodeFilterMap()); + + // Perform fallback + Map masterDataMap = FallbackUtil.backTrackTenantMasterDataMap(tenantMasterMap, tenantId); + + // Return response in MDMS v1 search response format for backward compatibility + return getModuleMasterMap(masterDataMap); + } + + private Map> applyFilterToData(Map> tenantMasterMap, Map schemaCodeFilterMap) { + Map> tenantMasterMapPostFiltering = new HashMap<>(); + + tenantMasterMap.keySet().forEach(tenantId -> { + Map schemaCodeVsFilteredMasters = new HashMap<>(); + tenantMasterMap.get(tenantId).keySet().forEach(schemaCode -> { + JSONArray masters = tenantMasterMap.get(tenantId).get(schemaCode); + if(!ObjectUtils.isEmpty(schemaCodeFilterMap.get(schemaCode))) { + schemaCodeVsFilteredMasters.put(schemaCode, filterMasters(masters, schemaCodeFilterMap.get(schemaCode))); + } else { + schemaCodeVsFilteredMasters.put(schemaCode, masters); + } + }); + tenantMasterMapPostFiltering.put(tenantId, schemaCodeVsFilteredMasters); + }); + + return tenantMasterMapPostFiltering; + } + + private JSONArray filterMasters(JSONArray masters, String filterExp) { + JSONArray filteredMasters = JsonPath.read(masters, filterExp); + return filteredMasters; + } + + private Map> getModuleMasterMap(Map masterMap) { + Map> moduleMasterMap = new HashMap<>(); + + for (Map.Entry entry : masterMap.entrySet()) { + String[] moduleMaster = entry.getKey().split(DOT_REGEX); + String moduleName = moduleMaster[0]; + String masterName = moduleMaster[1]; + + moduleMasterMap.computeIfAbsent(moduleName, k -> new HashMap<>()) + .put(masterName, entry.getValue()); + } + return moduleMasterMap; + } + + private Map getSchemaCodes(MdmsCriteria mdmsCriteria) { + Map schemaCodesFilterMap = new HashMap<>(); + for (ModuleDetail moduleDetail : mdmsCriteria.getModuleDetails()) { + for (MasterDetail masterDetail : moduleDetail.getMasterDetails()) { + String key = moduleDetail.getModuleName().concat(DOT_SEPARATOR).concat(masterDetail.getName()); + String value = masterDetail.getFilter(); + schemaCodesFilterMap.put(key, value); + } + } + return schemaCodesFilterMap; + } +} \ No newline at end of file diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/MDMSServiceV2.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/MDMSServiceV2.java new file mode 100644 index 00000000000..4c77ec4ee4c --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/MDMSServiceV2.java @@ -0,0 +1,116 @@ +package org.egov.infra.mdms.service; + +import lombok.extern.slf4j.Slf4j; +import org.egov.common.utils.MultiStateInstanceUtil; +import org.egov.infra.mdms.model.*; +import org.egov.infra.mdms.repository.MdmsDataRepository; +import org.egov.infra.mdms.service.enrichment.MdmsDataEnricher; +import org.egov.infra.mdms.service.validator.MdmsDataValidator; +import org.egov.infra.mdms.utils.FallbackUtil; +import org.egov.infra.mdms.utils.SchemaUtil; +import org.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@Slf4j +@Service +public class MDMSServiceV2 { + + private MdmsDataValidator mdmsDataValidator; + + private MdmsDataEnricher mdmsDataEnricher; + + private MdmsDataRepository mdmsDataRepository; + + private SchemaUtil schemaUtil; + + private MultiStateInstanceUtil multiStateInstanceUtil; + + @Autowired + public MDMSServiceV2(MdmsDataValidator mdmsDataValidator, MdmsDataEnricher mdmsDataEnricher, + MdmsDataRepository mdmsDataRepository, SchemaUtil schemaUtil, MultiStateInstanceUtil multiStateInstanceUtil) { + this.mdmsDataValidator = mdmsDataValidator; + this.mdmsDataEnricher = mdmsDataEnricher; + this.mdmsDataRepository = mdmsDataRepository; + this.schemaUtil = schemaUtil; + this.multiStateInstanceUtil = multiStateInstanceUtil; + } + + /** + * This method processes the requests that come for master data creation. + * @param mdmsRequest + * @return + */ + public List create(MdmsRequest mdmsRequest) { + + // Fetch schema against which data is getting created + JSONObject schemaObject = schemaUtil.getSchema(mdmsRequest); + + // Perform validations on incoming request + mdmsDataValidator.validateCreateRequest(mdmsRequest, schemaObject); + + // Enrich incoming master data + mdmsDataEnricher.enrichCreateRequest(mdmsRequest, schemaObject); + + // Emit MDMS create event to be listened by persister + mdmsDataRepository.create(mdmsRequest); + + return Arrays.asList(mdmsRequest.getMdms()); + } + + /** + * This method processes the requests that come for master data search. + * @param mdmsCriteriaReqV2 + * @return + */ + public List search(MdmsCriteriaReqV2 mdmsCriteriaReqV2) { + + /* + * Set incoming tenantId as state level tenantId for fallback in case master data for + * concrete tenantId does not exist. + */ + String tenantId = mdmsCriteriaReqV2.getMdmsCriteria().getTenantId(); + + List masterDataList = new ArrayList<>(); + List subTenantListForFallback = FallbackUtil.getSubTenantListForFallBack(tenantId); + + // Make a call to repository and get list of master data + for(String subTenantId : subTenantListForFallback) { + mdmsCriteriaReqV2.getMdmsCriteria().setTenantId(subTenantId); + masterDataList = mdmsDataRepository.searchV2(mdmsCriteriaReqV2.getMdmsCriteria()); + + if(!CollectionUtils.isEmpty(masterDataList)) + break; + } + + return masterDataList; + } + + /** + * This method processes the requests that come for master data update. + * @param mdmsRequest + * @return + */ + public List update(MdmsRequest mdmsRequest) { + + // Fetch schema against which data is getting created + JSONObject schemaObject = schemaUtil.getSchema(mdmsRequest); + + // Validate master data update request + mdmsDataValidator.validateUpdateRequest(mdmsRequest, schemaObject); + + // Enrich master data update request + mdmsDataEnricher.enrichUpdateRequest(mdmsRequest); + + // Emit MDMS update event to be listened by persister + mdmsDataRepository.update(mdmsRequest); + + return Arrays.asList(mdmsRequest.getMdms()); + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/SchemaDefinitionService.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/SchemaDefinitionService.java new file mode 100644 index 00000000000..dbde2ff784e --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/SchemaDefinitionService.java @@ -0,0 +1,78 @@ +package org.egov.infra.mdms.service; + +import lombok.Builder; +import lombok.extern.slf4j.Slf4j; +import org.egov.common.utils.MultiStateInstanceUtil; +import org.egov.infra.mdms.config.ApplicationConfig; +import org.egov.infra.mdms.model.*; +import org.egov.infra.mdms.repository.SchemaDefinitionRepository; +import org.egov.infra.mdms.service.enrichment.SchemaDefinitionEnricher; +import org.egov.infra.mdms.service.validator.SchemaDefinitionValidator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; + +@Service +@Builder +@Slf4j +public class SchemaDefinitionService { + + private SchemaDefinitionRepository schemaDefinitionRepository; + private ApplicationConfig applicationConfig; + private SchemaDefinitionEnricher schemaDefinitionEnricher; + private SchemaDefinitionValidator schemaDefinitionValidator; + private MultiStateInstanceUtil multiStateInstanceUtil; + + @Autowired + public SchemaDefinitionService(SchemaDefinitionRepository schemaDefinitionRepository, ApplicationConfig applicationConfig, + SchemaDefinitionEnricher schemaDefinitionEnricher, SchemaDefinitionValidator schemaDefinitionValidator, MultiStateInstanceUtil multiStateInstanceUtil){ + this.schemaDefinitionRepository = schemaDefinitionRepository; + this.applicationConfig = applicationConfig; + this.schemaDefinitionEnricher = schemaDefinitionEnricher; + this.schemaDefinitionValidator = schemaDefinitionValidator; + this.multiStateInstanceUtil = multiStateInstanceUtil; + } + + /** + * This method processes requests for schema definition creation. + * @param schemaDefinitionRequest + * @return + */ + public List create(SchemaDefinitionRequest schemaDefinitionRequest) { + + // Set incoming tenantId as state level tenantId as schema is always created at state level + String tenantId = schemaDefinitionRequest.getSchemaDefinition().getTenantId(); + schemaDefinitionRequest.getSchemaDefinition().setTenantId(multiStateInstanceUtil.getStateLevelTenant(tenantId)); + + // Validate schema create request + schemaDefinitionValidator.validateCreateRequest(schemaDefinitionRequest); + + // Enrich schema create request + schemaDefinitionEnricher.enrichCreateRequest(schemaDefinitionRequest); + + // Invoke repository method to emit schema creation event + schemaDefinitionRepository.create(schemaDefinitionRequest); + + return Arrays.asList(schemaDefinitionRequest.getSchemaDefinition()); + } + + /** + * This method processes the requests for schema definition search. + * @param schemaDefSearchRequest + * @return + */ + public List search(SchemaDefSearchRequest schemaDefSearchRequest) { + + // Set incoming tenantId as state level tenantId as schema is created at state level + String tenantId = schemaDefSearchRequest.getSchemaDefCriteria().getTenantId(); + schemaDefSearchRequest.getSchemaDefCriteria().setTenantId(multiStateInstanceUtil.getStateLevelTenant(tenantId)); + + // Fetch schema definitions based on the given criteria + List schemaDefinitions = schemaDefinitionRepository.search(schemaDefSearchRequest.getSchemaDefCriteria()); + + return schemaDefinitions; + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/enrichment/MdmsDataEnricher.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/enrichment/MdmsDataEnricher.java new file mode 100644 index 00000000000..bc20d3a8924 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/enrichment/MdmsDataEnricher.java @@ -0,0 +1,50 @@ +package org.egov.infra.mdms.service.enrichment; + +import org.egov.common.contract.models.AuditDetails; +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.utils.AuditDetailsEnrichmentUtil; +import org.egov.common.utils.UUIDEnrichmentUtil; +import org.egov.infra.mdms.model.Mdms; +import org.egov.infra.mdms.model.MdmsRequest; +import org.egov.infra.mdms.utils.CompositeUniqueIdentifierGenerationUtil; +import org.egov.tracer.model.CustomException; +import org.json.JSONObject; +import org.springframework.stereotype.Component; +import org.springframework.util.ObjectUtils; + +@Component +public class MdmsDataEnricher { + + public void enrichCreateRequest(MdmsRequest mdmsRequest, JSONObject schemaObject) { + Mdms mdms = mdmsRequest.getMdms(); + UUIDEnrichmentUtil.enrichRandomUuid(mdms, "id"); + mdms.setAuditDetails(AuditDetailsEnrichmentUtil.prepareAuditDetails(mdms.getAuditDetails(), mdmsRequest.getRequestInfo(), Boolean.TRUE)); + mdms.setUniqueIdentifier(CompositeUniqueIdentifierGenerationUtil.getUniqueIdentifier(schemaObject, mdmsRequest)); + } + + public AuditDetails getAuditDetails(RequestInfo requestInfo, AuditDetails auditDetails, Boolean isCreateRequest) { + if(isCreateRequest) { + auditDetails = AuditDetails.builder().createdBy(requestInfo.getUserInfo().getUuid()). + createdTime(System.currentTimeMillis()).lastModifiedBy(requestInfo.getUserInfo().getUuid()). + lastModifiedTime(System.currentTimeMillis()).build(); + } else { + if(auditDetails != null) { + auditDetails = AuditDetails.builder().createdBy(auditDetails.getCreatedBy()). + createdTime(auditDetails.getCreatedTime()).lastModifiedBy(requestInfo.getUserInfo().getUuid()). + lastModifiedTime(System.currentTimeMillis()).build(); + } else { + throw new CustomException("AUDIT_DETAILS_NULL_FOR_UPDATE_REQ","Audit details can not be null for update request"); + } + } + return auditDetails; + } + + public void enrichUpdateRequest(MdmsRequest mdmsRequest) { + Mdms mdms = mdmsRequest.getMdms(); + + if(ObjectUtils.isEmpty(mdms.getAuditDetails())) + throw new CustomException("AUDIT_DETAILS_ABSENT_ERR", "Audit details cannot be absent for update request"); + + mdms.setAuditDetails(getAuditDetails(mdmsRequest.getRequestInfo(), mdms.getAuditDetails(), Boolean.FALSE)); + } +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/enrichment/SchemaDefinitionEnricher.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/enrichment/SchemaDefinitionEnricher.java new file mode 100644 index 00000000000..9d2c12dd9cd --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/enrichment/SchemaDefinitionEnricher.java @@ -0,0 +1,48 @@ +package org.egov.infra.mdms.service.enrichment; + +import org.egov.common.contract.models.AuditDetails; +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.utils.AuditDetailsEnrichmentUtil; +import org.egov.common.utils.UUIDEnrichmentUtil; +import org.egov.infra.mdms.model.SchemaDefinition; +import org.egov.infra.mdms.model.SchemaDefinitionRequest; +import org.egov.tracer.model.CustomException; +import org.springframework.stereotype.Component; + +import java.util.UUID; + +@Component +public class SchemaDefinitionEnricher { + + /** + * This method enriches schemaDefinitionRequest + * @param schemaDefinitionRequest + */ + public void enrichCreateRequest(SchemaDefinitionRequest schemaDefinitionRequest) { + SchemaDefinition schemaDefinition = schemaDefinitionRequest.getSchemaDefinition(); + + // Invoke enrichment of uuid on id field of schemaDefinition + UUIDEnrichmentUtil.enrichRandomUuid(schemaDefinition, "id"); + + // Populate auditDetails + schemaDefinition.setAuditDetails(getAuditDetail(schemaDefinitionRequest.getRequestInfo(),schemaDefinition.getAuditDetails(), true)); + } + + public AuditDetails getAuditDetail(RequestInfo requestInfo, AuditDetails auditDetails, Boolean isCreateRequest) { + if(isCreateRequest) { + auditDetails = AuditDetails.builder().createdBy(requestInfo.getUserInfo().getUuid()). + createdTime(System.currentTimeMillis()).lastModifiedBy(requestInfo.getUserInfo().getUuid()). + lastModifiedTime(System.currentTimeMillis()).build(); + } else { + if(auditDetails != null ) { + auditDetails = AuditDetails.builder().createdBy(auditDetails.getCreatedBy()). + createdTime(auditDetails.getCreatedTime()).lastModifiedBy(requestInfo.getUserInfo().getUuid()). + lastModifiedTime(System.currentTimeMillis()).build(); + } else { + throw new CustomException("AUDIT_DETAILS_NULL_FOR_UPDATE_REQ","Audit details can not be null for update request"); + } + } + return auditDetails; + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/validator/MdmsDataValidator.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/validator/MdmsDataValidator.java new file mode 100644 index 00000000000..52186b61cf3 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/validator/MdmsDataValidator.java @@ -0,0 +1,252 @@ +package org.egov.infra.mdms.service.validator; + +import com.fasterxml.jackson.databind.JsonNode; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.TypeRef; +import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONArray; +import org.egov.infra.mdms.model.*; +import org.egov.infra.mdms.repository.MdmsDataRepository; +import org.egov.infra.mdms.service.SchemaDefinitionService; +import org.egov.infra.mdms.utils.CompositeUniqueIdentifierGenerationUtil; +import org.egov.infra.mdms.utils.ErrorUtil; +import org.egov.infra.mdms.utils.FallbackUtil; +import org.egov.tracer.model.CustomException; +import org.everit.json.schema.Schema; +import org.everit.json.schema.ValidationException; +import org.everit.json.schema.loader.SchemaLoader; +import org.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.ObjectUtils; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.IntStream; +import java.util.stream.StreamSupport; + +import static org.egov.infra.mdms.utils.MDMSConstants.*; + +@Component +@Slf4j +public class MdmsDataValidator { + + private final SchemaDefinitionService schemaDefinitionService; + + private final MdmsDataRepository mdmsDataRepository; + + @Autowired + public MdmsDataValidator(SchemaDefinitionService schemaDefinitionService, MdmsDataRepository mdmsDataRepository) { + this.schemaDefinitionService = schemaDefinitionService; + this.mdmsDataRepository = mdmsDataRepository; + } + + /** + * This method performs business validations on create master data request. + * @param mdmsRequest + * @param schemaObject + */ + public void validateCreateRequest(MdmsRequest mdmsRequest, JSONObject schemaObject) { + // Initialize error map and fetch schema + Map errors = new HashMap<>(); + + // Validations are performed here on the incoming data + validateDataWithSchemaDefinition(mdmsRequest, schemaObject, errors); + checkDuplicate(schemaObject, mdmsRequest); + validateReference(schemaObject, mdmsRequest.getMdms()); + + // Throw validation errors + ErrorUtil.throwCustomExceptions(errors); + } + + /** + * This method validates the incoming master data against the schema for which the master + * data is being created and populates violations(if any) in errors map. + * @param mdmsRequest + * @param schemaObject + * @param errors + */ + private void validateDataWithSchemaDefinition(MdmsRequest mdmsRequest, JSONObject schemaObject,Map errors) { + try { + // Load incoming master data as a json object + JSONObject dataObject = new JSONObject(mdmsRequest.getMdms().getData().toString()); + + // Load schema + Schema schema = SchemaLoader.load(schemaObject); + + // Validate data against the schema + schema.validate(dataObject); + } catch (ValidationException e) { + // Populate errors map for all the validation errors + Integer count = 0; + if (!e.getCausingExceptions().isEmpty()) { + for (ValidationException validationException : e.getCausingExceptions()) { + ++count; + errors.put("INVALID_REQUEST_".concat(validationException.getKeyword().toUpperCase()).concat(count.toString()), validationException.getErrorMessage()); + } + } else { + errors.put("INVALID_REQUEST", e.getErrorMessage()); + } + } catch (Exception e) { + throw new CustomException("MASTER_DATA_VALIDATION_ERR", "An unknown error occurred while validating provided master data against the schema - " + e.getMessage()); + } + } + + /** + * This method checks whether the master data which is being created already + * exists in the database or not. + * @param schemaObject + * @param mdmsRequest + */ + private void checkDuplicate(JSONObject schemaObject, MdmsRequest mdmsRequest) { + // Get the uniqueIdentifier for the incoming master data request + String uniqueIdentifier = CompositeUniqueIdentifierGenerationUtil.getUniqueIdentifier(schemaObject, mdmsRequest); + + // Fetch master data + List masterData = fetchMasterData(MdmsCriteriaV2.builder() + .tenantId(mdmsRequest.getMdms().getTenantId()) + .uniqueIdentifiers(Collections.singleton(uniqueIdentifier)) + .schemaCode(mdmsRequest.getMdms().getSchemaCode()) + .isActive(Boolean.TRUE) + .build()); + + // Throw error if the provided master data already exists + if (masterData != null && masterData.size() != 0) { + throw new CustomException("DUPLICATE_RECORD", "Duplicate record"); + } + + } + + /** + * This method fetches master data from the database depending on the criteria + * being passed. + * @param mdmsCriteria + * @return + */ + private List fetchMasterData(MdmsCriteriaV2 mdmsCriteria) { + // Make a call to the repository to check if the provided master data already exists + List moduleMasterData = mdmsDataRepository.searchV2(mdmsCriteria); + + return moduleMasterData; + + } + + /** + * This method validates whether the provided reference exists in the database. + * @param schemaObject + * @param mdms + */ + private void validateReference(JSONObject schemaObject, Mdms mdms) { + if (schemaObject.has(X_REFERENCE_SCHEMA_KEY)) { + org.json.JSONArray referenceSchema = (org.json.JSONArray) schemaObject.get(X_REFERENCE_SCHEMA_KEY); + + if (referenceSchema != null && referenceSchema.length() > 0) { + JsonNode mdmsData = mdms.getData(); + + IntStream.range(0, referenceSchema.length()).forEach(i -> { + Set uniqueIdentifiersForRefVerification = new HashSet<>(); + + JSONObject jsonObject = referenceSchema.getJSONObject(i); + String refFieldPath = jsonObject.getString(FIELD_PATH_KEY); + String schemaCode = jsonObject.getString(SCHEMA_CODE_KEY); + Object refResult = JsonPath.read(mdmsData.toString(), CompositeUniqueIdentifierGenerationUtil.getJsonPathExpressionFromDotSeparatedPath(refFieldPath)); + + addTypeCastedUniqueIdentifiersToVerificationSet(refResult, uniqueIdentifiersForRefVerification); + List subTenantListForFallback = FallbackUtil.getSubTenantListForFallBack(mdms.getTenantId()); + + Boolean isRefDataFound = Boolean.FALSE; + + for(String subTenant : subTenantListForFallback) { + List moduleMasterData = mdmsDataRepository.searchV2( + MdmsCriteriaV2.builder().tenantId(subTenant).uniqueIdentifiersForRefVerification(uniqueIdentifiersForRefVerification).schemaCode(schemaCode).build()); + + if (moduleMasterData.size() == uniqueIdentifiersForRefVerification.size()) { + isRefDataFound = Boolean.TRUE; + break; + } + } + + if(!isRefDataFound) { + throw new CustomException("REFERENCE_VALIDATION_ERR", "Provided reference value does not exist in database"); + } + + }); + } + } + } + + /** + * This method takes the reference object provided in the data create request, type casts it into String + * and adds it to the uniqueIdentifiers set for performing search. + * @param refResult + * @param uniqueIdentifiersForRefVerification + */ + private void addTypeCastedUniqueIdentifiersToVerificationSet(Object refResult, Set uniqueIdentifiersForRefVerification) { + if (refResult instanceof String) { + uniqueIdentifiersForRefVerification.add((String) refResult); + } else if(refResult instanceof Number){ + uniqueIdentifiersForRefVerification.add(String.valueOf(refResult)); + } else if (refResult instanceof List) { + uniqueIdentifiersForRefVerification.addAll((Collection) refResult); + } else { + throw new CustomException("REFERENCE_VALIDATION_ERR", "Reference must only be of the type string, number or a list of strings/numbers"); + } + } + + /** + * This method performs business validations on create master data request. + * @param mdmsRequest + * @param schemaObject + */ + public void validateUpdateRequest(MdmsRequest mdmsRequest, JSONObject schemaObject) { + // Initialize error map and fetch schema + Map errors = new HashMap<>(); + + // Validations are performed here on the incoming data + String uniqueIdentifierOfExistingRecord = fetchUniqueIdentifier(mdmsRequest); + validateIfUniqueFieldsAreNotBeingUpdated(uniqueIdentifierOfExistingRecord, CompositeUniqueIdentifierGenerationUtil.getUniqueIdentifier(schemaObject, mdmsRequest)); + validateDataWithSchemaDefinition(mdmsRequest, schemaObject, errors); + validateReference(schemaObject, mdmsRequest.getMdms()); + + // Throw validation errors + ErrorUtil.throwCustomExceptions(errors); + + } + + /** + * This method validates if any fields defined under unique field list are being updated. + * @param uniqueIdentifierOfExistingRecord + * @param uniqueIdentifier + */ + private void validateIfUniqueFieldsAreNotBeingUpdated(String uniqueIdentifierOfExistingRecord, String uniqueIdentifier) { + if(!uniqueIdentifierOfExistingRecord.equalsIgnoreCase(uniqueIdentifier)) { + throw new CustomException("UNIQUE_KEY_UPDATE_ERR", "Updating fields defined as unique is not allowed."); + } + } + + /** + * This method checks if the master that is being created already exists or not. + * @param mdmsRequest + * @return + */ + private String fetchUniqueIdentifier(MdmsRequest mdmsRequest) { + if(ObjectUtils.isEmpty(mdmsRequest.getMdms().getId())) + throw new CustomException("MASTER_DATA_ID_ABSENT_ERR", "Providing master data id is mandatory for update operation."); + + Set idForSearch = new HashSet<>(); + idForSearch.add(mdmsRequest.getMdms().getId()); + + // Fetch master data from database + List masterData = fetchMasterData(MdmsCriteriaV2.builder() + .tenantId(mdmsRequest.getMdms().getTenantId()) + .ids(idForSearch) + .build()); + + // Throw error if the provided master data does not exist + if (masterData == null || masterData.size() == 0) { + throw new CustomException("MASTER_DATA_NOT_FOUND", "Master data not found for update operation."); + } // Return unique identifier if the master data exists + else { + return masterData.get(0).getUniqueIdentifier(); + } + } +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/validator/SchemaDefinitionValidator.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/validator/SchemaDefinitionValidator.java new file mode 100644 index 00000000000..c7fa9c8e44a --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/service/validator/SchemaDefinitionValidator.java @@ -0,0 +1,99 @@ +package org.egov.infra.mdms.service.validator; + +import com.fasterxml.jackson.databind.JsonNode; +import org.egov.common.contract.request.RequestInfo; +import org.egov.infra.mdms.model.*; +import org.egov.infra.mdms.repository.SchemaDefinitionRepository; +import static org.egov.infra.mdms.errors.ErrorCodes.*; +import static org.egov.infra.mdms.utils.MDMSConstants.*; +import org.egov.infra.mdms.utils.ErrorUtil; +import org.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import java.util.*; + +@Component +public class SchemaDefinitionValidator { + + private SchemaDefinitionRepository schemaDefinitionRepository; + + @Autowired + public SchemaDefinitionValidator(SchemaDefinitionRepository schemaDefinitionRepository) { + this.schemaDefinitionRepository = schemaDefinitionRepository; + } + + /** + * This method performs business validations on schemaDefinitionRequest. + * @param schemaDefinitionRequest + */ + public void validateCreateRequest(SchemaDefinitionRequest schemaDefinitionRequest) { + + SchemaDefinition schemaDefinition = schemaDefinitionRequest.getSchemaDefinition(); + Map errors = new HashMap<>(); + + // Validate schema attributes + validateSchemaAttributes(schemaDefinition.getDefinition(), errors); + + // Check schema code uniqueness + checkSchemaCode(schemaDefinition.getTenantId(), Arrays.asList(schemaDefinition.getCode()), errors); + + // Throw errors if any + ErrorUtil.throwCustomExceptions(errors); + } + + /** + * This method performs validations on the schema definition attributes namely - + * 1. validate that required fields list is not empty + * 2. validate that unique fields list is not empty + * 3. validate that list of unique attributes is a subset of list of required attributes + * @param definition + * @param errorMap + */ + private void validateSchemaAttributes(JsonNode definition, Map errorMap) { + JSONObject schemaObject = new JSONObject(definition.toString()); + + // Check if the incoming schema definition has "required" key and at least one value against it + if(!schemaObject.has(REQUIRED_KEY) || ((org.json.JSONArray) schemaObject.get(REQUIRED_KEY)).length() == 0){ + errorMap.put(REQUIRED_ATTRIBUTE_LIST_ERR_CODE, REQUIRED_ATTRIBUTE_LIST_EMPTY_MSG); + } + + // Check if the incoming schema definition has "x-unique" key and at least one value against it + if(!schemaObject.has(X_UNIQUE_KEY) || ((org.json.JSONArray) schemaObject.get(X_UNIQUE_KEY)).length() == 0) { + errorMap.put(UNIQUE_ATTRIBUTE_LIST_ERR_CODE, UNIQUE_ATTRIBUTE_LIST_EMPTY_MSG); + } + + // Perform further validations iff both "required" and "x-unique" keys are present + if(CollectionUtils.isEmpty(errorMap)) { + List requiredAttributesList = ((org.json.JSONArray) schemaObject.get(REQUIRED_KEY)).toList(); + + List uniqueAttributesList = ((org.json.JSONArray) schemaObject.get(X_UNIQUE_KEY)).toList(); + + // Check if values against unique attributes are a subset of required fields + if (uniqueAttributesList.size() > requiredAttributesList.size() || !requiredAttributesList.containsAll(uniqueAttributesList)) { + errorMap.put(UNIQUE_ATTRIBUTE_LIST_ERR_CODE, UNIQUE_ATTRIBUTE_LIST_INVALID_MSG); + } + } + } + + /** + * This method checks whether a schema definition with the provided tenantId and code already exists. + * @param tenantId + * @param codes + * @param errorMap + */ + private void checkSchemaCode(String tenantId, List codes, Map errorMap) { + + // Build schema definition search criteria + SchemaDefCriteria schemaDefCriteria = SchemaDefCriteria.builder().tenantId(tenantId).codes(codes).build(); + + // Search for schema definitions with the incoming tenantId and codes + List schemaDefinitions = schemaDefinitionRepository.search(schemaDefCriteria); + + // If schema definition already exists for tenantId and code combination, populate error map + if(!schemaDefinitions.isEmpty()){ + errorMap.put(DUPLICATE_SCHEMA_CODE, DUPLICATE_SCHEMA_CODE_MSG); + } + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/CompositeUniqueIdentifierGenerationUtil.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/CompositeUniqueIdentifierGenerationUtil.java new file mode 100644 index 00000000000..cad46a2f946 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/CompositeUniqueIdentifierGenerationUtil.java @@ -0,0 +1,65 @@ +package org.egov.infra.mdms.utils; + +import com.fasterxml.jackson.databind.JsonNode; +import org.egov.infra.mdms.model.MdmsRequest; +import org.egov.tracer.model.CustomException; +import org.json.JSONObject; +import org.springframework.util.StringUtils; + +import java.util.stream.IntStream; +import static org.egov.infra.mdms.utils.MDMSConstants.*; + +public class CompositeUniqueIdentifierGenerationUtil { + + private CompositeUniqueIdentifierGenerationUtil(){} + + /** + * This method creates composite unique identifier based on the attributes provided + * in x-unique-key param. + * @param schemaObject + * @param mdmsRequest + * @return + */ + public static String getUniqueIdentifier(JSONObject schemaObject, MdmsRequest mdmsRequest) { + org.json.JSONArray uniqueFieldPaths = (org.json.JSONArray) schemaObject.get(X_UNIQUE_KEY); + + JsonNode data = mdmsRequest.getMdms().getData(); + StringBuilder compositeUniqueIdentifier = new StringBuilder(); + + // Build composite unique identifier + IntStream.range(0, uniqueFieldPaths.length()).forEach(i -> { + String uniqueIdentifierChunk = data.at(getJsonPointerExpressionFromDotSeparatedPath(uniqueFieldPaths.getString(i))).asText(); + + // Throw error in case value against unique identifier is empty + if(StringUtils.isEmpty(uniqueIdentifierChunk)) { + throw new CustomException("UNIQUE_IDENTIFIER_EMPTY_ERR", "Values defined against unique fields cannot be empty."); + } + + compositeUniqueIdentifier.append(uniqueIdentifierChunk); + + if (i != (uniqueFieldPaths.length() - 1)) + compositeUniqueIdentifier.append(DOT_SEPARATOR); + }); + + return compositeUniqueIdentifier.toString(); + } + + /** + * This method creates a JSON pointer expression from dot separated path. + * @param dotSeparatedPath + * @return + */ + public static String getJsonPointerExpressionFromDotSeparatedPath(String dotSeparatedPath) { + return FORWARD_SLASH + dotSeparatedPath.replaceAll(DOT_REGEX, FORWARD_SLASH); + } + + /** + * This method creates JSON path expression from dot separated path. + * @param dotSeparatedPath + * @return + */ + public static String getJsonPathExpressionFromDotSeparatedPath(String dotSeparatedPath) { + return DOLLAR_DOT + dotSeparatedPath; + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/ErrorUtil.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/ErrorUtil.java new file mode 100644 index 00000000000..f10d45503ae --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/ErrorUtil.java @@ -0,0 +1,21 @@ +package org.egov.infra.mdms.utils; + +import org.egov.tracer.model.CustomException; + +import java.util.Map; + +public class ErrorUtil { + + private ErrorUtil(){} + + /** + * This method throws custom exception for a map of exceptions + * @param exceptions + */ + public static void throwCustomExceptions(Map exceptions) { + if (!exceptions.isEmpty()) { + throw new CustomException(exceptions); + } + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/FallbackUtil.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/FallbackUtil.java new file mode 100644 index 00000000000..f3f0d69bb30 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/FallbackUtil.java @@ -0,0 +1,71 @@ +package org.egov.infra.mdms.utils; + +import net.minidev.json.JSONArray; +import org.egov.infra.mdms.model.Mdms; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static org.egov.infra.mdms.utils.MDMSConstants.DOT_SEPARATOR; + +public class FallbackUtil { + + private FallbackUtil() {} + + public static List getSubTenantListForFallBack(String tenantId) { + List subTenantList = new ArrayList<>(); + + subTenantList.add(tenantId); + + while(tenantId.contains(DOT_SEPARATOR)){ + tenantId = tenantId.substring(0, tenantId.lastIndexOf(DOT_SEPARATOR)); + subTenantList.add(tenantId); + } + + return subTenantList; + } + + public static Map backTrackTenantMasterDataMap(Map> tenantMasterMap, String tenantId) { + List subTenantListForFallback = FallbackUtil.getSubTenantListForFallBack(tenantId); + Map masterDataPostFallBack = new HashMap<>(); + for (String subTenant : subTenantListForFallback) { + if(tenantMasterMap.containsKey(subTenant)) { + for (Map.Entry entry : tenantMasterMap.get(subTenant).entrySet()) { + String schemaCode = entry.getKey(); + if(!masterDataPostFallBack.containsKey(schemaCode)) { + masterDataPostFallBack.put(schemaCode, entry.getValue()); + } + } + } + } + + return masterDataPostFallBack; + } + + public static List backTrackTenantMasterDataList(List masterDataList, String tenantId) { + List masterDataListAfterFallback = new ArrayList<>(); + List subTenantListForFallback = FallbackUtil.getSubTenantListForFallBack(tenantId); + + Map> schemaMasterMap = masterDataList.parallelStream().collect(Collectors.groupingBy(Mdms::getSchemaCode)); + + Map>> schemaGroupedTenantMasterMap = new HashMap<>(); + schemaMasterMap.keySet().forEach(schemaCode -> { + Map> tenantMasterMap = schemaMasterMap.get(schemaCode).stream().collect(Collectors.groupingBy(Mdms::getTenantId)); + schemaGroupedTenantMasterMap.put(schemaCode, tenantMasterMap); + }); + + for (String schemaCode : schemaGroupedTenantMasterMap.keySet()) { + Map> tenantMasterMap = schemaGroupedTenantMasterMap.get(schemaCode); + + for (String subTenant : subTenantListForFallback) { + if (tenantMasterMap.containsKey(subTenant)) + masterDataListAfterFallback.addAll(tenantMasterMap.get(subTenant)); + } + } + + return masterDataListAfterFallback; + } +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/MDMSConstants.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/MDMSConstants.java new file mode 100644 index 00000000000..3e58074fc76 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/MDMSConstants.java @@ -0,0 +1,19 @@ +package org.egov.infra.mdms.utils; + +import org.springframework.stereotype.Component; + + +@Component +public class MDMSConstants { + + public static final String X_UNIQUE_KEY = "x-unique"; + public static final String X_REFERENCE_SCHEMA_KEY = "x-ref-schema"; + public static final String REQUIRED_KEY = "required"; + public static final String DOT_SEPARATOR = "."; + public static final String DOT_REGEX = "\\."; + public static final String FORWARD_SLASH = "/"; + public static final String DOLLAR_DOT = "$."; + public static final String FIELD_PATH_KEY = "fieldPath"; + public static final String SCHEMA_CODE_KEY = "schemaCode"; + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/QueryUtil.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/QueryUtil.java new file mode 100644 index 00000000000..7d06cd8e68d --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/QueryUtil.java @@ -0,0 +1,124 @@ +package org.egov.infra.mdms.utils; + +import com.google.gson.Gson; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.IntStream; + +import static org.egov.infra.mdms.utils.MDMSConstants.*; + +public class QueryUtil { + + private QueryUtil(){} + + private static final Gson gson = new Gson(); + + /** + * This method aids in adding "WHERE" clause and "AND" condition depending on preparedStatementList i.e., + * if preparedStatementList is empty, it will understand that it is the first clause being added so it + * will add "WHERE" to the query and otherwise it will + * @param query + * @param preparedStmtList + */ + public static void addClauseIfRequired(StringBuilder query, List preparedStmtList){ + if(preparedStmtList.isEmpty()){ + query.append(" WHERE "); + }else{ + query.append(" AND "); + } + } + + /** + * This method returns a string with placeholders equal to the number of values that need to be put inside + * "IN" clause + * @param size + * @return + */ + public static String createQuery(Integer size) { + StringBuilder builder = new StringBuilder(); + + IntStream.range(0, size).forEach(i -> { + builder.append(" ?"); + if (i != size - 1) + builder.append(","); + }); + + return builder.toString(); + } + + /** + * This method adds a set of String values into preparedStatementList + * @param preparedStmtList + * @param ids + */ + public static void addToPreparedStatement(List preparedStmtList, Set ids) { + ids.forEach(id -> { + preparedStmtList.add(id); + }); + } + + /** + * This method appends order by clause to the query + * @param query + * @param orderByClause + * @return + */ + public static String addOrderByClause(String query, String orderByClause){ + return query + orderByClause; + } + + /** + * This method prepares partial json string from the filter map to query on jsonb column + * @param filterMap + * @return + */ + public static String preparePartialJsonStringFromFilterMap(Map filterMap) { + Map queryMap = new HashMap<>(); + + filterMap.keySet().forEach(key -> { + if(key.contains(DOT_SEPARATOR)){ + String[] keyArray = key.split(DOT_REGEX); + Map nestedQueryMap = new HashMap<>(); + prepareNestedQueryMap(0, keyArray, nestedQueryMap, filterMap.get(key)); + queryMap.put(keyArray[0], nestedQueryMap.get(keyArray[0])); + } else{ + queryMap.put(key, filterMap.get(key)); + } + }); + + String partialJsonQueryString = gson.toJson(queryMap); + + return partialJsonQueryString; + } + + /** + * Tail recursive method to prepare n-level nested partial json for queries on nested data in + * master data. For e.g. , if the key is in the format a.b.c, it will construct a nested json + * object of the form - {"a":{"b":{"c": "value"}}} + * @param index + * @param nestedKeyArray + * @param currentQueryMap + * @param value + */ + private static void prepareNestedQueryMap(int index, String[] nestedKeyArray, Map currentQueryMap, String value) { + // Return when all levels have been reached. + if(index == nestedKeyArray.length) + return; + + // For the final level simply put the value in the map. + else if (index == nestedKeyArray.length - 1) { + currentQueryMap.put(nestedKeyArray[index], value); + return; + } + + // For non terminal levels, add a child map. + currentQueryMap.put(nestedKeyArray[index], new HashMap<>()); + + // Make a recursive call to enrich data in next level. + prepareNestedQueryMap(index + 1, nestedKeyArray, (Map) currentQueryMap.get(nestedKeyArray[index]), value); + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/ResponseUtil.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/ResponseUtil.java new file mode 100644 index 00000000000..5a662882310 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/ResponseUtil.java @@ -0,0 +1,29 @@ +package org.egov.infra.mdms.utils; + +import org.egov.common.contract.request.RequestInfo; +import org.egov.common.contract.response.ResponseInfo; +import org.egov.common.utils.ResponseInfoUtil; +import org.egov.infra.mdms.model.Mdms; +import org.egov.infra.mdms.model.MdmsResponseV2; +import org.egov.infra.mdms.model.SchemaDefinition; +import org.egov.infra.mdms.model.SchemaDefinitionResponse; + +import java.util.List; + +public class ResponseUtil { + + private ResponseUtil(){} + + public static SchemaDefinitionResponse getSchemaDefinitionResponse(RequestInfo requestInfo , List schemaDefinitions){ + ResponseInfo responseInfo = ResponseInfoUtil.createResponseInfoFromRequestInfo(requestInfo, Boolean.TRUE); + SchemaDefinitionResponse schemaDefinitionResponse = SchemaDefinitionResponse.builder().schemaDefinitions(schemaDefinitions).responseInfo(responseInfo).build(); + return schemaDefinitionResponse; + } + + public static MdmsResponseV2 getMasterDataV2Response(RequestInfo requestInfo, List masterDataList){ + ResponseInfo responseInfo = ResponseInfoUtil.createResponseInfoFromRequestInfo(requestInfo, Boolean.TRUE); + MdmsResponseV2 response = MdmsResponseV2.builder().mdms(masterDataList).responseInfo(responseInfo).build(); + return response; + } + +} diff --git a/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/SchemaUtil.java b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/SchemaUtil.java new file mode 100644 index 00000000000..80a8294c389 --- /dev/null +++ b/core-services/mdms-v2/src/main/java/org/egov/infra/mdms/utils/SchemaUtil.java @@ -0,0 +1,52 @@ +package org.egov.infra.mdms.utils; + +import lombok.extern.slf4j.Slf4j; +import org.egov.infra.mdms.model.*; +import org.egov.infra.mdms.service.SchemaDefinitionService; +import org.egov.tracer.model.CustomException; +import org.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.Arrays; +import java.util.List; + +@Component +@Slf4j +public class SchemaUtil { + + private SchemaDefinitionService schemaDefinitionService; + + @Autowired + public SchemaUtil(SchemaDefinitionService schemaDefinitionService){ + this.schemaDefinitionService = schemaDefinitionService; + } + + /** + * This method fetches the schema definition object for the master data being created. + * @param mdmsRequest + * @return + */ + public JSONObject getSchema(MdmsRequest mdmsRequest) { + + Mdms mdms = mdmsRequest.getMdms(); + + SchemaDefCriteria schemaDefCriteria = SchemaDefCriteria.builder() + .tenantId(mdms.getTenantId()) + .codes(Arrays.asList(mdms.getSchemaCode())) + .build(); + + List schemaDefinitions = schemaDefinitionService.search(SchemaDefSearchRequest.builder() + .requestInfo(mdmsRequest.getRequestInfo()) + .schemaDefCriteria(schemaDefCriteria).build()); + + if(CollectionUtils.isEmpty(schemaDefinitions)) + throw new CustomException("SCHEMA_DEFINITION_NOT_FOUND_ERR", "Schema definition against which data is being created is not found"); + + JSONObject schemaObject = new JSONObject(schemaDefinitions.get(0).getDefinition().toString()); + + return schemaObject; + } + +} diff --git a/core-services/mdms-v2/src/main/resources/application.properties b/core-services/mdms-v2/src/main/resources/application.properties new file mode 100644 index 00000000000..674bf6a8f9d --- /dev/null +++ b/core-services/mdms-v2/src/main/resources/application.properties @@ -0,0 +1,41 @@ +server.port=8094 + +server.context-path=/mdms-v2 +server.servlet.context-path=/mdms-v2 +management.endpoints.web.base-path=/ +app.timezone=UTC + +#DATABASE CONFIGURATION +spring.datasource.driver-class-name=org.postgresql.Driver +spring.datasource.url=jdbc:postgresql://localhost:5432/microdb +spring.datasource.username=postgres +spring.datasource.password=postgres + +#FLYWAY CONFIGURATION +spring.flyway.url=jdbc:postgresql://localhost:5432/microdb +spring.flyway.user=postgres +spring.flyway.password=postgres +spring.flyway.table=public +spring.flyway.baseline-on-migrate=true +spring.flyway.outOfOrder=true +spring.flyway.locations=classpath:/db/migration/main +spring.flyway.enabled=true + +# KAFKA SERVER CONFIGURATIONS +kafka.config.bootstrap_server_config=localhost:9092 +spring.kafka.consumer.value-deserializer=org.egov.tracer.kafka.deserializer.HashMapDeserializer +spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer +spring.kafka.consumer.group-id=mdms +spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer +spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer +spring.kafka.listener.missing-topics-fatal=false +spring.kafka.consumer.properties.spring.json.use.type.headers=false + +# TOPICS +egov.mdms.schema.definition.save.topic=save-mdms-schema-definition +egov.mdms.data.save.topic=save-mdms-data +egov.mdms.data.update.topic=update-mdms-data +mdms.default.offset=0 +mdms.default.limit=10 + +logging.level.org.springframework.aop=DEBUG \ No newline at end of file diff --git a/core-services/mdms-v2/src/main/resources/db/Dockerfile b/core-services/mdms-v2/src/main/resources/db/Dockerfile new file mode 100644 index 00000000000..f38638a269f --- /dev/null +++ b/core-services/mdms-v2/src/main/resources/db/Dockerfile @@ -0,0 +1,9 @@ +FROM egovio/flyway:10.7.1 + +COPY ./migration/main /flyway/sql + +COPY migrate.sh /usr/bin/migrate.sh + +RUN chmod +x /usr/bin/migrate.sh + +ENTRYPOINT ["/usr/bin/migrate.sh"] diff --git a/core-services/mdms-v2/src/main/resources/db/migrate.sh b/core-services/mdms-v2/src/main/resources/db/migrate.sh new file mode 100644 index 00000000000..ac2195600b4 --- /dev/null +++ b/core-services/mdms-v2/src/main/resources/db/migrate.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -validateOnMigrate=false migrate diff --git a/core-services/mdms-v2/src/main/resources/db/migration/main/V20230531114515__schema_definition_ddl.sql b/core-services/mdms-v2/src/main/resources/db/migration/main/V20230531114515__schema_definition_ddl.sql new file mode 100644 index 00000000000..95eeef0306d --- /dev/null +++ b/core-services/mdms-v2/src/main/resources/db/migration/main/V20230531114515__schema_definition_ddl.sql @@ -0,0 +1,13 @@ +CREATE TABLE eg_mdms_schema_definition ( + id VARCHAR(64) NOT NULL, + tenantid VARCHAR(255) NOT NULL, + code VARCHAR(255) NOT NULL, + description VARCHAR(512), + definition JSONB NOT NULL, + isactive BOOLEAN NOT NULL, + createdBy character varying(64), + lastModifiedBy character varying(64), + createdTime bigint, + lastModifiedTime bigint, + CONSTRAINT pk_eg_schema_definition PRIMARY KEY (tenantId,code) +); diff --git a/core-services/mdms-v2/src/main/resources/db/migration/main/V20230531144020__mdms_data_create_ddl.sql b/core-services/mdms-v2/src/main/resources/db/migration/main/V20230531144020__mdms_data_create_ddl.sql new file mode 100644 index 00000000000..191ee9e0259 --- /dev/null +++ b/core-services/mdms-v2/src/main/resources/db/migration/main/V20230531144020__mdms_data_create_ddl.sql @@ -0,0 +1,14 @@ +CREATE TABLE eg_mdms_data ( + id VARCHAR(64) NOT NULL, + tenantid VARCHAR(255) NOT NULL, + uniqueidentifier VARCHAR(255), + schemacode VARCHAR(255) NOT NULL, + data JSONB NOT NULL, + isactive BOOLEAN NOT NULL, + createdBy character varying(64), + lastModifiedBy character varying(64), + createdTime bigint, + lastModifiedTime bigint, + CONSTRAINT pk_eg_mdms_data PRIMARY KEY (tenantId,schemacode,uniqueidentifier), + CONSTRAINT uk_eg_mdms_data UNIQUE(id) +); diff --git a/core-services/mdms-v2/src/main/resources/mdms-persister.yml b/core-services/mdms-v2/src/main/resources/mdms-persister.yml new file mode 100644 index 00000000000..6771da75718 --- /dev/null +++ b/core-services/mdms-v2/src/main/resources/mdms-persister.yml @@ -0,0 +1,63 @@ +serviceMaps: + serviceName: Mdms-Service + mappings: + - version: 1.0 + description: Persists the schema definition + fromTopic: save-mdms-schema-definition + isTransaction: true + queryMaps: + - query: INSERT INTO eg_mdms_schema_definition (id ,tenantid, code, description, definition, isactive, createdby, lastmodifiedby, createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?); + basePath: $.SchemaDefinition + jsonMaps: + - jsonPath: $.SchemaDefinition.id + + - jsonPath: $.SchemaDefinition.tenantId + + - jsonPath: $.SchemaDefinition.code + + - jsonPath: $.SchemaDefinition.description + + - jsonPath: $.SchemaDefinition.definition + type: JSON + dbType: JSONB + + - jsonPath: $.SchemaDefinition.isActive + + - jsonPath: $.SchemaDefinition.auditDetails.createdBy + + - jsonPath: $.SchemaDefinition.auditDetails.lastModifiedBy + + - jsonPath: $.SchemaDefinition.auditDetails.createdTime + + - jsonPath: $.SchemaDefinition.auditDetails.lastModifiedTime + + + - version: 1.0 + description: Persists the mdms data + fromTopic: save-mdms-data + isTransaction: true + queryMaps: + - query: INSERT INTO eg_mdms_data (tenantid, uniqueidentifier, schemacode, data, isactive, createdby, lastmodifiedby, createdtime, lastmodifiedtime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?); + basePath: $.Mdms + jsonMaps: + - jsonPath: $.Mdms.tenantId + + - jsonPath: $.Mdms.uniqueIdentifier + + - jsonPath: $.Mdms.schemaCode + + - jsonPath: $.Mdms.data + type: JSON + dbType: JSONB + + - jsonPath: $.Mdms.isActive + + - jsonPath: $.Mdms.auditDetails.createdBy + + - jsonPath: $.Mdms.auditDetails.lastModifiedBy + + - jsonPath: $.Mdms.auditDetails.createdTime + + - jsonPath: $.Mdms.auditDetails.lastModifiedTime + + diff --git a/core-services/national-dashboard-ingest/src/main/java/org/egov/nationaldashboardingest/config/ApplicationProperties.java b/core-services/national-dashboard-ingest/src/main/java/org/egov/nationaldashboardingest/config/ApplicationProperties.java index 88509d07665..677d8031bd9 100644 --- a/core-services/national-dashboard-ingest/src/main/java/org/egov/nationaldashboardingest/config/ApplicationProperties.java +++ b/core-services/national-dashboard-ingest/src/main/java/org/egov/nationaldashboardingest/config/ApplicationProperties.java @@ -59,4 +59,4 @@ public class ApplicationProperties { @Value("#{${national.dashboard.usageTypeNOC}}") private List nationalDashboardUsageTypeNOC; -} \ No newline at end of file +} diff --git a/core-services/national-dashboard-ingest/src/main/resources/application.properties b/core-services/national-dashboard-ingest/src/main/resources/application.properties index 47a9db8ddc8..9b890968c42 100644 --- a/core-services/national-dashboard-ingest/src/main/resources/application.properties +++ b/core-services/national-dashboard-ingest/src/main/resources/application.properties @@ -65,4 +65,4 @@ adaptor.ingest.system.role=NDA_SYSTEM #mdms egov.mdms.host=http://egov-mdms-service.egov:8080 -egov.mdms.search.endpoint=/egov-mdms-service/v1/_search \ No newline at end of file +egov.mdms.search.endpoint=/egov-mdms-service/v1/_search diff --git a/core-services/report/CHANGELOG.md b/core-services/report/CHANGELOG.md index 070b704a872..9772795a35e 100644 --- a/core-services/report/CHANGELOG.md +++ b/core-services/report/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All notable changes to this module will be documented in this file. +## 1.3.6 - 2023-08-10 + +- Central Instance Library Integration + ## 1.3.5 - 2023-02-06 - Transition from 1.3.5-beta version to 1.3.5 version diff --git a/core-services/report/pom.xml b/core-services/report/pom.xml index ab7fe49bb00..a9826c11063 100644 --- a/core-services/report/pom.xml +++ b/core-services/report/pom.xml @@ -10,7 +10,7 @@ org.egov.services report - 1.3.5-SNAPSHOT + 1.3.6-SNAPSHOT Report Infra Report Infra @@ -36,17 +36,17 @@ org.egov enc-client - 2.0.3-SNAPSHOT + 2.0.4-SNAPSHOT org.egov.services services-common - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT org.egov.services tracer - 1.2.0-SNAPSHOT + 2.1.0-SNAPSHOT org.springframework.boot diff --git a/core-services/service-request/src/main/java/digit/config/Configuration.java b/core-services/service-request/src/main/java/digit/config/Configuration.java index febd9097d8f..c7849475706 100644 --- a/core-services/service-request/src/main/java/digit/config/Configuration.java +++ b/core-services/service-request/src/main/java/digit/config/Configuration.java @@ -51,6 +51,9 @@ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectM @Value("${egov.service.definition.create.topic}") private String serviceDefinitionCreateTopic; + @Value("${egov.service.definition.update.topic}") + private String serviceDefinitionUpdateTopic; + @Value("${egov.service.create.topic}") private String serviceCreateTopic; @@ -60,4 +63,31 @@ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectM @Value("${egov.max.string.input.size}") private Integer maxStringInputSize; + @Value("${user.service.hostname}") + private String userServiceHostName; + + @Value("${user.service.searchpath}") + private String userServiceSearchPath; + + @Value("${egov.service.notification.action.code}") + private String surveyActionCode; + + @Value("${egov.service.notification.event.topic}") + private String userEventTopic; + + @Value("${egov.service.notification.ui.host}") + private String notificationUiHost; + + @Value("${egov.service.notification.ui.redirect.url}") + private String notificationEndpoint; + + @Value("${egov.localization.host}") + private String localizationHost; + + @Value("${egov.localization.search.endpoint}") + private String localizationEndpoint; + + @Value("${egov.service.notification.fallback.locale}") + private String fallBackLocale; + } diff --git a/core-services/service-request/src/main/java/digit/constants/Constants.java b/core-services/service-request/src/main/java/digit/constants/Constants.java index 66bd547818f..d44726a6dfe 100644 --- a/core-services/service-request/src/main/java/digit/constants/Constants.java +++ b/core-services/service-request/src/main/java/digit/constants/Constants.java @@ -21,4 +21,14 @@ public class Constants { public static final String CHANNEL = "channel"; + public static final String NEW_SURVEY = "New Survey"; + public static final String WEBAPP = "WEBAPP"; + public static final String SYSTEMGENERATED = "SYSTEMGENERATED"; + public static final String APPLICATION_NUMBER_PLACEHOLDER = "{APPNUMBER}"; + public static final String TENANTID_PLACEHOLDER = "{TENANTID}"; + public static final String LOCALIZATION_MODULE = "rainmaker-common"; + public static final String LOCALIZATION_CODE = "SS_SURVEY_NOTIFICATION_TEMPLATE"; + public static final String SURVEY_TITLE = "{survey_title}"; + public static final String LOCALIZATION_CODES_JSONPATH = "$.messages.*.code"; + public static final String LOCALIZATION_MSGS_JSONPATH = "$.messages.*.message"; } diff --git a/core-services/service-request/src/main/java/digit/kafka/Consumer.java b/core-services/service-request/src/main/java/digit/kafka/Consumer.java index 557ffe5d7bb..2d5107a6172 100644 --- a/core-services/service-request/src/main/java/digit/kafka/Consumer.java +++ b/core-services/service-request/src/main/java/digit/kafka/Consumer.java @@ -3,19 +3,45 @@ import org.springframework.kafka.annotation.KafkaListener; import org.springframework.stereotype.Component; +import lombok.extern.slf4j.Slf4j; +import com.fasterxml.jackson.databind.ObjectMapper; +import digit.service.NotificationService; +import digit.web.models.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.kafka.support.KafkaHeaders; +import org.springframework.messaging.handler.annotation.Header; +import org.springframework.stereotype.Component; +import org.springframework.util.ObjectUtils; + + import java.util.HashMap; @Component +@Slf4j public class Consumer { /* * Uncomment the below line to start consuming record from kafka.topics.consumer * Value of the variable kafka.topics.consumer should be overwritten in application.properties */ - //@KafkaListener(topics = {"kafka.topics.consumer"}) - public void listen(final HashMap record) { + @Autowired + private ObjectMapper mapper; + + @Autowired + private NotificationService notificationService; + + @KafkaListener(topics = {"save-service-definition"}) + public void listen(final HashMap record, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic) { + + try { + ServiceDefinitionRequest request = mapper.convertValue(record, ServiceDefinitionRequest.class); + //log.info(request.toString()); + notificationService.prepareEventAndSend(request); + + } catch (final Exception e) { - //TODO + log.error("Error while listening to value: " + record + " on topic: " + topic + ": ", e); + } } } diff --git a/core-services/service-request/src/main/java/digit/repository/ServiceDefinitionRequestRepository.java b/core-services/service-request/src/main/java/digit/repository/ServiceDefinitionRequestRepository.java index acf01303e30..8ae028064f6 100644 --- a/core-services/service-request/src/main/java/digit/repository/ServiceDefinitionRequestRepository.java +++ b/core-services/service-request/src/main/java/digit/repository/ServiceDefinitionRequestRepository.java @@ -54,12 +54,31 @@ public List getServiceDefinitions(ServiceDefinitionSearchRequ + System.out.println("inside get service definition"); + System.out.println(criteria); String query = serviceDefinitionQueryBuilder.getServiceDefinitionSearchQuery(criteria, preparedStmtList); log.info("query for search: " + query + " params: " + preparedStmtList); return jdbcTemplate.query(query, preparedStmtList.toArray(), serviceDefinitionRowMapper); } + public Integer fetchTotalSurveyCount(ServiceDefinitionSearchRequest ServiceDefinitionSearchRequest) { + List preparedStmtList = new ArrayList<>(); + ServiceDefinitionCriteria ServiceDefinitionCriteria = ServiceDefinitionSearchRequest.getServiceDefinitionCriteria(); + + if(CollectionUtils.isEmpty(ServiceDefinitionCriteria.getIds())) + return 0; + + // Omit pagination in case of count + ServiceDefinitionCriteria.setIsCountCall(Boolean.TRUE); + String query = serviceDefinitionQueryBuilder.getSurveyCountQuery(ServiceDefinitionSearchRequest, preparedStmtList); + ServiceDefinitionCriteria.setIsCountCall(Boolean.FALSE); + + log.info("query for count search call: " + query + " params: " + preparedStmtList); + + return jdbcTemplate.queryForObject(query, preparedStmtList.toArray(), Integer.class); + } + public List getService(ServiceCriteria criteria) { return new ArrayList<>(); } diff --git a/core-services/service-request/src/main/java/digit/repository/ServiceRequestRepository.java b/core-services/service-request/src/main/java/digit/repository/ServiceRequestRepository.java index 17a0cdf5ddf..88ff29ea61b 100644 --- a/core-services/service-request/src/main/java/digit/repository/ServiceRequestRepository.java +++ b/core-services/service-request/src/main/java/digit/repository/ServiceRequestRepository.java @@ -6,15 +6,22 @@ import digit.repository.rowmapper.ServiceRowMapper; import digit.web.models.*; import lombok.extern.slf4j.Slf4j; +import org.egov.tracer.model.ServiceCallException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.SingleColumnRowMapper; import org.springframework.stereotype.Repository; import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.RestTemplate; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; import java.util.ArrayList; import java.util.List; +import java.util.Map; @Slf4j @Repository @@ -29,6 +36,11 @@ public class ServiceRequestRepository { @Autowired private ServiceQueryBuilder serviceQueryBuilder; + @Autowired + private ObjectMapper mapper; + + @Autowired + private RestTemplate restTemplate; public List getService(ServiceSearchRequest serviceSearchRequest) { ServiceCriteria criteria = serviceSearchRequest.getServiceCriteria(); @@ -60,4 +72,31 @@ public List getService(ServiceSearchRequest serviceSearchRequest) { log.info("query for search: " + query + " params: " + preparedStmtList); return jdbcTemplate.query(query, preparedStmtList.toArray(), serviceRowMapper); } + + /** + * fetch method which takes the URI and request object + * and returns response in generic format + * @param uri + * @param request + * @return + */ + @SuppressWarnings("rawtypes") + public Map fetchResult(String uri, Object request) { + + mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); + Map response = null; + log.info("URI: "+ uri); + + try { + log.info("Request: "+mapper.writeValueAsString(request)); + response = restTemplate.postForObject(uri, request, Map.class); + }catch(HttpClientErrorException e) { + log.error("External Service threw an Exception: ",e.getResponseBodyAsString()); + throw new ServiceCallException(e.getResponseBodyAsString()); + }catch(JsonProcessingException e) { + log.error("Exception while searching user data : ",e); + } + + return response; + } } diff --git a/core-services/service-request/src/main/java/digit/repository/querybuilder/ServiceDefinitionQueryBuilder.java b/core-services/service-request/src/main/java/digit/repository/querybuilder/ServiceDefinitionQueryBuilder.java index 937093cc7c6..a940262a8ef 100644 --- a/core-services/service-request/src/main/java/digit/repository/querybuilder/ServiceDefinitionQueryBuilder.java +++ b/core-services/service-request/src/main/java/digit/repository/querybuilder/ServiceDefinitionQueryBuilder.java @@ -23,11 +23,13 @@ public class ServiceDefinitionQueryBuilder { private static final String AND_QUERY = " AND "; private static final String IDS_WRAPPER_QUERY = " SELECT id FROM ({HELPER_TABLE}) temp "; + public static final String SURVEY_COUNT_WRAPPER = " SELECT COUNT(*) FROM ({INTERNAL_QUERY}) AS count "; private final String ORDERBY_CREATEDTIME = " ORDER BY sd.createdtime DESC "; public String getServiceDefinitionsIdsQuery(ServiceDefinitionSearchRequest serviceDefinitionSearchRequest, List preparedStmtList) { ServiceDefinitionCriteria criteria = serviceDefinitionSearchRequest.getServiceDefinitionCriteria(); - + System.out.println("criteria in query method"); + System.out.println(criteria); StringBuilder query = new StringBuilder(SELECT + " DISTINCT(sd.id), sd.createdtime "); query.append(" FROM eg_service_definition sd "); @@ -39,7 +41,7 @@ public String getServiceDefinitionsIdsQuery(ServiceDefinitionSearchRequest servi if(!CollectionUtils.isEmpty(criteria.getCode())){ addClauseIfRequired(query, preparedStmtList); - query.append(" sd.code IN ( ").append(createQuery(criteria.getCode())).append(" )"); + query.append(" sd.code ILIKE ( ").append(createQuery(criteria.getCode())).append(" || '%' )"); addToPreparedStatement(preparedStmtList, criteria.getCode()); } @@ -60,6 +62,31 @@ public String getServiceDefinitionsIdsQuery(ServiceDefinitionSearchRequest servi query.append(" sd.clientid = ? "); preparedStmtList.add(criteria.getClientId()); } + + if(!ObjectUtils.isEmpty(criteria.getTodaysDate())) + { + System.out.println("inside todays date query"); + if(!ObjectUtils.isEmpty(criteria.getStatus()) && criteria.getStatus().equalsIgnoreCase("Active")){ + addClauseIfRequired(query, preparedStmtList); + System.out.println("inside active query"); + query.append(" to_timestamp((sd.additionaldetails->>'endDate')::bigint) > to_timestamp(?::bigint)"); + preparedStmtList.add(criteria.getTodaysDate()); + }else if(!ObjectUtils.isEmpty(criteria.getStatus()) && criteria.getStatus().equalsIgnoreCase("Inactive")){ + addClauseIfRequired(query, preparedStmtList); + + query.append(" to_timestamp((sd.additionaldetails->>'startDate')::bigint) < to_timestamp(?::bigint)"); + query.append(" AND to_timestamp((sd.additionaldetails->>'endDate')::bigint) < to_timestamp(?::bigint)"); + + preparedStmtList.add(criteria.getTodaysDate()); + preparedStmtList.add(criteria.getTodaysDate()); + } + } + + if(!ObjectUtils.isEmpty(criteria.getPostedBy())){ + addClauseIfRequired(query, preparedStmtList); + query.append("LOWER(sd.additionaldetails->>'postedBy') ILIKE ( ? || '%' )"); + preparedStmtList.add(criteria.getPostedBy()); + } // Fetch service definitions which have NOT been soft deleted addClauseIfRequired(query, preparedStmtList); @@ -70,14 +97,21 @@ public String getServiceDefinitionsIdsQuery(ServiceDefinitionSearchRequest servi query.append(ORDERBY_CREATEDTIME); // Pagination to limit results - if(ObjectUtils.isEmpty(serviceDefinitionSearchRequest.getPagination())){ - prepareDefaultPaginationObject(serviceDefinitionSearchRequest); + if(criteria!=null && !criteria.getIsCountCall()){ + if(ObjectUtils.isEmpty(serviceDefinitionSearchRequest.getPagination())){ + prepareDefaultPaginationObject(serviceDefinitionSearchRequest); + } + addPagination(query, preparedStmtList, serviceDefinitionSearchRequest.getPagination()); } - addPagination(query, preparedStmtList, serviceDefinitionSearchRequest.getPagination()); return IDS_WRAPPER_QUERY.replace("{HELPER_TABLE}", query.toString()); } + public String getSurveyCountQuery(ServiceDefinitionSearchRequest criteria, List preparedStmtList) { + String query = "select count(*) from eg_service_definition where isactive = true"; + return query; + } + private void prepareDefaultPaginationObject(ServiceDefinitionSearchRequest serviceDefinitionSearchRequest) { Pagination pagination = new Pagination(); pagination.setOffset(config.getDefaultOffset()); @@ -142,6 +176,31 @@ public String getServiceDefinitionSearchQuery(ServiceDefinitionCriteria criteria addToPreparedStatement(preparedStmtList, criteria.getIds()); } + if(!ObjectUtils.isEmpty(criteria.getTodaysDate())) + { + System.out.println("inside todays date query"); + if(!ObjectUtils.isEmpty(criteria.getStatus()) && criteria.getStatus().equalsIgnoreCase("Active")){ + addClauseIfRequired(query, preparedStmtList); + System.out.println("inside active query"); + query.append(" to_timestamp((sd.additionaldetails->>'endDate')::bigint) > to_timestamp(?::bigint)"); + preparedStmtList.add(criteria.getTodaysDate()); + }else if(!ObjectUtils.isEmpty(criteria.getStatus()) && criteria.getStatus().equalsIgnoreCase("Inactive")){ + addClauseIfRequired(query, preparedStmtList); + query.append(" to_timestamp((sd.additionaldetails->>'startDate')::bigint) < to_timestamp(?::bigint)"); + query.append(" AND to_timestamp((sd.additionaldetails->>'endDate')::bigint) < to_timestamp(?::bigint)"); + preparedStmtList.add(criteria.getTodaysDate()); + preparedStmtList.add(criteria.getTodaysDate()); + } + } + + if(!ObjectUtils.isEmpty(criteria.getPostedBy())){ + addClauseIfRequired(query, preparedStmtList); + query.append("LOWER(sd.additionaldetails->>'postedBy') ILIKE ( ? || '%' )"); + preparedStmtList.add(criteria.getPostedBy()); + } + + + return query.toString(); } -} +} \ No newline at end of file diff --git a/core-services/service-request/src/main/java/digit/repository/querybuilder/ServiceQueryBuilder.java b/core-services/service-request/src/main/java/digit/repository/querybuilder/ServiceQueryBuilder.java index e5244218391..96228779355 100644 --- a/core-services/service-request/src/main/java/digit/repository/querybuilder/ServiceQueryBuilder.java +++ b/core-services/service-request/src/main/java/digit/repository/querybuilder/ServiceQueryBuilder.java @@ -71,11 +71,11 @@ public String getServiceIdsQuery(ServiceSearchRequest serviceSearchRequest, List // order services based on their createdtime in latest first manner query.append(ORDERBY_CREATEDTIME); - if(ObjectUtils.isEmpty(serviceSearchRequest.getPagination())) - prepareDefaultPaginationObject(serviceSearchRequest); + // if(ObjectUtils.isEmpty(serviceSearchRequest.getPagination())) + // prepareDefaultPaginationObject(serviceSearchRequest); - // Pagination to limit results - addPagination(query, preparedStmtList, serviceSearchRequest.getPagination()); + // // Pagination to limit results + // addPagination(query, preparedStmtList, serviceSearchRequest.getPagination()); return IDS_WRAPPER_QUERY.replace("{HELPER_TABLE}", query.toString()); } @@ -120,8 +120,7 @@ private void addPagination(StringBuilder query, List preparedStmtList, P // Append limit query.append(" LIMIT ? "); - preparedStmtList.add(ObjectUtils.isEmpty(pagination.getLimit()) ? config.getDefaultLimit() : - ((pagination.getLimit() > config.getMaxLimit()) ? config.getMaxLimit() : pagination.getLimit())); + preparedStmtList.add(ObjectUtils.isEmpty(pagination.getLimit()) ? config.getDefaultLimit() : pagination.getLimit()); } diff --git a/core-services/service-request/src/main/java/digit/service/NotificationService.java b/core-services/service-request/src/main/java/digit/service/NotificationService.java new file mode 100644 index 00000000000..59dad0b4d61 --- /dev/null +++ b/core-services/service-request/src/main/java/digit/service/NotificationService.java @@ -0,0 +1,118 @@ +package digit.service; + +import com.jayway.jsonpath.JsonPath; +import lombok.extern.slf4j.Slf4j; +import net.logstash.logback.encoder.org.apache.commons.lang.StringUtils; +import org.egov.common.contract.request.RequestInfo; +import digit.config.Configuration; +import digit.kafka.Producer; +import digit.web.models.*; +import org.egov.tracer.model.CustomException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.web.client.RestTemplate; +import static digit.constants.Constants.*; +import java.util.*; + + +@Slf4j +@Service +public class NotificationService { + + @Autowired + private Producer producer; + + @Autowired + private Configuration configs; + + @Autowired + private RestTemplate restTemplate; + + /** + * Prepares event notifications and pushes to event-notification topic + * @param request Request object containing details of survey + */ + public void prepareEventAndSend(ServiceDefinitionRequest request){ + // Prepare link to view document + String tenantId = request.getServiceDefinition().getTenantId(); + StringBuilder link = new StringBuilder(configs.getNotificationUiHost()); + link.append(configs.getNotificationEndpoint()); + String customizedLink = getCustomSurveyViewLink(link.toString(), request.getServiceDefinition()); + String messageTemplate = fetchContentFromLocalization(request.getRequestInfo(), tenantId,LOCALIZATION_MODULE , LOCALIZATION_CODE); + messageTemplate = messageTemplate.replace(SURVEY_TITLE, request.getServiceDefinition().getCode()); + + Action action = null; + + List items = new ArrayList<>(); + ActionItem documentItem = ActionItem.builder().actionUrl(customizedLink).code(configs.getSurveyActionCode()).build(); + items.add(documentItem); + + action = Action.builder().actionUrls(items).build(); + + List events = Collections.singletonList(Event.builder() + .tenantId(request.getServiceDefinition().getTenantId()) + .name(NEW_SURVEY) + .source(WEBAPP) + .eventType(SYSTEMGENERATED) + .description(messageTemplate) + .actions(action) + .build()); + log.info(events.toString()); + producer.push(configs.getUserEventTopic(), new EventRequest(request.getRequestInfo(), events)); + } + + /** + * Forms survey view link for notifications + * @param link link with placeholders + * @param serviceDefinition object containing details of survey to be validated + * @return link with replaced information + */ + private String getCustomSurveyViewLink(String link, ServiceDefinition serviceDefinition) { + link = link.replace(APPLICATION_NUMBER_PLACEHOLDER, serviceDefinition.getClientId()); + link = link.replace(TENANTID_PLACEHOLDER, serviceDefinition.getTenantId()); + return link; + } + + /** + * Fetches messages from localization service + * + * @param tenantId tenantId of the BPA + * @param requestInfo The requestInfo of the request + * @return Localization messages for the module + */ + private String fetchContentFromLocalization(RequestInfo requestInfo, String tenantId, String module, String code){ + String message = null; + List codes = new ArrayList<>(); + List messages = new ArrayList<>(); + Object result = null; + String locale = ""; + if(requestInfo.getMsgId().contains("|")) + locale = requestInfo.getMsgId().split("[\\|]")[1]; + if(StringUtils.isEmpty(locale)) + locale = configs.getFallBackLocale(); + StringBuilder uri = new StringBuilder(); + uri.append(configs.getLocalizationHost()).append(configs.getLocalizationEndpoint()); + uri.append("?tenantId=").append(tenantId.split("\\.")[0]).append("&locale=").append(locale).append("&module=").append(module); + + Map request = new HashMap<>(); + request.put("RequestInfo", requestInfo); + try { + result = restTemplate.postForObject(uri.toString(), request, Map.class); + codes = JsonPath.read(result, LOCALIZATION_CODES_JSONPATH); + messages = JsonPath.read(result, LOCALIZATION_MSGS_JSONPATH); + } catch (Exception e) { + log.error("Exception while fetching from localization: " + e); + } + if(CollectionUtils.isEmpty(messages)){ + throw new CustomException("LOCALIZATION_NOT_FOUND", "Localization not found for the code: " + code); + } + for(int index = 0; index < codes.size(); index++){ + if(codes.get(index).equals(code)){ + message = messages.get(index); + } + } + return message; + } + +} diff --git a/core-services/service-request/src/main/java/digit/service/ServiceDefinitionRequestService.java b/core-services/service-request/src/main/java/digit/service/ServiceDefinitionRequestService.java index eba021c8c88..e670c34391d 100644 --- a/core-services/service-request/src/main/java/digit/service/ServiceDefinitionRequestService.java +++ b/core-services/service-request/src/main/java/digit/service/ServiceDefinitionRequestService.java @@ -8,10 +8,23 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import digit.repository.ServiceRequestRepository; +import lombok.extern.slf4j.Slf4j; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.JsonNode; + +import java.time.Instant; +import java.time.LocalDate; +import java.time.ZoneId; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; import java.util.List; +import java.util.Set; +@Slf4j @Service public class ServiceDefinitionRequestService { @@ -30,6 +43,12 @@ public class ServiceDefinitionRequestService { @Autowired private Configuration config; + @Autowired + private ObjectMapper mapper; + + @Autowired + private ServiceRequestRepository serviceRequestRepository; + public ServiceDefinition createServiceDefinition(ServiceDefinitionRequest serviceDefinitionRequest) { ServiceDefinition serviceDefinition = serviceDefinitionRequest.getServiceDefinition(); @@ -43,17 +62,43 @@ public ServiceDefinition createServiceDefinition(ServiceDefinitionRequest servic // Producer statement to emit service definition to kafka for persisting producer.push(config.getServiceDefinitionCreateTopic(), serviceDefinitionRequest); - // Restore attribute values to the type in which it was sent in service definition request + // Restore attribute values to the type in which it was sent in service + // definition request enrichmentService.setAttributeDefinitionValuesBackToNativeState(serviceDefinition); return serviceDefinition; } - public List searchServiceDefinition(ServiceDefinitionSearchRequest serviceDefinitionSearchRequest){ - - List listOfServiceDefinitions = serviceDefinitionRequestRepository.getServiceDefinitions(serviceDefinitionSearchRequest); - - if(CollectionUtils.isEmpty(listOfServiceDefinitions)) + public List searchServiceDefinition( + ServiceDefinitionSearchRequest serviceDefinitionSearchRequest) { + + System.out.println("search service definition outside"); + System.out.println(serviceDefinitionSearchRequest.getServiceDefinitionCriteria()); + if (serviceDefinitionSearchRequest.getServiceDefinitionCriteria().getStatus() != null + && (!serviceDefinitionSearchRequest.getServiceDefinitionCriteria().getStatus().isEmpty()) + && (!serviceDefinitionSearchRequest.getServiceDefinitionCriteria().getStatus() + .equalsIgnoreCase("all"))) { + + LocalDate currentDate = LocalDate.now(ZoneId.systemDefault()); + long todayStartEpochMillis = currentDate.atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(); + + ServiceDefinitionCriteria ServiceDefinitionCriteria = serviceDefinitionSearchRequest.getServiceDefinitionCriteria(); + ServiceDefinitionCriteria.setTodaysDate(todayStartEpochMillis); + serviceDefinitionSearchRequest.setServiceDefinitionCriteria(ServiceDefinitionCriteria); + System.out.println("search service definition inside"); + System.out.println(serviceDefinitionSearchRequest.getServiceDefinitionCriteria()); + List ListOfActiveInactiveServiceDefinitions = serviceDefinitionRequestRepository + .getServiceDefinitions(serviceDefinitionSearchRequest); + + Collections.sort(ListOfActiveInactiveServiceDefinitions); + return ListOfActiveInactiveServiceDefinitions; + + } + + List listOfServiceDefinitions = serviceDefinitionRequestRepository + .getServiceDefinitions(serviceDefinitionSearchRequest); + + if (CollectionUtils.isEmpty(listOfServiceDefinitions)) return new ArrayList<>(); listOfServiceDefinitions.forEach(serviceDefinition -> { @@ -61,15 +106,92 @@ public List searchServiceDefinition(ServiceDefinitionSearchRe enrichmentService.setAttributeDefinitionValuesBackToNativeState(serviceDefinition); }); + // serch user by uuid which is clientid in service definition and enrich the + // posted by variable. + Set clientIds = new HashSet<>(); + // prepare a set of clientIds from servicedefinitionrequest to send to user + // search request + listOfServiceDefinitions.forEach(serviceDefinition -> { + if (serviceDefinition.getClientId() != null) + clientIds.add(serviceDefinition.getClientId()); + }); + + UserSearchRequest userSearchRequestByUuid = null; + String Url = config.getUserServiceHostName() + .concat(config.getUserServiceSearchPath()); + + userSearchRequestByUuid = UserSearchRequest.builder() + .requestInfo(serviceDefinitionSearchRequest.getRequestInfo()) + .uuid(clientIds).build(); + + List usersresponse = mapper + .convertValue(serviceRequestRepository.fetchResult(Url, userSearchRequestByUuid), UserResponse.class) + .getUser(); + + listOfServiceDefinitions.forEach(serviceDefinition -> { + String id = serviceDefinition.getClientId(); + usersresponse.forEach(user -> { + if (user.getUuid().equals(id)) { + serviceDefinition.setPostedBy(user.getName()); + } + }); + }); + + if (serviceDefinitionSearchRequest.getServiceDefinitionCriteria().getPostedBy() != null + && (!serviceDefinitionSearchRequest.getServiceDefinitionCriteria().getPostedBy().isEmpty()) + && (!serviceDefinitionSearchRequest.getServiceDefinitionCriteria().getPostedBy() + .equalsIgnoreCase("All"))) { + // UserSearchRequest userSearchRequest = null; + // String userUri = config.getUserServiceHostName() + // .concat(config.getUserServiceSearchPath()); + + // userSearchRequest = UserSearchRequest.builder().requestInfo(serviceDefinitionSearchRequest.getRequestInfo()) + // .tenantId(serviceDefinitionSearchRequest.getServiceDefinitionCriteria().getTenantId()) + // .name(serviceDefinitionSearchRequest.getServiceDefinitionCriteria().getPostedBy()).build(); + + // List users = mapper + // .convertValue(serviceRequestRepository.fetchResult(userUri, userSearchRequest), UserResponse.class) + // .getUser(); + + // List finalListOfServiceDefinitions = new ArrayList<>(); + + // listOfServiceDefinitions.forEach(serviceDefinition -> { + // String id = serviceDefinition.getClientId(); + // users.forEach(user -> { + // if (user.getUuid().equals(id)) { + // finalListOfServiceDefinitions.add(serviceDefinition); + // } + // }); + // }); + + // listOfServiceDefinitions = finalListOfServiceDefinitions; + List ListOfPostedByServiceDefinitions = serviceDefinitionRequestRepository + .getServiceDefinitions(serviceDefinitionSearchRequest); + listOfServiceDefinitions = ListOfPostedByServiceDefinitions; + } + Collections.sort(listOfServiceDefinitions); return listOfServiceDefinitions; } + public ServiceDefinition updateServiceDefinition(ServiceDefinitionRequest serviceDefinitionRequest) { - // TO DO + ServiceDefinition serviceDefinition = serviceDefinitionRequest.getServiceDefinition(); + + enrichmentService.updateServiceDefinitionRequest(serviceDefinitionRequest); + + producer.push(config.getServiceDefinitionUpdateTopic(), serviceDefinitionRequest); + + return serviceDefinition; + } - return serviceDefinitionRequest.getServiceDefinition(); + /** + * Fetches total count of surveys in the system based on the search criteria + * + * @param criteria Survey search criteria + */ + public Integer countTotalSurveys(ServiceDefinitionSearchRequest serviceDefinitionSearchRequest) { + return serviceDefinitionRequestRepository.fetchTotalSurveyCount(serviceDefinitionSearchRequest); } } - diff --git a/core-services/service-request/src/main/java/digit/service/ServiceRequestEnrichmentService.java b/core-services/service-request/src/main/java/digit/service/ServiceRequestEnrichmentService.java index 79a8e90a3a0..a52ccc98a93 100644 --- a/core-services/service-request/src/main/java/digit/service/ServiceRequestEnrichmentService.java +++ b/core-services/service-request/src/main/java/digit/service/ServiceRequestEnrichmentService.java @@ -103,4 +103,18 @@ public void setAttributeValuesBackToNativeState(ServiceRequest serviceRequest, M attributeValue.setValue(attributeCodeVsValueMap.get(attributeValue.getAttributeCode())); }); } + + public void updateServiceDefinitionRequest(ServiceDefinitionRequest serviceDefinitionRequest) { + ServiceDefinition serviceDefinition = serviceDefinitionRequest.getServiceDefinition(); + RequestInfo requestInfo = serviceDefinitionRequest.getRequestInfo(); + + AuditDetails auditDetails = new AuditDetails(); + auditDetails.setCreatedBy(requestInfo.getUserInfo().getUuid()); + auditDetails.setLastModifiedBy(requestInfo.getUserInfo().getUuid()); + auditDetails.setCreatedTime(System.currentTimeMillis()); + auditDetails.setLastModifiedTime(System.currentTimeMillis()); + + serviceDefinition.setAuditDetails(auditDetails); + + } } diff --git a/core-services/service-request/src/main/java/digit/web/controllers/ServiceDefinitionController.java b/core-services/service-request/src/main/java/digit/web/controllers/ServiceDefinitionController.java index 8cc826b4b26..574480a2825 100644 --- a/core-services/service-request/src/main/java/digit/web/controllers/ServiceDefinitionController.java +++ b/core-services/service-request/src/main/java/digit/web/controllers/ServiceDefinitionController.java @@ -44,7 +44,8 @@ public ResponseEntity create(@RequestBody @Valid Serv @RequestMapping(value="/definition/v1/_search", method = RequestMethod.POST) public ResponseEntity search(@Valid @RequestBody ServiceDefinitionSearchRequest serviceDefinitionSearchRequest) { List serviceDefinitionList = serviceDefinitionRequestService.searchServiceDefinition(serviceDefinitionSearchRequest); - ServiceDefinitionResponse response = ServiceDefinitionResponse.builder().serviceDefinition(serviceDefinitionList).build(); + Integer totalCount = serviceDefinitionRequestService.countTotalSurveys(serviceDefinitionSearchRequest); + ServiceDefinitionResponse response = ServiceDefinitionResponse.builder().serviceDefinition(serviceDefinitionList).totalCount(totalCount).build(); return new ResponseEntity<>(response,HttpStatus.OK); } diff --git a/core-services/service-request/src/main/java/digit/web/models/Action.java b/core-services/service-request/src/main/java/digit/web/models/Action.java new file mode 100644 index 00000000000..8c1fb9fc78b --- /dev/null +++ b/core-services/service-request/src/main/java/digit/web/models/Action.java @@ -0,0 +1,27 @@ +package digit.web.models; + +import java.util.List; + +import javax.validation.constraints.NotNull; +import lombok.*; +import org.springframework.validation.annotation.Validated; + + +@Validated +@AllArgsConstructor +@EqualsAndHashCode +@Getter +@NoArgsConstructor +@Setter +@ToString +@Builder +public class Action { + private String tenantId; + + private String id; + + private String eventId; + + @NotNull + private List actionUrls; +} diff --git a/core-services/service-request/src/main/java/digit/web/models/ActionItem.java b/core-services/service-request/src/main/java/digit/web/models/ActionItem.java new file mode 100644 index 00000000000..6c540b16e49 --- /dev/null +++ b/core-services/service-request/src/main/java/digit/web/models/ActionItem.java @@ -0,0 +1,23 @@ +package digit.web.models; + +import javax.validation.constraints.NotNull; +import lombok.*; +import org.springframework.validation.annotation.Validated; + + +@Validated +@AllArgsConstructor +@EqualsAndHashCode +@Getter +@NoArgsConstructor +@Setter +@ToString +@Builder +public class ActionItem { + @NotNull + private String actionUrl; + + @NotNull + private String code; + +} diff --git a/core-services/service-request/src/main/java/digit/web/models/Event.java b/core-services/service-request/src/main/java/digit/web/models/Event.java new file mode 100644 index 00000000000..c1f4aa6ac94 --- /dev/null +++ b/core-services/service-request/src/main/java/digit/web/models/Event.java @@ -0,0 +1,37 @@ +package digit.web.models; + +import javax.validation.constraints.NotNull; +import lombok.*; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; + +@Validated +@AllArgsConstructor +@EqualsAndHashCode +@Getter +@NoArgsConstructor +@Setter +@ToString +@Builder +public class Event { + @NotNull + private String tenantId; + + private String id; + + @NotNull + private String eventType; + + private String name; + + @NotNull + private String description; + + @NotNull + private String source; + + private EventDetails eventDetails; + + private Action actions; +} diff --git a/core-services/service-request/src/main/java/digit/web/models/EventDetails.java b/core-services/service-request/src/main/java/digit/web/models/EventDetails.java new file mode 100644 index 00000000000..1df32197b1a --- /dev/null +++ b/core-services/service-request/src/main/java/digit/web/models/EventDetails.java @@ -0,0 +1,37 @@ +package digit.web.models; + +import java.math.BigDecimal; +import lombok.*; +import org.springframework.validation.annotation.Validated; + +@Validated +@AllArgsConstructor +@EqualsAndHashCode +@Getter +@NoArgsConstructor +@Setter +@ToString +@Builder +public class EventDetails { + private String id; + + private String eventId; + + private Long fromDate; + + private Long toDate; + + private BigDecimal latitude; + + private BigDecimal longitude; + + private String address; + + + public boolean isEmpty(EventDetails details) { + if(null == details.getFromDate() || null == details.getToDate() || null == details.getLatitude() || null == details.getLongitude()) { + return true; + } + return false; + } +} diff --git a/core-services/service-request/src/main/java/digit/web/models/EventRequest.java b/core-services/service-request/src/main/java/digit/web/models/EventRequest.java new file mode 100644 index 00000000000..c935ab81bef --- /dev/null +++ b/core-services/service-request/src/main/java/digit/web/models/EventRequest.java @@ -0,0 +1,32 @@ +package digit.web.models; + +import java.util.List; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.egov.common.contract.request.RequestInfo; +import org.springframework.validation.annotation.Validated; + +@Validated +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class EventRequest { + @NotNull + @JsonProperty("RequestInfo") + private RequestInfo requestInfo; + + @NotNull + @Valid + @JsonProperty("events") + private List events; +} diff --git a/core-services/service-request/src/main/java/digit/web/models/ServiceDefinition.java b/core-services/service-request/src/main/java/digit/web/models/ServiceDefinition.java index 0d186e8114e..5456ba1f77a 100644 --- a/core-services/service-request/src/main/java/digit/web/models/ServiceDefinition.java +++ b/core-services/service-request/src/main/java/digit/web/models/ServiceDefinition.java @@ -30,7 +30,7 @@ @AllArgsConstructor @NoArgsConstructor @Builder -public class ServiceDefinition { +public class ServiceDefinition implements Comparable { @JsonProperty("id") @Size(min = 2, max = 64) private String id = null; @@ -44,6 +44,9 @@ public class ServiceDefinition { @Size(min = 2, max = 64) private String code = null; + @JsonProperty("postedBy") + private String postedBy = null; + @JsonProperty("module") @NotNull @Size(min = 2, max = 64) @@ -52,6 +55,10 @@ public class ServiceDefinition { @JsonProperty("isActive") private Boolean isActive = true; + @Size(max = 128) + @JsonProperty("status") + private String status; + @JsonProperty("attributes") @NotNull @Valid @@ -73,4 +80,10 @@ public ServiceDefinition addAttributesItem(AttributeDefinition attributesItem) { return this; } + // for sorting response according to create time + @Override + public int compareTo(ServiceDefinition other) { + return Long.compare(this.auditDetails.getCreatedTime(), other.auditDetails.getCreatedTime()); + } + } diff --git a/core-services/service-request/src/main/java/digit/web/models/ServiceDefinitionCriteria.java b/core-services/service-request/src/main/java/digit/web/models/ServiceDefinitionCriteria.java index f66d6aaf683..ae892d49f5a 100644 --- a/core-services/service-request/src/main/java/digit/web/models/ServiceDefinitionCriteria.java +++ b/core-services/service-request/src/main/java/digit/web/models/ServiceDefinitionCriteria.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; @@ -18,6 +19,7 @@ import lombok.NoArgsConstructor; import lombok.Data; import lombok.Builder; +import lombok.Builder.Default;; /** * The object will contain all the search parameters for Service Definition. @@ -46,6 +48,22 @@ public class ServiceDefinitionCriteria { @JsonProperty("clientId") private String clientId = null; + @JsonProperty("postedBy") + private String postedBy; + + @JsonProperty("status") + private String status; + + @JsonProperty("todaysDate") + private Long todaysDate; + + @JsonProperty("isActive") + private Boolean isActive; + + @JsonIgnore + @Default + private Boolean isCountCall = false; + public ServiceDefinitionCriteria addIdsItem(String idsItem) { if (this.ids == null) { this.ids = new ArrayList<>(); diff --git a/core-services/service-request/src/main/java/digit/web/models/ServiceDefinitionResponse.java b/core-services/service-request/src/main/java/digit/web/models/ServiceDefinitionResponse.java index 7e5e126f0d5..f853988c579 100644 --- a/core-services/service-request/src/main/java/digit/web/models/ServiceDefinitionResponse.java +++ b/core-services/service-request/src/main/java/digit/web/models/ServiceDefinitionResponse.java @@ -42,6 +42,9 @@ public class ServiceDefinitionResponse { @JsonProperty("Pagination") @Valid private Pagination pagination = null; + + @JsonProperty("TotalCount") + private Integer totalCount; public ServiceDefinitionResponse addServiceDefinitionItem(ServiceDefinition serviceDefinitionItem) { diff --git a/core-services/service-request/src/main/java/digit/web/models/User.java b/core-services/service-request/src/main/java/digit/web/models/User.java new file mode 100644 index 00000000000..d3791eac854 --- /dev/null +++ b/core-services/service-request/src/main/java/digit/web/models/User.java @@ -0,0 +1,76 @@ +package digit.web.models; + + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class User { + @JsonProperty("id") + private Long id = null; + + @JsonProperty("uuid") + private String uuid = null; + + @JsonProperty("userName") + private String userName = null; + + @JsonProperty("name") + private String name = null; + + @JsonProperty("gender") + private String gender = null; + + @JsonProperty("mobileNumber") + private String mobileNumber = null; + + @JsonProperty("emailId") + private String emailId = null; + + @JsonProperty("altContactNumber") + private String altContactNumber = null; + + @JsonProperty("pan") + private String pan = null; + + @JsonProperty("aadhaarNumber") + private String aadhaarNumber = null; + + @JsonProperty("permanentAddress") + private String permanentAddress = null; + + @JsonProperty("permanentPincode") + private String permanentPincode = null; + + @JsonProperty("correspondencePincode") + private String correspondencePincode = null; + + @JsonProperty("correspondenceAddress") + private String correspondenceAddress = null; + + @JsonProperty("active") + private Boolean active = null; + + @JsonProperty("createdBy") + private Long createdBy = null; + + @JsonProperty("lastModifiedBy") + private Long lastModifiedBy = null; + + @JsonProperty("tenantId") + private String tenantId = null; +} diff --git a/core-services/service-request/src/main/java/digit/web/models/UserResponse.java b/core-services/service-request/src/main/java/digit/web/models/UserResponse.java new file mode 100644 index 00000000000..e35c87e8d04 --- /dev/null +++ b/core-services/service-request/src/main/java/digit/web/models/UserResponse.java @@ -0,0 +1,22 @@ +package digit.web.models; + +import java.util.List; + +import org.egov.common.contract.response.ResponseInfo; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@AllArgsConstructor +@Data +@NoArgsConstructor +public class UserResponse { + @JsonProperty("responseInfo") + ResponseInfo responseInfo; + + @JsonProperty("user") + List user; +} diff --git a/core-services/service-request/src/main/java/digit/web/models/UserSearchRequest.java b/core-services/service-request/src/main/java/digit/web/models/UserSearchRequest.java new file mode 100644 index 00000000000..f7114beddea --- /dev/null +++ b/core-services/service-request/src/main/java/digit/web/models/UserSearchRequest.java @@ -0,0 +1,54 @@ +package digit.web.models; + +import java.util.List; +import java.util.Set; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.egov.common.contract.request.RequestInfo; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Builder +@Data +@NoArgsConstructor +@AllArgsConstructor +public class UserSearchRequest { + @JsonProperty("RequestInfo") + private RequestInfo requestInfo; + + @JsonProperty("id") + private List id; + + @JsonProperty("uuid") + private Set uuid; + + @JsonProperty("userName") + private String userName; + + @JsonProperty("name") + private String name; + + @JsonProperty("mobileNumber") + private String mobileNumber; + + @JsonProperty("aadhaarNumber") + private String aadhaarNumber; + + @JsonProperty("pan") + private String pan; + + @JsonProperty("emailId") + private String emailId; + + @JsonProperty("tenantId") + private String tenantId; + + @JsonProperty("pageSize") + private Integer pageSize=500; + + @JsonProperty("userType") + private String userType; +} diff --git a/core-services/service-request/src/main/resources/application.properties b/core-services/service-request/src/main/resources/application.properties index c040a347c22..036d2410559 100644 --- a/core-services/service-request/src/main/resources/application.properties +++ b/core-services/service-request/src/main/resources/application.properties @@ -47,8 +47,24 @@ egov.service.request.max.limit=100 # Kafka topics egov.service.definition.create.topic=save-service-definition +egov.service.definition.update.topic=update-service-definition egov.service.create.topic=save-service egov.service.create.indexer.topic=save-service-indexer # String input size configuration -egov.max.string.input.size=8192 \ No newline at end of file +egov.max.string.input.size=8192 + +#USER APIs +user.service.hostname=http://egov-user:8080/ +user.service.searchpath=user/_search + +# NOTIFICATION CONFIGS +egov.service.notification.ui.host=https://upyog-sandbox.niua.org/ +egov.service.notification.ui.redirect.url=digit-ui/citizen/engagement/surveys/fill-survey?applicationNumber={APPNUMBER}&tenantId={TENANTID} +egov.service.notification.fallback.locale=en_IN +egov.service.notification.action.code=PARTICIPATE +egov.service.notification.event.topic=persist-user-events-async + +# LOCALIZATION CONFIG +egov.localization.host=https://dev.digit.org +egov.localization.search.endpoint=/localization/messages/v1/_search \ No newline at end of file diff --git a/core-services/service-request/src/main/resources/service-request-persister.yml b/core-services/service-request/src/main/resources/service-request-persister.yml index ada2919663d..72985fdf203 100644 --- a/core-services/service-request/src/main/resources/service-request-persister.yml +++ b/core-services/service-request/src/main/resources/service-request-persister.yml @@ -135,4 +135,23 @@ serviceMaps: - jsonPath: $.Service.attributes.*.additionalDetails type: JSON - dbType: JSONB \ No newline at end of file + dbType: JSONB + + - version: 1.0 + description: Update service definition details in service definition table + fromTopic: update-service-definition + isTransaction: true + queryMaps: + + - query: UPDATE eg_service_definition SET isactive = ?, lastmodifiedby = ?, lastmodifiedtime = ? WHERE id = ? + basePath: $.ServiceDefinition + jsonMaps: + - jsonPath: $.ServiceDefinition.isActive + + - jsonPath: $.ServiceDefinition.auditDetails.lastModifiedBy + + - jsonPath: $.ServiceDefinition.auditDetails.lastModifiedTime + + - jsonPath: $.ServiceDefinition.clientId + + - jsonPath: $.ServiceDefinition.id \ No newline at end of file diff --git a/core-services/xstate-chatbot/nodejs/package.json b/core-services/xstate-chatbot/nodejs/package.json index 9a42f386769..a1aaa7b687c 100644 --- a/core-services/xstate-chatbot/nodejs/package.json +++ b/core-services/xstate-chatbot/nodejs/package.json @@ -1,6 +1,6 @@ { "name": "xstate-chatbot-server", - "version": "1.1.1", + "version": "1.0.1", "main": "src/app.js", "scripts": { "start": "node --inspect src/app.js", @@ -12,9 +12,12 @@ "JSONPath": "^0.11.2", "axios": "^0.18.1", "body-parser": "^1.18.3", + "cors": "^2.8.5", "express": "^4.16.4", "express-cluster": "0.0.5", "form-data": "^3.0.0", + "har-validator": "^5.1.5", + "http-proxy-middleware": "^2.0.6", "kafka-node": "^5.0.0", "lodash": "^4.17.11", "moment-timezone": "^0.5.32", diff --git a/core-services/xstate-chatbot/nodejs/src/app.js b/core-services/xstate-chatbot/nodejs/src/app.js index 0f900b90621..3d661d54d43 100644 --- a/core-services/xstate-chatbot/nodejs/src/app.js +++ b/core-services/xstate-chatbot/nodejs/src/app.js @@ -2,7 +2,7 @@ const express = require('express'), bodyParser = require('body-parser'), envVariables = require('./env-variables'), port = envVariables.port; - + const { createProxyMiddleware } = require('http-proxy-middleware'); const createAppServer = () => { const app = express(); app.use((req, res, next) => { @@ -18,6 +18,9 @@ const app = express(); app.use(bodyParser.urlencoded({ limit: '10mb', extended: true, parameterLimit: 50000 })); // app.use(cookieParser()); app.use(envVariables.contextPath, require('./channel/routes')); + app.use(createProxyMiddleware('/', // replace with your endpoint + { target: 'https://mseva.lgpunjab.gov.in/' } // replace with your target + )); module.exports = app; return app; } diff --git a/core-services/xstate-chatbot/nodejs/src/channel/value-first.js b/core-services/xstate-chatbot/nodejs/src/channel/value-first.js index 174b9ff99d1..e9aeaf23781 100644 --- a/core-services/xstate-chatbot/nodejs/src/channel/value-first.js +++ b/core-services/xstate-chatbot/nodejs/src/channel/value-first.js @@ -13,7 +13,7 @@ let valueFirstRequestBody = "{\"@VER\":\"1.2\",\"USER\":{\"@USERNAME\":\"\",\"@P let textMessageBody = "{\"@UDH\":\"0\",\"@CODING\":\"1\",\"@TEXT\":\"\",\"@MSGTYPE\":\"1\",\"@TEMPLATEINFO\":\"\",\"@PROPERTY\":\"0\",\"@ID\":\"\",\"ADDRESS\":[{\"@FROM\":\"\",\"@TO\":\"\",\"@SEQ\":\"\",\"@TAG\":\"\"}]}"; -let imageMessageBody = "{\"@UDH\":\"0\",\"@CODING\":\"1\",\"@TEXT\":\"\",\"@MSGTYPE\":\"4\",\"@MEDIADATA\":\"\",\"@CAPTION\":\"\",\"@TYPE\":\"image\",\"@CONTENTTYPE\":\"image\/png\",\"@TEMPLATEINFO\":\"\",\"@PROPERTY\":\"0\",\"@ID\":\"\",\"ADDRESS\":[{\"@FROM\":\"\",\"@TO\":\"\",\"@SEQ\":\"\",\"@TAG\":\"\"}]}"; +let imageMessageBody = "{\"@UDH\":\"0\",\"@CODING\":\"1\",\"@TEXT\":\"\",\"@MSGTYPE\":\"4\",\"@MEDIADATA\":\"\",\"@CAPTION\":\"\",\"@TYPE\":\"image\",\"@CONTENTTYPE\":\"image\/jpeg\",\"@TEMPLATEINFO\":\"\",\"@PROPERTY\":\"0\",\"@ID\":\"\",\"ADDRESS\":[{\"@FROM\":\"\",\"@TO\":\"\",\"@SEQ\":\"\",\"@TAG\":\"\"}]}"; let buttontemplateMessageBody = "{\"@UDH\":\"0\",\"@CODING\":\"1\",\"@TEXT\":\"\",\"@CAPTION\":\"\",\"@TYPE\":\"\",\"@CONTENTTYPE\":\"\",\"@TEMPLATEINFO\":\"\",\"@MSGTYPE\":\"3\",\"@B_URLINFO\":\"\",\"@PROPERTY\":\"0\",\"@ID\":\"\",\"ADDRESS\":[{\"@FROM\":\"\",\"@TO\":\"\",\"@SEQ\":\"1\",\"@TAG\":\"\"}]}" @@ -102,7 +102,7 @@ class ValueFirstWhatsAppProvider { input = '(' + requestBody.latitude + ',' + requestBody.longitude + ')'; } else if(type === 'image'){ - var imageInBase64String = requestBody.MediaData; + var imageInBase64String = requestBody.media_data; input = await this.convertFromBase64AndStore(imageInBase64String); } else if(type === 'unknown' || type === 'document') @@ -277,10 +277,21 @@ class ValueFirstWhatsAppProvider { async sendMessage(requestBody) { let url = config.valueFirstWhatsAppProvider.valueFirstURL; + let token = await this.generateBearerToken(); + console.log('token:' + token); + + if(token){ + token = 'Bearer ' + token; + + } + else { + console.error('Error in sending message'); + return undefined; + } let headers = { 'Content-Type': 'application/json', - 'Authorization': config.valueFirstWhatsAppProvider.valuefirstLoginAuthorizationHeader + 'Authorization': token } var request = { @@ -330,6 +341,34 @@ class ValueFirstWhatsAppProvider { this.sendMessage(requestBody); } + async generateBearerToken(){ + let url = config.valueFirstWhatsAppProvider.valueFirstTokenURL; + + let myheaders = { + 'Authorization': config.valueFirstWhatsAppProvider.valuefirstLoginAuthorizationHeader + } + var requestOptions = { + method: 'POST', + headers: myheaders, + origin: '*' + }; + url = url + '?action=generate'; + + console.log('URL: ' + url + JSON.stringify(requestOptions)); + let response = await fetch(url,requestOptions); + console.log(response); + if(response.status === 200){ + console.log('Token generated successfully'); + let messageBack = await response.json(); + return messageBack.token; + } + else { + console.error('Error while generating token'); + console.error(response); + return undefined; + } + } + async getTransformMessageForTemplate(reformattedMessages){ if(reformattedMessages.length>0){ let requestBody = JSON.parse(valueFirstRequestBody); diff --git a/core-services/xstate-chatbot/nodejs/src/machine/bills.js b/core-services/xstate-chatbot/nodejs/src/machine/bills.js index d93528fcd5a..886c107a422 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/bills.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/bills.js @@ -23,6 +23,10 @@ const bills = { id: 'fetchBillsForUser', src: (context) => billService.fetchBillsForUser(context.user,context.service), onDone: [ + { + target: '#paytmLinkForERPWnS', + cond: (context) => context.service == 'WS' || context.service == 'SW' + }, { target: 'personalBills', cond: (context, event) => { @@ -56,10 +60,19 @@ const bills = { let bills = context.bills.pendingBills; let localeList = config.supportedLocales.split(','); let localeIndex = localeList.indexOf(context.user.locale); - if(context.service == 'WS') + let serviceName = ''; + let serviceId = ''; + + if(context.service == 'WS' || context.service == 'SW'){ + serviceName=dialog.get_message(messages.serviceWSName, context.user.locale); + serviceId=dialog.get_message(messages.serviceConnectionNo, context.user.locale); templateList = config.valueFirstWhatsAppProvider.valuefirstNotificationWSBillTemplateid.split(','); - else + } + else{ + serviceName=dialog.get_message(messages.servicePTName, context.user.locale); + serviceId=dialog.get_message(messages.servicePropertyID, context.user.locale); templateList = config.valueFirstWhatsAppProvider.valuefirstNotificationPTBillTemplateid.split(','); + } if(templateList[localeIndex]) context.extraInfo.templateId = templateList[localeIndex]; @@ -70,23 +83,23 @@ const bills = { let bill = bills[0]; dialog.sendMessage(context, dialog.get_message(messages.personalBills.singleRecord, context.user.locale), true); await new Promise(resolve => setTimeout(resolve, 1000)); - let params=[]; - params.push(bill.id); - params.push(bill.payerName); - params.push("₹ "+bill.dueAmount); - params.push(bill.dueDate); - - let urlComponemt = bill.paymentLink.split('/'); - let bttnUrlComponent = urlComponemt[urlComponemt.length -1]; - - var templateContent = { - output: context.extraInfo.templateId, - type: "template", - params: params, - bttnUrlComponent: bttnUrlComponent - }; + let singleRecordMessage = dialog.get_message(messages.personalBills.singleRecord.billTemplate, context.user.locale); + console.log('singleRecordMessage: '+ singleRecordMessage); + singleRecordMessage = singleRecordMessage.replace('{{service}}',serviceName); + singleRecordMessage = singleRecordMessage.replace('{{serviceid}}',serviceId); + singleRecordMessage = singleRecordMessage.replace('{{id}}',bill.id); + singleRecordMessage = singleRecordMessage.replace('{{payerName}}',bill.payerName); + singleRecordMessage = singleRecordMessage.replace('{{dueAmount}}',"₹ "+bill.dueAmount); + // singleRecordMessage = singleRecordMessage.replace('{{dueDate}}',bill.dueDate); + singleRecordMessage = singleRecordMessage.replace('{{paymentLink}}',bill.paymentLink); + + console.log('After singleRecordMessage: '+ singleRecordMessage); + + dialog.sendMessage(context, singleRecordMessage, true); + await new Promise(resolve => setTimeout(resolve, 1000)); + dialog.sendMessage(context, dialog.get_message(messages.paymentDisclaimer, context.user.locale), true); - dialog.sendMessage(context, templateContent, true); + } else { let services = bills.map(element => element.service); let serviceSet = new Set(services); @@ -97,27 +110,29 @@ const bills = { for(let i = 0; i < bills.length; i++) { let bill = bills[i]; - let params=[]; - params.push(bill.id); - params.push(bill.payerName); - params.push("₹ "+bill.dueAmount); - params.push(bill.dueDate); - - let urlComponemt = bill.paymentLink.split('/'); - let bttnUrlComponent = urlComponemt[urlComponemt.length -1]; - - var templateContent = { - output: context.extraInfo.templateId, - type: "template", - params: params, - bttnUrlComponent: bttnUrlComponent - }; + // let params=[]; + // params.push(bill.id); + // params.push(bill.payerName); + // params.push("₹ "+bill.dueAmount); + // params.push(bill.dueDate); + let multipleRecordsMessage = dialog.get_message(messages.personalBills.multipleRecords.billTemplate, context.user.locale); + multipleRecordsMessage = multipleRecordsMessage.replace('{{service}}',serviceName); + multipleRecordsMessage = multipleRecordsMessage.replace('{{serviceid}}',serviceId); + multipleRecordsMessage = multipleRecordsMessage.replace('{{id}}',bill.id); + multipleRecordsMessage = multipleRecordsMessage.replace('{{payerName}}',bill.payerName); + multipleRecordsMessage = multipleRecordsMessage.replace('{{dueAmount}}',"₹ "+bill.dueAmount); + // multipleRecordsMessage = multipleRecordsMessage.replace('{{dueDate}}',bill.dueDate); + multipleRecordsMessage = multipleRecordsMessage.replace('{{paymentLink}}',bill.paymentLink); + + if(i==bills.length-1) - dialog.sendMessage(context, templateContent, true); + dialog.sendMessage(context, multipleRecordsMessage, true); else - dialog.sendMessage(context, templateContent, false); + dialog.sendMessage(context, multipleRecordsMessage, false); } + await new Promise(resolve => setTimeout(resolve, 900)); + dialog.sendMessage(context, dialog.get_message(messages.paymentDisclaimer, context.user.locale), true); } else { dialog.sendMessage(context, dialog.get_message(messages.personalBills.multipleRecordsSameService, context.user.locale), true); await new Promise(resolve => setTimeout(resolve, 1000)); @@ -125,34 +140,53 @@ const bills = { for(let i = 0; i < bills.length; i++) { let bill = bills[i]; - let params=[]; - params.push(bill.id); - params.push(bill.payerName); - params.push("₹ "+bill.dueAmount); - params.push(bill.dueDate); - - let urlComponemt = bill.paymentLink.split('/'); - let bttnUrlComponent = urlComponemt[urlComponemt.length -1]; - - var templateContent = { - output: context.extraInfo.templateId, - type: "template", - params: params, - bttnUrlComponent: bttnUrlComponent - }; + // let params=[]; + // params.push(bill.id); + // params.push(bill.payerName); + // params.push("₹ "+bill.dueAmount); + // params.push(bill.dueDate); + let multipleRrdsSameServiceMsgs = dialog.get_message(messages.personalBills.multipleRecordsSameService.billTemplate, context.user.locale); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{service}}',serviceName); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{serviceid}}',serviceId); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{id}}',bill.id); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{payerName}}',bill.payerName); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{dueAmount}}',"₹ "+bill.dueAmount); + // multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{dueDate}}',bill.dueDate); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{paymentLink}}',bill.paymentLink); + + // let urlComponemt = bill.paymentLink.split('/'); if(i == bills.length-1) - dialog.sendMessage(context, templateContent, true); + dialog.sendMessage(context, multipleRrdsSameServiceMsgs, true); else - dialog.sendMessage(context, templateContent, false); } + dialog.sendMessage(context, multipleRrdsSameServiceMsgs, false); } + await new Promise(resolve => setTimeout(resolve, 900)); + dialog.sendMessage(context, dialog.get_message(messages.paymentDisclaimer, context.user.locale), true); } - + } + let endStatement = dialog.get_message(messages.endStatement, context.user.locale); + await new Promise(resolve => setTimeout(resolve, 1000)); + dialog.sendMessage(context, endStatement, true); })(); }), always: '#searchBillInitiate' }, + paytmLinkForERPWnS:{ + id: 'paytmLinkForERPWnS', + initial: 'process', + states: { + process: { + onEntry: assign((context,event) => { + let message = dialog.get_message(messages.paytmPaymentMessage, context.user.locale); + message = message.replace('{{paymentLink}}',config.paytmWnSLink); + dialog.sendMessage(context, message, true); + }), + always : '#searchBillInitiate' + } + } + }, searchBillInitiate: { id: 'searchBillInitiate', initial: 'question', @@ -173,7 +207,7 @@ const bills = { onEntry: assign((context, event) => { let messageText = event.message.input; messageText = messageText.toLowerCase(); - let isValid = ((messageText === dialog.get_message(messages.quickReplyButtonText.mainMenu, context.user.locale) || messageText === dialog.get_message(messages.quickReplyButtonText.payOtherBill, context.user.locale)) && dialog.validateInputType(event, 'button')); + let isValid = ((messageText === 'main menu' || messageText === 'pay other bill') && dialog.validateInputType(event, 'button')); context.message = { isValid: isValid, messageContent: messageText @@ -366,7 +400,7 @@ const bills = { openSearch:{ onEntry: assign((context, event) => { (async() => { - context.slots.bills.openSearchLink = await billService.getOpenSearchLink(context.service,context.user.name,context.user.mobileNumber,context.user.locale); + context.slots.bills.openSearchLink = await billService.getOpenSearchLink(context.service); let { services, messageBundle } = billService.getSupportedServicesAndMessageBundle(); let billServiceName = dialog.get_message(messageBundle[context.service],context.user.locale); let message = dialog.get_message(messages.openSearch, context.user.locale); @@ -387,7 +421,7 @@ const bills = { }, error: { onEntry: assign( (context, event) => { - dialog.sendMessage(context, dialog.get_message(dialog.global_messages.error.retry, context.user.locale), true); + dialog.sendMessage(context, dialog.get_message(dialog.global_messages.error.retry, context.user.locale, true), false); }), always : 'question' } @@ -440,13 +474,11 @@ const bills = { }, re_enter: { onEntry: assign((context, event) => { - let { searchOptions, messageBundle } = billService.getSearchOptionsAndMessageBundleForService(context.service); - context.slots.bills.searchParamOption = searchOptions[0]; let { option, example } = billService.getOptionAndExampleMessageBundle(context.slots.bills.service, context.slots.bills.searchParamOption); let message = dialog.get_message(messages.paramInput.re_enter, context.user.locale); let optionMessage = dialog.get_message(option, context.user.locale); message = message.replace('{{option}}', optionMessage); - dialog.sendMessage(context, message, true); + dialog.sendMessage(context, message, false); }), always:{ target: 'question' @@ -505,10 +537,19 @@ const bills = { let bills = context.bills.searchResults; let localeList = config.supportedLocales.split(','); let localeIndex = localeList.indexOf(context.user.locale); - if(context.service == 'WS') + let serviceName = ''; + let serviceId = ''; + + if(context.service == 'WS' || context.service == 'SW'){ + serviceName=dialog.get_message(messages.serviceWSName, context.user.locale); + serviceId=dialog.get_message(messages.serviceConnectionNo, context.user.locale); templateList = config.valueFirstWhatsAppProvider.valuefirstNotificationWSBillTemplateid.split(','); - else + } + else{ + serviceName=dialog.get_message(messages.servicePTName, context.user.locale); + serviceId=dialog.get_message(messages.servicePropertyID, context.user.locale); templateList = config.valueFirstWhatsAppProvider.valuefirstNotificationPTBillTemplateid.split(','); + } if(templateList[localeIndex]) context.extraInfo.templateId = templateList[localeIndex]; @@ -520,24 +561,35 @@ const bills = { let bill = bills[0]; dialog.sendMessage(context, dialog.get_message(messages.billSearchResults.singleRecord, context.user.locale), true); await new Promise(resolve => setTimeout(resolve, 1000)); + let singleRecordMessage = dialog.get_message(messages.billSearchResults.singleRecord.billTemplate, context.user.locale); + singleRecordMessage = singleRecordMessage.replace('{{service}}',serviceName); + singleRecordMessage = singleRecordMessage.replace('{{serviceid}}',serviceId); + singleRecordMessage = singleRecordMessage.replace('{{id}}',bill.id); + singleRecordMessage = singleRecordMessage.replace('{{payerName}}',bill.payerName); + singleRecordMessage = singleRecordMessage.replace('{{dueAmount}}',"₹ "+bill.dueAmount); + // singleRecordMessage = singleRecordMessage.replace('{{dueDate}}',bill.dueDate); + singleRecordMessage = singleRecordMessage.replace('{{paymentLink}}',bill.paymentLink); + + // let params=[]; + // params.push(bill.id); + // params.push(bill.payerName); + // params.push("₹ "+bill.dueAmount); + // params.push(bill.dueDate); - let params=[]; - params.push(bill.id); - params.push(bill.payerName); - params.push("₹ "+bill.dueAmount); - params.push(bill.dueDate); - - let urlComponemt = bill.paymentLink.split('/'); - let bttnUrlComponent = urlComponemt[urlComponemt.length -1]; - - var templateContent = { - output: context.extraInfo.templateId, - type: "template", - params: params, - bttnUrlComponent: bttnUrlComponent - }; + // let urlComponemt = bill.paymentLink.split('/'); + // let bttnUrlComponent = urlComponemt[urlComponemt.length -1]; + + // var templateContent = { + // output: context.extraInfo.templateId, + // type: "template", + // params: params, + // bttnUrlComponent: bttnUrlComponent + // }; + + dialog.sendMessage(context, singleRecordMessage, true); + await new Promise(resolve => setTimeout(resolve, 1000)); + dialog.sendMessage(context, dialog.get_message(messages.paymentDisclaimer, context.user.locale), true); - dialog.sendMessage(context, templateContent, true); } else { let services = bills.map(element => element.service); let serviceSet = new Set(services); @@ -548,55 +600,75 @@ const bills = { for(let i = 0; i < bills.length; i++) { let bill = bills[i]; - let params=[]; - params.push(bill.id); - params.push(bill.payerName); - params.push("₹ "+bill.dueAmount); - params.push(bill.dueDate); - - let urlComponemt = bill.paymentLink.split('/'); - let bttnUrlComponent = urlComponemt[urlComponemt.length -1]; - - var templateContent = { - output: context.extraInfo.templateId, - type: "template", - params: params, - bttnUrlComponent: bttnUrlComponent - }; + let multipleRecordsMessage = dialog.get_message(messages.billSearchResults.multipleRecords.billTemplate, context.user.locale); + multipleRecordsMessage = multipleRecordsMessage.replace('{{service}}',serviceName); + multipleRecordsMessage = multipleRecordsMessage.replace('{{serviceid}}',serviceId); + multipleRecordsMessage = multipleRecordsMessage.replace('{{id}}',bill.id); + multipleRecordsMessage = multipleRecordsMessage.replace('{{payerName}}',bill.payerName); + multipleRecordsMessage = multipleRecordsMessage.replace('{{dueAmount}}',"₹ "+bill.dueAmount); + // multipleRecordsMessage = multipleRecordsMessage.replace('{{dueDate}}',bill.dueDate); + multipleRecordsMessage = multipleRecordsMessage.replace('{{paymentLink}}',bill.paymentLink); + + + + // let params=[]; + // params.push(bill.id); + // params.push(bill.payerName); + // params.push("₹ "+bill.dueAmount); - dialog.sendMessage(context, templateContent, true); + // var templateContent = { + // output: context.extraInfo.templateId, + // type: "template", + // params: params, + // bttnUrlComponent: bttnUrlComponent + // }; + + dialog.sendMessage(context, multipleRecordsMessage, true); } + await new Promise(resolve => setTimeout(resolve, 900)); + dialog.sendMessage(context, dialog.get_message(messages.paymentDisclaimer, context.user.locale), true); } else { - dialog.sendMessage(context, dialog.get_message(messages.billSearchResults.multipleRecordsSameService, context.user.locale), true); + dialog.sendMessage(context, dialog.get_message(messages.billSearchResults.multipleRecordsSameService, context.user.locale), false); await new Promise(resolve => setTimeout(resolve, 1000)); for(let i = 0; i < bills.length; i++) { let bill = bills[i]; + let multipleRrdsSameServiceMsgs = dialog.get_message(messages.billSearchResults.multipleRecordsSameService.billTemplate, context.user.locale); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{service}}',serviceName); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{serviceid}}',serviceId); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{id}}',bill.id); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{payerName}}',bill.payerName); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{dueAmount}}',"₹ "+bill.dueAmount); + // multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{dueDate}}',bill.dueDate); + multipleRrdsSameServiceMsgs = multipleRrdsSameServiceMsgs.replace('{{paymentLink}}',bill.paymentLink); + - let params=[]; - params.push(bill.id); - params.push(bill.payerName); - params.push("₹ "+bill.dueAmount); - params.push(bill.dueDate); - - let urlComponemt = bill.paymentLink.split('/'); - let bttnUrlComponent = urlComponemt[urlComponemt.length -1]; - context.extraInfo.bttnUrlComponent = bttnUrlComponent; - - var templateContent = { - output: context.extraInfo.templateId, - type: "template", - params: params, - bttnUrlComponent: bttnUrlComponent - }; + // let params=[]; + // params.push(bill.id); + // params.push(bill.payerName); + // params.push("₹ "+bill.dueAmount); + // params.push(bill.dueDate); + + // let urlComponemt = bill.paymentLink.split('/'); + // let bttnUrlComponent = urlComponemt[urlComponemt.length -1]; + // context.extraInfo.bttnUrlComponent = bttnUrlComponent; + + // var templateContent = { + // output: context.extraInfo.templateId, + // type: "template", + // params: params, + // bttnUrlComponent: bttnUrlComponent + // }; - dialog.sendMessage(context, templateContent, true); + dialog.sendMessage(context, multipleRrdsSameServiceMsgs, true); } + await new Promise(resolve => setTimeout(resolve, 1000)); + dialog.sendMessage(context, dialog.get_message(messages.paymentDisclaimer, context.user.locale), true); } } let endStatement = dialog.get_message(messages.endStatement, context.user.locale); await new Promise(resolve => setTimeout(resolve, 1500)); - dialog.sendMessage(context, endStatement); + dialog.sendMessage(context, endStatement, true); })(); }), @@ -618,7 +690,7 @@ const bills = { onEntry: assign((context, event) => { let messageText = event.message.input; messageText = messageText.toLowerCase(); - let isValid = ((messageText === dialog.get_message(messages.quickReplyButtonText.mainMenu, context.user.locale) || messageText === dialog.get_message(messages.quickReplyButtonText.payOtherBill, context.user.locale)) && dialog.validateInputType(event, 'button')); + let isValid = ((messageText === 'main menu' || messageText === 'pay other bill') && dialog.validateInputType(event, 'button')); //let textValid = (messageText === '1' || messageText === '2'); context.message = { isValid: (isValid || textValid), @@ -731,36 +803,61 @@ const bills = { }; let messages = { + paytmPaymentMessage: { + en_IN: '\n👉 To pay your water and sewerage bill kindly click on the below link\n{{paymentLink}}', + hi_IN: '\n👉 अपने पानी और सीवरेज बिल का भुगतान करने के लिए कृपया नीचे दिए गए लिंक पर क्लिक करें\n{{paymentLink}}', + pa_IN: '\n👉 ਆਪਣੇ ਪਾਣੀ ਅਤੇ ਸੀਵਰੇਜ ਦੇ ਬਿੱਲ ਦਾ ਭੁਗਤਾਨ ਕਰਨ ਲਈ ਹੇਠਾਂ ਦਿੱਤੇ ਲਿੰਕ ਤੇ ਕਲਿੱਕ ਕਰੋ\n{{paymentLink}}' + }, + servicePTName: { + en_IN: 'Property Tax', + hi_IN: 'संपत्ति कर' + }, + serviceWSName: { + en_IN: 'Water and Sewerage', + hi_IN: 'पानी और सीवरेज' + }, + servicePropertyID: { + en_IN: 'Property ID', + hi_IN: 'प्रॉपर्टी आईडी' + }, + serviceConnectionNo: { + en_IN: 'Connection No', + hi_IN: 'कनेक्शन नंबर' + }, personalBills: { singleRecord: { en_IN: 'Following are the unpaid bills linked to this mobile number 👇', - hi_IN: 'इस मोबाइल नंबर से जुड़े अवैतनिक बिल निम्नलिखित हैं 👇:', + hi_IN: 'इस मोबाइल नंबर से जुड़े अवैतनिक बिल निम्नलिखित हैं:', billTemplate: { - en_IN: '👉 *{{service}} Bill*\n\n*Connection No*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Due Date*\n{{dueDate}}\n\n*Payment Link :*\n{{paymentLink}}', - hi_IN: '👉 *{{service}} बिल*\n\n*कनेक्शन नंबर*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*देय तिथि *\n{{dueDate}}\n\n*भुगतान लिंक :*\n{{PaymentLink}}' + en_IN: '👉 *{{service}} Bill*\n\n*{{serviceid}}*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Payment Link :*\n{{paymentLink}}', + hi_IN: '👉 *{{service}} विधेयक*\n\n*{{serviceid}}*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*भुगतान लिंक :*\n{{paymentLink}}', + pa_IN: '👉 *{{service}} ਬਿੱਲ*\n\n*{{serviceid}}*\n{{id}}\n\n*ਮਾਲਕ ਦਾ ਨਾਮ*\n{{payerName}}\n\n*ਬਕਾਯਾ ਰਕਮ*\nरु {{dueAmount}}\n\n*ਭੁਗਤਾਨ ਲਿੰਕ :*\n{{paymentLink}}' } }, multipleRecords: { en_IN: 'Following are the unpaid bills linked to this mobile number 👇', - hi_IN: 'इस मोबाइल नंबर से जुड़े अवैतनिक बिल निम्नलिखित हैं 👇:', + hi_IN: 'इस मोबाइल नंबर से जुड़े अवैतनिक बिल निम्नलिखित हैं: ', billTemplate: { - en_IN: '👉 *{{service}} Bill*\n\n*Connection No*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Due Date*\n{{dueDate}}\n\n*Payment Link :*\n{{paymentLink}}', - hi_IN: '👉 *{{service}} बिल*\n\n*कनेक्शन नंबर*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*देय तिथि *\n{{dueDate}}\n\n*भुगतान लिंक :*\n{{PaymentLink}}' + en_IN: '👉 *{{service}} Bill*\n\n*{{serviceid}}*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Payment Link :*\n{{paymentLink}}', + hi_IN: '👉 *{{service}} विधेयक*\n\n*{{serviceid}}*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*भुगतान लिंक :*\n{{paymentLink}}', + pa_IN: '👉 *{{service}} ਬਿੱਲ*\n\n*{{serviceid}}*\n{{id}}\n\n*ਮਾਲਕ ਦਾ ਨਾਮ*\n{{payerName}}\n\n*ਬਕਾਯਾ ਰਕਮ*\nरु {{dueAmount}}\n\n*ਭੁਗਤਾਨ ਲਿੰਕ :*\n{{paymentLink}}' } }, multipleRecordsSameService: { en_IN: 'Following are the unpaid bills linked to this mobile number 👇', - hi_IN: 'इस मोबाइल नंबर से जुड़े अवैतनिक बिल निम्नलिखित हैं 👇:', + hi_IN: 'इस मोबाइल नंबर से जुड़े अवैतनिक बिल निम्नलिखित हैं: ', billTemplate: { - en_IN: '👉 *{{service}} Bill*\n\n*Connection No*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Due Date*\n{{dueDate}}\n\n*Payment Link :*\n{{paymentLink}}', - hi_IN: '👉 *{{service}} बिल*\n\n*कनेक्शन नंबर*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*देय तिथि *\n{{dueDate}}\n\n*भुगतान लिंक :*\n{{PaymentLink}}' + en_IN: '👉 *{{service}} Bill*\n\n*{{serviceid}}*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Payment Link :*\n{{paymentLink}}', + hi_IN: '👉 *{{service}} विधेयक*\n\n*{{serviceid}}*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*भुगतान लिंक :*\n{{paymentLink}}', + pa_IN: '👉 *{{service}} ਬਿੱਲ*\n\n*{{serviceid}}*\n{{id}}\n\n*ਮਾਲਕ ਦਾ ਨਾਮ*\n{{payerName}}\n\n*ਬਕਾਯਾ ਰਕਮ*\nरु {{dueAmount}}\n\n*ਭੁਗਤਾਨ ਲਿੰਕ :*\n{{paymentLink}}' } } }, noBills: { notLinked: { - en_IN: 'Sorry 😥 ! Your mobile number is not linked to the selected service.\n\nWe can still proceed with the payment using the *{{searchOption}}* mentioned in your *{{service}}* bill/receipt.', - hi_IN: 'क्षमा करें 😥! आपका मोबाइल नंबर चयनित सेवा से लिंक नहीं है।\n\nहम आपके *{{searchOption}}* या रसीद में उल्लिखित *{{service}}* का उपयोग करके भुगतान जारी रख सकते हैं।' + en_IN: 'Sorry 😥 ! Your mobile number is not linked to the selected service.\n\nWe can still proceed with the payment using the *{{searchOption}}* mentioned in your {{service}} bill/receipt.', + hi_IN: 'सॉरी 😥 ! आपका मोबाइल नंबर चयनित सेवा से लिंक नहीं है। हम अभी भी आपके {{service}} बिल/रसीद में उल्लिखित *{{searchOption}}* का उपयोग करके भुगतान के साथ आगे बढ़ सकते हैं।:', + pa_IN: 'ਮਾਫ ਕਰਨਾ 😥! ਤੁਹਾਡਾ ਮੋਬਾਈਲ ਨੰਬਰ ਚੁਣੀ ਗਈ ਸੇਵਾ ਨਾਲ ਜੁੜਿਆ ਨਹੀਂ ਹੈ. ਅਸੀਂ ਅਜੇ ਵੀ ਤੁਹਾਡੇ {{service}} ਦੇ ਬਿੱਲ / ਰਸੀਦ ਵਿੱਚ ਦਰਸਾਏ ਗਏ *{{searchOption}}* ਦੀ ਵਰਤੋਂ ਕਰਦਿਆਂ ਭੁਗਤਾਨ ਨੂੰ ਜਾਰੀ ਕਰ ਸਕਦੇ ਹਾਂ.' }, noPending: { en_IN: 'There are no pending bills against your account. You can still search the bills as given below', @@ -770,18 +867,19 @@ let messages = { searchBillInitiate: { question: { en_IN: '\nWant to pay any other {{billserviceName}} Bill ?\n\n👉 Type and Send *1* to Search & Pay for other bills.\n\n👉 To go back to the main menu, type and send *mseva*.', - hi_IN: '\nकृपया अन्य बिल या शुल्क के लिए खोज और भुगतान करें जो आपके मोबाइल नंबर से लिंक नहीं हैं, टाइप करें *1* और भेजें।\n\n👉 मुख्य मेनू पर वापस जाने के लिए *mseva* टाइप करें और भेजें ।' + hi_IN: '\nकृपया अन्य बिल या शुल्क के लिए खोज और भुगतान करें जो आपके मोबाइल नंबर से लिंक नहीं हैं, टाइप करें ‘1’ और भेजें। मुख्य मेनू पर वापस जाने के लिए ‘mseva’ टाइप करें और भेजें ।' }, error:{ - en_IN: "Option you have selected seems to be invalid 😐\nPlease select the valid option to proceed further.", - hi_IN: "चयनित विकल्प अमान्य प्रतीत होता है 😐\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।" + en_IN: "Option you have selected seems to be invalid 😐\nKindly click on the above button to proceed further.", + hi_IN: "क्षमा करें, मुझे समझ में नहीं आया" } }, billServices: { question: { preamble: { en_IN: 'Type and send the option number to indicate if you know the *{{searchOption}}* 👇\n\n*1.* Yes\n*2.* No', - hi_IN: 'यदि आप *{{searchOption}}* जानते हैं तो इंगित करने के लिए विकल्प संख्या टाइप करें और भेजें 👇\n\n*1.* हाँ\n*2.* नहीं' + hi_IN: 'टाइप करें और विकल्प संख्या भेजें यह इंगित करने के लिए कि क्या आप संपत्ति आईडी जानते हैं 👇\n\n1.हां\n2.नहीं', + pa_IN: 'ਇਹ ਸੰਕੇਤ ਕਰਨ ਲਈ ਵਿਕਲਪ ਨੰਬਰ ਲਿਖੋ ਅਤੇ ਭੇਜੋ ਕਿ ਕੀ ਤੁਹਾਨੂੰ ਜਾਇਦਾਦ ID know ਪਤਾ ਹੈ 👇\n\n1.हां\n2.नहीं' }, confirmation:{ en_IN: 'Do you have the *{{searchOption}}* to proceed for payment ?\n', @@ -790,74 +888,82 @@ let messages = { }, error:{ en_IN: 'Option you have selected seems to be invalid 😐\nKindly select the valid option to proceed further.', - hi_IN: 'चयनित विकल्प अमान्य प्रतीत होता है 😐\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।' + hi_IN: 'क्षमा करें, मुझे समझ में नहीं आया। कृपया दिए गए विकल्पों के लिए फिर से एक नंबर दर्ज करे।' } }, searchParamOptions: { question: { preamble: { en_IN: 'Please type and send the number for your option👇', - hi_IN: 'सेवा का चयन करने के लिए प्रासंगिक विकल्प संख्या टाइप करें और भेजें 👇' + hi_IN: 'कृपया नीचे दिए गए सूची से अपना विकल्प टाइप करें और भेजें:' } }, error:{ en_IN: 'Option you have selected seems to be invalid 😐\nKindly select the valid option to proceed further.', - hi_IN: 'चयनित विकल्प अमान्य प्रतीत होता है 😐\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।' + hi_IN: 'क्षमा करें, मुझे समझ में नहीं आया। कृपया दिए गए विकल्पों के लिए फिर से एक नंबर दर्ज करे।' } }, paramInput: { question: { en_IN: 'Please enter the *{{option}}*\n\n{{example}}', - hi_IN: 'कृपया *{{option}}* दर्ज करें\n\n{{example}}' + hi_IN: 'कृपया *{{option}}* दर्ज करें\n\n{{example}}', + pa_IN: 'कृपया *{{option}}* दर्ज करें\n\n{{example}}' }, re_enter: { en_IN: 'The entered {{option}} is not found in our records.\n\nPlease check the entered details and try again.\n\n👉 To go back to the main menu, type and send mseva.', - hi_IN: 'दर्ज किया गया {{option}} हमारे रिकॉर्ड में नहीं मिला है।\n\nकृपया दर्ज किए गए विवरणों की जांच करें और पुनः प्रयास करें\n\n👉 मुख्य मेनू पर वापस जाने के लिए mseva टाइप करें और भेजें।' + hi_IN: 'क्षमा करें, आपके द्वारा प्रदान किया गया मूल्य गलत है। बिलों को प्राप्त करने के लिए \n कृपया फिर से {{option}} दर्ज करें।\n\nमुख्य मेनू पर वापस जाने के लिए ‘mseva’ टाइप करें और भेजें ।' } }, billSearchResults: { noRecords: { en_IN: 'The {{searchParamOption}} : {{paramInput}} is not found in our records.\n\nPlease check the entered details and try again.', - hi_IN: 'दर्ज किया गया {{searchParamOption}} : {{paramInput}} हमारे रिकॉर्ड में नहीं मिला है।\n\nकृपया दर्ज किए गए विवरणों की जांच करें और पुनः प्रयास करें।' + hi_IN: 'आपके द्वारा प्रदान किए गए विवरण {{searchParamOption}} : {{paramInput}} हमारे रिकॉर्ड में नहीं पाया जाता है। कृपया आपके द्वारा प्रदान किए गए विवरण को एक बार फिर से देखें।' }, singleRecord: { en_IN: 'Following unpaid bills are found 👇', - hi_IN: 'निम्नलिखित बिल अवैतनिक पाए गए हैं 👇', + hi_IN: 'निम्नलिखित अवैतनिक बिल पाए जाते हैं', + pa_IN: 'ਹੇਠ ਦਿੱਤੇ ਬਿਨਾਂ ਭੁਗਤਾਨ ਕੀਤੇ ਬਿਲ ਮਿਲਦੇ ਹਨ 👇', billTemplate: { - en_IN: '👉 *{{service}} Bill*\n\n*Connection No*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Due Date*\n{{dueDate}}\n\n*Payment Link :*\n{{paymentLink}}', - hi_IN: '👉 *{{service}} बिल*\n\n*कनेक्शन नंबर*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*देय तिथि *\n{{dueDate}}\n\n*भुगतान लिंक :*\n{{PaymentLink}}' + en_IN: '👉 *{{service}} Bill*\n\n*{{serviceid}}*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Payment Link :*\n{{paymentLink}}', + hi_IN: '👉 *{{service}} विधेयक*\n\n*{{serviceid}}*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*भुगतान लिंक :*\n{{paymentLink}}', + pa_IN: '👉 *{{service}} ਬਿੱਲ*\n\n*{{serviceid}}*\n{{id}}\n\n*ਮਾਲਕ ਦਾ ਨਾਮ*\n{{payerName}}\n\n*ਬਕਾਯਾ ਰਕਮ*\nरु {{dueAmount}}\n\n*ਭੁਗਤਾਨ ਲਿੰਕ :*\n{{paymentLink}}' } }, multipleRecords: { en_IN: 'Following unpaid bills are found 👇', - hi_IN: 'निम्नलिखित बिल अवैतनिक पाए गए हैं 👇', + hi_IN: 'निम्नलिखित अवैतनिक बिल पाए जाते हैं', + pa_IN: 'ਹੇਠ ਦਿੱਤੇ ਬਿਨਾਂ ਭੁਗਤਾਨ ਕੀਤੇ ਬਿਲ ਮਿਲਦੇ ਹਨ 👇', billTemplate: { - en_IN: '👉 *{{service}} Bill*\n\n*Connection No*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Due Date*\n{{dueDate}}\n\n*Payment Link :*\n{{paymentLink}}', - hi_IN: '👉 *{{service}} बिल*\n\n*कनेक्शन नंबर*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*देय तिथि *\n{{dueDate}}\n\n*भुगतान लिंक :*\n{{PaymentLink}}' + en_IN: '👉 *{{service}} Bill*\n\n*{{serviceid}}*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Payment Link :*\n{{paymentLink}}', + hi_IN: '👉 *{{service}} विधेयक*\n\n*{{serviceid}}*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*भुगतान लिंक :*\n{{paymentLink}}', + pa_IN: '👉 *{{service}} ਬਿੱਲ*\n\n*{{serviceid}}*\n{{id}}\n\n*ਮਾਲਕ ਦਾ ਨਾਮ*\n{{payerName}}\n\n*ਬਕਾਯਾ ਰਕਮ*\nरु {{dueAmount}}\n\n*ਭੁਗਤਾਨ ਲਿੰਕ :*\n{{paymentLink}}' } }, multipleRecordsSameService: { en_IN: 'Following unpaid bills are found 👇', - hi_IN: 'निम्नलिखित बिल अवैतनिक पाए गए हैं 👇', + hi_IN: 'निम्नलिखित अवैतनिक बिल पाए जाते हैं', + pa_IN: 'ਹੇਠ ਦਿੱਤੇ ਬਿਨਾਂ ਭੁਗਤਾਨ ਕੀਤੇ ਬਿਲ ਮਿਲਦੇ ਹਨ 👇', billTemplate: { - en_IN: '👉 *{{service}} Bill*\n\n*Connection No*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Due Date*\n{{dueDate}}\n\n*Payment Link :*\n{{paymentLink}}', - hi_IN: '👉 *{{service}} बिल*\n\n*कनेक्शन नंबर*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*देय तिथि *\n{{dueDate}}\n\n*भुगतान लिंक :*\n{{PaymentLink}}' + en_IN: '👉 *{{service}} Bill*\n\n*{{serviceid}}*\n{{id}}\n\n*Owner Name*\n{{payerName}}\n\n*Amount Due*\nRs {{dueAmount}}\n\n*Payment Link :*\n{{paymentLink}}', + hi_IN: '👉 *{{service}} विधेयक*\n\n*{{serviceid}}*\n{{id}}\n\n*स्वामी का नाम*\n{{payerName}}\n\n*देय राशि*\nरु {{dueAmount}}\n\n*भुगतान लिंक :*\n{{paymentLink}}', + pa_IN: '👉 *{{service}} ਬਿੱਲ*\n\n*{{serviceid}}*\n{{id}}\n\n*ਮਾਲਕ ਦਾ ਨਾਮ*\n{{payerName}}\n\n*ਬਕਾਯਾ ਰਕਮ*\nरु {{dueAmount}}\n\n*ਭੁਗਤਾਨ ਲਿੰਕ :*\n{{paymentLink}}' } } }, paramInputInitiate: { question: { en_IN: 'Please type and send ‘1’ to Enter {{searchParamOption}} again. \nOr \'mseva\' to Go ⬅️ Back to the main menu.', - hi_IN: 'कृपया {{searchParamOption}} फिर से टाइप करने के लिए ’1’ टाइप करें और भेजें।\nअथवा मुख्य मेनू पर वापस जाने के लिए ‘mseva’ टाइप करें और भेजें।' + hi_IN: 'कृपया {{searchParamOption}} फिर से टाइप करने के लिए ’1’ टाइप करें और भेजें।\n\nमुख्य मेनू पर वापस जाने के लिए ‘mseva’ टाइप करें और भेजें ।' }, error:{ en_IN: "Option you have selected seems to be invalid 😐\nKindly select the valid option to proceed further.", - hi_IN: "चयनित विकल्प अमान्य प्रतीत होता है 😐\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।" + hi_IN: "क्षमा करें, मुझे समझ में नहीं आया" } }, openSearch: { - en_IN: "Click on the link below to search and pay your {{billserviceName}} bill 👇\n{{link}}\n\nThe image below shows you how to search and pay {{billserviceName}} bill using this link. 👇.", - hi_IN: "अपना {{billserviceName}} खोजने और भुगतान करने के लिए नीचे दिए गए लिंक पर क्लिक करें 👇\n{{link}}\n\nनीचे दी गई छवि आपको दिखाती है कि इस लिंक का उपयोग करके संपत्ति कर की खोज और भुगतान कैसे करें। 👇" + en_IN: "Click on the link below to search and pay your {{billserviceName}} bill -\n{{link}}\n\nThe image below shows you how to search and pay {{billserviceName}} bill using this link. 👇.", + hi_IN: "अपना{{billserviceName}} खोजने और भुगतान करने के लिए नीचे दिए गए लिंक पर क्लिक करें👇\n\n{{link}}\n\nनीचे दी गई छवि आपको दिखाती है कि इस लिंक का उपयोग करके {{billserviceName}} की खोज और भुगतान कैसे करें।", + pa_IN: "ਆਪਣਾ {{billserviceName}} search ਦੀ ਭਾਲ ਕਰਨ ਅਤੇ ਅਦਾਇਗੀ ਕਰਨ ਲਈ ਹੇਠਾਂ ਦਿੱਤੇ ਲਿੰਕ ਤੇ ਕਲਿੱਕ ਕਰੋ 👇\n\n{{link}}\n\nਹੇਠਾਂ ਦਿੱਤੀ ਤਸਵੀਰ ਤੁਹਾਨੂੰ ਦਰਸਾਉਂਦੀ ਹੈ ਕਿ ਇਸ ਲਿੰਕ ਦੀ ਵਰਤੋਂ ਨਾਲ {{billserviceName}} ਦੀ ਖੋਜ ਅਤੇ ਭੁਗਤਾਨ ਕਿਵੇਂ ਕਰਨਾ ਹੈ." }, newNumberregistration:{ confirm:{ @@ -866,22 +972,17 @@ let messages = { }, decline:{ en_IN: 'Thank you for the response 🙏\n\n👉 To go back to the main menu, type and send *mseva*', - hi_IN: 'प्रतिक्रिया के लिए धन्यवाद 🙏\n\n👉 मुख्य मेनू पर वापस जाने के लिए *mseva* टाइप करें और भेजें।' + hi_IN: 'प्रतिक्रिया के लिए धन्यवाद 🙏\n\n👉 मुख्य मेनू पर वापस जाने के लिए, टाइप करें और भेजें *mseva*' } }, endStatement: { en_IN: "👉 To go back to the main menu, type and send *mseva*", - hi_IN: "👉 मुख्य मेनू पर वापस जाने के लिए *mseva* टाइप करें और भेजें।" + hi_IN: "👉 मुख्य मेनू पर वापस जाने के लिए, टाइप करें और भेजें *mseva*" }, - quickReplyButtonText:{ - mainMenu:{ - en_IN: 'main menu', - hi_IN: 'मुख्य मेनू' - }, - payOtherBill:{ - en_IN: 'pay other bill', - hi_IN: 'अन्य बिल भुगतान' - } + paymentDisclaimer: { + en_IN: '👉 By clicking on the above link you confirm that your calculated property tax is correct or you can check your property details here https://mseva.lgpunjab.gov.in/citizen', + hi_IN: '👉 उपरोक्त लिंक पर क्लिक करके आप पुष्टि कर सकते हैं कि आपकी संपत्ति की गणना सही है। या आप यहां अपनी संपत्ति का विवरण देख सकते हैं https://mseva.lgpunjab.gov.in/citizen', + pa_IN: '👉 ਉਪਰੋਕਤ ਲਿੰਕ ਤੇ ਕਲਿਕ ਕਰਕੇ ਤੁਸੀਂ ਪੁਸ਼ਟੀ ਕਰ ਸਕਦੇ ਹੋ ਕਿ ਤੁਹਾਡਾ ਗਣਨਾ ਕੀਤਾ ਗਿਆ ਪ੍ਰਾਪਰਟੀ ਟੈਕਸ ਸਹੀ ਹੈ ਜਾਂ ਤੁਸੀਂ ਆਪਣੀ ਸੰਪਤੀ ਦੇ ਵੇਰਵੇ ਇੱਥੇ ਵੇਖ ਸਕਦੇ ਹੋ https://mseva.lgpunjab.gov.in/citizen' } } let grammer = { diff --git a/core-services/xstate-chatbot/nodejs/src/machine/pgr.js b/core-services/xstate-chatbot/nodejs/src/machine/pgr.js index 2345b2ec1f9..f278ed4a7cf 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/pgr.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/pgr.js @@ -4,7 +4,7 @@ const dialog = require('./util/dialog'); const localisationService = require('./util/localisation-service'); const config = require('../env-variables'); const moment = require("moment-timezone"); - +let event; const pgr = { id: 'pgr', initial: 'pgrmenu', @@ -204,7 +204,12 @@ const pgr = { let preamble = dialog.get_message(messages.fileComplaint.complaintType2Step.item.question.preamble, context.user.locale); let localisationPrefix = 'CS_COMPLAINT_TYPE_'; let complaintType = localisationService.getMessageBundleForCode(localisationPrefix + context.slots.pgr.complaint.toUpperCase()); - preamble = preamble.replace('{{complaint}}',dialog.get_message(complaintType,context.user.locale)); + let complaint = dialog.get_message(context.slots.pgr.complaint,context.user.locale); + if(complaint != undefined) + preamble = preamble.replace('{{complaint}}', complaint); + else + preamble = preamble.replace('{{complaint}}', context.slots.pgr.complaint); + let {prompt, grammer} = dialog.constructListPromptAndGrammer(complaintItems, messageBundle, context.user.locale, false, true); context.grammer = grammer; // save the grammer in context to be used in next step dialog.sendMessage(context, `${preamble}${prompt}`); @@ -795,31 +800,16 @@ const pgr = { onDone: { target: '#endstate', actions: assign((context, event) => { - let templateList; + console.log(event,"event"); let complaintDetails = event.data; - let localeList = config.supportedLocales.split(','); - let localeIndex = localeList.indexOf(context.user.locale); - templateList = config.valueFirstWhatsAppProvider.valuefirstNotificationLodgeCompliantTemplateid.split(','); - - if(templateList[localeIndex]) - context.extraInfo.templateId = templateList[localeIndex]; - else - context.extraInfo.templateId = templateList[0]; - - let params=[]; - params.push(complaintDetails.complaintNumber); - - let urlComponemt = complaintDetails.complaintLink.split('/'); - let bttnUrlComponent = urlComponemt[urlComponemt.length -1]; - - var templateContent = { - output: context.extraInfo.templateId, - type: "template", - params: params, - bttnUrlComponent: bttnUrlComponent - }; - - dialog.sendMessage(context, templateContent, true); + console.log(complaintDetails); + let message = dialog.get_message(messages.fileComplaint.persistComplaint, context.user.locale); + console.log(message); + message = message.replace('{{complaintNumber}}', complaintDetails.complaintNumber); + message = message.replace('{{complaintLink}}', complaintDetails.complaintLink); + let closingStatement = dialog.get_message(messages.fileComplaint.closingStatement, context.user.locale); + message = message + closingStatement; + dialog.sendMessage(context, message); }) } } @@ -855,25 +845,14 @@ const pgr = { dialog.sendMessage(context, preamble, true); await new Promise(resolve => setTimeout(resolve, 1000)); for(let i = 0; i < complaints.length; i++) { - let params=[]; + let template = dialog.get_message(messages.trackComplaint.results.complaintTemplate, context.user.locale); let complaint = complaints[i]; + template = template.replace('{{complaintType}}',complaint.complaintType); + template = template.replace('{{filedDate}}', complaint.filedDate); + template = template.replace('{{complaintStatus}}', complaint.complaintStatus); + template = template.replace('{{complaintLink}}', complaint.complaintLink); - params.push(complaint.complaintType); - params.push(complaint.complaintNumber); - params.push(complaint.filedDate); - params.push(complaint.complaintStatus); - - let urlComponemt = complaint.complaintLink.split('/'); - let bttnUrlComponent = urlComponemt[urlComponemt.length -1]; - - var templateContent = { - output: context.extraInfo.templateId, - type: "template", - params: params, - bttnUrlComponent: bttnUrlComponent - }; - - dialog.sendMessage(context, templateContent, true); + dialog.sendMessage(context, template, true); } await new Promise(resolve => setTimeout(resolve, 1000)); var closingStatement = dialog.get_message(messages.trackComplaint.results.closingStatement, context.user.locale); @@ -919,19 +898,27 @@ let messages = { question: { preamble: { en_IN : 'Please type and send the number to select a complaint type from the list below 👇\n', - hi_IN : 'नीचे दी गई सूची से शिकायत प्रकार चुनने के लिए विकल्प संख्या टाइप करें और भेजें 👇' + hi_IN : 'कृपया नीचे दी गई सूची में से एक शिकायत प्रकार का चयन करने के लिए नंबर टाइप करें और भेजें 👇', + pa_IN : 'ਹੇਠ ਲਿਖਤ ਸੂਚੀ ਵਿਚੋਂ ਸ਼ਿਕਾਇਤ ਕਿਸਮ ਚੁਣਨ ਲਈ ਕਿਰਪਾ ਕਰਕੇ ਨੰਬਰ ਲਿਖੋ ਅਤੇ ਭੇਜੋ 👇' }, otherType: { en_IN: 'Others', - hi_IN: 'अन्य' - } + hi_IN: 'Others', + pa_IN: 'Others' + }, + // Streetother:{ + // en_IN: 'Streetlight', + // hi_IN: 'Streetlight', + // pa_IN: 'Streetlight' + // }, } }, item: { question: { preamble : { en_IN : 'What is the problem you are facing with {{complaint}}?\n', - hi_IN : '{{complaint}} से आप किस प्रकार की समस्या का सामना कर रहे हैं?\n', + hi_IN : 'आपको {{complaint}} से क्या समस्या आ रही है', + pa_IN : '{{complaint}} ਨਾਲ ਤੁਸੀਂ ਕਿਸ ਸਮੱਸਿਆ ਦਾ ਸਾਹਮਣਾ ਕਰ ਰਹੇ ਹੋ' }, } }, @@ -939,17 +926,19 @@ let messages = { geoLocation: { question: { en_IN :'Please share your location if you are at the grievance site.\n\n👉 Refer the image below to understand steps for sharing the location.\n\n👉 To continue without sharing the location, type and send *1*.', - hi_IN : 'यदि आप शिकायत स्थल पर हैं तो कृपया अपना स्थान साझा करें।\n\n👉 स्थान साझा करने के चरणों को समझने के लिए नीचे दी गई छवि देखें।\n\n👉 स्थान साझा किए बिना जारी रखने के लिए, 1 टाइप करें और भेजें।' + hi_IN : 'यदि आप शिकायत स्थल पर हैं तो कृपया अपना स्थान साझा करें।\n\n👉 स्थान साझा करने के चरणों को समझने के लिए नीचे दी गई छवि देखें।\n\n👉 स्थान साझा किए बिना जारी रखने के लिए, टाइप करें और 1 भेजें।', + pa_IN : 'ਜੇ ਤੁਸੀਂ ਸ਼ਿਕਾਇਤ ਵਾਲੀ ਥਾਂ ਤੇ ਹੋ ਤਾਂ ਕਿਰਪਾ ਕਰਕੇ ਆਪਣਾ ਸਥਾਨ ਸਾਂਝਾ ਕਰੋ.\n\n👉 ਸਥਾਨ ਨੂੰ ਸਾਂਝਾ ਕਰਨ ਦੇ ਕਦਮਾਂ ਨੂੰ ਸਮਝਣ ਲਈ ਹੇਠ ਦਿੱਤੇ ਚਿੱਤਰ ਨੂੰ ਵੇਖੋ.\n\n👉 ਨਿਰਧਾਰਤ ਸਥਾਨ ਸਾਂਝਾ ਕੀਤੇ ਬਗੈਰ ਜਾਰੀ ਰੱਖਣ ਲਈ, 1 ਲਿਖੋ ਅਤੇ ਭੇਜੋ.' } }, // geoLocation confirmLocation: { confirmCityAndLocality: { en_IN: 'Is this the correct location of the complaint?\nCity: {{city}}\nLocality: {{locality}}\n\nType and send *1* if it is incorrect\nElse, type and send *2* to confirm and proceed', - hi_IN: 'क्या यह शिकायत का सही स्थान है?\nशहर: {{city}} \n स्थान: {{locality}} \n\nयदि यह गलत है *1* टाइप करें और भेजें\nअन्यथा, पुष्टि करने और आगे बढ़ने के लिए *2* टाइप करें और भेजें' + hi_IN: 'क्या यह शिकायत का सही स्थान है?\शहर: {{city}}\स्थान: {{locality}}\n\nटाइप करें और 1 भेजें यदि यह गलत है\nअन्यथा, पुष्टि करने और आगे बढ़ने के लिए 2 टाइप करें और भेजें', + pa_IN: 'ਕੀ ਇਹ ਸ਼ਿਕਾਇਤ ਦਾ ਸਹੀ ਸਥਾਨ ਹੈ?\ਸ਼ਹਿਰ: {{city}}\ਸਥਾਨ: {{locality}}\n\nਟਾਈਪ ਕਰੋ ਅਤੇ 1 ਭੇਜੋ ਜੇ ਇਹ ਗਲਤ ਹੈ\nਹੋਰ, ਪੁਸ਼ਟੀ ਕਰਨ ਅਤੇ ਅੱਗੇ ਵਧਣ ਲਈ ਟਾਈਪ ਕਰੋ ਅਤੇ 2 ਭੇਜੋ' }, confirmCity: { en_IN: 'Is this the correct location of the complaint?\nCity: {{city}}\n\nType and send *1* if it is incorrect\nElse, type and send *2* to confirm and proceed', - hi_IN: 'क्या यह शिकायत का सही स्थान है? \nशहर: {{city}}\nयदि यह गलत है *1* टाइप करें और भेजें\nअन्यथा, पुष्टि करने और आगे बढ़ने के लिए *2* टाइप करें और भेजें' + hi_IN: 'क्या यह शिकायत का सही स्थान है? \nशहर: {{city}}\n अगर यह गलत है तो कृपया "No" भेजें।\nअन्यथा किसी भी चरित्र को टाइप करें और आगे बढ़ने के लिए भेजें।' } }, city: { @@ -971,67 +960,76 @@ let messages = { imageUpload: { question: { en_IN: 'If possible, attach a photo of your grievance.\n\nTo continue without photo, type and send *1*', - hi_IN: 'यदि संभव हो तो अपनी शिकायत का फोटो संलग्न करें।\n\nफोटो के बिना जारी रखने के लिए, *1* टाइप करें और भेजें' + hi_IN: 'यदि संभव हो तो अपनी शिकायत का फोटो संलग्न करें।\n\nफोटो के बिना जारी रखने के लिए, टाइप करें और 1 भेजें', + pa_IN: ' ਨਾਮ ਦੀ ਪੁਸ਼ਟੀ ਕਰਨ ਲਈ 1 ਟਾਈਪ ਕਰੋ ਅਤੇ ਭੇਜੋ' }, error:{ en_IN : 'Sorry, I didn\'t understand', - hi_IN: 'क्षमा करें, मुझे समझ नहीं आया।', + hi_IN: 'क्षमा करें, मुझे समझ नहीं आया ।', } }, persistComplaint: { en_IN: 'Thank You 😃 Your complaint is registered successfully with mSeva.\n\nThe Complaint No is : *{{complaintNumber}}*\n\nClick on the link below to view and track your complaint:\n{{complaintLink}}\n', - hi_IN: 'धन्यवाद 😃 आपकी शिकायत mSeva के साथ सफलतापूर्वक दर्ज हो गई है।\n\nशिकायत संख्या है : *{{complaintNumber}}*\n\nअपनी शिकायत देखने और ट्रैक करने के लिए नीचे दिए गए लिंक पर क्लिक करें:\n {{complaintLink}}\n' + hi_IN: 'धन्यवाद 😃 आपकी शिकायत mSeva के साथ सफलतापूर्वक दर्ज हो गई है।\nशिकायत संख्या है: {{complaintNumber}}\n अपनी शिकायत देखने और ट्रैक करने के लिए नीचे दिए गए लिंक पर क्लिक करें:\n {{complaintLink}}\n', + pa_IN: 'ਧੰਨਵਾਦ 😃 ਤੁਹਾਡੀ ਸ਼ਿਕਾਇਤ mSeva ਨਾਲ ਸਫਲਤਾਪੂਰਵਕ ਰਜਿਸਟਰ ਹੋਈ ਹੈ.\nਸ਼ਿਕਾਇਤ ਨੰਬਰ ਹੈ: {{complaintNumber}}\n ਆਪਣੀ ਸ਼ਿਕਾਇਤ ਨੂੰ ਵੇਖਣ ਅਤੇ ਟਰੈਕ ਕਰਨ ਲਈ ਹੇਠਾਂ ਦਿੱਤੇ ਲਿੰਕ ਤੇ ਕਲਿੱਕ ਕਰੋ:\n {{complaintLink}}\n' }, closingStatement: { en_IN: '\nIn case of any help please type and send "mseva"', - hi_IN: '\nकिसी भी मदद के लिए कृपया "mseva" टाइप करें और भेजें' + hi_IN: '\nकिसी भी मदद के मामले में कृपया "mseva" टाइप करें और भेजें', + pa_IN: '\nਕਿਸੇ ਵੀ ਮਦਦ ਦੀ ਸਥਿਤੀ ਵਿੱਚ, ਕਿਰਪਾ ਕਰਕੇ ਟਾਈਪ ਕਰੋ ਅਤੇ ਭੇਜੋ' }, cityFuzzySearch: { question: { en_IN: "Enter the name of your city.\n\n(For example - Jalandhar, Amritsar, Ludhiana)", - hi_IN: "अपने शहर का नाम दर्ज करें।\n\n(उदाहरण के लिए - जालंधर, अमृतसर, लुधियाना)" + hi_IN: "अपने शहर का नाम दर्ज करें। (उदाहरण के लिए - जालंधर, अमृतसर, लुधियाना)", + pa_IN: "ਆਪਣੇ ਸ਼ਹਿਰ ਦਾ ਨਾਮ ਦਰਜ ਕਰੋ. (ਉਦਾਹਰਣ ਵਜੋਂ - ਜਲੰਧਰ, ਅੰਮ੍ਰਿਤਸਰ, ਲੁਧਿਆਣਾ" }, confirmation: { en_IN: "Did you mean *“{{city}}”* ?\n\n👉 Type and send *1* to confirm.\n\n👉 Type and send *2* to write again.", - hi_IN: "क्या आपका मतलब *“{{city}}”* था?\n\n👉 पुष्टि करने के लिए *1* टाइप करें और भेजें।\n\n👉 फिर से लिखने के लिए *2* टाइप करें और भेजें।" + hi_IN: "क्या आपका मतलब *“{{city}}”* से था ?\n\n👉 टाइप करें और पुष्टि करने के लिए 1 भेजें।\n\n👉 टाइप करें और फिर से लिखने के लिए 2 भेजें।", + pa_IN: "ਕੀ ਤੁਹਾਡਾ ਮਤਲਬ *“{{city}}”* ਹੈ ?\n\n👉 ਪੁਸ਼ਟੀ ਕਰਨ ਲਈ 1 ਲਿਖੋ ਅਤੇ ਭੇਜੋ.\n\n👉 ਟਾਈਪ ਕਰੋ ਅਤੇ ਦੁਬਾਰਾ ਲਿਖਣ ਲਈ 2 ਭੇਜੋ." }, noRecord:{ - en_IN: 'The provided city is either incorrect or not present in our record.\nPlease enter the details again.', - hi_IN: 'प्रदान किया गया शहर या तो गलत है या हमारे रिकॉर्ड में मौजूद नहीं है।\nकृपया विवरण फिर से दर्ज करें' + en_IN: 'Provided city is miss-spelled or not present in our system record.\nPlease enter the details again.', + hi_IN: 'आपके द्वारा दर्ज किया गया शहर गलत वर्तनी वाला है या हमारे सिस्टम रिकॉर्ड में मौजूद नहीं है।\nकृपया फिर से विवरण दर्ज करें।' } }, localityFuzzySearch: { question: { en_IN: "Enter the name of your locality.\n\n(For example - Ajit Nagar)", - hi_IN: "अपने इलाके का नाम दर्ज करें।\n\n(उदाहरण के लिए - अजीत नगर)" + hi_IN: "अपने इलाके का नाम दर्ज करें। (उदाहरण के लिए - अजीत नगर)", + pa_IN: "ਆਪਣੇ ਸਥਾਨ ਦਾ ਨਾਮ ਦਰਜ ਕਰੋ. (ਉਦਾਹਰਣ ਵਜੋਂ - ਅਜੀਤ ਨਗਰ)" }, confirmation: { en_IN: "Did you mean *“{{locality}}”* ?\n\n👉 Type and send *1* to confirm.\n\n👉 Type and send *2* to write again.", - hi_IN: "क्या आपका मतलब *“{{locality}}”* था?\n\n👉 पुष्टि करने के लिए *1* टाइप करें और भेजें।\n\n👉 फिर से लिखने के लिए *2* टाइप करें और भेजें।" + hi_IN: "क्या आपका मतलब *“{{locality}}”* से था ?\n\n👉 टाइप करें और पुष्टि करने के लिए 1 भेजें।\n\n👉 टाइप करें और फिर से लिखने के लिए 2 भेजें।", + pa_IN: "ਕੀ ਤੁਹਾਡਾ ਮਤਲਬ *“{{locality}}”* ਹੈ ?\n\n👉 ਪੁਸ਼ਟੀ ਕਰਨ ਲਈ 1 ਲਿਖੋ ਅਤੇ ਭੇਜੋ.\n\n👉 ਟਾਈਪ ਕਰੋ ਅਤੇ ਦੁਬਾਰਾ ਲਿਖਣ ਲਈ 2 ਭੇਜੋ." }, noRecord:{ - en_IN: 'The provided locality is either incorrect or not present in our record.\nPlease enter the details again.', - hi_IN: 'प्रदान किया गया स्थान या तो गलत है या हमारे रिकॉर्ड में मौजूद नहीं है।\nकृपया विवरण फिर से दर्ज करें' + en_IN: 'Provided locality is miss-spelled or not present in our system record.\nPlease enter the details again.', + hi_IN: 'आपके द्वारा दर्ज किया गया स्थान गलत वर्तनी वाला है या हमारे सिस्टम रिकॉर्ड में मौजूद नहीं है।\nकृपया फिर से विवरण दर्ज करें।' } } }, // fileComplaint trackComplaint: { noRecords: { en_IN: 'Sorry 😥 No complaints are found registered from this mobile number.\n\n👉 To go back to the main menu, type and send mseva.', - hi_IN: 'अब आपके द्वारा पंजीकृत कोई खुली शिकायत नहीं है।\n\n👉 मुख्य मेनू पर वापस जाने के लिए mseva टाइप करें और भेजें।' + hi_IN: 'अब आपके द्वारा पंजीकृत कोई खुली शिकायत नहीं है।\nमुख्य मेनू पर वापस जाने के लिए ‘mseva’ टाइप करें और भेजें ।' }, results: { preamble: { en_IN: 'Following are your open complaints', - hi_IN: 'आपकी निम्नलिखित शिकायतें खुली हैं:' + hi_IN: 'आपकी खुली शिकायतें निम्नलिखित हैं', + pa_IN: 'ਤੁਹਾਡੀਆਂ ਖੁੱਲੀਆਂ ਸ਼ਿਕਾਇਤਾਂ ਹੇਠ ਲਿਖੀਆਂ ਹਨ' }, complaintTemplate: { - en_IN: '*{{complaintType}}*\n\nFiled Date: {{filedDate}}\n\nCurrent Complaint Status: *{{complaintStatus}}*\n\nTap on the link below to view complaint details\n{{complaintLink}}', - hi_IN: '*{{complaintType}}*\n\nदायर तिथि: {{filedDate}}\n\nवर्तमान शिकायत की स्थिति: *{{complaintStatus}}*\n\nशिकायत विवरण देखने के लिए नीचे दिए गए लिंक पर टैप करें\n{{complaintLink}}' + en_IN: '*{{complaintType}}*\n\nFiled Date: {{filedDate}}\n\nCurrent Complaint Status: *{{complaintStatus}}*\n\nTap on the link below to view details\n{{complaintLink}}', + hi_IN: '*{{complaintType}}*\n\nदायर तिथि: {{filedDate}}\n\nशिकायत की स्थिति: *{{complaintStatus}}*\n\nशिकायत देखने के लिए नीचे दिए गए लिंक पर टैप करें\n{{complaintLink}}' }, closingStatement: { en_IN: '👉 To go back to the main menu, type and send mseva.', - hi_IN: '👉 मुख्य मेनू पर वापस जाने के लिए mseva टाइप करें और भेजें।' + hi_IN: '👉 मुख्य मेनू पर वापस जाने के लिए, टाइप करें और mseva भेजें।', + pa_IN: '👉 ਮੁੱਖ ਮੀਨੂੰ ਤੇ ਵਾਪਸ ਜਾਣ ਲਈ, ਟਾਈਪ ਕਰੋ ਅਤੇ ਮੇਲ ਭੇਜੋ.' } } } @@ -1040,15 +1038,15 @@ let messages = { let grammer = { pgrmenu: { question: [ - {intention: 'file_new_complaint', recognize: ['1', 'file', 'new']}, + {intention: 'file_new_complaint', recognize: ['1',]}, {intention: 'track_existing_complaints', recognize: ['2', 'track', 'existing']} ] }, confirmation: { choice: [ - {intention: 'Yes', recognize: ['1',]}, + {intention: 'Yes', recognize: ['1']}, {intention: 'No', recognize: ['2']} ] } }; -module.exports = pgr; +module.exports = pgr; \ No newline at end of file diff --git a/core-services/xstate-chatbot/nodejs/src/machine/receipts.js b/core-services/xstate-chatbot/nodejs/src/machine/receipts.js index ad6595fcee7..486f28ed41a 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/receipts.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/receipts.js @@ -57,7 +57,7 @@ const receipts = { error: { onEntry: assign( (context, event) => { let message =dialog.get_message(messages.services.error,context.user.locale); - dialog.sendMessage(context, message, true); + dialog.sendMessage(context, message,true); }), always : [ { @@ -146,7 +146,7 @@ const receipts = { ], onError: { actions: assign((context, event) => { - let message = dialog.get_message(messages.receiptSlip.error,context.user.locale); + let message = messages.receiptSlip.error; //context.chatInterface.toUser(context.user, message); dialog.sendMessage(context, message, true); }), @@ -224,6 +224,8 @@ const receipts = { states: { question: { onEntry: assign((context, event) => { + (async() => { + await new Promise(resolve => setTimeout(resolve, 1000)); let { searchOptions, messageBundle } = receiptService.getSearchOptionsAndMessageBundleForService(context.receipts.slots.service); context.receipts.slots.searchParamOption = searchOptions[0]; let { option, example } = receiptService.getOptionAndExampleMessageBundle(context.receipts.slots.service, context.receipts.slots.searchParamOption); @@ -495,7 +497,7 @@ const receipts = { ], onError: { actions: assign((context, event) => { - let message = dialog.get_message(messages.receiptSearchResults.error,context.user.locale); + let message = messages.receiptSearchResults.error; dialog.sendMessage(context, message , true); }), always : [ @@ -597,7 +599,10 @@ const receipts = { onEntry: assign((context, event) => { let messageText = event.message.input; messageText = messageText.toLowerCase(); - let isValid = ((messageText === dialog.get_message(messages.quickReplyButtonText.mainMenu,context.user.locale) || messageText === dialog.get_message(messages.quickReplyButtonText.viewReceipts,context.user.locale)) && dialog.validateInputType(event, 'button')); + console.log('After'); + // let isValid = ((messageText === 'main menu' || messageText === 'view receipts') && dialog.validateInputType(event, 'button')); + let isValid = ((messageText === '1' || messageText === '2')); + console.log('isValid: ' + isValid); context.message = { isValid: isValid, messageContent: messageText @@ -613,13 +618,13 @@ const receipts = { { target: '#pdfReceiptList', cond: (context, event) => { - return (context.message.isValid && context.message.messageContent ==='view receipts'); + return (context.message.isValid && context.message.messageContent ==='1'); } }, { target: '#sevamenu', cond: (context, event) => { - return (context.message.isValid && context.message.messageContent ==='main menu'); + return (context.message.isValid && context.message.messageContent ==='2'); } } ] @@ -709,7 +714,7 @@ const receipts = { ], onError: { actions: assign((context, event) => { - let message = dialog.get_message(messages.multipleRecordReceipt.error,context.user.locale); + let message = messages.multipleRecordReceipt.error; dialog.sendMessage(context, message , true); }), always : [ @@ -971,40 +976,42 @@ let messages = { question: { preamble: { en_IN: 'Type and send the option number to view payment history for the preferred service 👇', - hi_IN: 'पसंदीदा सेवा का भुगतान इतिहास देखने के लिए, विकल्प संख्या टाइप करें और भेजें 👇' + hi_IN: 'पसंदीदा सेवा के लिए भुगतान इतिहास देखने के लिए विकल्प संख्या टाइप करें और भेजें', + pa_IN: 'ਪਸੰਦੀਦਾ ਸੇਵਾ ਲਈ ਅਦਾਇਗੀ ਦੇ ਇਤਿਹਾਸ ਨੂੰ ਵੇਖਣ ਲਈ ਵਿਕਲਪ ਨੰਬਰ ਟਾਈਪ ਕਰੋ ਅਤੇ ਭੇਜੋ 👇' }, }, error:{ en_IN: 'Selected option seems to be invalid 😐\n\nPlease select the valid option to proceed further.', - hi_IN: 'चयनित विकल्प अमान्य प्रतीत होता है 😐\n\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।' + hi_IN: 'चयनित विकल्प अमान्य प्रतीत होता है 😐\n\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।', + pa_IN: 'ਚੁਣੀ ਹੋਈ ਚੋਣ ਅਵੈਧ ਜਾਪਦੀ ਹੈ 😐\n\nਕਿਰਪਾ ਕਰਕੇ ਅੱਗੇ ਵਧਣ ਲਈ ਜਾਇਜ਼ ਵਿਕਲਪ ਦੀ ਚੋਣ ਕਰੋ.' }, }, trackReceipts:{ error:{ en_IN: 'Sorry. Some error occurred on server!', - hi_IN: 'क्षमा करें। सर्वर पर कुछ त्रुटि हुई!' + hi_IN: 'माफ़ करना। सर्वर पर कुछ त्रुटि हुई!' }, }, receiptSlip:{ not_found:{ - en_IN: 'Sorry 😥 ! Your mobile number is not linked to the selected service.\n\n👉 We can still proceed to view payment history using the *{{searchOption}}* mentioned in your {{service}} bill/receipt.', - hi_IN: 'क्षमा करें 😥 ! आपका मोबाइल नंबर चयनित सेवा से लिंक नहीं है।' + en_IN: 'Sorry 😥 ! Your mobile number is not linked to selected service.\n\n👉 We can still proceed to view payment history using the *{{searchOption}}* mentioned in your {{service}} bill/receipt.', + hi_IN: 'सॉरी 😥 ! आपका मोबाइल नंबर चयनित सेवा से लिंक नहीं है।' }, error:{ en_IN:'Sorry. Some error occurred on server.', - hi_IN: 'क्षमा करें। सर्वर पर कुछ त्रुटि हुई!' + hi_IN: 'माफ़ करना। सर्वर पर कुछ त्रुटि हुई!' }, listofreceipts:{ singleRecord: { en_IN:'👉 {{service}} payment receipt\n\nConnection No {{id}}\nAmount Paid Rs. {{amount}}\nDate of Payment {{date}}\n\nReceipt Link : {{receiptDocumentLink}}\n\n', - hi_IN: '👉 आपकी {{service}} {{locality}}, {{city}}में संपत्ति के खिलाफ उपभोक्ता संख्या {{id}} के लिए भुगतान रसीद नीचे दी गई है 👇:\n\n भुगतान की प्रति देखने और डाउनलोड करने के लिए लिंक पर क्लिक करें ।\n\n {{date}} - रु {{amount}} - {{transactionNumber}} \n पलक: {{receiptDocumentLink}}\n\n' + hi_IN: 'आपकी {{service}} {{locality}}, {{city}} में संपत्ति के खिलाफ उपभोक्ता संख्या {{id}} के लिए भुगतान रसीद नीचे दी गई है 👇:\n\n भुगतान की प्रति देखने और डाउनलोड करने के लिए लिंक पर क्लिक करें ।\n\n {{date}} - रु {{amount}} - {{transactionNumber}} \n पलक: {{receiptDocumentLink}}\n\n' }, multipleRecordsSameService: { - en_IN: 'Following {{service records}} records found linked to your mobile number.\n\nPlease type and send the preferred option number to view the payment history 👇', - hi_IN: 'निम्नलिखित जल और सीवरेज रिकॉर्ड आपके मोबाइल नंबर से जुड़े हुए पाए गए।\n\nभुगतान इतिहास देखने के लिए पसंदीदा विकल्प संख्या टाइप करें और भेजें 👇', + en_IN: 'Following {{service records}} records found linked to your mobile number.\n\nPlease type and send the applicable option number to view the payment history 👇', + hi_IN: 'कई रिकॉर्ड मिले हैं। आगे बढ़ने के लिए एक रिकॉर्ड का चयन करें। आप हमेशा वापस आ सकते हैं और एक और रिकॉर्ड चुन सकते हैं।', receiptTemplate: { en_IN: '*{{consumerNumber}}*\n{{id}}\n*Locality:* {{locality}} , {{city}}', - hi_IN: '*{{consumerNumber}}*\n{{id}}\n*इलाका:* {{locality}} , {{city}}' + hi_IN: '*उपभोक्ता संख्या*\n{{id}} ,\n*इलाका:* {{locality}} , {{city}}' } } }, @@ -1012,19 +1019,20 @@ let messages = { searchReceptInitiate:{ question:{ en_IN:'Please type and send ‘1’ to Search and View for past payments which are not linked to your mobile number.', - hi_IN:'पिछले भुगतानों के खोज और दृश्य के लिए जो आपके मोबाइल नंबर से लिंक नहीं हैं| कृपया ’1’ टाइप करें और भेजें', + hi_IN:'पिछले भुगतानों के खोज और दृश्य के लिए जो आपके मोबाइल नंबर से लिंक नहीं हैं| कृपया 1 टाइप करें और भेजें', }, error:{ en_IN: 'Selected option seems to be invalid 😐\n\nPlease select the valid option to proceed further.', - hi_IN: 'चयनित विकल्प अमान्य प्रतीत होता है 😐\n\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।' + hi_IN: 'चयनित विकल्प अमान्य प्रतीत होता है 😐\n\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।', + pa_IN: 'ਚੁਣੀ ਹੋਈ ਚੋਣ ਅਵੈਧ ਜਾਪਦੀ ਹੈ 😐\n\nਕਿਰਪਾ ਕਰਕੇ ਅੱਗੇ ਵਧਣ ਲਈ ਜਾਇਜ਼ ਵਿਕਲਪ ਦੀ ਚੋਣ ਕਰੋ.' }, }, mobileLinkage:{ notLinked: { - en_IN: 'Sorry 😥 ! Your mobile number is not linked to the selected service.\n\n👉 We can still proceed to view payment history using the {{searchOption}} mentioned in your {{service}} bill/receipt.', - hi_IN: 'सॉरी 😥 ! आपका मोबाइल नंबर चयनित सेवा से लिंक नहीं है।\n\n👉 हम आपके {{service}} बिल या रसीद में उल्लिखित {{searchOption}} का उपयोग करके भुगतान इतिहास देखने के लिए आगे बढ़ सकते हैं।', + en_IN: 'Sorry 😥 ! Your mobile number is not linked to selected service.\n\n👉 We can still proceed to view payment history using the {{searchOption}} mentioned in your {{service}} bill/receipt.', + hi_IN: 'ऐसा लगता है कि आपके द्वारा उपयोग किया जा रहा मोबाइल नंबर {{service}} सेवा से लिंक नहीं है। कृपया अपने खाता नंबर को {{service}} सेवा से जोड़ने के लिए शहरी स्थानीय निकाय पर जाएँ। फिर भी आप अपनी खाता जानकारी खोजकर सेवा का लाभ उठा सकते हैं।', resultHeader:{ en_IN: 'Here are your past bill payment 👇\n\n', hi_IN: 'ये रहा आपका भुगतान इतिहास 👇\n\n', @@ -1035,26 +1043,28 @@ let messages = { question: { preamble: { en_IN: 'Please type and send the number for your option👇\n\n*1.* Yes\n*2.* No', - hi_IN: 'सेवा का चयन करने के लिए प्रासंगिक विकल्प संख्या टाइप करें और भेजें 👇\n\n*1.* हां\n*2.* नहीं' + hi_IN: 'कृपया टाइप करें और अपने विकल्प के लिए नंबर भेजें👇\n\n1.हां\n2.नहीं' }, confirmation: { en_IN: 'Type and send option number to indicate if you know the *{{searchOption}}* 👇\n\n*1.* Yes\n*2.* No', - hi_IN: 'यदि आप *{{searchOption}}* जानते हैं तो इंगित करने के लिए विकल्प संख्या टाइप करें और भेजें 👇\n\n*1.* हाँ\n*2.* नहीं' + hi_IN: 'क्या आपके पास भुगतान के लिए आगे बढ़ने के लिए {{searchOption}} है ?\n' } }, error:{ en_IN: 'Selected option seems to be invalid 😐\n\nPlease select the valid option to proceed further.', - hi_IN: 'चयनित विकल्प अमान्य प्रतीत होता है 😐\n\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।' + hi_IN: 'चयनित विकल्प अमान्य प्रतीत होता है 😐\n\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।', + pa_IN: 'ਚੁਣੀ ਹੋਈ ਚੋਣ ਅਵੈਧ ਜਾਪਦੀ ਹੈ 😐\n\nਕਿਰਪਾ ਕਰਕੇ ਅੱਗੇ ਵਧਣ ਲਈ ਜਾਇਜ਼ ਵਿਕਲਪ ਦੀ ਚੋਣ ਕਰੋ.' }, }, paramInput: { question: { en_IN: 'Please enter the *{{option}}*\n\n{{example}}', - hi_IN: 'कृपया *{{option}}* दर्ज करें\n\n{example}' + hi_IN: 'कृपया *{{option}}* दर्ज करें\n\n{{example}}', + pa_IN: 'ਕਿਰਪਾ ਕਰਕੇ *{{option}}* ਦਾਖਲ ਕਰੋ\n\n{{example}}' }, re_enter: { en_IN: 'The entered {{option}} is not found in our records.\n\nPlease check the entered details and try again.\n\n👉 To go back to the main menu, type and send mseva.', - hi_IN: 'दर्ज किया गया {{option}} हमारे रिकॉर्ड में नहीं मिला है।\n\nकृपया दर्ज किए गए विवरणों की जांच करें और पुनः प्रयास करें\n\n👉 मुख्य मेनू पर वापस जाने के लिए mseva टाइप करें और भेजें।' + hi_IN: 'क्षमा करें, आपके द्वारा प्रदान किया गया मान गलत है। \n कृपया फिर से बिल प्राप्त करने के लिए {{option}} फिर से दर्ज करें।\n\nऔर टाइप करें "mseva" और मुख्य मेनू पर वापस जाएं।' } }, receiptSearchResults:{ @@ -1064,7 +1074,7 @@ let messages = { }, norecords:{ en_IN:'The {{searchparamoption}} : {{paramInput}} is not found in our records.\n\nPlease check the entered details and try again.', - hi_IN: 'दर्ज किया गया {{searchparamoption}} : {{paramInput}} हमारे रिकॉर्ड में नहीं मिला है।\n\nकृपया दर्ज किए गए विवरणों की जांच करें और पुनः प्रयास करें।' + hi_IN: 'आपके द्वारा प्रदान किए गए विवरण {{searchparamoption}} : {{paramInput}} हमारे रिकॉर्ड में नहीं पाया जाता है। कृपया आपके द्वारा प्रदान किए गए विवरण को एक बार फिर से देखें।' }, results:{ singleRecord: { @@ -1072,23 +1082,29 @@ let messages = { hi_IN: 'आपकी {{service}} {{locality}}, {{city}} में संपत्ति के खिलाफ उपभोक्ता संख्या {{id}} के लिए भुगतान रसीद नीचे दी गई है 👇:\n\n भुगतान की प्रति देखने और डाउनलोड करने के लिए लिंक पर क्लिक करें ।\n\n {{date}} - रु {{amount}} - {{transactionNumber}} \n पलक: {{receiptDocumentLink}}\n\n' }, multipleRecordsSameService: { - en_IN: 'Following {{service records}} records found linked to your mobile number.\n\nPlease type and send the preferred option number to view the payment history 👇', - hi_IN: 'निम्नलिखित {{service records}} रिकॉर्ड आपके मोबाइल नंबर से जुड़े हुए पाए गए।\n\nभुगतान इतिहास देखने के लिए पसंदीदा विकल्प संख्या टाइप करें और भेजें 👇', + en_IN: 'Following {{service records}} records found linked to your mobile number.\n\nPlease type and send the applicable option number to view the payment history 👇', + hi_IN: 'कई रिकॉर्ड मिले हैं। आगे बढ़ने के लिए एक रिकॉर्ड का चयन करें। आप हमेशा वापस आ सकते हैं और एक और रिकॉर्ड चुन सकते हैं।', receiptTemplate: { en_IN: 'Consumer Number - {{id}}\nLocality: {{locality}} , {{city}}', - hi_IN: 'उपभोक्ता संख्या - {{id}}\nलोकैलिटी: {{locality}} , {{city}}' + hi_IN: 'उपभोक्ता संख्या - {{id}} , {{locality}} , {{city}}' } } }, }, paramInputInitiate: { + questionViewReceipts: { + en_IN: 'Please type and send your option to continue\n\n*1*. View Receipts\n*2*. Main Menu', + hi_IN: 'कृपया टाइप करें और जारी रखने के लिए अपना विकल्प भेजे \n\n*1*. देखें रसीद\n*2*. मुख्य मेनू', + pa_IN: 'ਕਿਰਪਾ ਕਰਕੇ ਜਾਰੀ ਕਰਨ ਲਈ ਆਪਣੀ ਚੋਣ ਟਾਈਪ ਕਰੋ ਅਤੇ ਭੇਜੋ \n\n*1*. ਰਸੀਦਾਂ ਵੇਖੋ \n*2*. ਮੁੱਖ ਮੇਨੂ' + }, question: { - en_IN: '👉 To view last payment receipt, type *1* and send\n\n👉 To go back to the main menu, type and send *mseva*.', - hi_IN: '👉 अंतिम भुगतान रसीद देखने के लिए, *1* टाइप करें और भेजें\n\n👉 मुख्य मेनू पर वापस जाने के लिए, *mseva* टाइप करें और भेजें।' + en_IN: '👉 To view last payment receipt, type and send *1*\n\n👉 To go back to the main menu, type and send *mseva*.', + hi_IN: '👉 अंतिम भुगतान रसीद देखने के लिए, टाइप करें और भेजें *1* \n\n👉 मुख्य मेनू पर वापस जाने के लिए, *mseva* टाइप करें और भेजें।' }, error:{ en_IN: 'Selected option seems to be invalid 😐\n\nPlease select the valid option to proceed further.', hi_IN: 'चयनित विकल्प अमान्य प्रतीत होता है 😐\n\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।', + pa_IN: 'ਚੁਣੀ ਹੋਈ ਚੋਣ ਅਵੈਧ ਜਾਪਦੀ ਹੈ 😐\n\nਕਿਰਪਾ ਕਰਕੇ ਅੱਗੇ ਵਧਣ ਲਈ ਜਾਇਜ਼ ਵਿਕਲਪ ਦੀ ਚੋਣ ਕਰੋ.' }, }, @@ -1101,7 +1117,7 @@ let messages = { multipleRecordReceipt:{ error:{ en_IN:'Sorry. Some error occurred on server.', - hi_IN: 'क्षमा करें। सर्वर पर कुछ त्रुटि हुई!' + hi_IN: 'माफ़ करना। सर्वर पर कुछ त्रुटि हुई!' }, singleReceipt: { en_IN:'Your {{service}} payment receipt for consumer number {{id}} against property in {{locality}},{{city}} is given 👇 below:\n\nClick on the link to view and download a copy of payment receipt.\n\n {{date}} - Rs. {{amount}} - {{transactionNumber}}\nLink: {{receiptDocumentLink}}\n\n', @@ -1110,6 +1126,7 @@ let messages = { multipleReceipts: { en_IN: 'Here is your payment history 👇\n\n', hi_IN: 'ये रहा आपका भुगतान इतिहास 👇', + pa_IN: 'ਇਹ ਤੁਹਾਡਾ ਭੁਗਤਾਨ ਦਾ ਇਤਿਹਾਸ ਹੈ 👇', receiptTemplate: { en_IN: '{{date}} {{status}} {{amount}}', hi_IN: '{{date}} {{status}} {{amount}}' @@ -1120,34 +1137,40 @@ let messages = { hi_IN: '*{{date}}* *{{status}}* *{{amount}}*', date:{ en_IN:'Date', - hi_IN:'तारीख' + hi_IN:'दिनांक', + pa_IN:'ਤਾਰੀਖ' }, amount:{ en_IN:'Amount', - hi_IN:'रकम' + hi_IN:'राशि', + pa_IN:'ਦੀ ਮਾਤਰਾ' }, status:{ en_IN:'Status', - hi_IN:'स्थिति' + hi_IN:'स्थिति', + pa_IN:'ਸਥਿਤੀ' }, paid:{ en_IN:'Paid', - hi_IN:'भुगतान किया' + hi_IN:'भुगतान', + pa_IN:'ਭੁਗਤਾਨ ਕੀਤਾ' } } }, pdfReceiptList:{ en_IN:"To view the receipt, please type and send the option number 👇", - hi_IN:"रसीद देखने के लिए विकल्प संख्या टाइप करें और भेजें 👇", + hi_IN:"रसीद देखने के लिए कृपया टाइप करें और विकल्प संख्या भेजें 👇", + pa_IN:"ਰਸੀਦ ਨੂੰ ਵੇਖਣ ਲਈ, ਕਿਰਪਾ ਕਰਕੇ ਟਾਈਪ ਕਰੋ ਅਤੇ ਵਿਕਲਪ ਨੰਬਰ send ਭੇਜੋ 👇", receiptTemplate:{ en_IN: "*Paid:* ₹ {{amount}} | *Date:* {{date}}", - hi_IN: "*भुगतान किया गया:* ₹ {{amount}} | *तारीख:* {{date}}" + hi_IN: "*भुगतान किया गया:* ₹ {{amount}} | *दिनांक:* {{date}}", + pa_IN: "*ਭੁਗਤਾਨ ਕੀਤਾ:* ₹ {{amount}} | *ਮਿਤੀ:* {{date}}" } }, lastState:{ en_IN: '👉 To go back to the main menu, type and send *mseva*.', - hi_IN: '👉 मुख्य मेनू पर वापस जाने के लिए mseva टाइप करें और भेजें।', + hi_IN: '👉 मुख्य मेनू पर वापस जाने के लिए, टाइप करें और *mseva* भेजें।', template: { en_IN: '*Consumer Number*\n{{id}}\n*Amount Paid* {{amount}}\n*Paid On* {{date}}', hi_IN: '*Consumer Number*\n{{id}}\n*Amount Paid* {{amount}}\n*Paid On* {{date}}' @@ -1155,18 +1178,8 @@ let messages = { }, wait:{ en_IN: "Please wait while your receipt is being generated.", - hi_IN: "कृपया प्रतीक्षा करें जब तक आपकी रसीद तैयार की जा रही है।" - }, - - quickReplyButtonText:{ - mainMenu:{ - en_IN: 'main menu', - hi_IN: 'मुख्य मेनू' - }, - viewReceipts:{ - en_IN: 'view receipts', - hi_IN: 'रसीद देखें' - } + hi_IN: "कृपया प्रतीक्षा करें जब तक आपकी रसीद तैयार की जा रही है।.", + pa_IN: "ਕਿਰਪਾ ਕਰਕੇ ਉਡੀਕ ਕਰੋ ਜਦੋਂ ਤੁਹਾਡੀ ਰਸੀਦ ਤਿਆਰ ਕੀਤੀ ਜਾ ਰਹੀ ਹੈ." } }; diff --git a/core-services/xstate-chatbot/nodejs/src/machine/service/dummy-pgr.js b/core-services/xstate-chatbot/nodejs/src/machine/service/dummy-pgr.js index b0a20cdd717..9961bac968d 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/service/dummy-pgr.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/service/dummy-pgr.js @@ -155,7 +155,7 @@ class DummyPGRService { "department": "Streetlights", "slaHours": 336, "menuPath": "StreetLights", - "active": false, + "active": true, "order": 1 }, { @@ -164,7 +164,7 @@ class DummyPGRService { "department": "DEPT_1", "slaHours": 336, "menuPath": "StreetLights", - "active": true, + "active": false, "order": 2 }, { @@ -622,51 +622,68 @@ class DummyPGRService { this.complaintCategoriesMessageBundle = { StreetLights: { en_IN : "Streetlights", - hi_IN : "सड़क की बत्तियाँ" + hi_IN : "स्ट्रीटलाइट्स", + pa_IN : "ਸਟ੍ਰੀਟ ਲਾਈਟਾਂ" }, Garbage: { en_IN : "Garbage", - hi_IN : "कचरा" + hi_IN : "कचरा", + pa_IN : "ਕੂੜਾ ਕਰਕਟ" }, Drains: { en_IN : "Drains", - hi_IN : "नालियों" + hi_IN : "नालियां", + pa_IN : "ਨਾਲੀਆਂ" }, WaterandSewage: { en_IN : "Water and Sewage", - hi_IN : "पानी और सीवेज" + hi_IN : "पानी और सीवेज", + pa_IN : "ਪਾਣੀ ਅਤੇ ਸੀਵਰੇਜ" }, RoadsAndFootpaths: { en_IN : "Roads and Footpaths", - hi_IN : "सड़कें और फुटपाथ" + hi_IN : "सड़कें और फुटपाथ", + pa_IN : "ਸੜਕਾਂ ਅਤੇ ਫੁੱਟਪਾਥ" }, Mosquitos: { en_IN : "Mosquitos", - hi_IN : "मच्छर" + hi_IN : "मच्छर", + pa_IN : "ਮੱਛਰ" }, Animals: { en_IN : "Animals", - hi_IN : "जानवरों" + hi_IN : "पशु", + pa_IN : "ਜਾਨਵਰ" }, PublicToilets: { en_IN : "Public Toilets", - hi_IN : "सार्वजनिक शौंचालय" + hi_IN : "सार्वजनिक शौचालय", + pa_IN : "ਜਨਤਕ ਟਾਇਲਟ" }, LandViolations: { en_IN : "Land violations", - hi_IN : "भूमि का उल्लंघन" + hi_IN : "भूमि उल्लंघन", + pa_IN : "ਜ਼ਮੀਨ ਦੀ ਉਲੰਘਣਾ" }, Trees: { en_IN : "Trees", - hi_IN : "पेड़" + hi_IN : "पेड़", + pa_IN : "ਰੁੱਖ" }, OpenDefecation: { en_IN : "Open defecation", - hi_IN : "खुले में शौच जाना" + hi_IN : "खुले में शौच", + pa_IN : "ਖੁੱਲਾ ਟੱਪਣਾ" }, Parks: { en_IN : "Parks", - hi_IN : "पार्क" + hi_IN : "पार्क", + pa_IN : "ਪਾਰਕ" + }, + Others: { + en_IN : "Others", + hi_IN : "अन्य", + pa_IN : "ਹੋਰ" } } } // constructor diff --git a/core-services/xstate-chatbot/nodejs/src/machine/service/egov-bill.js b/core-services/xstate-chatbot/nodejs/src/machine/service/egov-bill.js index 39959c64aff..7d147ba2634 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/service/egov-bill.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/service/egov-bill.js @@ -21,11 +21,13 @@ class BillService { let messageBundle = { WS: { en_IN: 'Water and Sewerage', - hi_IN: 'पानी और सीवरेज बिल' + hi_IN: 'पानी और सीवरेज', + pa_IN: 'ਪਾਣੀ ਅਤੇ ਸੀਵਰੇਜ' }, PT: { en_IN: 'Property Tax', - hi_IN: 'संपत्ति कर' + hi_IN: 'संपत्ति कर', + pa_IN: 'ਜਾਇਦਾਦ ਟੈਕਸ' }, TL: { en_IN: 'Trade License Fees', @@ -125,8 +127,8 @@ class BillService { hi_IN: 'कनेक्शन नंबर' }; example = { - en_IN: '(Connection No must be in format\nWS/XXX/XX-XX/XXXXX)', - hi_IN: '(कनेक्शन नंबर WS/XXX/XX-XX/XXXXX प्रारूप में होना चाहिए)' + en_IN: '(Connection Number must be in format\nXXXXXXXXXX OR WS/XXX/XX-XX/XXXXX)', + hi_IN: '(कनेक्शन नंबर nXXXXXXXXXX OR WS/XXX/XX-XX/XXXXX प्रारूप में होना चाहिए)' } } @@ -136,8 +138,9 @@ class BillService { hi_IN: 'संपत्ति आईडी' }; example = { - en_IN: '(Property ID must be in format\nPB-PT-XXXX-XX-XX-XXXXX)', - hi_IN: '(प्रॉपर्टी आईडी प्रारूप में होनी चाहिए\nPB-PT-XXXX-XX-XX-XXXXX)' + en_IN: '(Property ID must be in format\nPT-xxxx-xxxxxx)', + hi_IN: '(संपत्ति आईडी\nPT-xxxx-xxxxxx प्रारूप में होनी चाहिए)', + pa_IN: '(ਪ੍ਰਾਪਰਟੀ ID ਫਾਰਮੈਟ\nPT-xxxx-xxxxxx ਵਿੱਚ ਹੋਣੀ ਚਾਹੀਦੀ ਹੈ)' } } @@ -188,10 +191,10 @@ class BillService { } if(searchParamOption === 'consumerNumber' || searchParamOption === 'propertyId' || searchParamOption === 'connectionNumber'){ - if(service === 'PT'){ - let regexp = new RegExp(state+'-PT-\\d{4}-\\d{2}-\\d{2}-\\d+$'); - return regexp.test(paramInput); - } + // if(service === 'PT'){ + // let regexp = new RegExp(state+'-PT-\\d{4}-\\d{2}-\\d{2}-\\d+$'); + // return regexp.test(paramInput); + // } if(service === 'WS'){ //todo let regexp = new RegExp('^(WS|SW)/\\d{3}/\\d{4}-\\d{2}/\\d+$'); @@ -218,8 +221,7 @@ class BillService { } - async prepareBillResult(responseBody, user){ - let locale = user.locale; + async prepareBillResult(responseBody,authToken,locale){ let results=responseBody.Bill; let billLimit = config.billsAndReceiptsUseCase.billSearchLimit; @@ -243,7 +245,7 @@ class BillService { let toBillYear = new Date(result.billDetails[result.billDetails.length-1].toPeriod).getFullYear(); let billPeriod = fromMonth+" "+fromBillYear+"-"+toMonth+" "+toBillYear; let tenantId= result.tenantId; - let link = await self.getPaymentLink(result.consumerCode,tenantId,result.businessService,locale, user); + let link = await self.getPaymentLink(result.consumerCode,tenantId,result.businessService,locale); let serviceCode = localisationService.getMessageBundleForCode(localisationServicePrefix + result.businessService.toUpperCase()); var data={ @@ -344,7 +346,7 @@ class BillService { if(response.status === 201) { let responseBody = await response.json(); - results = await this.prepareBillResult(responseBody, user); + results = await this.prepareBillResult(responseBody, user.authToken, user.locale); totalBillSize=responseBody.Bill.length; pendingBillSize=results.length; @@ -466,7 +468,7 @@ class BillService { return data; } - async getPaymentLink(consumerCode,tenantId,businessService,locale, user) + async getPaymentLink(consumerCode,tenantId,businessService,locale) { var UIHost = config.egovServices.externalHost; var paymentPath = config.egovServices.msgpaylink; @@ -610,7 +612,7 @@ class BillService { return messageBundle; } - async getOpenSearchLink(service, name, mobileNumber, locale){ + async getOpenSearchLink(service){ var UIHost = config.egovServices.externalHost; var paymentPath; if(service=='WS') diff --git a/core-services/xstate-chatbot/nodejs/src/machine/service/egov-pgr-v1.js b/core-services/xstate-chatbot/nodejs/src/machine/service/egov-pgr-v1.js index 09865ebb8a0..4620179fbbb 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/service/egov-pgr-v1.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/service/egov-pgr-v1.js @@ -97,6 +97,11 @@ class PGRV1Service { let matchedCityMessageBundle = null; for(let city of cities) { let cityName = messageBundle[city]['en_IN']; + console.log(cityName); + if(cityAndLocality.city=="Sahibzada Ajit Singh Nagar") + { + cityAndLocality.city="Mohali"; + } if(cityName.toLowerCase() == cityAndLocality.city.toLowerCase()) { matchedCity = city; matchedCityMessageBundle = messageBundle[city]; @@ -433,7 +438,7 @@ class PGRV1Service { async makeCitizenURLForComplaint(serviceRequestId, mobileNumber){ let encodedPath = urlencode(serviceRequestId, 'utf8'); - let url = config.egovServices.externalHost + "citizen/otpLogin?mobileNo=" + mobileNumber + "&redirectTo=complaint-details/" + encodedPath + "&channel=whatsapp&tag=complaintTrack"; + let url = config.egovServices.externalHost + "citizen/otpLogin?mobileNo=" + mobileNumber + "&redirectTo=complaint-details/" + encodedPath; let shortURL = await this.getShortenedURL(url); return shortURL; } diff --git a/core-services/xstate-chatbot/nodejs/src/machine/service/egov-pgr.js b/core-services/xstate-chatbot/nodejs/src/machine/service/egov-pgr.js index 35bef7b898d..dcce5449ab4 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/service/egov-pgr.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/service/egov-pgr.js @@ -93,6 +93,10 @@ class PGRService { let latlng = geocode.substring(1, geocode.length - 1); // Remove braces let cityAndLocality = await getCityAndLocality(latlng); let { cities, messageBundle } = await this.fetchCities(tenantId); + if(cityAndLocality.city=="Sahibzada Ajit Singh Nagar") + { + cityAndLocality.city="Mohali"; +} let matchedCity = null; let matchedCityMessageBundle = null; for(let city of cities) { @@ -435,7 +439,7 @@ class PGRService { async makeCitizenURLForComplaint(serviceRequestId, mobileNumber){ let encodedPath = urlencode(serviceRequestId, 'utf8'); - let url = config.egovServices.externalHost + "citizen/otpLogin?mobileNo=" + mobileNumber + "&redirectTo=digit-ui/citizen/pgr/complaints/" + encodedPath + "&channel=whatsapp&tag=complaintTrack"; + let url = config.egovServices.externalHost + "citizen/otpLogin?mobileNo=" + mobileNumber + "&redirectTo=digit-ui/citizen/pgr/complaints/" + encodedPath; let shortURL = await this.getShortenedURL(url); return shortURL; } diff --git a/core-services/xstate-chatbot/nodejs/src/machine/service/egov-receipts.js b/core-services/xstate-chatbot/nodejs/src/machine/service/egov-receipts.js index 59dbef4e794..adb43cd06f6 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/service/egov-receipts.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/service/egov-receipts.js @@ -135,8 +135,9 @@ class ReceiptService { hi_IN: 'संपत्ति आईडी' }; example = { - en_IN: '(Property ID must be in format\nPB-PT-XXXX-XX-XX-XXXXX)', - hi_IN: '(प्रॉपर्टी आईडी प्रारूप में होनी चाहिए\nPB-PT-XXXX-XX-XX-XXXXX)' + en_IN: '(Property ID must be in format\nPT-xxxx-xxxxxx)', + hi_IN: '(संपत्ति आईडी\nPT-xxxx-xxxxxx प्रारूप में होनी चाहिए)', + pa_IN: '(ਪ੍ਰਾਪਰਟੀ ID ਫਾਰਮੈਟ\nPT-xxxx-xxxxxx ਵਿੱਚ ਹੋਣੀ ਚਾਹੀਦੀ ਹੈ)' } } diff --git a/core-services/xstate-chatbot/nodejs/src/machine/service/payment-status-update-event.js b/core-services/xstate-chatbot/nodejs/src/machine/service/payment-status-update-event.js index cdd86e76655..4ac67382666 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/service/payment-status-update-event.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/service/payment-status-update-event.js @@ -97,7 +97,7 @@ class PaymentStatusUpdateEventFormatter{ key = 'consolidatedreceipt'; - let pdfUrl = config.egovServices.externalHost + 'pdf-service/v1/_create'; + let pdfUrl = config.egovServices.egovServicesHost + 'pdf-service/v1/_create'; pdfUrl = pdfUrl + '?key='+key+ '&tenantId=' + tenantId; let msgId = request.RequestInfo.msgId.split('|'); @@ -105,13 +105,21 @@ class PaymentStatusUpdateEventFormatter{ let requestBody = { RequestInfo: { - authToken: request.RequestInfo.authToken, + authToken: user.authToken, msgId: msgId, userInfo: user.userInfo }, Payments:[] }; requestBody.Payments.push(payment); + console.log("Before PT receipt custom changes: " + JSON.stringify(requestBody)); + + if(businessService === 'PT'){ + this.ptreceipt(requestBody); + } + console.log("After PT receipt custom changes: " + JSON.stringify(requestBody)); + console.log("URL: "+ pdfUrl); + console.log("user token: "+ user.authToken); let options = { method: 'POST', @@ -129,7 +137,7 @@ class PaymentStatusUpdateEventFormatter{ }; let extraInfo = { whatsAppBusinessNumber: config.whatsAppBusinessNumber.slice(2), - fileName: consumerCode + fileName: key }; if(isOwner){ @@ -474,20 +482,23 @@ let messageBundle = { } }, paymentFail:{ - en_IN: "Sorry 😥! The Payment Transaction has failed due to authentication failure.\n\nYour transaction reference number is *{{transaction_number}}*.\n\nTo go back to the main menu, type and send mseva.", - hi_IN: "क्षमा करें 😥! प्रमाणीकरण विफलता के कारण भुगतान लेनदेन विफल हो गया है। आपका लेन-देन संदर्भ संख्या *{{transaction_number}}* है।\n\nमुख्य मेनू पर वापस जाने के लिए, टाइप करें और mseva भेजें।" + en_IN: "Sorry 😥! The Payment Transaction has failed due to authentication failure.\n\nYour transaction reference number is {{transaction_number}}.\n\nTo go back to the main menu, type and send mseva.", + hi_IN: "क्क्षमा करें 😥! प्रमाणीकरण विफलता के कारण भुगतान लेनदेन विफल हो गया है।\n\nआपकी लेन-देन संदर्भ संख्या {{transaction_number}} है।\n\nमुख्य मेनू पर वापस जाने के लिए, टाइप करें और mseva भेजें।", + pa_IN: "ਮਾਫ ਕਰਨਾ 😥! ਪ੍ਰਮਾਣਿਕਤਾ ਅਸਫਲ ਹੋਣ ਕਾਰਨ ਭੁਗਤਾਨ ਸੌਦਾ ਅਸਫਲ ਹੋ ਗਿਆ ਹੈ.\n\nਤੁਹਾਡਾ ਲੈਣ-ਦੇਣ ਦਾ ਹਵਾਲਾ ਨੰਬਰ {{transaction_number}} ਹੈ.\n\nਮੁੱਖ ਮੀਨੂੰ ਤੇ ਵਾਪਸ ਜਾਣ ਲਈ, ਟਾਈਪ ਕਰੋ ਅਤੇ ਮੇਲ ਭੇਜੋ." }, wait:{ en_IN: "Please wait while your receipt is being generated.", - hi_IN: "कृपया प्रतीक्षा करें जब तक कि आपकी रसीद उत्पन्न न हो जाए।" + hi_IN: "कृपया प्रतीक्षा करें जब तक आपकी रसीद तैयार की जा रही है।.", + pa_IN: "ਕਿਰਪਾ ਕਰਕੇ ਉਡੀਕ ਕਰੋ ਜਦੋਂ ਤੁਹਾਡੀ ਰਸੀਦ ਤਿਆਰ ਕੀਤੀ ਜਾ ਰਹੀ ਹੈ." }, registration:{ - en_IN: 'If you want to receive {{service}} bill alerts for *{{consumerCode}}* on this mobile number type and send *1*\n\nElse type and send *2*', + en_IN: 'If you want to receive {{service}} bill alerts for {{consumerCode}} on this mobile number type and send *1*\n\nElse type and send *2*', hi_IN: 'यदि आप इस मोबाइल नंबर प्रकार पर {{उपभोक्ता कोड}} के लिए बिल अलर्ट प्राप्त करना चाहते हैं और भेजें *1*\n\nअन्यथा टाइप करें और *2* भेजें' }, endStatement:{ en_IN: "👉 To go back to the main menu, type and send mseva.", - hi_IN: "👉 मुख्य मेनू पर वापस जाने के लिए, टाइप करें और mseva भेजें।" + hi_IN: '👉 मुख्य मेनू पर वापस जाने के लिए, टाइप करें और mseva भेजें।', + pa_IN: '👉 ਮੁੱਖ ਮੀਨੂੰ ਤੇ ਵਾਪਸ ਜਾਣ ਲਈ, ਟਾਈਪ ਕਰੋ ਅਤੇ ਮੇਲ ਭੇਜੋ.' } }; diff --git a/core-services/xstate-chatbot/nodejs/src/machine/service/reminders-service.js b/core-services/xstate-chatbot/nodejs/src/machine/service/reminders-service.js index 187fddbffdf..de6ac18ee86 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/service/reminders-service.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/service/reminders-service.js @@ -68,7 +68,8 @@ class RemindersService { let messages = { reminder:{ en_IN: 'You have not selected any option.\n\n👉 To continue, please type and send mseva.', - hi_IN: 'आपने कोई विकल्प नहीं चुना है।\n\n👉 जारी रखने के लिए, कृपया mseva टाइप करें और भेजें' + hi_IN: 'आपने कोई विकल्प नहीं चुना है।\n\n👉 जारी रखने के लिए, कृपया टाइप करें और mseva भेजें', + pa_IN: 'ਤੁਸੀਂ ਕੋਈ ਵਿਕਲਪ ਨਹੀਂ ਚੁਣਿਆ ਹੈ.\n\n👉 ਜਾਰੀ ਰੱਖਣ ਲਈ, ਕਿਰਪਾ ਕਰਕੇ ਟਾਈਪ ਕਰੋ ਅਤੇ mseva ਭੇਜੋ' } } diff --git a/core-services/xstate-chatbot/nodejs/src/machine/seva.js b/core-services/xstate-chatbot/nodejs/src/machine/seva.js index 37102f0509f..41725f6f73d 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/seva.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/seva.js @@ -39,9 +39,15 @@ const sevaMachine = Machine({ question: { onEntry: assign((context, event) => { context.onboarding = {}; - let message = messages.onboarding.onboardingLocale.question; + // let message = messages.onboarding.onboardingLocale.question; context.grammer = grammer.locale.question; - dialog.sendMessage(context, message, true); + + var templateContent = { + output: "3797433", + type: "template" + }; + dialog.sendMessage(context, templateContent, true); + // dialog.sendMessage(context, message, true); }), on: { USER_MESSAGE: 'process' @@ -92,8 +98,7 @@ const sevaMachine = Machine({ (async() => { await new Promise(resolve => setTimeout(resolve, 3000)); let nameInformationMessage = dialog.get_message(messages.onboarding.nameInformation, context.user.locale); - dialog.sendMessage(context, nameInformationMessage); - await new Promise(resolve => setTimeout(resolve, 1000)); + dialog.sendMessage(context, nameInformationMessage, false); let message = dialog.get_message(messages.onboarding.onboardingName.question, context.user.locale); dialog.sendMessage(context, message); })(); @@ -129,8 +134,7 @@ const sevaMachine = Machine({ (async() => { await new Promise(resolve => setTimeout(resolve, 3000)); let nameInformationMessage = dialog.get_message(messages.onboarding.nameInformation, context.user.locale); - dialog.sendMessage(context, nameInformationMessage); - await new Promise(resolve => setTimeout(resolve, 1000)); + dialog.sendMessage(context, nameInformationMessage, false); let message = dialog.get_message(messages.onboarding.onBoardingUserProfileConfirmation.question, context.user.locale); message = message.replace('{{name}}', context.user.name); dialog.sendMessage(context, message); @@ -292,11 +296,26 @@ const sevaMachine = Machine({ invoke: { onEntry: assign((context, event) => { var message = dialog.get_message(messages.welcome, context.user.locale); - if(context.user.name) + let name = 'Citizen'; + if(context.user.name){ message = message.replace('{{name}}', context.user.name); - else - message = message.replace(' {{name}}', 'Citizen'); - dialog.sendMessage(context, message, true); + name=context.user.name; + } + else { + message = message.replace('{{name}}', 'Citizen'); + name='Citizen'; + } + let params=[]; + params.push(name); + + var templateContent = { + output: "3797437", + type: "template", + params: params + }; + + dialog.sendMessage(context, templateContent, true); + // dialog.sendMessage(context, message, true); }), always: '#sevamenu' } @@ -310,8 +329,8 @@ const sevaMachine = Machine({ if(context.user.name) message = message.replace('{{name}}', context.user.name); else - message = message.replace(' {{name}}', ''); - dialog.sendMessage(context, message); + message = message.replace('{{name}}', ''); + dialog.sendMessage(context, message, true); }), always: '#sevamenu' }, @@ -453,57 +472,66 @@ let messages = { }, onboarding: { onboardingWelcome:{ - en_IN: 'Dear Citizen,\n\nWelcome to mSeva 🙏\n\nNow you can file/ track your complaints and pay your bills via WhatsApp.', - hi_IN: 'प्रिय नागरिक,\n\nएमसेवा में आपका स्वागत है 🙏\n\nअब आप अपनी शिकायतों को दर्ज या ट्रैक कर सकते हैं और व्हाट्सएप के माध्यम से अपने बिलों का भुगतान भी कर सकते हैं।' + en_IN: 'Dear Citizen,\n\nWelcome to mSeva Punjab 🙏\n\nNow you can file/ track your complaints and pay your bills via WhatsApp.', + hi_IN: 'प्रिय नागरिक,\n\nएमसेवा पंजाब में आपका स्वागत है 🙏\n\nअब आप व्हाट्सएप के माध्यम से अपनी शिकायतें दर्ज/ट्रैक कर सकते हैं और अपने बिलों का भुगतान कर सकते हैं।', + pa_IN: 'ਪਿਆਰੇ ਨਾਗਰਿਕ,\n\nਐਮਸੇਵਾ ਪੰਜਾਬ ਵਿਚ ਤੁਹਾਡਾ ਸਵਾਗਤ ਹੈ 🙏\n\nਹੁਣ ਤੁਸੀਂ ਆਪਣੀਆਂ ਸ਼ਿਕਾਇਤਾਂ ਦਾਇਰ / ਟਰੈਕ ਕਰ ਸਕਦੇ ਹੋ ਅਤੇ ਆਪਣੇ ਬਿੱਲਾਂ ਦਾ ਭੁਗਤਾਨ ਵਟਸਐਪ ਰਾਹੀਂ ਕਰ ਸਕਦੇ ਹੋ.' }, onboardingLocale: { - question: 'To select the language simply type and send the number of the preferred option 👇\n\n1. English\n2. हिन्दी\n3. ਪੰਜਾਬੀ' + question:'To select the language simply type and send the number of the preferred option 👇\n\n1. English\n2. हिन्दी\n3. ਪੰਜਾਬੀ' }, onboardingName: { question: { en_IN: 'As per our records, we have not found any name linked to this mobile number.\n\n👉 Please provide your name to continue.', - hi_IN: 'हमारे रिकॉर्ड के अनुसार, हमें इस मोबाइल नंबर से जुड़ा कोई नाम नहीं मिला है।\n\n👉 जारी रखने के लिए कृपया अपना नाम प्रदान करें।' + hi_IN: 'हमारे रिकॉर्ड के अनुसार, हमें इस मोबाइल नंबर से जुड़ा कोई नाम नहीं मिला है।\n\n👉 जारी रखने के लिए कृपया अपना नाम प्रदान करें।', + pa_IN: 'ਸਾਡੇ ਰਿਕਾਰਡ ਦੇ ਅਨੁਸਾਰ, ਸਾਨੂੰ ਇਸ ਮੋਬਾਈਲ ਨੰਬਰ ਨਾਲ ਜੁੜਿਆ ਕੋਈ ਨਾਮ ਨਹੀਂ ਮਿਲਿਆ ਹੈ.\n\n👉 ਜਾਰੀ ਰੱਖਣ ਲਈ ਕਿਰਪਾ ਕਰਕੇ ਆਪਣਾ ਨਾਮ ਦੇਣ ਦੀ ਖ਼ੇਚਲ ਕੀਤੀ ਜਾਵੈ' } }, onBoardingUserProfileConfirmation: { question: { en_IN: 'As per our records, we have found the name *“{{name}}”* linked with this mobile number.\n\n👉 Type and send *1* to confirm the name.\n\n👉 Type and send *2* to change the name.', - hi_IN: 'हमारे रिकॉर्ड के अनुसार, हमें इस मोबाइल नंबर से जुड़ा *“{{name}}”* नाम मिला है।\n\n👉 नाम की पुष्टि करने के लिए *1* टाइप करें और भेजें।\n\n👉 नाम बदलने के लिए *2* टाइप करें और भेजें।' + hi_IN: 'हमारे रिकॉर्ड के अनुसार, हमें इस मोबाइल नंबर से जुड़ा *“{{name}}”* नाम मिला है।\n\n👉 नाम की पुष्टि करने के लिए 1 टाइप करें और भेजें\n\n👉 नाम बदलने के लिए 2 टाइप करें और भेजें', + pa_IN: 'ਸਾਡੇ ਰਿਕਾਰਡ ਦੇ ਅਨੁਸਾਰ, ਸਾਨੂੰ ਇਸ ਮੋਬਾਈਲ ਨੰਬਰ ਨਾਲ ਜੋੜਿਆ *“{{name}}”*ਨਾਮ ਮਿਲਿਆ ਹੈ.\n\n👉 ਨਾਮ ਦੀ ਪੁਸ਼ਟੀ ਕਰਨ ਲਈ 1 ਟਾਈਪ ਕਰੋ ਅਤੇ ਭੇਜੋ\n\n👉 ਨਾਮ ਬਦਲਣ ਲਈ 2 ਟਾਈਪ ਕਰੋ ਅਤੇ ਭੇਜੋ' } }, changeName: { question: { en_IN: 'Please provide your name to continue.', - hi_IN: 'जारी रखने के लिए कृपया अपना नाम प्रदान करें।' + hi_IN: 'जारी रखने के लिए कृपया अपना नाम प्रदान करें।', + pa_IN: 'ਜਾਰੀ ਰੱਖਣ ਲਈ ਕਿਰਪਾ ਕਰਕੇ ਆਪਣਾ ਨਾਮ ਦੇਣ ਦੀ ਖ਼ੇਚਲ ਕੀਤੀ ਜਾਵੈ' } }, onboardingNameConfirmation: { en_IN: "Confirm Name : {{name}}?\n\n👉 Type and send *1* to confirm the name.\n\n👉 Type and send *2* to change the name.", - hi_IN: "पुष्टि नाम: {{name}}\n\n👉 नाम की पुष्टि करने के लिए *1* टाइप करें और भेजें।\n\n👉 नाम बदलने के लिए *2* टाइप करें और भेजें।" + hi_IN: "पुष्टि नाम: {{name}}?\n\n👉 नाम की पुष्टि करने के लिए 1 टाइप करें और भेजें.\n\n👉 नाम बदलने के लिए 2 टाइप करें और भेजें.", + pa_IN: "ਨਾਮ ਦੀ ਪੁਸ਼ਟੀ ਕਰੋ: {{name}}?\n\n👉 ਨਾਮ ਦੀ ਪੁਸ਼ਟੀ ਕਰਨ ਲਈ 1 ਟਾਈਪ ਕਰੋ ਅਤੇ ਭੇਜੋ.\n\n👉 ਟਾਈਪ ਕਰੋ ਅਤੇ ਨਾਮ ਬਦਲਣ ਲਈ 2 ਭੇਜੋ." }, onboardingThankYou: { en_IN: 'Thanks for providing the confirmation 👍\nWe are happy to serve you 😊', - hi_IN: 'पुष्टि प्रदान करने के लिए धन्यवाद 👍\nहम आपकी सेवा करके खुश हैं 😊' + hi_IN: 'पुष्टि प्रदान करने के लिए धन्यवाद 👍\nहम आपकी सेवा करके खुश हैं 😊', + pa_IN: 'ਪੁਸ਼ਟੀ ਪ੍ਰਦਾਨ ਕਰਨ ਲਈ ਧੰਨਵਾਦ 👍\nਅਸੀਂ ਤੁਹਾਡੀ ਸੇਵਾ ਕਰ ਕੇ ਖੁਸ਼ ਹਾਂ 😊' }, nameInformation: { en_IN: 'For a personalized experience, we would like to confirm your name.', - hi_IN: 'व्यक्तिगत अनुभव के लिए, हम आपके नाम की पुष्टि करना चाहेंगे।' + hi_IN: 'एक व्यक्तिगत अनुभव के लिए, हम आपके नाम की पुष्टि करना चाहेंगे।', + pa_IN: 'ਇੱਕ ਨਿੱਜੀ ਤਜਰਬੇ ਲਈ, ਅਸੀਂ ਤੁਹਾਡੇ ਨਾਮ ਦੀ ਪੁਸ਼ਟੀ ਕਰਨਾ ਚਾਹੁੰਦੇ ਹਾਂ.' } }, locale : { question: { en_IN: "To select the language simply type and send the number of the preferred option 👇\n\n1. English\n2. हिन्दी\n3. ਪੰਜਾਬੀ", - hi_IN: "भाषा का चयन करने के लिए बस टाइप करें और पसंदीदा विकल्प का नंबर भेजें 👇\n\n1. अंग्रेजी\n2. हिंदी\n3. ਪੰਜਾਬੀ" + hi_IN: "कृपया अपनी पसंदीदा भाषा चुनें\n1. English\n2. हिंदी\n3. ਪੰਜਾਬੀ", + pa_IN: 'ਭਾਸ਼ਾ ਨੂੰ ਚੁਣਨ ਲਈ ਬਸ ਟਾਈਪ ਕਰੋ ਅਤੇ ਪਸੰਦੀਦਾ ਵਿਕਲਪ ਦੀ ਸੰਖਿਆ ਭੇਜੋ 👇\n\n1. ਅੰਗਰੇਜ਼ੀ\n2. ਹਿੰਦੀ\n3. ਪੰਜਾਬੀ' } }, welcome: { - en_IN: 'Dear {{name}},\n\nWelcome to mSeva 🙏.\n\nNow you can file/ track your complaints and pay your bills via WhatsApp.\n', - hi_IN: 'प्रिय {{name}},\n\nएमसेवा में आपका स्वागत है 🙏\n\nअब आप अपनी शिकायतों को दर्ज या ट्रैक कर सकते हैं और व्हाट्सएप के माध्यम से अपने बिलों का भुगतान भी कर सकते हैं।' + en_IN: 'Dear {{name}},\n\nWelcome to mSeva Punjab 🙏.\n\nNow you can file/ track your complaints and pay your bills via WhatsApp.\n', + hi_IN: 'नमस्ते {{name}},\n\nmSeva पंजाब में आपका स्वागत है 🙏।\n\nअब आप WhatsApp द्वारा कई सुविधाओं का लाभ ले सकते है जैसे शिकायत दर्ज करना, बिल का भुगतान करना।' }, sevamenu: { question: { - en_IN : 'How can we serve you today? Please type and send the number for your option 👇\n\n*1.* File Complaint\n\n*2.* Track Complaints\n\n*3.* Pay Water & Sewerage Bill\n\n*4.* Pay Property Tax Bill\n\n*5.* View Payments History\n\n*6.* Change Language\n\n👉 At any stage type and send *mseva* to go back to the main menu.', - hi_IN: 'आज हम आपकी सेवा कैसे कर सकते हैं? सेवा का चयन करने के लिए प्रासंगिक विकल्प संख्या टाइप करें और भेजें 👇\n\n*1.* शिकायत दर्ज करें\n\n*2.* शिकायतों को ट्रैक करें\n\n*3.* पानी और सीवरेज बिल का भुगतान करें\n\n*4.* संपत्ति कर बिल का भुगतान करें\n\n*5.* भुगतान इतिहास देखें\n\n*6.* भाषा बदलें\n\n👉 किसी भी समय, मुख्य मेनू पर वापस जाने के लिए mseva टाइप करें और भेजें।' + en_IN : 'How can we serve you today? Please type and send the number for your option 👇\n\n*1.* File New Complaint\n\n*2.* Track Complaints\n\n*3.* Pay Water & Sewerage Bill\n\n*4.* Pay Property Tax Bill\n\n*5.* View Payments History\n\n*6.* Change Language\n\n👉 At any stage type and send *mseva* to go back to the main menu.', + hi_IN: 'आज हम आपकी सेवा कैसे कर सकते हैं? कृपया टाइप करें और अपने विकल्प के लिए नंबर भेजें 👇\n\n*1.* शिकायत दर्ज करें\n\n*2.* ट्रैक शिकायतें\n\n*3.* पानी और सीवरेज बिल का भुगतान करें\n\n*4.* संपत्ति कर बिल का भुगतान करें\n\n*5.* भुगतान इतिहास देखें\n\n*6.* भाषा बदलें\n\n👉 किसी भी स्तर पर टाइप करें और मुख्य मेनू पर वापस जाने के लिए mseva भेजें।', + pa_IN: 'ਅੱਜ ਅਸੀਂ ਤੁਹਾਡੀ ਸੇਵਾ ਕਿਵੇਂ ਕਰ ਸਕਦੇ ਹਾਂ? ਕਿਰਪਾ ਕਰਕੇ ਟਾਈਪ ਕਰੋ ਅਤੇ ਆਪਣੀ ਵਿਕਲਪ for ਲਈ ਨੰਬਰ ਭੇਜੋ 👇\n\n*1.* ਫਾਈਲ ਸ਼ਿਕਾਇਤ\n\n*2.* ਟਰੈਕ ਸ਼ਿਕਾਇਤਾਂ\n\n*3.* ਪਾਣੀ ਅਤੇ ਸੀਵਰੇਜ ਬਿੱਲ ਦਾ ਭੁਗਤਾਨ ਕਰੋ\n\n*4.* ਜਾਇਦਾਦ ਟੈਕਸ ਬਿੱਲ ਦਾ ਭੁਗਤਾਨ ਕਰੋ\n\n*5.* ਭੁਗਤਾਨ ਦਾ ਇਤਿਹਾਸ ਵੇਖੋ\n\n*6.* ਭਾਸ਼ਾ ਬਦਲੋ\n\n👉 ਕਿਸੇ ਵੀ ਪੜਾਅ ਤੇ ਟਾਈਪ ਕਰੋ ਅਤੇ ਮੁੱਖ ਮੇਨੂ ਤੇ ਵਾਪਸ ਜਾਣ ਲਈ mseva ਭੇਜੋ.' } }, endstate: { @@ -520,7 +548,9 @@ let grammer = { locale: { question: [ {intention: 'en_IN', recognize: ['1', 'english']}, - {intention: 'hi_IN', recognize: ['2', 'hindi']} + {intention: 'hi_IN', recognize: ['2', 'hindi']}, + {intention: 'pa_IN', recognize: ['3', 'punjabi']} + ] }, menu: { @@ -530,7 +560,7 @@ let grammer = { {intention: 'ws_bills', recognize: ['3', 'wsbill']}, {intention: 'pt_bills', recognize: ['4', 'ptbill']}, {intention: 'receipts', recognize: ['5','receipt']}, - {intention: 'locale', recognize: ['6','language', 'english', 'hindi']} + {intention: 'locale', recognize: ['6','language', 'english', 'hindi', 'punjabi']} ] }, confirmation: { @@ -541,4 +571,4 @@ let grammer = { } } -module.exports = sevaMachine; +module.exports = sevaMachine; \ No newline at end of file diff --git a/core-services/xstate-chatbot/nodejs/src/machine/util/dialog.js b/core-services/xstate-chatbot/nodejs/src/machine/util/dialog.js index 77006d70c0a..3e14c70883a 100644 --- a/core-services/xstate-chatbot/nodejs/src/machine/util/dialog.js +++ b/core-services/xstate-chatbot/nodejs/src/machine/util/dialog.js @@ -82,7 +82,8 @@ let global_messages = { error: { retry: { en_IN: 'Selected option seems to be invalid 😐\n\nPlease select the valid option to proceed further.', - hi_IN: 'चयनित विकल्प अमान्य प्रतीत होता है 😐\n\n कृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।' + hi_IN: 'चयनित विकल्प अमान्य प्रतीत होता है 😐\n\nकृपया आगे बढ़ने के लिए वैध विकल्प का चयन करें।', + pa_IN: 'ਚੁਣੀ ਹੋਈ ਚੋਣ ਅਵੈਧ ਜਾਪਦੀ ਹੈ 😐\n\nਕਿਰਪਾ ਕਰਕੇ ਅੱਗੇ ਵਧਣ ਲਈ ਜਾਇਜ਼ ਵਿਕਲਪ ਦੀ ਚੋਣ ਕਰੋ.' }, proceeding: { en_IN: 'I am sorry, I didn\'t understand. But proceeding nonetheless', @@ -99,7 +100,7 @@ let global_messages = { }, [INTENTION_GOBACK]: { en_IN : 'Go Back', - hi_IN : 'पीछे जाना' + hi_IN : 'Go Back' }, } diff --git a/core-services/xstate-chatbot/nodejs/src/session/session-manager.js b/core-services/xstate-chatbot/nodejs/src/session/session-manager.js index 7612ac99ec8..417dd32cf7d 100644 --- a/core-services/xstate-chatbot/nodejs/src/session/session-manager.js +++ b/core-services/xstate-chatbot/nodejs/src/session/session-manager.js @@ -77,8 +77,7 @@ class SessionManager { service.onTransition( state => { if(state.changed) { let userId = state.context.user.userId; - let stateStrings = state.toStrings(); - let sourceStrings = state.history.toStrings(); + let stateStrings = state.toStrings() let active = !state.done && !state.forcedClose; let saveState = JSON.parse(JSON.stringify(state)); // deep copy @@ -87,7 +86,7 @@ class SessionManager { (async() => { await chatStateRepository.updateState(userId, active, JSON.stringify(saveState), timeStamp); let sessionId = await chatStateRepository.getSessionId(userId); - telemetry.log(userId, 'transition', {input: reformattedMessage.message.input, source: sourceStrings[sourceStrings.length-1], destination: stateStrings[stateStrings.length-1], locale: locale, sessionId: sessionId, timestamp: timeStamp, extraInfo: reformattedMessage.extraInfo}); + telemetry.log(userId, 'transition', {input: reformattedMessage.message.input, destination: stateStrings[stateStrings.length-1], locale: locale, sessionId: sessionId, timestamp: timeStamp}); })(); } diff --git a/core-services/xstate-chatbot/nodejs/src/session/user-service.js b/core-services/xstate-chatbot/nodejs/src/session/user-service.js index 45f6db5a83b..139615dca83 100644 --- a/core-services/xstate-chatbot/nodejs/src/session/user-service.js +++ b/core-services/xstate-chatbot/nodejs/src/session/user-service.js @@ -21,6 +21,7 @@ class UserService { } user = await this.enrichuserDetails(user); + console.log("User Response:",user); return user; } @@ -36,13 +37,14 @@ class UserService { let response = await fetch(url, options); if(response.status === 200) { let body = await response.json(); - user.userInfo.name = body.name; - user.userInfo.locale = body.locale; + user.userInfo.name = body.name + console.log("user name enrichment:",body.name); } return user; } async loginUser(mobileNumber, tenantId) { + console.log("Inside Login user"); let data = new URLSearchParams(); data.append('grant_type', 'password'); data.append('scope', 'read'); @@ -79,7 +81,16 @@ class UserService { async createUser(mobileNumber, tenantId) { let requestBody = { - RequestInfo: {}, + RequestInfo: { + "apiId": "Rainmaker", + "ver": ".01", + "ts": "", + "action": "_create", + "did": "1", + "key": "", + "msgId": "20170310130900|en_IN", + "authToken": null + }, User: { otpReference: config.userService.userServiceHardCodedPassword, permamnentCity: tenantId, diff --git a/core-services/xstate-chatbot/react-app/package.json b/core-services/xstate-chatbot/react-app/package.json index 89ed18a9e0a..67bf2b62ddf 100644 --- a/core-services/xstate-chatbot/react-app/package.json +++ b/core-services/xstate-chatbot/react-app/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "react-app-rewired": "^2.1.6", - "react-scripts": "latest" + "react-scripts": "4.0.3" }, "browserslist": { "production": [ diff --git a/core-services/zuul/src/main/resources/application.properties b/core-services/zuul/src/main/resources/application.properties index 78fd3f32e7d..ebf734c4876 100644 --- a/core-services/zuul/src/main/resources/application.properties +++ b/core-services/zuul/src/main/resources/application.properties @@ -12,7 +12,7 @@ zuul.health.enabled=true security.basic.enabled=false management.security.enabled=false -zuul.sensitiveHeaders=Cookie,Set-Cookie,auth-token +zuul.sensitiveHeaders=Cookie,Set-Cookie,x-user-info,auth-token egov.auth-service-host=http://localhost:8081/ egov.auth-service-uri=user/_details?access_token= @@ -22,7 +22,7 @@ egov.authorize.access.control.uri=access/v1/actions/_authorize egov.user-info-header=x-user-info egov.open-endpoints-whitelist=/user/oauth/token,/user-otp/v1/_send,/otp/v1/_validate,/user/citizen/_create,/localization/messages,/localization/messages/v1/_search,/user/password/nologin/_update,/pgr/servicedefinition/v1/_search,/pgr/servicecategories/v1/_search,/pgr/v1/otp/_send,/pgr-master/receivingmode/v1/_search,/tenant/v1/tenant/_search,/egov-location/boundarys,/egov-location/boundarys/boundariesByBndryTypeNameAndHierarchyTypeName,/pgr-master/service/v1/_search,/egov-location/boundarys/getLocationByLocationName,/pgr-master/OTPConfig/_search,/pgr-master/serviceGroup/v1/_search,/egov-location/boundarys/isshapefileexist,/pgr/services/v1/_search,/hr-masters/hrconfigurations/_search,/collection-services/receipts/_view,/pgr-master/service/v2/_search,/pgr-master/servicedefinition/v1/_search,/citizen-services,/citizen-services/v1/requests/_search,/admin/abc,/whatsapp-webhook/messages -egov.mixed-mode-endpoints-whitelist=/pgr/seva/v1/_create,/pgr/seva/v1/_search,/pgr/seva/v1/_count,/workflow/history/v1/_search,/filestore/v1/files/id,/filestore/v1/files,/filestore/v1/files/tag,/wcms/masters/categorytype/_search,/wcms/masters/pipesize/_search,/wcms/masters/sourcetype/_search,/wcms/masters/supplytype/_search,/pt-property/property/propertytypes/_search,/wcms/masters/donation/_search,/wcms/masters/propertytype-categorytype/_search,/wcms/masters/propertytype-pipesize/_search,/wcms/masters/propertytype-usagetype/_search,/wcms/masters/treatmentplant/_search,/wcms-connection/connection/_getconnectiontypes,/wcms-connection/connection/_getbillingtypes,/pt-property/properties/_search,/pt-property/property/usages/_search,/egov-idgen/id/_generate,/egf-masters/financialyears/_search,/egov-common-workflows/process/_start,/egov-common-workflows/process/_search,/egov-common-workflows/tasks,/egov-common-workflows/tasks/{id}/_update,/user/_search,/user/users/_createnovalidate,/user/users/{id}/_update,/wcms-connection/connection/_create +egov.mixed-mode-endpoints-whitelist=/pgr/seva/v1/_create,/pgr/seva/v1/_search,/pgr/seva/v1/_count,/workflow/history/v1/_search,/filestore/v1/files/id,/filestore/v1/files,/filestore/v1/files/tag,/egov-common-masters/departments/_search,/wcms/masters/categorytype/_search,/wcms/masters/pipesize/_search,/wcms/masters/sourcetype/_search,/wcms/masters/supplytype/_search,/pt-property/property/propertytypes/_search,/wcms/masters/donation/_search,/wcms/masters/propertytype-categorytype/_search,/wcms/masters/propertytype-pipesize/_search,/wcms/masters/propertytype-usagetype/_search,/wcms/masters/treatmentplant/_search,/wcms-connection/connection/_getconnectiontypes,/wcms-connection/connection/_getbillingtypes,/pt-property/properties/_search,/pt-property/property/usages/_search,/egov-idgen/id/_generate,/egf-masters/financialyears/_search,/egov-common-workflows/process/_start,/egov-common-workflows/process/_search,/egov-common-workflows/tasks,/egov-common-workflows/tasks/{id}/_update,/user/_search,/user/users/_createnovalidate,/user/users/{id}/_update,/wcms-connection/connection/_create spring.servlet.multipart.max-file-size=5MB spring.servlet.multipart.max-request-size=30MB diff --git a/edcr/service/CHANGELOG.md b/edcr/service/CHANGELOG.md index fb17f5e144c..9bd664fb93a 100644 --- a/edcr/service/CHANGELOG.md +++ b/edcr/service/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All notable changes to this module will be documented in this file. +## 2.1.2 - 2023-09-14 +Central Instance Library Integration + ## 2.1.1 - Data push for edcr diff --git a/edcr/service/egov/egov-commons/pom.xml b/edcr/service/egov/egov-commons/pom.xml index 6daeb659c2f..1fa8da0c114 100644 --- a/edcr/service/egov/egov-commons/pom.xml +++ b/edcr/service/egov/egov-commons/pom.xml @@ -33,7 +33,7 @@ egov-erp org.egov.edcr - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT 4.0.0 @@ -57,7 +57,7 @@ org.egov.edcr egov-config - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT tests test diff --git a/edcr/service/egov/egov-commons/src/main/java/org/egov/common/entity/edcr/Plan.java b/edcr/service/egov/egov-commons/src/main/java/org/egov/common/entity/edcr/Plan.java index 72faf6766d2..993b0beac7f 100644 --- a/edcr/service/egov/egov-commons/src/main/java/org/egov/common/entity/edcr/Plan.java +++ b/edcr/service/egov/egov-commons/src/main/java/org/egov/common/entity/edcr/Plan.java @@ -71,13 +71,15 @@ public class Plan implements Serializable { private static final long serialVersionUID = 7276648029097296311L; + + private String tenantId; + Map planInfoProperties = new HashMap<>(); + /** * Plan scrutiny report status. Values true mean "Accepted" and False mean "Not Accepted". Default value false. On plan * scrutiny, if all the rules are success then value is true. */ - Map planInfoProperties = new HashMap<>(); - private Boolean edcrPassed = false; // Submission date of plan scrutiny. private Date applicationDate; @@ -197,10 +199,19 @@ public class Plan implements Serializable { private transient Map noObjectionCertificates = new HashMap<>(); private List nocDeptCodes = new ArrayList(); private HashMap featureAmendments = new LinkedHashMap<>(); + @JsonIgnore private transient Map> mdmsMasterData; private transient Boolean mainDcrPassed = false; private List icts = new ArrayList<>(); + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + public List getCanopyDistanceFromPlotBoundary() { return canopyDistanceFromPlotBoundary; } @@ -647,4 +658,4 @@ public void setIcts(List icts) { this.icts = icts; } -} +} \ No newline at end of file diff --git a/edcr/service/egov/egov-commons/src/main/java/org/egov/commons/service/RestCallService.java b/edcr/service/egov/egov-commons/src/main/java/org/egov/commons/service/RestCallService.java index 25ebcd89bc6..a5404c275db 100644 --- a/edcr/service/egov/egov-commons/src/main/java/org/egov/commons/service/RestCallService.java +++ b/edcr/service/egov/egov-commons/src/main/java/org/egov/commons/service/RestCallService.java @@ -24,6 +24,7 @@ public Object fetchResult(StringBuilder uri, Object request) { LOG.info("Request: " + mapper.writeValueAsString(request)); RestTemplate restTemplate = new RestTemplate(); response = restTemplate.postForObject(uri.toString(), request, Map.class); + LOG.info("Response: " + mapper.writeValueAsString(response)); } catch (HttpClientErrorException | JsonProcessingException e) { LOG.error("Error occurred while calling API", e); } diff --git a/edcr/service/egov/egov-config/pom.xml b/edcr/service/egov/egov-config/pom.xml index 4db862328c7..a93cf44376a 100644 --- a/edcr/service/egov/egov-config/pom.xml +++ b/edcr/service/egov/egov-config/pom.xml @@ -51,7 +51,7 @@ egov-erp org.egov.edcr - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT 4.0.0 diff --git a/edcr/service/egov/egov-ear/pom.xml b/edcr/service/egov/egov-ear/pom.xml index 4c93e10de29..d217bfebbaf 100644 --- a/edcr/service/egov/egov-ear/pom.xml +++ b/edcr/service/egov/egov-ear/pom.xml @@ -5,7 +5,7 @@ org.egov.edcr egov-erp - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT 4.0.0 @@ -19,13 +19,13 @@ org.egov.edcr egov-egiweb - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT war org.egov.edcr egov-edcrweb - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT war diff --git a/edcr/service/egov/egov-edcr-extract/pom.xml b/edcr/service/egov/egov-edcr-extract/pom.xml index f8bb156264c..e47ff3c2542 100644 --- a/edcr/service/egov/egov-edcr-extract/pom.xml +++ b/edcr/service/egov/egov-edcr-extract/pom.xml @@ -35,7 +35,7 @@ org.egov.edcr egov-erp - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT e-governments edcr extract @@ -134,13 +134,13 @@ org.egov.edcr egov-egi - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT org.egov.edcr egov-commons - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT diff --git a/edcr/service/egov/egov-edcr-extract/src/main/java/org/egov/edcr/feature/DxfToPdfConverterExtract.java b/edcr/service/egov/egov-edcr-extract/src/main/java/org/egov/edcr/feature/DxfToPdfConverterExtract.java index 2fab39b2a8d..72d34bd73b0 100644 --- a/edcr/service/egov/egov-edcr-extract/src/main/java/org/egov/edcr/feature/DxfToPdfConverterExtract.java +++ b/edcr/service/egov/egov-edcr-extract/src/main/java/org/egov/edcr/feature/DxfToPdfConverterExtract.java @@ -64,6 +64,7 @@ import org.kabeja.math.MathUtils; import org.kabeja.xml.SAXSerializer; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -96,6 +97,8 @@ public class DxfToPdfConverterExtract extends FeatureExtract { private MDMSValidator mdmsValidator; @Autowired private CityService cityService; + @Value("${is.environment.central.instance}") + private String isEnvironmentCentralInstance; @Override public PlanDetail extract(PlanDetail planDetail) { @@ -104,7 +107,12 @@ public PlanDetail extract(PlanDetail planDetail) { boolean mdmsDxfToPdfEnabled = false; if (mdmsEnabled != null && mdmsEnabled) { City stateCity = cityService.fetchStateCityDetails(); - String tenantID = ApplicationThreadLocals.getTenantID(); + String[] tenantArr = ApplicationThreadLocals.getFullTenantID().split("\\."); + String tenantID; + if(Boolean.TRUE.equals(Boolean.valueOf(isEnvironmentCentralInstance))) { + tenantID = tenantArr[0].concat(".").concat(tenantArr[1]); + } else + tenantID = tenantArr[0]; Object mdmsData = edcrMdmsUtil.mDMSCall(new RequestInfo(), new StringBuilder().append(stateCity.getCode()).append(".").append(tenantID).toString()); @@ -149,10 +157,10 @@ public PlanDetail extract(PlanDetail planDetail) { } catch (IOException e) { LOG.error("Error occured while reading mdms data", e); } - } + } else { + return planDetail; } - } } else { List dxfToPdfAppConfigEnabled = appConfigValueService diff --git a/edcr/service/egov/egov-edcr-extract/src/main/java/org/egov/edcr/service/ExtractService.java b/edcr/service/egov/egov-edcr-extract/src/main/java/org/egov/edcr/service/ExtractService.java index 6a1d0c7f1b5..a84de264756 100644 --- a/edcr/service/egov/egov-edcr-extract/src/main/java/org/egov/edcr/service/ExtractService.java +++ b/edcr/service/egov/egov-edcr-extract/src/main/java/org/egov/edcr/service/ExtractService.java @@ -40,6 +40,7 @@ import org.kabeja.parser.Parser; import org.kabeja.parser.ParserBuilder; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.fasterxml.jackson.databind.ObjectMapper; @@ -58,6 +59,8 @@ public class ExtractService { private CityService cityService; @Autowired private MDMSValidator mdmsValidator; + @Value("${is.environment.central.instance}") + private String isEnvironmentCentralInstance; private Logger LOG = LogManager.getLogger(ExtractService.class); @@ -96,9 +99,15 @@ public Plan extract(File dxfFile, Amendment amd, Date scrutinyDate, List org.egov.edcr egov-erp - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT egov-edcr e-governments edcr @@ -62,7 +62,7 @@ org.egov.edcr egov-edcr-extract - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT diff --git a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrApplication.java b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrApplication.java index daaa814cd38..c1b7fe11e50 100644 --- a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrApplication.java +++ b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrApplication.java @@ -29,6 +29,7 @@ import org.egov.infra.admin.master.entity.User; import org.egov.infra.persistence.entity.AbstractAuditable; import org.hibernate.validator.constraints.Length; +import org.hibernate.validator.constraints.SafeHtml; import org.springframework.web.multipart.MultipartFile; @Entity @@ -103,6 +104,9 @@ public class EdcrApplication extends AbstractAuditable { private transient Map> mdmsMasterData; private transient String deviationStatus; + + @SafeHtml + private String tenantId; @Override public Long getId() { @@ -306,4 +310,12 @@ public void setDeviationStatus(String deviationStatus) { this.deviationStatus = deviationStatus; } -} + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + +} \ No newline at end of file diff --git a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrApplicationDetail.java b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrApplicationDetail.java index 5d27f76a60f..12fea844425 100644 --- a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrApplicationDetail.java +++ b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrApplicationDetail.java @@ -61,6 +61,7 @@ import org.egov.infra.filestore.entity.FileStoreMapper; import org.egov.infra.persistence.entity.AbstractAuditable; import org.hibernate.validator.constraints.Length; +import org.hibernate.validator.constraints.SafeHtml; @Entity @Table(name = "EDCR_APPLICATION_DETAIL") @@ -114,6 +115,9 @@ public class EdcrApplicationDetail extends AbstractAuditable { @Length(min = 1, max = 128) private String comparisonDcrNumber; + + @SafeHtml + private String tenantId; @Override public Long getId() { @@ -221,4 +225,12 @@ public void setComparisonDcrNumber(String comparisonDcrNumber) { this.comparisonDcrNumber = comparisonDcrNumber; } -} + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + +} \ No newline at end of file diff --git a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrPdfDetail.java b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrPdfDetail.java index 724d751e7b7..f4e6e532c21 100644 --- a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrPdfDetail.java +++ b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/entity/EdcrPdfDetail.java @@ -17,6 +17,7 @@ import org.egov.infra.filestore.entity.FileStoreMapper; import org.egov.infra.persistence.entity.AbstractAuditable; +import org.hibernate.validator.constraints.SafeHtml; @Entity @@ -48,6 +49,9 @@ public class EdcrPdfDetail extends AbstractAuditable { @Transient private List violations; + + @SafeHtml + private String tenantId; @Override public Long getId() { @@ -107,4 +111,12 @@ public void setViolations(List violations) { this.violations = violations; } -} + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + +} \ No newline at end of file diff --git a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/repository/PlanFeatureRepository.java b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/repository/PlanFeatureRepository.java index 8c7aae40574..9816319fb5f 100644 --- a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/repository/PlanFeatureRepository.java +++ b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/repository/PlanFeatureRepository.java @@ -380,8 +380,9 @@ public List getFeatures() { pf = new PlanFeature(InfoCommsTechService.class); features.add(pf); - pf = new PlanFeature(DxfToPdfConverter.class); - features.add(pf); + /* + * pf = new PlanFeature(DxfToPdfConverter.class); features.add(pf); + */ return features; diff --git a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrApplicationService.java b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrApplicationService.java index 505c9ccf82e..8f50ef70410 100644 --- a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrApplicationService.java +++ b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrApplicationService.java @@ -27,6 +27,7 @@ import org.egov.edcr.repository.EdcrApplicationDetailRepository; import org.egov.edcr.repository.EdcrApplicationRepository; import org.egov.edcr.service.es.EdcrIndexService; +import org.egov.infra.config.core.ApplicationThreadLocals; import org.egov.infra.config.persistence.datasource.routing.annotation.ReadOnly; import org.egov.infra.filestore.entity.FileStoreMapper; import org.egov.infra.filestore.service.FileStoreService; @@ -118,8 +119,10 @@ public EdcrApplication update(final EdcrApplication edcrApplication) { private Plan callDcrProcess(EdcrApplication edcrApplication, String applicationType) { Plan planDetail = new Plan(); + planDetail.setTenantId(ApplicationThreadLocals.getFullTenantID()); planDetail = planService.process(edcrApplication, applicationType); updateFile(planDetail, edcrApplication); + edcrApplication.getEdcrApplicationDetails().get(0).setTenantId(ApplicationThreadLocals.getFullTenantID()); edcrApplicationDetailService.saveAll(edcrApplication.getEdcrApplicationDetails()); return planDetail; diff --git a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrBpaRestService.java b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrBpaRestService.java index 4b6e466d5a8..fa09c27cb18 100644 --- a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrBpaRestService.java +++ b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrBpaRestService.java @@ -16,6 +16,8 @@ @Service("edcrBpaRestService") public class EdcrBpaRestService { + private static final String COMMON_DOMAIN_NAME = "common.domain.name"; + private static final String IS_ENVIRONMENT_CENTRAL_INSTANCE = "is.environment.central.instance"; private static final String BPACHECKDEMOND = "%s/bpa/rest/stakeholder/check/demand-pending/{userId}"; private static final String REDIRECTTOCOLLECTION = "%s/bpa/application/stakeholder/generate-bill/{userId}"; private static final String STAKEHOLDER_VALIDATION_URL = "%s/bpa/rest/validate/stakeholder/{userId}"; @@ -26,14 +28,20 @@ public class EdcrBpaRestService { public Boolean checkAnyTaxIsPendingToCollectForStakeHolder(final Long userId, final HttpServletRequest request) { final RestTemplate restTemplate = new RestTemplate(); - final String url = String.format(BPACHECKDEMOND, WebUtils.extractRequestDomainURL(request, false)); + final String url = String.format(BPACHECKDEMOND, + WebUtils.extractRequestDomainURL(request, false, + environmentSettings.getProperty(IS_ENVIRONMENT_CENTRAL_INSTANCE, Boolean.class), + environmentSettings.getProperty(COMMON_DOMAIN_NAME))); Map checkPending = restTemplate.getForObject(url, Map.class, userId); return checkPending.get("pending") != null && checkPending.get("pending"); } public String generateBillAndRedirectToCollection(final Long userId, final HttpServletRequest request) { final RestTemplate restTemplate = new RestTemplate(); - final String url = String.format(REDIRECTTOCOLLECTION, WebUtils.extractRequestDomainURL(request, false)); + final String url = String.format(REDIRECTTOCOLLECTION, + WebUtils.extractRequestDomainURL(request, false, + environmentSettings.getProperty(IS_ENVIRONMENT_CENTRAL_INSTANCE, Boolean.class), + environmentSettings.getProperty(COMMON_DOMAIN_NAME))); return restTemplate.getForObject(url, String.class, userId); } @@ -46,13 +54,19 @@ public ErrorDetail validateStakeholder(final Long userId, final HttpServletReque url = String.format(STAKEHOLDER_VALIDATION_URL, environmentSettings.getProperty("stakeholder.domain.url", String.class)); else - url = String.format(STAKEHOLDER_VALIDATION_URL, WebUtils.extractRequestDomainURL(request, false)); + url = String.format(STAKEHOLDER_VALIDATION_URL, + WebUtils.extractRequestDomainURL(request, false, + environmentSettings.getProperty(IS_ENVIRONMENT_CENTRAL_INSTANCE, Boolean.class), + environmentSettings.getProperty(COMMON_DOMAIN_NAME))); return restTemplate.getForObject(url, ErrorDetail.class, userId); } public List getEdcrIntegratedServices(final HttpServletRequest request) { final RestTemplate restTemplate = new RestTemplate(); - final String url = String.format(EDCR_SERVICES_URL, WebUtils.extractRequestDomainURL(request, false)); + final String url = String.format(EDCR_SERVICES_URL, + WebUtils.extractRequestDomainURL(request, false, + environmentSettings.getProperty(IS_ENVIRONMENT_CENTRAL_INSTANCE, Boolean.class), + environmentSettings.getProperty(COMMON_DOMAIN_NAME))); return restTemplate.getForObject(url, List.class); } } diff --git a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrRestService.java b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrRestService.java index f99fe0ee0e1..148d9989299 100644 --- a/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrRestService.java +++ b/edcr/service/egov/egov-edcr/src/main/java/org/egov/edcr/service/EdcrRestService.java @@ -70,9 +70,8 @@ import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.egov.common.entity.dcr.helper.ErrorDetail; import org.egov.common.entity.edcr.Plan; import org.egov.common.entity.edcr.PlanInformation; @@ -121,6 +120,8 @@ @Transactional(readOnly = true) public class EdcrRestService { + private static final String IS_ENVIRONMENT_CENTRAL_INSTANCE = "is.environment.central.instance"; + private final SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); private static final String MSG_UNQ_TRANSACTION_NUMBER = "Transaction Number should be unique"; @@ -135,7 +136,7 @@ public class EdcrRestService { private static final String BPA_05 = "BPA-05"; - private static Logger LOG = LogManager.getLogger(EdcrApplicationService.class); + private static final Logger LOG = LoggerFactory.getLogger(EdcrApplicationService.class); public static final String FILE_DOWNLOAD_URL = "%s/edcr/rest/dcr/downloadfile"; @@ -164,25 +165,17 @@ public class EdcrRestService { private EdcrApplicationDetailService applicationDetailService; @Autowired - private EnvironmentSettings environmentSettings; - - @Autowired - private RestTemplate restTemplate; - - @Value("${egov.services.egov-indexer.url}") - private String egovIndexerUrl; + private EdcrApplicationDetailService applicationDetailService; - @Value("${indexer.host}") - private String indexerHost; - public Session getCurrentSession() { return entityManager.unwrap(Session.class); } @Transactional public EdcrDetail createEdcr(final EdcrRequest edcrRequest, final MultipartFile file, - Map> masterData) { + Map> masterData) { EdcrApplication edcrApplication = new EdcrApplication(); + edcrApplication.setTenantId(ApplicationThreadLocals.getFullTenantID()); edcrApplication.setMdmsMasterData(masterData); EdcrApplicationDetail edcrApplicationDetail = new EdcrApplicationDetail(); if (ApplicationType.OCCUPANCY_CERTIFICATE.toString().equalsIgnoreCase(edcrRequest.getAppliactionType())) { @@ -235,19 +228,20 @@ public EdcrDetail createEdcr(final EdcrRequest edcrRequest, final MultipartFile tenantId = ApplicationThreadLocals.getTenantID(); } edcrApplication.setThirdPartyUserTenant(tenantId); + edcrApplication.setArchitectInformation(edcrRequest.getRequestInfo().getUserInfo().getName()); } edcrApplication = edcrApplicationService.createRestEdcr(edcrApplication); - + //Code to push the data of edcr application to kafka index EdcrIndexData edcrIndexData = new EdcrIndexData(); - if(environmentSettings.getDataPush()) { - //Building object to be pushed + if (environmentSettings.getDataPush()) { + //Building object to be pushed edcrIndexData = setEdcrIndexData(edcrApplication, edcrApplication.getEdcrApplicationDetails().get(0)); - // call kafka topic - pushDataToIndexer(edcrIndexData, "edcr-create-application"); - } - + // call kafka topic + pushDataToIndexer(edcrIndexData, "edcr-create-application"); + } + return setEdcrResponse(edcrApplication.getEdcrApplicationDetails().get(0), edcrRequest); } @@ -398,11 +392,28 @@ public EdcrDetail setEdcrResponse(EdcrApplicationDetail edcrApplnDtl, EdcrReques if (edcrApplnDtl.getApplication().getServiceType() != null) edcrDetail.setApplicationSubType(edcrApplnDtl.getApplication().getServiceType()); String tenantId; - String[] tenantArr = edcrApplnDtl.getApplication().getThirdPartyUserTenant().split("\\."); - if (tenantArr.length == 1) - tenantId = tenantArr[0]; - else - tenantId = tenantArr[1]; + boolean isCentralInstanceEnabled = environmentSettings.getProperty(IS_ENVIRONMENT_CENTRAL_INSTANCE, Boolean.class); + if (isCentralInstanceEnabled) { + tenantId = edcrApplnDtl.getPlanDetailFileStore().getTenantId(); + if (StringUtils.isBlank(tenantId)) { + String[] tenantArr = edcrApplnDtl.getApplication().getThirdPartyUserTenant().split("\\."); + if (tenantArr.length == 1) + tenantId = tenantArr[0]; + else + tenantId = tenantArr[1]; + } + } else { + if (edcrApplnDtl.getPlanDetailFileStore() != null && edcrApplnDtl.getPlanDetailFileStore().getTenantId() != null) { + tenantId = edcrApplnDtl.getPlanDetailFileStore().getTenantId(); + } else { + String[] tenantArr = edcrApplnDtl.getApplication().getThirdPartyUserTenant().split("\\."); + if (tenantArr.length == 1) + tenantId = tenantArr[0]; + else + tenantId = tenantArr[1]; + } + } + if (edcrApplnDtl.getDxfFileId() != null) edcrDetail.setDxfFile(format(getFileDownloadUrl(edcrApplnDtl.getDxfFileId().getFileStoreId(), tenantId))); @@ -416,7 +427,7 @@ public EdcrDetail setEdcrResponse(EdcrApplicationDetail edcrApplnDtl, EdcrReques File file = edcrApplnDtl.getPlanDetailFileStore() != null ? fileStoreService.fetch(edcrApplnDtl.getPlanDetailFileStore().getFileStoreId(), - DcrConstants.APPLICATION_MODULE_TYPE, tenantId) + DcrConstants.APPLICATION_MODULE_TYPE, tenantId) : null; if (LOG.isInfoEnabled()) @@ -438,7 +449,7 @@ public EdcrDetail setEdcrResponse(EdcrApplicationDetail edcrApplnDtl, EdcrReques edcrDetail.setPlanDetail(pl1); } } catch (IOException e) { - LOG.log(Level.ERROR, e); + LOG.error("Error occurred while mapping !!", e); } for (EdcrPdfDetail planPdf : edcrApplnDtl.getEdcrPdfDetails()) { @@ -455,8 +466,9 @@ public EdcrDetail setEdcrResponse(EdcrApplicationDetail edcrApplnDtl, EdcrReques } edcrDetail.setPlanPdfs(planPdfs); - edcrDetail.setTenantId(edcrRequest.getTenantId()); - + edcrDetail.setTenantId(edcrApplnDtl.getTenantId() == null ? edcrRequest.getTenantId() : edcrApplnDtl.getTenantId()); + if (edcrDetail.getPlanDetail() != null && edcrDetail.getPlanDetail().getTenantId() == null) + edcrDetail.getPlanDetail().setTenantId(edcrApplnDtl.getTenantId()); if (StringUtils.isNotBlank(edcrRequest.getComparisonEdcrNumber())) edcrDetail.setComparisonEdcrNumber(edcrRequest.getComparisonEdcrNumber()); @@ -507,7 +519,7 @@ public EdcrDetail setEdcrResponseForAcrossTenants(Object[] applnDtls, String sta try { file = String.valueOf(applnDtls[8]) != null ? fileStoreService.fetch(String.valueOf(applnDtls[8]), - DcrConstants.APPLICATION_MODULE_TYPE, tenantId) + DcrConstants.APPLICATION_MODULE_TYPE, tenantId) : null; } catch (ApplicationRuntimeException e) { LOG.error("Error occurred, while fetching plan details!!!", e); @@ -532,7 +544,7 @@ public EdcrDetail setEdcrResponseForAcrossTenants(Object[] applnDtls, String sta edcrDetail.setPlanDetail(pl1); } } catch (IOException e) { - LOG.log(Level.ERROR, e); + LOG.error("Error occurred while mapping !!", e); } edcrDetail.setTenantId(stateCityCode.concat(".").concat(tenantId)); @@ -590,131 +602,263 @@ && isBlank(edcrRequest.getApplicationNumber()) if (edcrRequest.getLimit() != null) offset = edcrRequest.getOffset(); - if (edcrRequest != null && edcrRequest.getTenantId().equalsIgnoreCase(stateCity.getCode())) { - final Map params = new ConcurrentHashMap<>(); + boolean isCentralIntsanceEnabled = environmentSettings.getProperty(IS_ENVIRONMENT_CENTRAL_INSTANCE, Boolean.class); + if (isCentralIntsanceEnabled) { + final Criteria criteria = getCurrentSession().createCriteria(EdcrApplicationDetail.class, + "edcrApplicationDetail"); + criteria.createAlias("edcrApplicationDetail.application", "application"); + if (edcrRequest != null && isNotBlank(edcrRequest.getEdcrNumber())) { + criteria.add(Restrictions.eq("edcrApplicationDetail.dcrNumber", edcrRequest.getEdcrNumber())); + } + if (edcrRequest != null && isNotBlank(edcrRequest.getTransactionNumber())) { + criteria.add(Restrictions.eq("application.transactionNumber", edcrRequest.getTransactionNumber())); + } + if (edcrRequest != null && isNotBlank(edcrRequest.getApplicationNumber())) { + criteria.add(Restrictions.eq("application.applicationNumber", edcrRequest.getApplicationNumber())); + } - String queryString = searchAtStateTenantLevel(edcrRequest, userInfo, userId, onlyTenantId, params, isStakeholder); - LOG.info(queryString); - final Query query = getCurrentSession().createSQLQuery(queryString).setFirstResult(offset) - .setMaxResults(limit); - for (final Map.Entry param : params.entrySet()) - query.setParameter(param.getKey(), param.getValue()); - List applns = query.list(); - if (applns.isEmpty()) { - EdcrDetail edcrDetail = new EdcrDetail(); - edcrDetail.setErrors("No Record Found"); - return Arrays.asList(edcrDetail); - } else { - List edcrDetails2 = new ArrayList<>(); - for (Object[] appln : applns) - edcrDetails2.add(setEdcrResponseForAcrossTenants(appln, stateCity.getCode())); - List sortedList = new ArrayList<>(); - String orderBy = "desc"; - if (isNotBlank(edcrRequest.getOrderBy())) - orderBy = edcrRequest.getOrderBy(); - if (orderBy.equalsIgnoreCase("asc")) - sortedList = edcrDetails2.stream().sorted(Comparator.comparing(EdcrDetail::getApplicationDate)) - .collect(Collectors.toList()); - else - sortedList = edcrDetails2.stream().sorted(Comparator.comparing(EdcrDetail::getApplicationDate).reversed()) - .collect(Collectors.toList()); + String appliactionType = edcrRequest.getAppliactionType(); - LOG.info("The number of records = " + edcrDetails2.size()); - return sortedList; + if (edcrRequest != null && isNotBlank(appliactionType)) { + ApplicationType applicationType = null; + if ("BUILDING_PLAN_SCRUTINY".equalsIgnoreCase(appliactionType)) { + applicationType = ApplicationType.PERMIT; + } else if ("BUILDING_OC_PLAN_SCRUTINY".equalsIgnoreCase(appliactionType)) { + applicationType = ApplicationType.OCCUPANCY_CERTIFICATE; + } + if ("Permit".equalsIgnoreCase(appliactionType)) { + applicationType = ApplicationType.PERMIT; + } else if ("Occupancy certificate".equalsIgnoreCase(appliactionType)) { + applicationType = ApplicationType.OCCUPANCY_CERTIFICATE; + } + criteria.add(Restrictions.eq("application.applicationType", applicationType)); } - } else { - final Criteria criteria = getCriteriaofSingleTenant(edcrRequest, userInfo, userId, onlyTenantId, isStakeholder); - LOG.info(criteria.toString()); + if (edcrRequest != null && isNotBlank(edcrRequest.getApplicationSubType())) { + criteria.add(Restrictions.eq("application.serviceType", edcrRequest.getApplicationSubType())); + } + + if (edcrRequest != null && isNotBlank(edcrRequest.getTenantId())) { + criteria.add(Restrictions.ilike("edcrApplicationDetail.tenantId", "%" + edcrRequest.getTenantId() + "%")); + } + + if (onlyTenantId && userInfo != null && isNotBlank(userId)) { + criteria.add(Restrictions.eq("application.thirdPartyUserCode", userId)); + } + + if (isNotBlank(edcrRequest.getStatus())) + criteria.add(Restrictions.eq("edcrApplicationDetail.status", edcrRequest.getStatus())); + if (edcrRequest.getFromDate() != null) + criteria.add(Restrictions.ge("application.applicationDate", edcrRequest.getFromDate())); + if (edcrRequest.getToDate() != null) + criteria.add(Restrictions.le("application.applicationDate", edcrRequest.getToDate())); + String orderBy = "desc"; + if (isNotBlank(edcrRequest.getOrderBy())) + orderBy = edcrRequest.getOrderBy(); + if (orderBy.equalsIgnoreCase("asc")) + criteria.addOrder(Order.asc("edcrApplicationDetail.createdDate")); + else + criteria.addOrder(Order.desc("edcrApplicationDetail.createdDate")); + + criteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); criteria.setFirstResult(offset); criteria.setMaxResults(limit); edcrApplications = criteria.list(); - } - LOG.info("The number of records = " + edcrApplications.size()); - if (edcrApplications.isEmpty()) { - EdcrDetail edcrDetail = new EdcrDetail(); - edcrDetail.setErrors("No Record Found"); - return Arrays.asList(edcrDetail); } else { - return edcrDetailsResponse(edcrApplications, edcrRequest); + if (edcrRequest != null && edcrRequest.getTenantId().equalsIgnoreCase(stateCity.getCode())) { + final Map params = new ConcurrentHashMap<>(); + + StringBuilder queryStr = new StringBuilder(); + searchAtStateTenantLevel(edcrRequest, userInfo, userId, onlyTenantId, params, isStakeholder); + final Query query = getCurrentSession().createSQLQuery(queryStr.toString()).setFirstResult(offset) + .setMaxResults(limit); + LOG.info(queryStr.toString()); + + for (final Map.Entry param : params.entrySet()) + query.setParameter(param.getKey(), param.getValue()); + List applns = query.list(); + if (applns.isEmpty()) { + EdcrDetail edcrDetail = new EdcrDetail(); + edcrDetail.setErrors("No Record Found"); + return Arrays.asList(edcrDetail); + } else { + List edcrDetails2 = new ArrayList<>(); + for (Object[] appln : applns) + edcrDetails2.add(setEdcrResponseForAcrossTenants(appln, stateCity.getCode())); + List sortedList = new ArrayList<>(); + String orderBy = "desc"; + if (isNotBlank(edcrRequest.getOrderBy())) + orderBy = edcrRequest.getOrderBy(); + if (orderBy.equalsIgnoreCase("asc")) + sortedList = edcrDetails2.stream().sorted(Comparator.comparing(EdcrDetail::getApplicationDate)) + .collect(Collectors.toList()); + else + sortedList = edcrDetails2.stream().sorted(Comparator.comparing(EdcrDetail::getApplicationDate).reversed()) + .collect(Collectors.toList()); + + LOG.info("The number of records = " + edcrDetails2.size()); + return sortedList; + } + } else { + final Criteria criteria = getCriteriaofSingleTenant(edcrRequest, userInfo, userId, onlyTenantId, isStakeholder); + + LOG.info(criteria.toString()); + criteria.setFirstResult(offset); + criteria.setMaxResults(limit); + edcrApplications = criteria.list(); + } } + + LOG.info("The number of records = " + edcrApplications.size()); + if (edcrApplications.isEmpty()) { + EdcrDetail edcrDetail = new EdcrDetail(); + edcrDetail.setErrors("No Record Found"); + return Arrays.asList(edcrDetail); + } else { + return edcrDetailsResponse(edcrApplications, edcrRequest); + } } - public Integer fetchCount(final EdcrRequest edcrRequest, final RequestInfoWrapper reqInfoWrapper) { - UserInfo userInfo = reqInfoWrapper.getRequestInfo() == null ? null - : reqInfoWrapper.getRequestInfo().getUserInfo(); - String userId = ""; - if (userInfo != null && StringUtils.isNoneBlank(userInfo.getUuid())) - userId = userInfo.getUuid(); - else if (userInfo != null && StringUtils.isNoneBlank(userInfo.getId())) - userId = userInfo.getId(); - - // When the user is ANONYMOUS, then search application by edcrno or transaction - // number - if (userInfo != null && StringUtils.isNoneBlank(userId) && userInfo.getPrimaryrole() != null - && !userInfo.getPrimaryrole().isEmpty()) { - List roles = userInfo.getPrimaryrole().stream().map(Role::getCode).collect(Collectors.toList()); - LOG.info("****Roles***" + roles); - if (roles.contains("ANONYMOUS")) - userId = ""; - } - boolean onlyTenantId = edcrRequest != null && isBlank(edcrRequest.getEdcrNumber()) - && isBlank(edcrRequest.getTransactionNumber()) && isBlank(edcrRequest.getAppliactionType()) - && isBlank(edcrRequest.getApplicationSubType()) && isBlank(edcrRequest.getStatus()) - && edcrRequest.getFromDate() == null && edcrRequest.getToDate() == null - && isBlank(edcrRequest.getApplicationNumber()) - && isNotBlank(edcrRequest.getTenantId()); - - boolean isStakeholder = edcrRequest != null && (isNotBlank(edcrRequest.getAppliactionType()) - || isNotBlank(edcrRequest.getApplicationSubType()) || isNotBlank(edcrRequest.getStatus()) - || edcrRequest.getFromDate() != null || edcrRequest.getToDate() != null); + public Integer fetchCount ( final EdcrRequest edcrRequest, final RequestInfoWrapper reqInfoWrapper){ + UserInfo userInfo = reqInfoWrapper.getRequestInfo() == null ? null + : reqInfoWrapper.getRequestInfo().getUserInfo(); + String userId = ""; + if (userInfo != null && StringUtils.isNoneBlank(userInfo.getUuid())) + userId = userInfo.getUuid(); + else if (userInfo != null && StringUtils.isNoneBlank(userInfo.getId())) + userId = userInfo.getId(); + + // When the user is ANONYMOUS, then search application by edcrno or transaction + // number + if (userInfo != null && StringUtils.isNoneBlank(userId) && userInfo.getPrimaryrole() != null + && !userInfo.getPrimaryrole().isEmpty()) { + List roles = userInfo.getPrimaryrole().stream().map(Role::getCode).collect(Collectors.toList()); + LOG.info("****Roles***" + roles); + if (roles.contains("ANONYMOUS")) + userId = ""; + } + boolean onlyTenantId = edcrRequest != null && isBlank(edcrRequest.getEdcrNumber()) + && isBlank(edcrRequest.getTransactionNumber()) && isBlank(edcrRequest.getAppliactionType()) + && isBlank(edcrRequest.getApplicationSubType()) && isBlank(edcrRequest.getStatus()) + && edcrRequest.getFromDate() == null && edcrRequest.getToDate() == null + && isBlank(edcrRequest.getApplicationNumber()) + && isNotBlank(edcrRequest.getTenantId()); + + boolean isStakeholder = edcrRequest != null && (isNotBlank(edcrRequest.getAppliactionType()) + || isNotBlank(edcrRequest.getApplicationSubType()) || isNotBlank(edcrRequest.getStatus()) + || edcrRequest.getFromDate() != null || edcrRequest.getToDate() != null); + + boolean isCentralIntsanceEnabled = environmentSettings.getProperty(IS_ENVIRONMENT_CENTRAL_INSTANCE, Boolean.class); + if (isCentralIntsanceEnabled) { + + final Criteria criteria = getCurrentSession().createCriteria(EdcrApplicationDetail.class, + "edcrApplicationDetail"); + criteria.createAlias("edcrApplicationDetail.application", "application"); + if (edcrRequest != null && isNotBlank(edcrRequest.getEdcrNumber())) { + criteria.add(Restrictions.eq("edcrApplicationDetail.dcrNumber", edcrRequest.getEdcrNumber())); + } + if (edcrRequest != null && isNotBlank(edcrRequest.getTransactionNumber())) { + criteria.add(Restrictions.eq("application.transactionNumber", edcrRequest.getTransactionNumber())); + } + if (edcrRequest != null && isNotBlank(edcrRequest.getApplicationNumber())) { + criteria.add(Restrictions.eq("application.applicationNumber", edcrRequest.getApplicationNumber())); + } - City stateCity = cityService.fetchStateCityDetails(); - if (edcrRequest != null && edcrRequest.getTenantId().equalsIgnoreCase(stateCity.getCode())) { - final Map params = new ConcurrentHashMap<>(); + String appliactionType = edcrRequest.getAppliactionType(); + + if (edcrRequest != null && isNotBlank(appliactionType)) { + ApplicationType applicationType = null; + if ("BUILDING_PLAN_SCRUTINY".equalsIgnoreCase(appliactionType)) { + applicationType = ApplicationType.PERMIT; + } else if ("BUILDING_OC_PLAN_SCRUTINY".equalsIgnoreCase(appliactionType)) { + applicationType = ApplicationType.OCCUPANCY_CERTIFICATE; + } + if ("Permit".equalsIgnoreCase(appliactionType)) { + applicationType = ApplicationType.PERMIT; + } else if ("Occupancy certificate".equalsIgnoreCase(appliactionType)) { + applicationType = ApplicationType.OCCUPANCY_CERTIFICATE; + } + criteria.add(Restrictions.eq("application.applicationType", applicationType)); + } + if (edcrRequest != null && isNotBlank(edcrRequest.getApplicationSubType())) { + criteria.add(Restrictions.eq("application.serviceType", edcrRequest.getApplicationSubType())); + } - String queryString = searchAtStateTenantLevel(edcrRequest, userInfo, userId, onlyTenantId, params, isStakeholder); + if (edcrRequest != null && isNotBlank(edcrRequest.getTenantId())) { + criteria.add(Restrictions.ilike("edcrApplicationDetail.tenantId", "%" + edcrRequest.getTenantId() + "%")); + } - final Query query = getCurrentSession().createSQLQuery(queryString); - for (final Map.Entry param : params.entrySet()) - query.setParameter(param.getKey(), param.getValue()); - return query.list().size(); - } else { - final Criteria criteria = getCriteriaofSingleTenant(edcrRequest, userInfo, userId, onlyTenantId, isStakeholder); - return criteria.list().size(); - } + if (onlyTenantId && userInfo != null && isNotBlank(userId)) { + criteria.add(Restrictions.eq("application.thirdPartyUserCode", userId)); + } - } + if (isNotBlank(edcrRequest.getStatus())) + criteria.add(Restrictions.eq("edcrApplicationDetail.status", edcrRequest.getStatus())); + if (edcrRequest.getFromDate() != null) + criteria.add(Restrictions.ge("application.applicationDate", edcrRequest.getFromDate())); + if (edcrRequest.getToDate() != null) + criteria.add(Restrictions.le("application.applicationDate", edcrRequest.getToDate())); + String orderBy = "desc"; + if (isNotBlank(edcrRequest.getOrderBy())) + orderBy = edcrRequest.getOrderBy(); + if (orderBy.equalsIgnoreCase("asc")) + criteria.addOrder(Order.asc("edcrApplicationDetail.createdDate")); + else + criteria.addOrder(Order.desc("edcrApplicationDetail.createdDate")); + + criteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); + return criteria.list().size(); + } else { + City stateCity = cityService.fetchStateCityDetails(); + if (edcrRequest != null && edcrRequest.getTenantId().equalsIgnoreCase(stateCity.getCode())) { + final Map params = new ConcurrentHashMap<>(); + + StringBuilder queryStr = new StringBuilder(); + searchAtStateTenantLevel(edcrRequest, userInfo, userId, onlyTenantId, params, isStakeholder); + + String queryString = searchAtStateTenantLevel(edcrRequest, userInfo, userId, onlyTenantId, params, isStakeholder); + + final Query query = getCurrentSession().createSQLQuery(queryString); + for (final Map.Entry param : params.entrySet()) + query.setParameter(param.getKey(), param.getValue()); + return query.list().size(); + } else { + final Criteria criteria = getCriteriaofSingleTenant(edcrRequest, userInfo, userId, onlyTenantId, isStakeholder); + return criteria.list().size(); + } + } + } - private String searchAtStateTenantLevel(final EdcrRequest edcrRequest, UserInfo userInfo, String userId, boolean onlyTenantId, - final Map params, boolean isStakeholder) { - StringBuilder queryStr = new StringBuilder(); - Map tenants = tenantUtils.tenantsMap(); - Iterator> tenantItr = tenants.entrySet().iterator(); - String orderByWrapperDesc = "select * from ({}) as result order by result.applicationDate desc"; - String orderByWrapperAsc = "select * from ({}) as result order by result.applicationDate asc"; - while (tenantItr.hasNext()) { - Map.Entry value = tenantItr.next(); - queryStr.append("(select '") - .append(value.getKey()) - .append("' as tenantId,appln.transactionNumber,dtl.dcrNumber,dtl.status,appln.applicantName,dxf.fileStoreId as dxfFileId,scrudxf.fileStoreId as scrutinizedDxfFileId,rofile.fileStoreId as reportOutputId,pdfile.fileStoreId as planDetailFileStore,appln.applicationDate,appln.applicationNumber,appln.applicationType,appln.serviceType,appln.planPermitNumber,appln.permitApplicationDate from ") - .append(value.getKey()) - .append(".edcr_application appln, ") - .append(value.getKey()) - .append(".edcr_application_detail dtl, ") - .append(value.getKey()) - .append(".eg_filestoremap dxf, ") - .append(value.getKey()) - .append(".eg_filestoremap scrudxf, ") - .append(value.getKey()) - .append(".eg_filestoremap rofile, ") - .append(value.getKey()) - .append(".eg_filestoremap pdfile ") - .append("where appln.id = dtl.application and dtl.dxfFileId=dxf.id and dtl.scrutinizedDxfFileId=scrudxf.id and dtl.reportOutputId=rofile.id and dtl.planDetailFileStore=pdfile.id "); + private String searchAtStateTenantLevel ( final EdcrRequest edcrRequest, UserInfo userInfo, String userId, + boolean onlyTenantId, + final Map params, boolean isStakeholder){ + StringBuilder queryStr = new StringBuilder(); + Map tenants = tenantUtils.tenantsMap(); + Iterator> tenantItr = tenants.entrySet().iterator(); + String orderByWrapperDesc = "select * from ({}) as result order by result.applicationDate desc"; + String orderByWrapperAsc = "select * from ({}) as result order by result.applicationDate asc"; + while (tenantItr.hasNext()) { + Map.Entry value = tenantItr.next(); + queryStr.append("(select '") + .append(value.getKey()) + .append("' as tenantId,appln.transactionNumber,dtl.dcrNumber,dtl.status,appln.applicantName,dxf.fileStoreId as dxfFileId,scrudxf.fileStoreId as scrutinizedDxfFileId,rofile.fileStoreId as reportOutputId,pdfile.fileStoreId as planDetailFileStore,appln.applicationDate,appln.applicationNumber,appln.applicationType,appln.serviceType,appln.planPermitNumber,appln.permitApplicationDate from ") + .append(value.getKey()) + .append(".edcr_application appln, ") + .append(value.getKey()) + .append(".edcr_application_detail dtl, ") + .append(value.getKey()) + .append(".eg_filestoremap dxf, ") + .append(value.getKey()) + .append(".eg_filestoremap scrudxf, ") + .append(value.getKey()) + .append(".eg_filestoremap rofile, ") + .append(value.getKey()) + .append(".eg_filestoremap pdfile ") + .append("where appln.id = dtl.application and dtl.dxfFileId=dxf.id and dtl.scrutinizedDxfFileId=scrudxf.id and dtl.reportOutputId=rofile.id and dtl.planDetailFileStore=pdfile.id "); if (isNotBlank(edcrRequest.getEdcrNumber())) { queryStr.append("and dtl.dcrNumber=:dcrNumber "); @@ -726,15 +870,10 @@ private String searchAtStateTenantLevel(final EdcrRequest edcrRequest, UserInfo params.put("transactionNumber", edcrRequest.getTransactionNumber()); } - if (isNotBlank(edcrRequest.getApplicationNumber())) { - queryStr.append("and appln.applicationNumber=:applicationNumber "); - params.put("applicationNumber", edcrRequest.getApplicationNumber()); - } - - if ((onlyTenantId || isStakeholder) && userInfo != null && isNotBlank(userId)) { - queryStr.append("and appln.thirdPartyUserCode=:thirdPartyUserCode "); - params.put("thirdPartyUserCode", userId); - } + if (onlyTenantId && userInfo != null && isNotBlank(userId)) { + queryStr.append("and appln.thirdPartyUserCode=:thirdPartyUserCode "); + params.put("thirdPartyUserCode", userId); + } String appliactionType = edcrRequest.getAppliactionType(); if (isNotBlank(appliactionType)) { @@ -757,56 +896,35 @@ private String searchAtStateTenantLevel(final EdcrRequest edcrRequest, UserInfo params.put("servicetype", edcrRequest.getApplicationSubType()); } - if (isNotBlank(edcrRequest.getStatus())) { - queryStr.append("and dtl.status=:status "); - params.put("status", edcrRequest.getStatus()); + queryStr.append(" order by appln.createddate desc)"); + if (tenantItr.hasNext()) { + queryStr.append(" union "); + } } - if (edcrRequest.getFromDate() != null) { - queryStr.append("and appln.applicationDate>=to_timestamp(:fromDate, 'yyyy-MM-dd')"); - params.put("fromDate", sf.format(resetFromDateTimeStamp(edcrRequest.getFromDate()))); + final Query query = getCurrentSession().createSQLQuery(queryStr.toString()); + for (final Map.Entry param : params.entrySet()) + query.setParameter(param.getKey(), param.getValue()); + List applns = query.list(); + if (applns.isEmpty()) { + EdcrDetail edcrDetail = new EdcrDetail(); + edcrDetail.setErrors("No Record Found"); + return Arrays.asList(edcrDetail); + } else { + List edcrDetails2 = new ArrayList<>(); + for (Object[] appln : applns) + edcrDetails2.add(setEdcrResponseForAcrossTenants(appln, stateCity.getCode())); + return edcrDetails2; } - - if (edcrRequest.getToDate() != null) { - queryStr.append("and appln.applicationDate<=to_timestamp(:toDate ,'yyyy-MM-dd')"); - params.put("toDate", sf.format(resetToDateTimeStamp(edcrRequest.getToDate()))); + } else { + final Criteria criteria = getCurrentSession().createCriteria(EdcrApplicationDetail.class, "edcrApplicationDetail"); + criteria.createAlias("edcrApplicationDetail.application", "application"); + if (edcrRequest != null && isNotBlank(edcrRequest.getEdcrNumber())) { + criteria.add(Restrictions.eq("edcrApplicationDetail.dcrNumber", edcrRequest.getEdcrNumber())); } - String orderBy = "desc"; - if (isNotBlank(edcrRequest.getOrderBy())) - orderBy = edcrRequest.getOrderBy(); - if (orderBy.equalsIgnoreCase("asc")) - queryStr.append(" order by appln.createddate asc)"); - else - queryStr.append(" order by appln.createddate desc)"); - if (tenantItr.hasNext()) { - queryStr.append(" union "); + if (edcrRequest != null && isNotBlank(edcrRequest.getTransactionNumber())) { + criteria.add(Restrictions.eq("application.transactionNumber", edcrRequest.getTransactionNumber())); } - } - String query; - String orderBy = "desc"; - if (isNotBlank(edcrRequest.getOrderBy())) - orderBy = edcrRequest.getOrderBy(); - if (orderBy.equalsIgnoreCase("asc")) - query = orderByWrapperAsc.replace("{}", queryStr); - else - query = orderByWrapperDesc.replace("{}", queryStr); - return query; - } - - private Criteria getCriteriaofSingleTenant(final EdcrRequest edcrRequest, UserInfo userInfo, String userId, - boolean onlyTenantId, boolean isStakeholder) { - final Criteria criteria = getCurrentSession().createCriteria(EdcrApplicationDetail.class, - "edcrApplicationDetail"); - criteria.createAlias("edcrApplicationDetail.application", "application"); - if (edcrRequest != null && isNotBlank(edcrRequest.getEdcrNumber())) { - criteria.add(Restrictions.eq("edcrApplicationDetail.dcrNumber", edcrRequest.getEdcrNumber())); - } - if (edcrRequest != null && isNotBlank(edcrRequest.getTransactionNumber())) { - criteria.add(Restrictions.eq("application.transactionNumber", edcrRequest.getTransactionNumber())); - } - if (edcrRequest != null && isNotBlank(edcrRequest.getApplicationNumber())) { - criteria.add(Restrictions.eq("application.applicationNumber", edcrRequest.getApplicationNumber())); - } String appliactionType = edcrRequest.getAppliactionType(); @@ -829,246 +947,248 @@ private Criteria getCriteriaofSingleTenant(final EdcrRequest edcrRequest, UserIn criteria.add(Restrictions.eq("application.serviceType", edcrRequest.getApplicationSubType())); } - if ((onlyTenantId || isStakeholder) && userInfo != null && isNotBlank(userId)) { - criteria.add(Restrictions.eq("application.thirdPartyUserCode", userId)); - } + if ((onlyTenantId || isStakeholder) && userInfo != null && isNotBlank(userId)) { + criteria.add(Restrictions.eq("application.thirdPartyUserCode", userId)); + } - if (isNotBlank(edcrRequest.getStatus())) - criteria.add(Restrictions.eq("edcrApplicationDetail.status", edcrRequest.getStatus())); - if (edcrRequest.getFromDate() != null) - criteria.add(Restrictions.ge("application.applicationDate", edcrRequest.getFromDate())); - if (edcrRequest.getToDate() != null) - criteria.add(Restrictions.le("application.applicationDate", edcrRequest.getToDate())); - String orderBy = "desc"; - if (isNotBlank(edcrRequest.getOrderBy())) - orderBy = edcrRequest.getOrderBy(); - if (orderBy.equalsIgnoreCase("asc")) - criteria.addOrder(Order.asc("edcrApplicationDetail.createdDate")); - else - criteria.addOrder(Order.desc("edcrApplicationDetail.createdDate")); + if (isNotBlank(edcrRequest.getStatus())) + criteria.add(Restrictions.eq("edcrApplicationDetail.status", edcrRequest.getStatus())); + if (edcrRequest.getFromDate() != null) + criteria.add(Restrictions.ge("application.applicationDate", edcrRequest.getFromDate())); + if (edcrRequest.getToDate() != null) + criteria.add(Restrictions.le("application.applicationDate", edcrRequest.getToDate())); + String orderBy = "desc"; + if (isNotBlank(edcrRequest.getOrderBy())) + orderBy = edcrRequest.getOrderBy(); + if (orderBy.equalsIgnoreCase("asc")) + criteria.addOrder(Order.asc("edcrApplicationDetail.createdDate")); + else + criteria.addOrder(Order.desc("edcrApplicationDetail.createdDate")); - criteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); - return criteria; - } + criteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); + return criteria; + } - public ErrorDetail validatePlanFile(final MultipartFile file) { - List dcrAllowedExtenstions = new ArrayList<>( - Arrays.asList(edcrApplicationSettings.getValue("dcr.dxf.allowed.extenstions").split(","))); - - String fileSize = edcrApplicationSettings.getValue("dcr.dxf.max.size"); - final String maxAllowSizeInMB = fileSize; - String extension; - if (file != null && !file.isEmpty()) { - extension = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf('.') + 1); - if (extension != null && !extension.isEmpty()) { - - if (!dcrAllowedExtenstions.contains(extension.toLowerCase())) { - return new ErrorDetail("BPA-02", "Please upload " + dcrAllowedExtenstions + " format file only"); - } else if (file.getSize() > (Long.valueOf(maxAllowSizeInMB) * 1024 * 1024)) { - return new ErrorDetail("BPA-04", "File size should not exceed 30 MB"); - } /* - * else if (allowedExtenstions.contains(extension.toLowerCase()) && (!mimeTypes.contains(mimeType) || - * StringUtils.countMatches(file.getOriginalFilename(), ".") > 1 || file.getOriginalFilename().contains("%00"))) - * { return new ErrorDetail("BPA-03", "Malicious file upload"); } - */ + public ErrorDetail validatePlanFile ( final MultipartFile file){ + List dcrAllowedExtenstions = new ArrayList<>( + Arrays.asList(edcrApplicationSettings.getValue("dcr.dxf.allowed.extenstions").split(","))); + + String fileSize = edcrApplicationSettings.getValue("dcr.dxf.max.size"); + final String maxAllowSizeInMB = fileSize; + String extension; + if (file != null && !file.isEmpty()) { + extension = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf('.') + 1); + if (extension != null && !extension.isEmpty()) { + + if (!dcrAllowedExtenstions.contains(extension.toLowerCase())) { + return new ErrorDetail("BPA-02", "Please upload " + dcrAllowedExtenstions + " format file only"); + } else if (file.getSize() > (Long.valueOf(maxAllowSizeInMB) * 1024 * 1024)) { + return new ErrorDetail("BPA-04", "File size should not exceed 30 MB"); + } /* + * else if (allowedExtenstions.contains(extension.toLowerCase()) && (!mimeTypes.contains(mimeType) || + * StringUtils.countMatches(file.getOriginalFilename(), ".") > 1 || file.getOriginalFilename().contains("%00"))) + * { return new ErrorDetail("BPA-03", "Malicious file upload"); } + */ + } + } else { + return new ErrorDetail(BPA_05, "Please upload plan file, It is mandatory"); } - } else { - return new ErrorDetail(BPA_05, "Please upload plan file, It is mandatory"); + + return null; } - return null; - } + public ErrorDetail validateEdcrRequest ( final EdcrRequest edcrRequest, final MultipartFile planFile){ + if (edcrRequest.getRequestInfo() == null) + return new ErrorDetail(BPA_07, REQ_BODY_REQUIRED); + else if (edcrRequest.getRequestInfo().getUserInfo() == null + || (edcrRequest.getRequestInfo().getUserInfo() != null + && isBlank(edcrRequest.getRequestInfo().getUserInfo().getUuid()))) + return new ErrorDetail(BPA_07, USER_ID_IS_MANDATORY); + + if (isBlank(edcrRequest.getTransactionNumber())) + return new ErrorDetail(BPA_07, "Please enter transaction number"); + if (isNotBlank(edcrRequest.getTransactionNumber()) + && edcrApplicationService.findByTransactionNumber(edcrRequest.getTransactionNumber()) != null) { + return new ErrorDetail(BPA_01, MSG_UNQ_TRANSACTION_NUMBER); + } - public ErrorDetail validateEdcrRequest(final EdcrRequest edcrRequest, final MultipartFile planFile) { - if (edcrRequest.getRequestInfo() == null) - return new ErrorDetail(BPA_07, REQ_BODY_REQUIRED); - else if (edcrRequest.getRequestInfo().getUserInfo() == null - || (edcrRequest.getRequestInfo().getUserInfo() != null - && isBlank(edcrRequest.getRequestInfo().getUserInfo().getUuid()))) - return new ErrorDetail(BPA_07, USER_ID_IS_MANDATORY); - - if (isBlank(edcrRequest.getTransactionNumber())) - return new ErrorDetail(BPA_07, "Please enter transaction number"); - if (isNotBlank(edcrRequest.getTransactionNumber()) - && edcrApplicationService.findByTransactionNumber(edcrRequest.getTransactionNumber()) != null) { - return new ErrorDetail(BPA_01, MSG_UNQ_TRANSACTION_NUMBER); + return validatePlanFile(planFile); } - return validatePlanFile(planFile); - } + public ErrorDetail validateEdcrOcRequest ( final EdcrRequest edcrRequest, final MultipartFile planFile){ + if (edcrRequest.getRequestInfo() == null) + return new ErrorDetail(BPA_07, REQ_BODY_REQUIRED); + else if (edcrRequest.getRequestInfo().getUserInfo() == null + || (edcrRequest.getRequestInfo().getUserInfo() != null + && isBlank(edcrRequest.getRequestInfo().getUserInfo().getUuid()))) + return new ErrorDetail(BPA_07, USER_ID_IS_MANDATORY); - public ErrorDetail validateEdcrOcRequest(final EdcrRequest edcrRequest, final MultipartFile planFile) { - if (edcrRequest.getRequestInfo() == null) - return new ErrorDetail(BPA_07, REQ_BODY_REQUIRED); - else if (edcrRequest.getRequestInfo().getUserInfo() == null - || (edcrRequest.getRequestInfo().getUserInfo() != null - && isBlank(edcrRequest.getRequestInfo().getUserInfo().getUuid()))) - return new ErrorDetail(BPA_07, USER_ID_IS_MANDATORY); + if (isBlank(edcrRequest.getTransactionNumber())) + return new ErrorDetail(BPA_07, "Transaction number is mandatory"); - if (isBlank(edcrRequest.getTransactionNumber())) - return new ErrorDetail(BPA_07, "Transaction number is mandatory"); + if (null == edcrRequest.getPermitDate()) + return new ErrorDetail("BPA-08", "Permit Date is mandatory"); + if (isNotBlank(edcrRequest.getTransactionNumber()) + && edcrApplicationService.findByTransactionNumber(edcrRequest.getTransactionNumber()) != null) { + return new ErrorDetail(BPA_01, MSG_UNQ_TRANSACTION_NUMBER); - if (null == edcrRequest.getPermitDate()) - return new ErrorDetail("BPA-08", "Permit Date is mandatory"); - if (isNotBlank(edcrRequest.getTransactionNumber()) - && edcrApplicationService.findByTransactionNumber(edcrRequest.getTransactionNumber()) != null) { - return new ErrorDetail(BPA_01, MSG_UNQ_TRANSACTION_NUMBER); + } + return validatePlanFile(planFile); } - return validatePlanFile(planFile); - } + public List validateScrutinizeOcRequest ( final EdcrRequest edcrRequest, + final MultipartFile planFile){ + List errorDetails = new ArrayList<>(); - public List validateScrutinizeOcRequest(final EdcrRequest edcrRequest, final MultipartFile planFile) { - List errorDetails = new ArrayList<>(); + if (edcrRequest.getRequestInfo() == null) + errorDetails.add(new ErrorDetail(BPA_07, REQ_BODY_REQUIRED)); + else if (edcrRequest.getRequestInfo().getUserInfo() == null + || (edcrRequest.getRequestInfo().getUserInfo() != null + && isBlank(edcrRequest.getRequestInfo().getUserInfo().getUuid()))) + errorDetails.add(new ErrorDetail("BPA-08", USER_ID_IS_MANDATORY)); - if (edcrRequest.getRequestInfo() == null) - errorDetails.add(new ErrorDetail(BPA_07, REQ_BODY_REQUIRED)); - else if (edcrRequest.getRequestInfo().getUserInfo() == null - || (edcrRequest.getRequestInfo().getUserInfo() != null - && isBlank(edcrRequest.getRequestInfo().getUserInfo().getUuid()))) - errorDetails.add(new ErrorDetail("BPA-08", USER_ID_IS_MANDATORY)); + if (isBlank(edcrRequest.getTransactionNumber())) + errorDetails.add(new ErrorDetail("BPA-09", "Transaction number is mandatory")); - if (isBlank(edcrRequest.getTransactionNumber())) - errorDetails.add(new ErrorDetail("BPA-09", "Transaction number is mandatory")); + if (null == edcrRequest.getPermitDate()) + errorDetails.add(new ErrorDetail("BPA-10", "Permit Date is mandatory")); + if (isNotBlank(edcrRequest.getTransactionNumber()) + && edcrApplicationService.findByTransactionNumber(edcrRequest.getTransactionNumber()) != null) { + errorDetails.add(new ErrorDetail("BPA-11", MSG_UNQ_TRANSACTION_NUMBER)); - if (null == edcrRequest.getPermitDate()) - errorDetails.add(new ErrorDetail("BPA-10", "Permit Date is mandatory")); - if (isNotBlank(edcrRequest.getTransactionNumber()) - && edcrApplicationService.findByTransactionNumber(edcrRequest.getTransactionNumber()) != null) { - errorDetails.add(new ErrorDetail("BPA-11", MSG_UNQ_TRANSACTION_NUMBER)); + } - } + String dcrNo = edcrRequest.getComparisonEdcrNumber(); + if (StringUtils.isBlank(dcrNo)) { + errorDetails.add(new ErrorDetail("BPA-29", "Comparison eDcr number is mandatory")); + } else { + EdcrApplicationDetail permitDcr = applicationDetailService.findByDcrNumberAndTPUserTenant(dcrNo, + edcrRequest.getTenantId()); - String dcrNo = edcrRequest.getComparisonEdcrNumber(); - if (StringUtils.isBlank(dcrNo)) { - errorDetails.add(new ErrorDetail("BPA-29", "Comparison eDcr number is mandatory")); - } else { - EdcrApplicationDetail permitDcr = applicationDetailService.findByDcrNumberAndTPUserTenant(dcrNo, - edcrRequest.getTenantId()); + if (permitDcr != null && permitDcr.getApplication() != null + && StringUtils.isBlank(permitDcr.getApplication().getServiceType())) { + errorDetails.add(new ErrorDetail("BPA-26", "No service type found for dcr number " + dcrNo)); + } - if (permitDcr != null && permitDcr.getApplication() != null - && StringUtils.isBlank(permitDcr.getApplication().getServiceType())) { - errorDetails.add(new ErrorDetail("BPA-26", "No service type found for dcr number " + dcrNo)); - } + if (permitDcr == null) { + errorDetails.add(new ErrorDetail("BPA-24", "No record found with dcr number " + dcrNo)); + } - if (permitDcr == null) { - errorDetails.add(new ErrorDetail("BPA-24", "No record found with dcr number " + dcrNo)); - } + if (permitDcr != null && permitDcr.getApplication() != null && edcrRequest.getAppliactionType() + .equalsIgnoreCase(permitDcr.getApplication().getApplicationType().toString())) { + errorDetails.add(new ErrorDetail("BPA-27", "Application types are same")); + } - if (permitDcr != null && permitDcr.getApplication() != null && edcrRequest.getAppliactionType() - .equalsIgnoreCase(permitDcr.getApplication().getApplicationType().toString())) { - errorDetails.add(new ErrorDetail("BPA-27", "Application types are same")); + if (permitDcr != null && permitDcr.getApplication() != null && !edcrRequest.getApplicationSubType() + .equalsIgnoreCase(permitDcr.getApplication().getServiceType())) { + errorDetails.add(new ErrorDetail("BPA-28", "Service types are not mathing")); + } } - if (permitDcr != null && permitDcr.getApplication() != null && !edcrRequest.getApplicationSubType() - .equalsIgnoreCase(permitDcr.getApplication().getServiceType())) { - errorDetails.add(new ErrorDetail("BPA-28", "Service types are not mathing")); - } + ErrorDetail validatePlanFile = validatePlanFile(planFile); + if (validatePlanFile != null) + errorDetails.add(validatePlanFile); + + return errorDetails; } - ErrorDetail validatePlanFile = validatePlanFile(planFile); - if (validatePlanFile != null) - errorDetails.add(validatePlanFile); + public List validateEdcrMandatoryFields ( final EdcrRequest edcrRequest){ + List errors = new ArrayList<>(); + if (StringUtils.isBlank(edcrRequest.getAppliactionType())) { + errors.add(new ErrorDetail("BPA-10", "Application type is missing")); + } - return errorDetails; - } + if (StringUtils.isBlank(edcrRequest.getApplicationSubType())) { + errors.add(new ErrorDetail("BPA-11", "Service type is missing")); + } - public List validateEdcrMandatoryFields(final EdcrRequest edcrRequest) { - List errors = new ArrayList<>(); - if (StringUtils.isBlank(edcrRequest.getAppliactionType())) { - errors.add(new ErrorDetail("BPA-10", "Application type is missing")); + return errors; } - if (StringUtils.isBlank(edcrRequest.getApplicationSubType())) { - errors.add(new ErrorDetail("BPA-11", "Service type is missing")); + public ErrorDetail validateSearchRequest ( final String edcrNumber, final String transactionNumber){ + ErrorDetail errorDetail = null; + if (isBlank(edcrNumber) && isBlank(transactionNumber)) + return new ErrorDetail(BPA_07, "Please enter valid edcr number or transaction number"); + return errorDetail; } - return errors; - } - - public ErrorDetail validateSearchRequest(final String edcrNumber, final String transactionNumber) { - ErrorDetail errorDetail = null; - if (isBlank(edcrNumber) && isBlank(transactionNumber)) - return new ErrorDetail(BPA_07, "Please enter valid edcr number or transaction number"); - return errorDetail; - } - /* - * public String getMimeType(final MultipartFile file) { MimeUtil.registerMimeDetector( - * "eu.medsea.mimeutil.detector.MagicMimeMimeDetector"); eu.medsea.mimeutil.MimeType mimeType = null; try { mimeType = - * MimeUtil.getMostSpecificMimeType(MimeUtil.getMimeTypes(file.getInputStream()) ); } catch (MimeException | IOException e) { - * LOG.error(e); } MimeUtil.unregisterMimeDetector( "eu.medsea.mimeutil.detector.MagicMimeMimeDetector"); return - * String.valueOf(mimeType); } + * public String getMimeType(final MultipartFile file) { + * MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.MagicMimeMimeDetector"); eu.medsea.mimeutil.MimeType mimeType = + * null; try { mimeType = MimeUtil.getMostSpecificMimeType(MimeUtil.getMimeTypes(file.getInputStream())); } catch + * (MimeException | IOException e) { LOG.error(e); } + * MimeUtil.unregisterMimeDetector("eu.medsea.mimeutil.detector.MagicMimeMimeDetector"); return String.valueOf(mimeType); } */ - @SuppressWarnings("unused") - public ErrorDetail validateParam(List allowedExtenstions, List mimeTypes, MultipartFile file, - final String maxAllowSizeInMB) { - String extension; - String mimeType; - if (file != null && !file.isEmpty()) { - extension = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf('.') + 1); - if (extension != null && !extension.isEmpty()) { - // mimeType = getMimeType(file); - if (!allowedExtenstions.contains(extension.toLowerCase())) { - return new ErrorDetail("BPA-02", "Please upload " + allowedExtenstions + " format file only"); - } else if (file.getSize() > (Long.valueOf(maxAllowSizeInMB) * 1024 * 1024)) { - return new ErrorDetail("BPA-04", "File size should not exceed 30 MB"); - } /* - * else if (allowedExtenstions.contains(extension.toLowerCase()) && (!mimeTypes.contains(mimeType) || - * StringUtils.countMatches(file.getOriginalFilename(), ".") > 1 || file.getOriginalFilename().contains("%00"))) - * { return new ErrorDetail("BPA-03", "Malicious file upload"); } - */ + @SuppressWarnings("unused") + public ErrorDetail validateParam (List < String > allowedExtenstions, List < String > mimeTypes, MultipartFile + file, + final String maxAllowSizeInMB){ + String extension; + String mimeType; + if (file != null && !file.isEmpty()) { + extension = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf('.') + 1); + if (extension != null && !extension.isEmpty()) { + // mimeType = getMimeType(file); + if (!allowedExtenstions.contains(extension.toLowerCase())) { + return new ErrorDetail("BPA-02", "Please upload " + allowedExtenstions + " format file only"); + } else if (file.getSize() > (Long.valueOf(maxAllowSizeInMB) * 1024 * 1024)) { + return new ErrorDetail("BPA-04", "File size should not exceed 30 MB"); + } /* + * else if (allowedExtenstions.contains(extension.toLowerCase()) && (!mimeTypes.contains(mimeType) || + * StringUtils.countMatches(file.getOriginalFilename(), ".") > 1 || file.getOriginalFilename().contains("%00"))) + * { return new ErrorDetail("BPA-03", "Malicious file upload"); } + */ + } + } else { + return new ErrorDetail(BPA_05, "Please, upload plan file is mandatory"); } - } else { - return new ErrorDetail(BPA_05, "Please, upload plan file is mandatory"); + + return null; } - return null; - } + public ResponseInfo createResponseInfoFromRequestInfo (RequestInfo requestInfo, Boolean success){ + String apiId = null; + String ver = null; + String ts = null; + String resMsgId = ""; + String msgId = null; + if (requestInfo != null) { + apiId = requestInfo.getApiId(); + ver = requestInfo.getVer(); + if (requestInfo.getTs() != null) + ts = requestInfo.getTs().toString(); + msgId = requestInfo.getMsgId(); + } + String responseStatus = success ? "successful" : "failed"; - public ResponseInfo createResponseInfoFromRequestInfo(RequestInfo requestInfo, Boolean success) { - String apiId = null; - String ver = null; - String ts = null; - String resMsgId = ""; - String msgId = null; - if (requestInfo != null) { - apiId = requestInfo.getApiId(); - ver = requestInfo.getVer(); - if (requestInfo.getTs() != null) - ts = requestInfo.getTs().toString(); - msgId = requestInfo.getMsgId(); + return new ResponseInfo(apiId, ver, ts, resMsgId, msgId, responseStatus); } - String responseStatus = success ? "successful" : "failed"; - - return new ResponseInfo(apiId, ver, ts, resMsgId, msgId, responseStatus); - } - public String getFileDownloadUrl(final String fileStoreId, final String tenantId) { - return String.format(FILE_DOWNLOAD_URL, ApplicationThreadLocals.getDomainURL()) + "?tenantId=" + tenantId - + "&fileStoreId=" + fileStoreId; - } + public String getFileDownloadUrl ( final String fileStoreId, final String tenantId){ + return String.format(FILE_DOWNLOAD_URL, ApplicationThreadLocals.getDomainURL()) + "?tenantId=" + tenantId + + "&fileStoreId=" + fileStoreId; + } - public Date resetFromDateTimeStamp(final Date date) { - final Calendar cal1 = Calendar.getInstance(); - cal1.setTime(date); - cal1.set(Calendar.HOUR_OF_DAY, 0); - cal1.set(Calendar.MINUTE, 0); - cal1.set(Calendar.SECOND, 0); - cal1.set(Calendar.MILLISECOND, 0); - return cal1.getTime(); - } + public Date resetFromDateTimeStamp ( final Date date){ + final Calendar cal1 = Calendar.getInstance(); + cal1.setTime(date); + cal1.set(Calendar.HOUR_OF_DAY, 0); + cal1.set(Calendar.MINUTE, 0); + cal1.set(Calendar.SECOND, 0); + cal1.set(Calendar.MILLISECOND, 0); + return cal1.getTime(); + } - public Date resetToDateTimeStamp(final Date date) { - final Calendar cal1 = Calendar.getInstance(); - cal1.setTime(date); - cal1.set(Calendar.HOUR_OF_DAY, 23); - cal1.set(Calendar.MINUTE, 59); - cal1.set(Calendar.SECOND, 59); - cal1.set(Calendar.MILLISECOND, 999); - return cal1.getTime(); - } + public Date resetToDateTimeStamp ( final Date date){ + final Calendar cal1 = Calendar.getInstance(); + cal1.setTime(date); + cal1.set(Calendar.HOUR_OF_DAY, 23); + cal1.set(Calendar.MINUTE, 59); + cal1.set(Calendar.SECOND, 59); + cal1.set(Calendar.MILLISECOND, 999); + return cal1.getTime(); + } } \ No newline at end of file diff --git a/edcr/service/egov/egov-edcr/src/main/resources/db/migration/main/V20211129124739__edcr_tenantid_add_column_ddl.sql b/edcr/service/egov/egov-edcr/src/main/resources/db/migration/main/V20211129124739__edcr_tenantid_add_column_ddl.sql new file mode 100644 index 00000000000..0cb04e39564 --- /dev/null +++ b/edcr/service/egov/egov-edcr/src/main/resources/db/migration/main/V20211129124739__edcr_tenantid_add_column_ddl.sql @@ -0,0 +1,5 @@ +alter table edcr_application add column tenantId character varying(64); + +alter table edcr_application_detail add column tenantId character varying(64); + +alter table edcr_pdf_detail add column tenantId character varying(64); \ No newline at end of file diff --git a/edcr/service/egov/egov-edcrweb/pom.xml b/edcr/service/egov/egov-edcrweb/pom.xml index 28ce780bd0c..35dced698fd 100644 --- a/edcr/service/egov/egov-edcrweb/pom.xml +++ b/edcr/service/egov/egov-edcrweb/pom.xml @@ -34,7 +34,7 @@ egov-erp org.egov.edcr - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT 4.0.0 @@ -46,19 +46,19 @@ org.egov.edcr egov-egi - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT org.egov.edcr egov-commons - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT org.egov.edcr egov-edcr - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT diff --git a/edcr/service/egov/egov-edcrweb/src/main/java/org/egov/edcr/web/controller/rest/RestEdcrApplicationController.java b/edcr/service/egov/egov-edcrweb/src/main/java/org/egov/edcr/web/controller/rest/RestEdcrApplicationController.java index eaf6059c514..571dd44c35f 100644 --- a/edcr/service/egov/egov-edcrweb/src/main/java/org/egov/edcr/web/controller/rest/RestEdcrApplicationController.java +++ b/edcr/service/egov/egov-edcrweb/src/main/java/org/egov/edcr/web/controller/rest/RestEdcrApplicationController.java @@ -138,7 +138,7 @@ public class RestEdcrApplicationController { @Autowired private EdcrValidator edcrValidator; - + @PostMapping(value = "/scrutinizeplan", produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public ResponseEntity scrutinizePlan(@RequestBody MultipartFile planFile, @@ -230,6 +230,7 @@ public ResponseEntity scrutinize(@RequestPart("planFile") MultipartFile planF enrichUser.setUuid(userInfoReq.getUuid()); enrichUser.setMobile(userInfoReq.getMobile()); enrichUser.setTenantId(userInfoReq.getTenantId()); + enrichUser.setName(userInfoReq.getName()); edcr.getRequestInfo().setUserInfo(enrichUser); } ErrorDetail edcRes = edcrValidator.validate(edcr); diff --git a/edcr/service/egov/egov-egi/pom.xml b/edcr/service/egov/egov-egi/pom.xml index 27caf80627d..928fdc00ab8 100644 --- a/edcr/service/egov/egov-egi/pom.xml +++ b/edcr/service/egov/egov-egi/pom.xml @@ -35,7 +35,7 @@ egov-erp org.egov.edcr - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT 4.0.0 @@ -47,14 +47,14 @@ org.egov.edcr egov-config - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT org.egov.edcr egov-config - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT tests test diff --git a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/config/core/ApplicationThreadLocals.java b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/config/core/ApplicationThreadLocals.java index 0b400ba4f59..215307fb25a 100644 --- a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/config/core/ApplicationThreadLocals.java +++ b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/config/core/ApplicationThreadLocals.java @@ -57,56 +57,52 @@ public class ApplicationThreadLocals { private static ThreadLocal cityName = new ThreadLocal<>(); private static ThreadLocal municipalityName = new ThreadLocal<>(); private static ThreadLocal domainURL = new ThreadLocal<>(); - + private static ThreadLocal cityNameLocal = new ThreadLocal<>(); - + private static ThreadLocal districtName = new ThreadLocal<>(); private static ThreadLocal districtCode = new ThreadLocal<>(); private static ThreadLocal stateName = new ThreadLocal<>(); - private static ThreadLocal grade = new ThreadLocal<>(); - - - + private static ThreadLocal grade = new ThreadLocal<>(); + private static ThreadLocal fullTenantID = new ThreadLocal<>(); + private static ThreadLocal filestoreTenantID = new ThreadLocal<>(); public static String getGrade() { - return grade.get(); - } + return grade.get(); + } - public static void setGrade(String localGrade) { - grade.set(localGrade); - } - + public static void setGrade(String localGrade) { + grade.set(localGrade); + } public static String getDistrictName() { - return districtName.get(); - } + return districtName.get(); + } + + public static void setDistrictName(String localDistrictName) { + districtName.set(localDistrictName); + } - public static void setDistrictName(String localDistrictName) { - districtName.set(localDistrictName); - } - public static String getDistrictCode() { - return districtCode.get(); - } + return districtCode.get(); + } + + public static void setDistrictCode(String localDistrictCode) { + districtCode.set(localDistrictCode); + } - public static void setDistrictCode(String localDistrictCode) { - districtCode.set(localDistrictCode); - } - public static String getStateName() { - return stateName.get(); - } + return stateName.get(); + } - public static void setStateName(String localStateName) { - stateName.set(localStateName); - } - - + public static void setStateName(String localStateName) { + stateName.set(localStateName); + } - private ApplicationThreadLocals() { - //Not to be initialized + private ApplicationThreadLocals() { + // Not to be initialized } - + public static String getCityName() { return cityName.get(); } @@ -162,7 +158,7 @@ public static String getDomainURL() { public static void setDomainURL(String domURL) { domainURL.set(domURL); } - + public static String getCityNameLocal() { return cityNameLocal.get(); } @@ -171,6 +167,22 @@ public static void setCityNameLocal(String citiNameLocal) { cityNameLocal.set(citiNameLocal); } + public static String getFullTenantID() { + return fullTenantID.get(); + } + + public static void setFullTenantID(String fullTenantId) { + fullTenantID.set(fullTenantId); + } + + public static String getFilestoreTenantID() { + return filestoreTenantID.get(); + } + + public static void setFilestoreTenantID(String filestoreTenant) { + filestoreTenantID.set(filestoreTenant); + } + public static void clearValues() { domainName.remove(); userId.remove(); @@ -179,14 +191,14 @@ public static void clearValues() { cityName.remove(); municipalityName.remove(); domainURL.remove(); - + cityNameLocal.remove(); - + grade.remove(); districtCode.remove(); districtName.remove(); stateName.remove(); - - + fullTenantID.remove(); + filestoreTenantID.remove(); } -} +} \ No newline at end of file diff --git a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/custom/CustomImplProvider.java b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/custom/CustomImplProvider.java index 5afd4b393a3..c566a119cbb 100644 --- a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/custom/CustomImplProvider.java +++ b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/custom/CustomImplProvider.java @@ -218,7 +218,7 @@ public Object find(String beanName) { } // get ULB grade wise bean - if (ApplicationThreadLocals.getGrade().isEmpty()) { + if (ApplicationThreadLocals.getGrade() == null || ApplicationThreadLocals.getGrade().isEmpty()) { throw new RuntimeException("ULB grade not defined. Please update and try again"); } else { gradeBean = getBeanByName(beanName + "_" + ApplicationThreadLocals.getGrade()); diff --git a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/entity/FileStoreMapper.java b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/entity/FileStoreMapper.java index 3797750adaa..0ab1c2a0d6d 100644 --- a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/entity/FileStoreMapper.java +++ b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/entity/FileStoreMapper.java @@ -94,6 +94,9 @@ public class FileStoreMapper extends AbstractPersistable { @Temporal(TemporalType.TIMESTAMP) private Date createdDate = new Date(); + + @SafeHtml + private String tenantId; protected FileStoreMapper() { // For JPA @@ -160,4 +163,13 @@ public boolean equals(Object other) { public int hashCode() { return Objects.hash(id); } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + } \ No newline at end of file diff --git a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/service/impl/EgovMicroServiceStore.java b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/service/impl/EgovMicroServiceStore.java index f92f3085c1d..d280ddaad29 100644 --- a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/service/impl/EgovMicroServiceStore.java +++ b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/service/impl/EgovMicroServiceStore.java @@ -133,13 +133,14 @@ public FileStoreMapper store(File file, String fileName, String mimeType, String headers.setContentType(MediaType.MULTIPART_FORM_DATA); MultiValueMap map = new LinkedMultiValueMap(); map.add("file", new FileSystemResource(file.getName())); - map.add("tenantId", ApplicationThreadLocals.getTenantID()); + map.add("tenantId", ApplicationThreadLocals.getFilestoreTenantID()); map.add("module", moduleName); HttpEntity> request = new HttpEntity>(map, headers); ResponseEntity result = restTemplate.postForEntity(url, request, StorageResponse.class); FileStoreMapper fileMapper = new FileStoreMapper(result.getBody().getFiles().get(0).getFileStoreId(), fileName); + fileMapper.setTenantId(ApplicationThreadLocals.getFilestoreTenantID()); if (LOG.isDebugEnabled()) LOG.debug( String.format("Uploaded file %s with filestoreid %s ", file.getName(), fileMapper.getFileStoreId())); @@ -178,7 +179,7 @@ public FileStoreMapper store(InputStream fileStream, String fileName, String mim headers.setContentType(MediaType.MULTIPART_FORM_DATA); MultiValueMap map = new LinkedMultiValueMap(); map.add("file", new FileSystemResource(f.getName())); - map.add("tenantId", ApplicationThreadLocals.getTenantID()); + map.add("tenantId", ApplicationThreadLocals.getFilestoreTenantID()); map.add("module", moduleName); HttpEntity> request = new HttpEntity>(map, headers); @@ -188,7 +189,51 @@ public FileStoreMapper store(InputStream fileStream, String fileName, String mim if (LOG.isDebugEnabled()) LOG.debug(String.format("Upload completed for %s with filestoreid ", f.getName(), fileMapper.getFileStoreId())); + fileMapper.setTenantId(ApplicationThreadLocals.getFilestoreTenantID()); + fileMapper.setContentType(mimeType); + if (closeStream) + Files.deleteIfExists(Paths.get(fileName)); + return fileMapper; + } catch (RestClientException | IOException e) { + LOG.error("Error while Saving to FileStore", e); + + } + return null; + + } + + @Override + public FileStoreMapper store(InputStream fileStream, String fileName, String mimeType, String moduleName, + String tenantId, boolean closeStream) { + + try { + HttpHeaders headers = new HttpHeaders(); + fileName = normalizeString(fileName); + mimeType = normalizeString(mimeType); + moduleName = normalizeString(moduleName); + File f = new File(fileName); + FileUtils.copyToFile(fileStream, f); + if (closeStream) { + fileStream.close(); + } + if (LOG.isDebugEnabled()) + LOG.debug(String.format("Uploading ..... %s with size %s ", f.getName(), f.length())); + + headers.setContentType(MediaType.MULTIPART_FORM_DATA); + MultiValueMap map = new LinkedMultiValueMap(); + map.add("file", new FileSystemResource(f.getName())); + map.add("tenantId", StringUtils.isEmpty(tenantId) ? ApplicationThreadLocals.getFilestoreTenantID() : tenantId); + map.add("module", moduleName); + HttpEntity> request = new HttpEntity>(map, + headers); + ResponseEntity result = restTemplate.postForEntity(url, request, StorageResponse.class); + FileStoreMapper fileMapper = new FileStoreMapper(result.getBody().getFiles().get(0).getFileStoreId(), + fileName); + if (LOG.isDebugEnabled()) + LOG.debug(String.format("Upload completed for %s with filestoreid ", f.getName(), + fileMapper.getFileStoreId())); + fileMapper.setTenantId(ApplicationThreadLocals.getFilestoreTenantID()); fileMapper.setContentType(mimeType); if (closeStream) Files.deleteIfExists(Paths.get(fileName)); @@ -262,7 +307,7 @@ public File fetch(String fileStoreId, String moduleName) { fileStoreId = normalizeString(fileStoreId); moduleName = normalizeString(moduleName); - String urls = url + "/id?tenantId=" + ApplicationThreadLocals.getTenantID() + "&fileStoreId=" + fileStoreId; + String urls = url + "/id?tenantId=" + ApplicationThreadLocals.getFilestoreTenantID() + "&fileStoreId=" + fileStoreId; if (LOG.isDebugEnabled()) LOG.debug(String.format("fetch file fron url %s ", urls)); @@ -316,7 +361,7 @@ private Path getFilePath(Path fileDirPath, String fileStoreId) { public File fetch(String fileStoreId, String moduleName, String tenantId) { fileStoreId = normalizeString(fileStoreId); moduleName = normalizeString(moduleName); - String tenant = StringUtils.isEmpty(tenantId) ? ApplicationThreadLocals.getTenantID() : tenantId; + String tenant = StringUtils.isEmpty(tenantId) ? ApplicationThreadLocals.getFilestoreTenantID() : tenantId; String urls = url + "/id?tenantId=" + tenant + "&fileStoreId=" + fileStoreId; LOG.info(String.format("fetch file from url %s ", urls)); Path path = Paths.get("/tmp/" + RandomUtils.nextLong()); diff --git a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/service/impl/LocalDiskFileStoreService.java b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/service/impl/LocalDiskFileStoreService.java index d7f97d24e96..8e2b30c117e 100644 --- a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/service/impl/LocalDiskFileStoreService.java +++ b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/filestore/service/impl/LocalDiskFileStoreService.java @@ -48,6 +48,7 @@ package org.egov.infra.filestore.service.impl; +import org.egov.infra.config.core.ApplicationThreadLocals; import org.egov.infra.exception.ApplicationRuntimeException; import org.egov.infra.filestore.entity.FileStoreMapper; import org.egov.infra.filestore.service.FileStoreService; @@ -108,6 +109,7 @@ public FileStoreMapper store(File file, String fileName, String mimeType, String Path newFilePath = this.createNewFilePath(fileMapper, moduleName); Files.copy(file.toPath(), newFilePath); fileMapper.setContentType(mimeType); + fileMapper.setTenantId(ApplicationThreadLocals.getFilestoreTenantID()); if (deleteFile && file.delete()) LOG.info("File store source file deleted"); return fileMapper; @@ -133,6 +135,7 @@ private FileStoreMapper storeCommon(InputStream fileStream, String fileName, Str Path newFilePath = this.createNewFilePath(fileMapper, moduleName); Files.copy(fileStream, newFilePath); fileMapper.setContentType(mimeType); + fileMapper.setTenantId(ApplicationThreadLocals.getFilestoreTenantID()); if (closeStream) fileStream.close(); return fileMapper; diff --git a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/filter/ApplicationCoreFilter.java b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/filter/ApplicationCoreFilter.java index 0aee164aa09..ed8706c851f 100644 --- a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/filter/ApplicationCoreFilter.java +++ b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/filter/ApplicationCoreFilter.java @@ -97,14 +97,17 @@ public class ApplicationCoreFilter implements Filter { private String cdnURL; @Resource(name = "cities") - private transient List cities; + private List cities; @Value("${client.id}") private String clientId; @Value("${app.version}_${app.build.no}") private String applicationRelease; - + + @Value("${is.environment.central.instance}") + private String isEnvironmentCentralInstance; + private static final Logger LOG = LoggerFactory.getLogger(ApplicationCoreFilter.class); @Override @@ -124,7 +127,23 @@ public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain private void prepareRestService(HttpServletRequest req, HttpSession session) { String requestURL = new StringBuilder().append(ApplicationThreadLocals.getDomainURL()) .append(req.getRequestURI()).toString(); - if (requestURL.contains(ApplicationTenantResolverFilter.tenants.get("state")) + String fullTenant = req.getParameter("tenantId"); + + String[] tenantArr = fullTenant == null ? new String[0] : fullTenant.split("\\."); + String stateName; + if(Boolean.TRUE.equals(Boolean.valueOf(isEnvironmentCentralInstance))) { + if (tenantArr.length == 3 || tenantArr.length == 2) { + ApplicationThreadLocals.setStateName(tenantArr[1]); + stateName = tenantArr[1]; + } else { + if(tenantArr.length == 1) + ApplicationThreadLocals.setStateName(tenantArr[0]); + stateName = "state"; + } + } else { + stateName = "state"; + } + if (requestURL.contains(ApplicationTenantResolverFilter.tenants.get(stateName)) && (requestURL.contains("/rest/") || requestURL.contains("/oauth/"))) { prepareThreadLocal(ApplicationThreadLocals.getTenantID()); @@ -151,9 +170,17 @@ private void prepareUserSession(HttpSession session) { } private void prepareApplicationThreadLocal(HttpSession session) { - + String stateName; + String cityName; + if(Boolean.valueOf(isEnvironmentCentralInstance)) { + stateName = ApplicationThreadLocals.getStateName(); + cityName = ApplicationThreadLocals.getCityName(); + } else { + stateName = clientId; + cityName = (String) session.getAttribute(CITY_NAME_KEY); + } ApplicationThreadLocals.setCityCode((String) session.getAttribute(CITY_CODE_KEY)); - ApplicationThreadLocals.setCityName((String) session.getAttribute(CITY_NAME_KEY)); + ApplicationThreadLocals.setCityName(cityName); ApplicationThreadLocals.setCityNameLocal((String) session.getAttribute(CITY_LOCAL_NAME_KEY)); ApplicationThreadLocals.setMunicipalityName((String) session.getAttribute(CITY_CORP_NAME_KEY)); ApplicationThreadLocals.setUserId((Long) session.getAttribute(USERID_KEY)); @@ -162,7 +189,7 @@ private void prepareApplicationThreadLocal(HttpSession session) { if (city != null) { ApplicationThreadLocals.setDistrictCode(city.getDistrictCode()); ApplicationThreadLocals.setDistrictName(city.getDistrictName()); - ApplicationThreadLocals.setStateName(clientId); + ApplicationThreadLocals.setStateName(stateName); ApplicationThreadLocals.setGrade(city.getGrade()); } } @@ -176,11 +203,20 @@ private void prepareThreadLocal(String tenant) { // TODO: get the city by tenant City city = this.cityService.findAll().get(0); if (city != null) { + String stateName; + String cityName; + if(Boolean.TRUE.equals(Boolean.valueOf(isEnvironmentCentralInstance))) { + stateName = ApplicationThreadLocals.getStateName(); + cityName = ApplicationThreadLocals.getCityName(); + } else { + stateName = clientId; + cityName = city.getName(); + } ApplicationThreadLocals.setCityCode(city.getCode()); - ApplicationThreadLocals.setCityName(city.getName()); + ApplicationThreadLocals.setCityName(cityName); ApplicationThreadLocals.setDistrictCode(city.getDistrictCode()); ApplicationThreadLocals.setDistrictName(city.getDistrictName()); - ApplicationThreadLocals.setStateName(clientId); + ApplicationThreadLocals.setStateName(stateName); ApplicationThreadLocals.setGrade(city.getGrade()); ApplicationThreadLocals.setDomainName(city.getDomainURL()); // ApplicationThreadLocals.setDomainURL("https://"+city.getDomainURL()); @@ -203,4 +239,4 @@ public void destroy() { public void init(FilterConfig filterConfig) throws ServletException { // Nothing to be initialized } -} +} \ No newline at end of file diff --git a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/filter/ApplicationTenantResolverFilter.java b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/filter/ApplicationTenantResolverFilter.java index badd61f7b76..48deeb66a37 100644 --- a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/filter/ApplicationTenantResolverFilter.java +++ b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/filter/ApplicationTenantResolverFilter.java @@ -110,15 +110,19 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha HttpServletRequest req = (HttpServletRequest) request; MultiReadRequestWrapper customRequest = new MultiReadRequestWrapper(req); HttpSession session = customRequest.getSession(); - LOG.info("Request URL-->" + customRequest.getRequestURL()); - LOG.info("Request URI-->" + customRequest.getRequestURI()); - String domainURL = extractRequestDomainURL(customRequest, false); - String domainName = extractRequestedDomainName(customRequest); + LOG.info("Request URL--> {}", customRequest.getRequestURL()); + LOG.info("Request URI--> {}", customRequest.getRequestURI()); + boolean isEnvironmentCentralInstance = environmentSettings.getProperty("is.environment.central.instance", Boolean.class); + String commonDomainName = environmentSettings.getProperty("common.domain.name"); + LOG.info("####isEnvironmentCentralInstance--> {} #### domain name-->> {}", isEnvironmentCentralInstance, commonDomainName); + String domainURL = extractRequestDomainURL(customRequest, false, isEnvironmentCentralInstance, commonDomainName); + LOG.info("domainURL-->>>>>>" + domainURL); + String domainName = extractRequestedDomainName(customRequest, isEnvironmentCentralInstance, commonDomainName); ApplicationThreadLocals.setTenantID(environmentSettings.schemaName(domainName)); ApplicationThreadLocals.setDomainName(domainName); ApplicationThreadLocals.setDomainURL(domainURL); prepareRestService(customRequest, session); - LOG.info("***Tenant ID-->" + ApplicationThreadLocals.getTenantID()); + LOG.info("***Tenant ID--> {}", ApplicationThreadLocals.getTenantID()); chain.doFilter(customRequest, response); } @@ -133,6 +137,8 @@ public void destroy() { } private void prepareRestService(MultiReadRequestWrapper customRequest, HttpSession session) { + + boolean isEnvironmentCentralInstance = environmentSettings.getProperty("is.environment.central.instance", Boolean.class); if (tenants == null || tenants.isEmpty()) { tenants = tenantUtils.tenantsMap(); } @@ -141,25 +147,86 @@ private void prepareRestService(MultiReadRequestWrapper customRequest, HttpSessi // LOG.info("***********Enter to set tenant id and custom header**************" + req.getRequestURL().toString()); String requestURL = new StringBuilder().append(ApplicationThreadLocals.getDomainURL()) .append(customRequest.getRequestURI()).toString(); - if (requestURL.contains(tenants.get("state")) + LOG.debug("All tenants from config" + tenants); + LOG.info("tenants.get(state))" + tenants.get("state")); + LOG.info("Inside method to set tenant id and custom header"); + String tenantFromBody = StringUtils.EMPTY; + tenantFromBody = setCustomHeader(requestURL, tenantFromBody, customRequest); + LOG.info("Tenant from Body***" + tenantFromBody); + String fullTenant = customRequest.getParameter("tenantId"); + LOG.info("fullTenant***" + fullTenant); + if (StringUtils.isBlank(fullTenant)) { + fullTenant = tenantFromBody; + } + String[] tenantArr = fullTenant.split("\\."); + String stateName; + if(isEnvironmentCentralInstance) { + if (tenantArr.length == 3 || tenantArr.length == 2) { + ApplicationThreadLocals.setStateName(tenantArr[1]); + stateName = tenantArr[1]; + } else { + ApplicationThreadLocals.setStateName(tenantArr[0]); + stateName = "state"; + } + } else { + stateName = "state"; + } + LOG.info("stateName***" + stateName +"---->>>>"+requestURL); + LOG.info("tenants.get(stateName)***" + tenants.get(stateName)); + if (requestURL.contains(tenants.get(stateName)) && (requestURL.contains("/edcr/") && (requestURL.contains("/rest/") || requestURL.contains("/oauth/")))) { - - LOG.debug("All tenants from config" + tenants); - LOG.info("tenants.get(state))" + tenants.get("state")); - LOG.info("Inside method to set tenant id and custom header"); - String tenantFromBody = StringUtils.EMPTY; - tenantFromBody = setCustomHeader(requestURL, tenantFromBody, customRequest); - LOG.info("Tenant from Body***" + tenantFromBody); - String fullTenant = customRequest.getParameter("tenantId"); - LOG.info("fullTenant***" + fullTenant); - if (StringUtils.isBlank(fullTenant)) { - fullTenant = tenantFromBody; - } if (StringUtils.isBlank(fullTenant)) { throw new ApplicationRestException("incorrect_request", "RestUrl does not contain tenantId: " + fullTenant); } - String tenant = fullTenant.substring(fullTenant.lastIndexOf('.') + 1, fullTenant.length()); + ApplicationThreadLocals.setFullTenantID(fullTenant); + String tenant; + if(isEnvironmentCentralInstance) { + LOG.info("tenantArr.length---->>>>>>>>"+tenantArr.length); + LOG.info("tenantArr-1**---->>>>>>>>"+tenantArr[1]); + if (tenantArr.length == 3) { + tenant = tenantArr[1]; + ApplicationThreadLocals.setStateName(stateName); + ApplicationThreadLocals.setCityName(tenantArr[2]); + ApplicationThreadLocals.setFilestoreTenantID(fullTenant); + /* To support backward compatibility of rule processing, + * some dummy value is setting for district name, citycode and ULB grade + */ + ApplicationThreadLocals.setCityCode(tenantArr[2]); + ApplicationThreadLocals.setDistrictName(tenantArr[2]); + ApplicationThreadLocals.setGrade(tenantArr[2]); + } else if (tenantArr.length == 2) { + tenant = tenantArr[1]; + ApplicationThreadLocals.setCityName(tenant); + ApplicationThreadLocals.setCityCode(tenant); + ApplicationThreadLocals.setDistrictName(tenant); + ApplicationThreadLocals.setGrade(tenant); + ApplicationThreadLocals.setFilestoreTenantID(tenant); + } else { + tenant = tenantArr[0]; + ApplicationThreadLocals.setFilestoreTenantID(tenant); + } + } else { + if (tenantArr.length == 3) { + tenant = tenantArr[1]; + ApplicationThreadLocals.setStateName(stateName); + ApplicationThreadLocals.setCityName(tenantArr[2]); + ApplicationThreadLocals.setFilestoreTenantID(fullTenant); + /* To support backward compatibility of rule processing, + * some dummy value is setting for district name, citycode and ULB grade + */ + ApplicationThreadLocals.setCityCode(tenantArr[2]); + ApplicationThreadLocals.setDistrictName(tenantArr[2]); + ApplicationThreadLocals.setGrade(tenantArr[2]); + } else if (tenantArr.length == 2) { + tenant = tenantArr[1]; + ApplicationThreadLocals.setFilestoreTenantID(tenant); + } else { + tenant = tenantArr[0]; + ApplicationThreadLocals.setFilestoreTenantID(tenant); + } + } + LOG.info("tenant***" + tenant); LOG.info("tenant from rest request =" + tenant); LOG.info("City Code from session " + (String) session.getAttribute(CITY_CODE_KEY)); @@ -168,7 +235,7 @@ private void prepareRestService(MultiReadRequestWrapper customRequest, HttpSessi if (tenant.equalsIgnoreCase("generic") || tenant.equalsIgnoreCase("state")) { ApplicationThreadLocals.setTenantID(tenant); found = true; - } else if (tenant.equalsIgnoreCase(stateCity.getCode())) { + } else if (stateCity != null && tenant.equalsIgnoreCase(stateCity.getCode())) { ApplicationThreadLocals.setTenantID("state"); found = true; } else { @@ -262,4 +329,4 @@ private String setCustomHeader(String requestURL, String tenantAtBody, return tenantAtBody; } -} +} \ No newline at end of file diff --git a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/utils/WebUtils.java b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/utils/WebUtils.java index 453ee5a9206..5ff29390b1e 100644 --- a/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/utils/WebUtils.java +++ b/edcr/service/egov/egov-egi/src/main/java/org/egov/infra/web/utils/WebUtils.java @@ -68,7 +68,7 @@ public final class WebUtils { private static final char QUESTION_MARK = '?'; private static final char FORWARD_SLASH = '/'; private static final String SCHEME_DOMAIN_SEPARATOR = "://"; - private static final String EDCR_SERVICE_INTERNAL_URL = "egov-edcr.egov"; + private static final String EDCR_SERVICE_INTERNAL_URL = "egov-edcr."; private static final Logger LOG = LoggerFactory.getLogger(WebUtils.class); @@ -80,15 +80,19 @@ private WebUtils() { * This will return only domain name from http request
* eg: http://www.domain.com/cxt/xyz will return www.domain.com http://somehost:8090/cxt/xyz will return somehost **/ - public static String extractRequestedDomainName(HttpServletRequest httpRequest) { + public static String extractRequestedDomainName(HttpServletRequest httpRequest, boolean isCentralInstance, String commonDomainName) { String requestURL = httpRequest.getRequestURL().toString(); String domainName = getDomainName(requestURL); if (domainName.contains(EDCR_SERVICE_INTERNAL_URL)) { - String host = httpRequest.getHeader("x-forwarded-host"); - if (StringUtils.isNotBlank(host)) { - domainName = host.toString().split(",")[0]; - LOG.info("*****Domain Name*****" + domainName); + if(isCentralInstance) { + domainName = commonDomainName; + } else { + String host = httpRequest.getHeader("x-forwarded-host"); + if (StringUtils.isNotBlank(host)) { + domainName = host.split(",")[0]; + } } + LOG.info("*****Domain Name***** {}", domainName); } return domainName; } @@ -98,8 +102,7 @@ public static String extractRequestedDomainName(HttpServletRequest httpRequest) * eg: http://www.domain.com/cxt/xyz will return www.domain.com http://somehost:8090/cxt/xyz will return somehost **/ public static String extractRequestedDomainName(String requestURL) { - String domainName = getDomainName(requestURL); - return domainName; + return getDomainName(requestURL); } private static String getDomainName(String requestURL) { @@ -117,18 +120,23 @@ private static String getDomainName(String requestURL) { * http://www.domain.com/cxt/xyz withContext value as true will return http://www.domain.com/cxt/
* http://www.domain.com/cxt/xyz withContext value as false will return http://www.domain.com **/ - public static String extractRequestDomainURL(HttpServletRequest httpRequest, boolean withContext) { + public static String extractRequestDomainURL(HttpServletRequest httpRequest, boolean withContext, boolean isCentralInstance, String domainName) { StringBuilder url = new StringBuilder(httpRequest.getRequestURL()); String domainURL = ""; String protocol = httpRequest.getHeader("x-forwarded-proto"); String host = httpRequest.getHeader("x-forwarded-host"); + LOG.info("*****protocol Name***** {}", protocol); if (getDomainName(url.toString()).contains(EDCR_SERVICE_INTERNAL_URL)) { - if (StringUtils.isNotBlank(protocol) && StringUtils.isNotBlank(host)) { - String proto = protocol.toString().split(",")[0]; - String hostName = host.toString().split(",")[0]; - domainURL = new StringBuilder().append(proto).append(SCHEME_DOMAIN_SEPARATOR).append(hostName).toString(); - LOG.info("Domain URL*******" + domainURL); + String proto = "https"; + if(protocol != null) + proto = protocol.split(",")[0]; + String hostName = host.split(",")[0]; + if(isCentralInstance) { + proto = "https"; + hostName = domainName; } + domainURL = new StringBuilder().append(proto).append(SCHEME_DOMAIN_SEPARATOR).append(hostName).toString(); + LOG.info("Domain URL******* {}", domainURL); } else { String uri = httpRequest.getRequestURI(); domainURL = withContext diff --git a/edcr/service/egov/egov-egi/src/main/resources/config/application-config.properties b/edcr/service/egov/egov-egi/src/main/resources/config/application-config.properties index e31243ba620..1b543a60082 100644 --- a/edcr/service/egov/egov-egi/src/main/resources/config/application-config.properties +++ b/edcr/service/egov/egov-egi/src/main/resources/config/application-config.properties @@ -335,3 +335,5 @@ egov.edcr.max.limit=800 egov.services.egov-indexer.url=egov-indexer/index-operations/{edcr-create-application}/_index indexer.host=https://dev.digit.org/ edcr.indexer.data.push.required=false + +is.environment.central.instance=false diff --git a/edcr/service/egov/egov-egi/src/main/resources/db/migration/main/V20211129125021__egi_add_column_tenantid_ddl.sql b/edcr/service/egov/egov-egi/src/main/resources/db/migration/main/V20211129125021__egi_add_column_tenantid_ddl.sql new file mode 100644 index 00000000000..dbc8d4b9951 --- /dev/null +++ b/edcr/service/egov/egov-egi/src/main/resources/db/migration/main/V20211129125021__egi_add_column_tenantid_ddl.sql @@ -0,0 +1 @@ +alter table eg_filestoremap add column tenantId character varying(64); \ No newline at end of file diff --git a/edcr/service/egov/egov-egiweb/pom.xml b/edcr/service/egov/egov-egiweb/pom.xml index 74dc466a18d..f5bc6101d2e 100644 --- a/edcr/service/egov/egov-egiweb/pom.xml +++ b/edcr/service/egov/egov-egiweb/pom.xml @@ -53,7 +53,7 @@ egov-erp org.egov.edcr - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT e-governments egi web @@ -64,13 +64,13 @@ org.egov.edcr egov-egi - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT org.egov.edcr egov-config - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT tests test diff --git a/edcr/service/egov/pom.xml b/edcr/service/egov/pom.xml index be4a5102f5a..10084136ba2 100644 --- a/edcr/service/egov/pom.xml +++ b/edcr/service/egov/pom.xml @@ -6,7 +6,7 @@ org.egov.edcr egov-erp - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT pom @@ -207,7 +207,7 @@ org.egov.edcr egov-egi - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT commons-logging @@ -218,12 +218,12 @@ org.egov.edcr egov-config - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT org.egov.edcr egov-commons - 2.1.1-SNAPSHOT + 2.1.2-SNAPSHOT diff --git a/frontend/micro-ui/build/build-config.yml b/frontend/micro-ui/build/build-config.yml index 00d6032402c..21071112785 100644 --- a/frontend/micro-ui/build/build-config.yml +++ b/frontend/micro-ui/build/build-config.yml @@ -9,8 +9,8 @@ # - config: -- name: builds/digit-ui +- name: builds/workbench-ui build: - work-dir: frontend/micro-ui/web/ dockerfile: web/docker/Dockerfile - image-name: digit-ui + image-name: workbench-ui diff --git a/frontend/micro-ui/web/docker/Dockerfile b/frontend/micro-ui/web/docker/Dockerfile index b392968cc70..665c86d35fc 100644 --- a/frontend/micro-ui/web/docker/Dockerfile +++ b/frontend/micro-ui/web/docker/Dockerfile @@ -17,6 +17,10 @@ RUN yarn add @upyog/digit-ui-module-obps RUN yarn add @egovernments/digit-ui-module-common RUN yarn add @upyog/digit-ui-module-ws RUN yarn add @egovernments/digit-ui-module-commonpt +RUN yarn add @egovernments/digit-ui-module-workbench +RUN yarn add @egovernments/digit-ui-module-receipts +RUN yarn add @egovernments/digit-ui-module-bills +RUN yarn add @egovernments/digit-ui-module-masters ARG WORK_DIR WORKDIR /app ENV NODE_OPTIONS "--max-old-space-size=4096" @@ -29,6 +33,7 @@ RUN ls -lah RUN cd web/ \ && node envs.js \ && node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(4096*4096))' \ + && chmod +x ./install-deps.sh \ && ./install-deps.sh \ && yarn install \ && yarn build diff --git a/frontend/micro-ui/web/install-deps.sh b/frontend/micro-ui/web/install-deps.sh old mode 100755 new mode 100644 diff --git a/frontend/micro-ui/web/micro-ui-internals/example/package.json b/frontend/micro-ui/web/micro-ui-internals/example/package.json index 1469149631e..04456e1387b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/example/package.json +++ b/frontend/micro-ui/web/micro-ui-internals/example/package.json @@ -23,6 +23,8 @@ "@upyog/digit-ui-module-ws": "^1.7.0-beta.2", "@egovernments/digit-ui-module-bills": "^1.7.0-beta.2", "@egovernments/digit-ui-module-commonpt": "^1.7.0-beta.3", + "@egovernments/digit-ui-module-hrms": "1.7.0-beta.2", + "@egovernments/digit-ui-module-workbench": "1.0.0-beta", "http-proxy-middleware": "^1.0.5", "react": "17.0.2", "react-dom": "17.0.2", diff --git a/frontend/micro-ui/web/micro-ui-internals/example/src/index.js b/frontend/micro-ui/web/micro-ui-internals/example/src/index.js index afe1ef3ac87..593512afa20 100644 --- a/frontend/micro-ui/web/micro-ui-internals/example/src/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/example/src/index.js @@ -24,6 +24,8 @@ import { DigitUI } from "@egovernments/digit-ui-module-core"; import { initCommonPTComponents } from "@egovernments/digit-ui-module-commonpt"; import { initBillsComponents, BillsModule } from "@egovernments/digit-ui-module-bills"; +window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH"); + // import {initCustomisationComponents} from "./customisations"; // import { PGRModule, PGRLinks } from "@egovernments/digit-ui-module-pgr"; @@ -60,16 +62,15 @@ const enabledModules = [ "BillAmendment", "FireNoc", "Birth", - "Death" + "Death", ]; const initTokens = (stateCode) => { const userType = window.sessionStorage.getItem("userType") || process.env.REACT_APP_USER_TYPE || "CITIZEN"; - const token = window.localStorage.getItem("token")|| process.env[`REACT_APP_${userType}_TOKEN`]; - - const citizenInfo = window.localStorage.getItem("Citizen.user-info") - + const token = window.localStorage.getItem("token") || process.env[`REACT_APP_${userType}_TOKEN`]; + const citizenInfo = window.localStorage.getItem("Citizen.user-info"); + const citizenTenantId = window.localStorage.getItem("Citizen.tenant-id") || stateCode; const employeeInfo = window.localStorage.getItem("Employee.user-info"); @@ -123,6 +124,7 @@ const initDigitUI = () => { initCommonPTComponents(); initBillsComponents(); + // initCustomisationComponents(); const moduleReducers = (initData) => ({ @@ -142,9 +144,10 @@ const initDigitUI = () => { initTokens(stateCode); const registry = window?.Digit.ComponentRegistryService.getRegistry(); + window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH"); ReactDOM.render(, document.getElementById("root")); }; initLibraries().then(() => { initDigitUI(); -}); +}); \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/example/src/setupProxy.js b/frontend/micro-ui/web/micro-ui-internals/example/src/setupProxy.js index cc71b6a6a9e..311a448f150 100644 --- a/frontend/micro-ui/web/micro-ui-internals/example/src/setupProxy.js +++ b/frontend/micro-ui/web/micro-ui-internals/example/src/setupProxy.js @@ -15,6 +15,7 @@ module.exports = function (app) { "/access/v1/actions/mdms", "/egov-mdms-service", "/egov-location", + "/mdms-v2", "/localization", "/egov-workflow-v2", "/pgr-services", @@ -63,6 +64,7 @@ module.exports = function (app) { "/inbox/v1/elastic/_search", "/fsm-calculator", "/service-request", + "/fsm-calculator/v1/_advancebalancecalculate", ].forEach((location) => app.use(location, createProxy)); ["/pb-egov-assets"].forEach((location) => app.use(location, assetsProxy)); }; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/package.json b/frontend/micro-ui/web/micro-ui-internals/package.json index 98b64d6e715..62cb95af43b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/package.json +++ b/frontend/micro-ui/web/micro-ui-internals/package.json @@ -10,9 +10,9 @@ "packages/modules/common", "packages/modules/core", "packages/modules/pgr", - "packages/modules/dss", - "packages/modules/commonPt", "packages/modules/pt", + "packages/modules/ws", + "packages/modules/fsm", "packages/modules/mCollect", "packages/modules/obps" ], @@ -57,7 +57,7 @@ "build:commonPt": "cd packages/modules/commonPt && yarn build", "build:core": "cd packages/modules/core && yarn build", "build:pgr": "cd packages/modules/pgr && yarn build", - "buildD:fsm": "cd packages/modules/fsm && yarn build", + "build:fsm": "cd packages/modules/fsm && yarn build", "build:dss": "cd packages/modules/dss && yarn build", "build:mcollect": "cd packages/modules/mCollect && yarn build", "buildD:receipts": "cd packages/modules/receipts && yarn build", @@ -66,7 +66,7 @@ "build:obps": "cd packages/modules/obps && yarn build", "buildD:engagement": "cd packages/modules/engagement && yarn build", "buildD:noc": "cd packages/modules/noc && yarn build", - "buildD:ws": "cd packages/modules/ws && yarn build", + "build:ws": "cd packages/modules/ws && yarn build", "buildD:bills": "cd packages/modules/bills && yarn build", "buildR:reports": "cd packages/modules/reports && yarn build", "deploy:jenkins": "./scripts/jenkins.sh" @@ -83,9 +83,8 @@ }, "dependencies": { "lodash": "4.17.21", - "microbundle-crl": "^0.13.11" - }, - "resolutions": { + "microbundle-crl": "0.13.11" + } ,"resolutions": { "**/babel-loader": "8.2.2", "**/@babel/core": "7.14.0", "**/@babel/preset-env": "7.14.0", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/css/package.json b/frontend/micro-ui/web/micro-ui-internals/packages/css/package.json index 856e1e464e1..389a0deebbf 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/css/package.json +++ b/frontend/micro-ui/web/micro-ui-internals/packages/css/package.json @@ -34,7 +34,7 @@ "gulp-clean": "^0.4.0", "gulp-clean-css": "^4.3.0", "gulp-livereload": "^4.0.2", - "gulp-postcss": "^9.0.1", + "gulp-postcss": "9.0.1", "gulp-rename": "^2.0.0", "gulp-sass": "^4.1.1", "postcss": "8.4.12", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/fsm/useMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/fsm/useMDMS.js index a8ed40e0605..72210e8db12 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/fsm/useMDMS.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/fsm/useMDMS.js @@ -24,6 +24,10 @@ const useMDMS = (tenantId, moduleCode, type, config = {}, payload = []) => { return useQuery("FSM_APPLICATION_EDIT_APPLICATION_CHANNEL", () => onlyEmployeeChannels(), queryConfig); }; + const useUrcConfig = () => { + return useQuery("FSM_APPLICATION_NEW_URC_CONFIG", () => MdmsService.getUrcConfig(tenantId, moduleCode, type), queryConfig); + }; + const usePropertyType = () => { return useQuery("FSM_PROPERTY_TYPE", () => MdmsService.getPropertyType(tenantId, moduleCode, type), queryConfig); }; @@ -146,7 +150,9 @@ const useMDMS = (tenantId, moduleCode, type, config = {}, payload = []) => { case "ReceivedPaymentType": return useReceivedPaymentType(); case "WSTaxHeadMaster": - return useWSTaxHeadMaster() + return useWSTaxHeadMaster(); + case "UrcConfig": + return useUrcConfig(); default: return null; } diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js index 3d0647df055..112acfa6f15 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js @@ -21,7 +21,9 @@ import { useUserSearch } from "./userSearch"; import { useApplicationsForBusinessServiceSearch } from "./useApplicationForBillSearch"; import useBoundaryLocalities from "./useLocalities"; import useCommonMDMS from "./useMDMS"; +import useCommonMDMSV2 from "./useMDMSV2"; import useCustomMDMS from "./useCustomMDMS"; +import useWorkBenchCustomAPIHook from "./useWorkBenchCustomAPIHook"; import useCustomAPIHook from "./useCustomAPIHook"; import useInboxGeneral from "./useInboxGeneral/useInboxGeneral"; import useApplicationStatusGeneral from "./useStatusGeneral"; @@ -34,6 +36,7 @@ import useCreateEvent from "./events/useCreateEvent"; import useUpdateEvent from "./events/useUpdateEvent"; import useNewInboxGeneral from "./useInboxGeneral/useNewInbox"; import useDynamicData from "./useDynamicData"; +import useCustomAPIMutationHook from "./useCustomAPIMutationHook"; import useComplaintDetails from "./pgr/useComplaintDetails"; import { useComplaintsList, useComplaintsListByMobile } from "./pgr/useComplaintList"; @@ -91,6 +94,7 @@ import useAdvanceBalanceCalulation from "./fsm/useAdvanceBalanceCalculation"; import useEmployeeSearch from "./useEmployeeSearch"; import usePropertyMDMS from "./pt/usePropertyMDMS"; +import usePropertyMDMSV2 from "./pt/usePropertyMDMSV2"; import usePropertyAPI from "./pt/usePropertyAPI"; import usePropertyCreateNUpdateAPI from "./pt/usePropertyCreateNUpdateAPI"; import usePropertyDocumentSearch from "./pt/usePropertyDocumentSearch"; @@ -98,11 +102,14 @@ import useTenantsPT from "./pt/useTenants"; import usePtApplicationDetail from "./pt/useApplicationDetail"; import usePtApplicationActions from "./pt/useApplicationActions"; import usePtMDMS from "./pt/useMDMS"; +import usePtMDMSV2 from "./pt/useMDMSV2"; import usePropertyAssessment from "./pt/usePropertyAssessment"; import UseAssessmentCreateUlb from "./pt/UseAssessmentCreateUlb"; import usePtCalculationEstimate from "./pt/usePtCalculationEstimate"; import useGenderMDMS from "./pt/useGenderMDMS"; +import useGenderMDMSV2 from "./pt/useGenderMDMSV2"; import usePTGenderMDMS from "./pt/usePTGenderMDMS"; +import usePTGenderMDMSV2 from "./pt/usePTGenderMDMSV2"; import useMyPropertyPayments from "./pt/useMyPropertyPayments"; import useGenericViewProperty from "./pt/useGenericViewProperty"; import useRatingAndFeedbackMDMS from "./pt/useRatingAndFeedbackMDMS"; @@ -195,6 +202,12 @@ import useSurveySearch from "./surveys/useSearch"; import useSurveyShowResults from "./surveys/useShowResults"; import useSurveySubmitResponse from "./surveys/useSubmitResponse"; import useSurveyInbox from "./surveys/useSurveyInbox"; +import useServeyCreateDef from "./surveys/useCreateSurvey"; +import useCfdefinitionsearch from "./surveys/useCfdefinitionsearch"; +import useSubmitSurveyResponse from "./surveys/useSubmitSurveyResponse"; +import useSelectedSurveySearch from "./surveys/useSelectedSurveySearch"; +import useCfdefinitionsearchresult from "./surveys/useCfdefinitionsearchresult"; +import useUpdateSurvey from "./surveys/useSurveyUpdate"; import useNOCDetails from "./noc/useNOCDetails"; import useNOCInbox from "./noc/useInbox"; @@ -250,6 +263,7 @@ import useToCheckPrivacyEnablement from "./ws/useToCheckPrivacyEnablement"; import useWSConfigMDMS from "./ws/useWSConfigMDMS"; import useFeedBackSearch from "./useFeedBackSearch"; +import useWorkBenchRouteSubscription from "./useWorkBenchRouteSubscription" const pgr = { useComplaintDetails, @@ -316,6 +330,7 @@ const pt = { usePropertySearchNew, usePropertyPayment, usePropertyMDMS, + usePropertyMDMSV2, usePropertySearchWithDue, usePropertyAPI, usePropertyCreateNUpdateAPI, @@ -324,16 +339,20 @@ const pt = { useApplicationDetail: usePtApplicationDetail, useApplicationActions: usePtApplicationActions, useMDMS: usePtMDMS, + useMDMSV2: usePtMDMSV2, usePropertyAssessment, UseAssessmentCreateUlb, usePtCalculationEstimate, useGenderMDMS, + useGenderMDMSV2, usePTGenderMDMS, + usePTGenderMDMSV2, useMyPropertyPayments, useGenericViewProperty, useRatingAndFeedbackMDMS, useServiceSearchCF, }; + const dss = { useMDMS: useDssMdms, useDashboardConfig, @@ -440,6 +459,12 @@ const survey = { useSubmitResponse: useSurveySubmitResponse, useShowResults: useSurveyShowResults, useSurveyInbox, + useServeyCreateDef:useServeyCreateDef, + useCfdefinitionsearch:useCfdefinitionsearch, + useSubmitSurveyResponse:useSubmitSurveyResponse, + useSelectedSurveySearch:useSelectedSurveySearch, + useCfdefinitionsearchresult:useCfdefinitionsearchresult, + useUpdateSurvey:useUpdateSurvey, }; const noc = { @@ -506,13 +531,14 @@ const Hooks = { useApplicationsForBusinessServiceSearch, useDemandSearch, useInboxGeneral, + useCustomAPIMutationHook, useEmployeeSearch, useBoundaryLocalities, useCommonMDMS, + useCommonMDMSV2, useApplicationStatusGeneral, useModuleTenants, useRecieptSearch, - useRecieptSearchNew, usePaymentSearch, useNewInboxGeneral, useEvents, @@ -544,6 +570,7 @@ const Hooks = { ws, useCustomMDMS, useCustomAPIHook, + useWorkBenchCustomAPIHook, reports, useGetHowItWorksJSON, useGetFAQsJSON, @@ -554,6 +581,7 @@ const Hooks = { useBulkPdfDetails, useBillAmendmentInbox, useAudit, + useRouteSubscription:useWorkBenchRouteSubscription, }; -export default Hooks; \ No newline at end of file +export default Hooks; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/payment.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/payment.js index 5dec5172f17..8346553ac3c 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/payment.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/payment.js @@ -108,7 +108,7 @@ export const usePaymentUpdate = ({ egId }, businessService, config) => { }; export const useGetPaymentRulesForBusinessServices = (tenantId) => { - return useQuery(["getPaymentRules", tenantId], () => Digit.MDMSService.getPaymentRules(tenantId)); + return useQuery(["getPaymentRules", tenantId], () => Digit.MDMSServiceV2.getPaymentRules(tenantId)); }; export const usePaymentSearch = (tenantId, filters, config = {}) => { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useGenderMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useGenderMDMS.js index 5dffd8c6443..bd92a3c2c85 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useGenderMDMS.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useGenderMDMS.js @@ -1,9 +1,9 @@ import { useQuery } from "react-query"; -import { MdmsService } from "../../services/elements/MDMS"; +import { MdmsServiceV2 } from "../../services/elements/MDMSV2"; const useGenderMDMS = (tenantId, moduleCode, type, config = {}) => { const useGenderDetails = () => { - return useQuery("PT_GENDER_DETAILS", () => MdmsService.getGenderType(tenantId, moduleCode ,type), config); + return useQuery("PT_GENDER_DETAILS", () => MdmsServiceV2.getGenderType(tenantId, moduleCode ,type), config); }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useGenderMDMSV2.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useGenderMDMSV2.js new file mode 100644 index 00000000000..92443e0ad15 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useGenderMDMSV2.js @@ -0,0 +1,18 @@ +import { useQuery } from "react-query"; +import { MdmsServiceV2 } from "../../services/elements/MDMSV2"; + +const useGenderMDMSV2 = (tenantId, moduleCode, type, config = {}) => { + const useGenderDetails = () => { + return useQuery("PT_GENDER_DETAILS", () => MdmsServiceV2.getGenderType(tenantId, moduleCode ,type), config); + }; + + + switch (type) { + case "GenderType": + return useGenderDetails(); + } +}; + + + +export default useGenderMDMSV2; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useMDMS.js index 9a6b1b8dd14..bb7f1b7fb37 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useMDMS.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useMDMS.js @@ -1,20 +1,20 @@ -import { MdmsService, getGeneralCriteria } from "../../services/elements/MDMS"; +import { MdmsServiceV2, getGeneralCriteria } from "../../services/elements/MDMSV2"; import { useQuery } from "react-query"; const useMDMS = (tenantId, moduleCode, type, config = { }, payload = []) => { const useFinancialYears = () => { - return useQuery("PT_FINANCIAL_YEARLS", () => MdmsService.getDataByCriteria(tenantId, payload, moduleCode)); + return useQuery("PT_FINANCIAL_YEARLS", () => MdmsServiceV2.getDataByCriteria(tenantId, payload, moduleCode)); }; const useCommonFieldsConfig = () => { - return useQuery("COMMON_FIELDS", () => MdmsService.getCommonFieldsConfig(tenantId, moduleCode, type, payload)); + return useQuery("COMMON_FIELDS", () => MdmsServiceV2.getCommonFieldsConfig(tenantId, moduleCode, type, payload)); }; const usePropertyTaxDocuments = () => { - return useQuery("PT_PROPERTY_TAX_DOCUMENTS", () => MdmsService.getDataByCriteria(tenantId, payload, moduleCode)); + return useQuery("PT_PROPERTY_TAX_DOCUMENTS", () => MdmsServiceV2.getDataByCriteria(tenantId, payload, moduleCode)); }; /*const useGenderDetails = () => { - return useQuery("PT_GENDER_DETAILS", () => MdmsService.getGenderTypeDetails(tenantId, type, filter), config); + return useQuery("PT_GENDER_DETAILS", () => MdmsServiceV2.getGenderTypeDetails(tenantId, type, filter), config); };*/ switch (type) { @@ -28,7 +28,7 @@ const useMDMS = (tenantId, moduleCode, type, config = { }, payload = []) => { return useGenderDetails();*/ default: - return useQuery(type, () => MdmsService.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode), config); + return useQuery(type, () => MdmsServiceV2.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode), config); } }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useMDMSV2.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useMDMSV2.js new file mode 100644 index 00000000000..64d7d54e59b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/useMDMSV2.js @@ -0,0 +1,35 @@ +import { MdmsServiceV2, getGeneralCriteria } from "../../services/elements/MDMSV2"; +import { useQuery } from "react-query"; + +const useMDMSV2 = (tenantId, moduleCode, type, config = { }, payload = []) => { + const useFinancialYears = () => { + return useQuery("PT_FINANCIAL_YEARLS", () => MdmsServiceV2.getDataByCriteria(tenantId, payload, moduleCode)); + }; + const useCommonFieldsConfig = () => { + return useQuery("COMMON_FIELDS", () => MdmsServiceV2.getCommonFieldsConfig(tenantId, moduleCode, type, payload)); + }; + + const usePropertyTaxDocuments = () => { + return useQuery("PT_PROPERTY_TAX_DOCUMENTS", () => MdmsServiceV2.getDataByCriteria(tenantId, payload, moduleCode)); + }; + + /*const useGenderDetails = () => { + return useQuery("PT_GENDER_DETAILS", () => MdmsServiceV2.getGenderTypeDetails(tenantId, type, filter), config); + };*/ + + switch (type) { + case "FINANCIAL_YEARLS": + return useFinancialYears(); + case "PROPERTY_TAX_DOCUMENTS": + return usePropertyTaxDocuments(); + case "CommonFieldsConfig": + return useCommonFieldsConfig(); + /*case "GenderType": + return useGenderDetails();*/ + + default: + return useQuery(type, () => MdmsServiceV2.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode), config); + } +}; + +export default useMDMSV2; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePTGenderMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePTGenderMDMS.js index aca129f377d..7a262c2b787 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePTGenderMDMS.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePTGenderMDMS.js @@ -1,9 +1,9 @@ import { useQuery } from "react-query"; -import { MdmsService } from "../../services/elements/MDMS"; +import { MdmsServiceV2 } from "../../services/elements/MDMSV2"; const usePTGenderMDMS = (tenantId, moduleCode, type, config = {}) => { const usePTGenders = () => { - return useQuery("PT_FORM_GENDER_DETAILS", () => MdmsService.PTGenderType(tenantId, moduleCode ,type), config); + return useQuery("PT_FORM_GENDER_DETAILS", () => MdmsServiceV2.PTGenderType(tenantId, moduleCode ,type), config); }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePTGenderMDMSV2.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePTGenderMDMSV2.js new file mode 100644 index 00000000000..b0b802423e5 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePTGenderMDMSV2.js @@ -0,0 +1,17 @@ +import { useQuery } from "react-query"; +import { MdmsServiceV2 } from "../../services/elements/MDMSV2"; + +const usePTGenderMDMSV2 = (tenantId, moduleCode, type, config = {}) => { + const usePTGenders = () => { + return useQuery("PT_FORM_GENDER_DETAILS", () => MdmsServiceV2.PTGenderType(tenantId, moduleCode, type), config); + }; + + switch (type) { + case "GenderType": + return usePTGenders(); + default: + return null; + } +}; + +export default usePTGenderMDMSV2; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePropertyMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePropertyMDMS.js index aaab9227f15..9bcb25c7a22 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePropertyMDMS.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePropertyMDMS.js @@ -1,40 +1,40 @@ -import { MdmsService } from "../../services/elements/MDMS"; +import { MdmsServiceV2 } from "../../services/elements/MDMSV2"; import { useQuery } from "react-query"; const usePropertyMDMS = (tenantId, moduleCode, type, config = {}) => { const usePropertyOwnerType = () => { - return useQuery("PT_OWNERSHIP_CATEGORY", () => MdmsService.getPropertyOwnerType(tenantId, moduleCode, type), config); + return useQuery("PT_OWNERSHIP_CATEGORY", () => MdmsServiceV2.getPropertyOwnerType(tenantId, moduleCode, type), config); }; const usePropertyOwnerShipCategory = () => { - return useQuery("PT_OWNER_TYPE", () => MdmsService.getPropertyOwnerShipCategory(tenantId, moduleCode, type), config); + return useQuery("PT_OWNER_TYPE", () => MdmsServiceV2.getPropertyOwnerShipCategory(tenantId, moduleCode, type), config); }; const useSubOwnerShipCategory = () => { - return useQuery("PT_SUB_OWNERSHIP_CATEGORY", () => MdmsService.getPropertySubOwnerShipCategory(tenantId, moduleCode, type), config); + return useQuery("PT_SUB_OWNERSHIP_CATEGORY", () => MdmsServiceV2.getPropertySubOwnerShipCategory(tenantId, moduleCode, type), config); }; const useDocumentRequiredScreen = () => { - return useQuery("PT_DOCUMENT_REQ_SCREEN", () => MdmsService.getDocumentRequiredScreen(tenantId, moduleCode), config); + return useQuery("PT_DOCUMENT_REQ_SCREEN", () => MdmsServiceV2.getDocumentRequiredScreen(tenantId, moduleCode), config); }; const useUsageCategory = () => { - return useQuery("PT_USAGE_CATEGORY", () => MdmsService.getUsageCategory(tenantId, moduleCode, type), config); + return useQuery("PT_USAGE_CATEGORY", () => MdmsServiceV2.getUsageCategory(tenantId, moduleCode, type), config); }; const usePTPropertyType = () => { - return useQuery("PT_PROPERTY_TYPE", () => MdmsService.getPTPropertyType(tenantId, moduleCode, type), config); + return useQuery("PT_PROPERTY_TYPE", () => MdmsServiceV2.getPTPropertyType(tenantId, moduleCode, type), config); }; const useRentalDetails = () => { - return useQuery("PT_RENTAL_DETAILS", () => MdmsService.getRentalDetails(tenantId, moduleCode), config); + return useQuery("PT_RENTAL_DETAILS", () => MdmsServiceV2.getRentalDetails(tenantId, moduleCode), config); }; const useChargeSlabs = () => { - return useQuery("PT_RENTAL_DETAILS", () => MdmsService.getChargeSlabs(tenantId, moduleCode), config); + return useQuery("PT_RENTAL_DETAILS", () => MdmsServiceV2.getChargeSlabs(tenantId, moduleCode), config); }; const useFloorList = () => { - return useQuery("PT_FLOOR_LIST", () => MdmsService.getFloorList(tenantId, moduleCode), config); + return useQuery("PT_FLOOR_LIST", () => MdmsServiceV2.getFloorList(tenantId, moduleCode), config); }; const useMapConfig = () => { - return useQuery("PT_MAP_CONFIG", () => MdmsService.getMapConfig(tenantId, moduleCode), config); + return useQuery("PT_MAP_CONFIG", () => MdmsServiceV2.getMapConfig(tenantId, moduleCode), config); }; const _default = () => { - return useQuery([tenantId, moduleCode, type], () => MdmsService.getMultipleTypes(tenantId, moduleCode, type), config); + return useQuery([tenantId, moduleCode, type], () => MdmsServiceV2.getMultipleTypes(tenantId, moduleCode, type), config); }; switch (type) { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePropertyMDMSV2.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePropertyMDMSV2.js new file mode 100644 index 00000000000..3be6250f6b2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pt/usePropertyMDMSV2.js @@ -0,0 +1,66 @@ +import { MdmsServiceV2 } from "../../services/elements/MDMSV2"; +import { useQuery } from "react-query"; + +const usePropertyMDMSV2 = (tenantId, moduleCode, type, config = {}) => { + const usePropertyOwnerType = () => { + return useQuery("PT_OWNERSHIP_CATEGORY", () => MdmsServiceV2.getPropertyOwnerType(tenantId, moduleCode, type), config); + }; + const usePropertyOwnerShipCategory = () => { + return useQuery("PT_OWNER_TYPE", () => MdmsServiceV2.getPropertyOwnerShipCategory(tenantId, moduleCode, type), config); + }; + const useSubOwnerShipCategory = () => { + return useQuery("PT_SUB_OWNERSHIP_CATEGORY", () => MdmsServiceV2.getPropertySubOwnerShipCategory(tenantId, moduleCode, type), config); + }; + const useDocumentRequiredScreen = () => { + return useQuery("PT_DOCUMENT_REQ_SCREEN", () => MdmsServiceV2.getDocumentRequiredScreen(tenantId, moduleCode), config); + }; + const useUsageCategory = () => { + return useQuery("PT_USAGE_CATEGORY", () => MdmsServiceV2.getUsageCategory(tenantId, moduleCode, type), config); + }; + const usePTPropertyType = () => { + return useQuery("PT_PROPERTY_TYPE", () => MdmsServiceV2.getPTPropertyType(tenantId, moduleCode, type), config); + }; + const useRentalDetails = () => { + return useQuery("PT_RENTAL_DETAILS", () => MdmsServiceV2.getRentalDetails(tenantId, moduleCode), config); + }; + const useChargeSlabs = () => { + return useQuery("PT_RENTAL_DETAILS", () => MdmsServiceV2.getChargeSlabs(tenantId, moduleCode), config); + }; + const useFloorList = () => { + return useQuery("PT_FLOOR_LIST", () => MdmsServiceV2.getFloorList(tenantId, moduleCode), config); + }; + const useMapConfig = () => { + return useQuery("PT_MAP_CONFIG", () => MdmsServiceV2.getMapConfig(tenantId, moduleCode), config); + }; + + const _default = () => { + return useQuery([tenantId, moduleCode, type], () => MdmsServiceV2.getMultipleTypes(tenantId, moduleCode, type), config); + }; + + switch (type) { + case "OwnerShipCategory": + return usePropertyOwnerShipCategory(); + case "OwnerType": + return usePropertyOwnerType(); + case "SubOwnerShipCategory": + return useSubOwnerShipCategory(); + case "Documents": + return useDocumentRequiredScreen(); + case "UsageCategory": + return useUsageCategory(); + case "PTPropertyType": + return usePTPropertyType(); + case "RentalDetails": + return useRentalDetails(); + case "Floor": + return useFloorList(); + case "MapConfig": + return useMapConfig(); + case "ChargeSlabs": + return useChargeSlabs(); + default: + return _default(); + } +}; + +export default usePropertyMDMSV2; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCfdefinitionsearch.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCfdefinitionsearch.js new file mode 100644 index 00000000000..3b30c288fd7 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCfdefinitionsearch.js @@ -0,0 +1,10 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useQuery } from "react-query"; + +const useCfdefinitionsearch = (filters, config) => { + console.log(config,"useCfdefinitionsearch") + console.log(filters,"oooo") + return useQuery([`search_surveys`,filters.Pagination,filters.ServiceDefinitionCriteria], () => Surveys.cfdefinitionsearch(filters), { ...config }); +}; + +export default useCfdefinitionsearch; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCfdefinitionsearchresult.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCfdefinitionsearchresult.js new file mode 100644 index 00000000000..118c375f363 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCfdefinitionsearchresult.js @@ -0,0 +1,9 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useQuery } from "react-query"; + +const useCfdefinitionsearchresult = (filters, config) => { + console.log(config,"useCfdefinitionsearchresult") + return useQuery(`useCfdefinitionsearchresult_search_surveys_${new Date()}`, () => Surveys.cfdefinitionsearch(filters), { ...config }); +}; + +export default useCfdefinitionsearchresult; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCreateSurvey.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCreateSurvey.js new file mode 100644 index 00000000000..39ff08bd6bd --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCreateSurvey.js @@ -0,0 +1,10 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useCreateSurveysDef = (filters, config) => { + console.log("useCreateSurveysDef"); + + return useMutation((filters) => Surveys.createSurvey(filters)); +}; + +export default useCreateSurveysDef; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSelectedSurveySearch.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSelectedSurveySearch.js new file mode 100644 index 00000000000..f905b977798 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSelectedSurveySearch.js @@ -0,0 +1,9 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useQuery } from "react-query"; + +const useSelectedSurveySearch = (filters, config) => { + console.log(config,"useSelectedSurveySearch") + return useQuery(`search_selected_survey_${new Date()}`, () => Surveys.selectedSurveySearch(filters), { ...config }); +}; + +export default useSelectedSurveySearch; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSubmitSurveyResponse.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSubmitSurveyResponse.js new file mode 100644 index 00000000000..8f27ee9d60b --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSubmitSurveyResponse.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useSubmitSurveyResponse = (filters, config) => { + return useMutation((filters) => Surveys.submitSurveyResponse(filters)); +}; + +export default useSubmitSurveyResponse; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSurveyUpdate.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSurveyUpdate.js new file mode 100644 index 00000000000..e81de679ca2 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSurveyUpdate.js @@ -0,0 +1,9 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useUpdateSurvey = (filters, config) => { + console.log("updateSurvey") + return useMutation((filters) => Surveys.updateSurvey(filters)); +}; + +export default useUpdateSurvey; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useMDMS.js index ffc6aa8e456..d6dab75925d 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useMDMS.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useMDMS.js @@ -1,13 +1,13 @@ import React from "react"; import { useQuery } from "react-query"; -import { MdmsService } from "../../services/elements/MDMS"; +import { MdmsServiceV2 } from "../../services/elements/MDMSV2"; const useMDMS = { applicationTypes: (tenantId) => useQuery( [tenantId, "TL_MDMS_APPLICATION_STATUS"], () => - MdmsService.getDataByCriteria( + MdmsServiceV2.getDataByCriteria( tenantId, { details: { @@ -39,7 +39,7 @@ const useMDMS = { useQuery( [tenantId, "FORM_CONFIG"], () => - MdmsService.getDataByCriteria( + MdmsServiceV2.getDataByCriteria( tenantId, { details: { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useTLGenderMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useTLGenderMDMS.js index 9fe7827f128..98e1eb18c28 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useTLGenderMDMS.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useTLGenderMDMS.js @@ -1,9 +1,10 @@ import { useQuery } from "react-query"; import { MdmsService } from "../../services/elements/MDMS"; +import { MdmsServiceV2 } from "../../services/elements/MDMSV2"; const useTLGenderMDMS = (tenantId, moduleCode, type, config = {}) => { const useTLGenders = () => { - return useQuery("TL_GENDER_DETAILS", () => MdmsService.TLGenderType(tenantId, moduleCode ,type), config); + return useQuery("TL_GENDER_DETAILS", () => MdmsServiceV2.TLGenderType(tenantId, moduleCode ,type), config); }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useTradeLicenseMDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useTradeLicenseMDMS.js index 4e1e7c58190..f03c0a88d27 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useTradeLicenseMDMS.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/tl/useTradeLicenseMDMS.js @@ -1,21 +1,21 @@ -import { MdmsService } from "../../services/elements/MDMS"; +import { MdmsServiceV2 } from "../../services/elements/MDMSV2"; import { useQuery } from "react-query"; const useTradeLicenseMDMS = (tenantId, moduleCode, type, filter, config = {}) => { const useTLDocuments = () => { - return useQuery("TL_DOCUMENTS", () => MdmsService.getTLDocumentRequiredScreen(tenantId, moduleCode, type), config); + return useQuery("TL_DOCUMENTS", () => MdmsServiceV2.getTLDocumentRequiredScreen(tenantId, moduleCode, type), config); }; const useStructureType = () => { - return useQuery("TL_STRUCTURE_TYPE", () => MdmsService.getTLStructureType(tenantId, moduleCode, type), config); + return useQuery("TL_STRUCTURE_TYPE", () => MdmsServiceV2.getTLStructureType(tenantId, moduleCode, type), config); }; const useTradeUnitsData = () => { - return useQuery("TL_TRADE_UNITS", () => MdmsService.getTradeUnitsData(tenantId, moduleCode, type, filter), config); + return useQuery("TL_TRADE_UNITS", () => MdmsServiceV2.getTradeUnitsData(tenantId, moduleCode, type, filter), config); }; const useTradeOwnerShipCategory = () => { - return useQuery("TL_TRADE_OWNERSHIP_CATEGORY", () => MdmsService.GetTradeOwnerShipCategory(tenantId, moduleCode, type), config); + return useQuery("TL_TRADE_OWNERSHIP_CATEGORY", () => MdmsServiceV2.GetTradeOwnerShipCategory(tenantId, moduleCode, type), config); }; const useTradeOwnershipSubType = () => { - return useQuery("TL_TRADE_OWNERSHIP_CATEGORY", () => MdmsService.GetTradeOwnerShipCategory(tenantId, moduleCode, type), { + return useQuery("TL_TRADE_OWNERSHIP_CATEGORY", () => MdmsServiceV2.GetTradeOwnerShipCategory(tenantId, moduleCode, type), { select: data => { const {"common-masters":{OwnerShipCategory: categoryData} ={}} = data const filteredSubtypesData = categoryData.filter( e => e.code.includes(filter.keyToSearchOwnershipSubtype)).map( e => ({...e, i18nKey: `COMMON_MASTERS_OWNERSHIPCATEGORY_${e.code.replaceAll(".", "_")}`})) @@ -26,7 +26,7 @@ const useTradeLicenseMDMS = (tenantId, moduleCode, type, filter, config = {}) => }; const useOwnerTypeWithSubtypes = () => { - return useQuery("TL_TRADE_OWNERSSHIP_TYPE", () => MdmsService.GetTradeOwnerShipCategory(tenantId, moduleCode, type), { + return useQuery("TL_TRADE_OWNERSSHIP_TYPE", () => MdmsServiceV2.GetTradeOwnerShipCategory(tenantId, moduleCode, type), { select: data => { const {"common-masters":{OwnerShipCategory: categoryData} ={}} = data let OwnerShipCategory = {}; @@ -94,13 +94,13 @@ const useTradeLicenseMDMS = (tenantId, moduleCode, type, filter, config = {}) => }); }; const useTLAccessoriesType = () => { - return useQuery("TL_TRADE_ACCESSORY_CATEGORY", () => MdmsService.getTLAccessoriesType(tenantId, moduleCode, type), config); + return useQuery("TL_TRADE_ACCESSORY_CATEGORY", () => MdmsServiceV2.getTLAccessoriesType(tenantId, moduleCode, type), config); }; const useTLFinancialYear = () => { - return useQuery("TL_TRADE_FINANCIAL_YEAR", () => MdmsService.getTLFinancialYear(tenantId, moduleCode, type), config); + return useQuery("TL_TRADE_FINANCIAL_YEAR", () => MdmsServiceV2.getTLFinancialYear(tenantId, moduleCode, type), config); }; const _default = () => { - return useQuery([tenantId, moduleCode, type], () => MdmsService.getMultipleTypes(tenantId, moduleCode, type), config); + return useQuery([tenantId, moduleCode, type], () => MdmsServiceV2.getMultipleTypes(tenantId, moduleCode, type), config); }; switch (type) { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIMutationHook.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIMutationHook.js new file mode 100644 index 00000000000..6afcfe74d49 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIMutationHook.js @@ -0,0 +1,68 @@ +import { useQueryClient, useMutation } from "react-query"; +import { CustomService } from "../services/elements/CustomService"; + +/** + * Custom hook which can make api call and format response + * + * @author jagankumar-egov + * + * + * @example + * + const requestCriteria = [ + "/user/_search", // API details + {}, //requestParam + {data : {uuid:[Useruuid]}}, // requestBody + {} , // privacy value + { // other configs + enabled: privacyState, + cacheTime: 100, + select: (data) => { + // format data + return _.get(data, loadData?.jsonPath, value); + }, + }, + ]; + const mutation = Digit.Hooks.useCustomAPIMutationHook(...requestCriteria); + + +while mutating use the following format + +mutation.mutate({ + params: {}, + body: { "payload": { + // custom data + } + }}, + { + onError : ()=> { // custom logic}, + onSuccess : ()=> { // custom logic} + } + ); + + * + * @returns {Object} Returns the object which contains data and isLoading flag + */ + +const useCustomAPIMutationHook = ({ url, params, body, config = {}, plainAccessRequest, changeQueryName = "Random" }) => { + const client = useQueryClient(); + + const { isLoading, data, isFetching, ...rest } = useMutation( + (data) => CustomService.getResponse({ url, params: { ...params, ...data?.params }, body: { ...body, ...data?.body }, plainAccessRequest }), + { + cacheTime: 0, + ...config, + } + ); + return { + ...rest, + isLoading, + isFetching, + data, + revalidate: () => { + data && client.invalidateQueries({ queryKey: [url].filter((e) => e) }); + }, + }; +}; + +export default useCustomAPIMutationHook; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useMDMSV2.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useMDMSV2.js new file mode 100644 index 00000000000..c1564ceccb4 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useMDMSV2.js @@ -0,0 +1,44 @@ +import { MdmsServiceV2 } from "../services/elements/MDMSV2"; +import { useQuery } from "react-query"; + +const useMDMS = (tenantId, moduleCode, type, config = {}, payload = []) => { + const usePaymentGateway = () => { + return useQuery("PAYMENT_GATEWAY", () => MdmsServiceV2.getPaymentGateway(tenantId, moduleCode, type), { + select: (data) => { + return data?.[moduleCode]?.[type].filter((e) => e.active).map(({ gateway }) => gateway); + }, + ...config, + }); + }; + + const useReceiptKey = () => { + return useQuery("RECEIPT_KEY", () => MdmsServiceV2.getReceiptKey(tenantId, moduleCode, type), config); + }; + + const useBillsGenieKey = () => { + return useQuery("BILLS_GENIE_KEY", () => MdmsServiceV2.getBillsGenieKey(tenantId, moduleCode, type), config); + }; + + const useFSTPPlantInfo = () => { + return useQuery("FSTP_PLANTINFO", () => MdmsServiceV2.getFSTPPlantInfo(tenantId, moduleCode, type), config); + }; + + const _default = () => { + return useQuery([tenantId, moduleCode, type], () => MdmsServiceV2.getMultipleTypes(tenantId, moduleCode, type), config); + }; + + switch (type) { + case "PaymentGateway": + return usePaymentGateway(); + case "ReceiptKey": + return useReceiptKey(); + case "FSTPPlantInfo": + return useFSTPPlantInfo(); + case "BillsGenieKey": + return useBillsGenieKey(); + default: + return _default(); + } +}; + +export default useMDMS; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js index 25e51a94e97..d152f159d4d 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js @@ -13,9 +13,9 @@ const useModuleTenants = (module, config = {}) => { ...tenant, ulbKey: t(`TENANT_TENANTS_${tenant?.code?.toUpperCase?.()?.replace(".", "_")}`), ddrKey: t( - `DDR_${data.tenants - .filter((t) => t.code === tenant.code)?.[0] - .city?.districtTenantCode?.toUpperCase?.() + `DDR_${data?.tenants + .filter((t) => t?.code === tenant?.code)?.[0] + ?.city?.districtTenantCode?.toUpperCase?.() .replace(".", "_")}` ), })) @@ -26,9 +26,9 @@ const useModuleTenants = (module, config = {}) => { ...tenant, ulbKey: t(`TENANT_TENANTS_${tenant?.code?.toUpperCase?.()?.replace(".", "_")}`), ddrKey: t( - `DDR_${data.tenants - .filter((t) => t.code === tenant.code)?.[0] - .city?.districtTenantCode?.toUpperCase?.() + `DDR_${data?.tenants + .filter((t) => t?.code === tenant?.code)?.[0] + ?.city?.districtTenantCode?.toUpperCase?.() .replace(".", "_")}` ), })), diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkBenchCustomAPIHook.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkBenchCustomAPIHook.js new file mode 100644 index 00000000000..002ee4b32c0 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkBenchCustomAPIHook.js @@ -0,0 +1,56 @@ +import { useQuery, useQueryClient } from "react-query"; +import { CustomService } from "../services/elements/CustomService"; + +/** + * Custom hook which can make api call and format response + * + * @author jagankumar-egov + * + * + * @example + * + const requestCriteria = [ + "/user/_search", // API details + {}, //requestParam + {data : {uuid:[Useruuid]}}, // requestBody + {} , // privacy value + { // other configs + enabled: privacyState, + cacheTime: 100, + select: (data) => { + // format data + return _.get(data, loadData?.jsonPath, value); + }, + }, + ]; + const { isLoading, data, revalidate } = Digit.Hooks.useCustomAPIHook(...requestCriteria); + + * + * @returns {Object} Returns the object which contains data and isLoading flag + */ + + +const useWorkBenchCustomAPIHook = ({ url, params, body, config = {}, plainAccessRequest,changeQueryName="Random" }) => { + const client = useQueryClient(); + console.log(body,"body") + const { isLoading, data, isFetching,refetch } = useQuery( + [url,changeQueryName].filter((e) => e), + () => CustomService.getResponse({ url, params, body, plainAccessRequest }), + { + cacheTime:0, + ...config, + } + ); + + return { + isLoading, + isFetching, + data, + refetch, + revalidate: () => { + data && client.invalidateQueries({ queryKey: [url].filter((e) => e) }); + }, + }; +}; + +export default useWorkBenchCustomAPIHook; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkBenchRouteSubscription.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkBenchRouteSubscription.js new file mode 100644 index 00000000000..ed9b27b28bc --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkBenchRouteSubscription.js @@ -0,0 +1,17 @@ +import React, { useEffect, useState } from "react"; + +const useWorkBenchRouteSubscription = (pathname) => { + const [classname, setClassname] = useState("citizen"); + useEffect(() => { + const isEmployeeUrl = Digit.Utils.detectDsoRoute(pathname); + if (isEmployeeUrl && classname === "citizen") { + setClassname("employee"); + } else if (!isEmployeeUrl && classname === "employee") { + setClassname("citizen"); + } + }, [pathname]); + + return classname; +}; + +export default useWorkBenchRouteSubscription; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/workflow.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/workflow.js index 2549ed5d027..cea7aec34ed 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/workflow.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/workflow.js @@ -7,7 +7,7 @@ const useWorkflowDetails = ({ tenantId, id, moduleCode, role = "CITIZEN", servic const { isLoading, error, isError, data } = useQuery( ["workFlowDetails", tenantId, id, moduleCode, role, config], - () => Digit.WorkflowService.getDetailsById({ tenantId, id, moduleCode, role, getTripData }), + () => Digit.WorkflowService.getDetailsById({ tenantId, id, moduleCode, role, getTripData, serviceData }), getStaleData ? { ...staleDataConfig, ...config } : config ); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/index.js index 2d40c948c32..586f5c537ab 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/index.js @@ -18,6 +18,7 @@ import * as dateUtils from "./services/atoms/Utils/Date"; import Download from "./services/atoms/Download"; import { WorkflowService } from "./services/elements/WorkFlow"; import { MdmsService } from "./services/elements/MDMS"; +import { MdmsServiceV2 } from "./services/elements/MDMSV2"; import { Complaint } from "./services/elements/Complaint"; import { UserService } from "./services/elements/User"; import { PTService } from "./services/elements/PT"; @@ -88,6 +89,7 @@ const initLibraries = () => { setupLibraries("DateUtils", dateUtils); setupLibraries("WorkflowService", WorkflowService); setupLibraries("MDMSService", MdmsService); + setupLibraries("MDMSServiceV2", MdmsServiceV2); setupLibraries("UploadServices", UploadServices); setupLibraries("JsDictionary", JsDictionary); setupLibraries("GetServiceDefinitions", GetServiceDefinitions); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/ApiCacheService.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/ApiCacheService.js index a93977b8f91..c2101b37750 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/ApiCacheService.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/ApiCacheService.js @@ -16,6 +16,17 @@ const defaultApiCachingSettings = [ }, ], }, + { + serviceName: "mdms-v2", + cacheTimeInSecs: 3600, + debounceTimeInMS: 100, + moduleSettings: [ + { + moduleName: "FSM", + cacheTimeInSecs: 7200, + }, + ], + }, ]; const storageKey = "cachingService"; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js index 37fa6d5cacb..10f2977840b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js @@ -1,11 +1,13 @@ const Urls = { MDMS: `/egov-mdms-service/v1/_search`, + MDMSV2: `/mdms-v2/v1/_search`, WorkFlow: `/egov-workflow-v2/egov-wf/businessservice/_search`, WorkFlowProcessSearch: `/egov-workflow-v2/egov-wf/process/_search`, localization: `/localization/messages/v1/_search`, location: { localities: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=ADMIN&boundaryType=Locality`, revenue_localities: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=REVENUE&boundaryType=Locality`, + gramPanchayats: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=REVENUE&boundaryType=GP`, }, pgr_search: `/pgr-services/v2/request/_search`, @@ -197,6 +199,11 @@ const Urls = { delete: "/egov-survey-services/egov-ss/survey/_delete", submitResponse: "/egov-survey-services/egov-ss/survey/response/_submit", showResults: "/egov-survey-services/egov-ss/survey/response/_results", + createSurvey: "/service-request/service/definition/v1/_create", + cfdefinitionsearch: "/service-request/service/definition/v1/_search", + submitSurveyResponse: "/service-request/service/v1/_create", + selectedSurveySearch: "/service-request/service/v1/_search", + updateSurvey:"/service-request/service/definition/v1/_update", }, }, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/CustomService.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/CustomService.js index 2c6fbfd9b14..994b087f137 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/CustomService.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/CustomService.js @@ -1,16 +1,19 @@ import { Request } from "../atoms/Utils/Request"; export const CustomService = { - - getResponse: ({url,params,data,plainAccessRequest}) => + getResponse: ({ url, params, body, plainAccessRequest,useCache=true,userService=true,setTimeParam=true,userDownload=false}) => Request({ url: url, - data: data, - useCache: true, - userService: true, + data: body, + useCache, + userService, method: "POST", auth: true, params: params, - plainAccessRequest:plainAccessRequest - }), + plainAccessRequest: plainAccessRequest, + userDownload:userDownload, + setTimeParam + }) }; + + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Location.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Location.js index 13771aa0bcd..e85adf0bce3 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Location.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Location.js @@ -19,4 +19,13 @@ export const LocationService = { }); return response; }, + getGramPanchayats: async (tenantId) => { + const response = await ServiceRequest({ + serviceName: "getGramPanchayats", + url: Urls.location.gramPanchayats, + params: { tenantId: tenantId }, + useCache: true, + }); + return response; + }, }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js index 31850ae0944..2ae2fe2c5a5 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js @@ -149,9 +149,9 @@ const getBillsGenieKey = (tenantId, moduleCode) => ({ masterDetails: [{ name: "tenants" }, { name: "citymodule" }], }, { - moduleName: "common-masters", - masterDetails: [{name: "uiCommonPay"}] - } + moduleName: "common-masters", + masterDetails: [{ name: "uiCommonPay" }], + }, ], }, }); @@ -227,6 +227,24 @@ const getApplicationChannelCriteria = (tenantId, moduleCode) => ({ }, }); +const getUrcConfigCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "UrcConfig", + filter: null, + }, + ], + }, + ], + }, +}); + const getPropertyTypeCriteria = (tenantId, moduleCode, type) => ({ type, details: { @@ -645,32 +663,31 @@ const getGenderTypeList = (tenantId, moduleCode, type) => ({ }); const getMeterStatusTypeList = (tenantId) => ({ - moduleDetails: [ - { - moduleName: "ws-services-calculation", - masterDetails: [ - { - name: "MeterStatus", - filter: `$.*.name` - }, - ], - }, - ], - + moduleDetails: [ + { + moduleName: "ws-services-calculation", + masterDetails: [ + { + name: "MeterStatus", + filter: `$.*.name`, + }, + ], + }, + ], }); const getBillingPeriodValidation = (tenantId) => ({ - moduleDetails: [ - { - moduleName: "ws-services-masters", - masterDetails: [ - { - name: "billingPeriod", - filter: "*" - }, - ], - }, - ], + moduleDetails: [ + { + moduleName: "ws-services-masters", + masterDetails: [ + { + name: "billingPeriod", + filter: "*", + }, + ], + }, + ], }); const getDssDashboardCriteria = (tenantId, moduleCode) => ({ @@ -922,53 +939,53 @@ const getWSTaxHeadMasterCritera = (tenantId, moduleCode, type) => ({ }); const getHowItWorksJSON = (tenantId) => ({ - moduleDetails: [ - { - moduleName: "common-masters", - masterDetails: [ - { - name: "howItWorks", - }, - ], - }, - ], + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "howItWorks", + }, + ], + }, + ], }); const getFAQsJSON = (tenantId) => ({ moduleDetails: [ - { - moduleName: "common-masters", - masterDetails: [ - { - name: "faqs", - }, - ], - }, -], + { + moduleName: "common-masters", + masterDetails: [ + { + name: "faqs", + }, + ], + }, + ], }); const getDSSFAQsJSON = (tenantId) => ({ moduleDetails: [ - { - moduleName: "dss-dashboard", - masterDetails: [ - { - name: "FAQs", - }, - ], - }, -], + { + moduleName: "dss-dashboard", + masterDetails: [ + { + name: "FAQs", + }, + ], + }, + ], }); const getDSSAboutJSON = (tenantId) => ({ moduleDetails: [ - { - moduleName: "dss-dashboard", - masterDetails: [ - { - name: "About", - }, - ], - }, -], + { + moduleName: "dss-dashboard", + masterDetails: [ + { + name: "About", + }, + ], + }, + ], }); const getStaticData = () => ({ @@ -1004,6 +1021,8 @@ const GetApplicationChannel = (MdmsRes) => i18nKey: `ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_${channel.code}`, })); +const getUrcConfig = (MdmsRes) => MdmsRes["FSM"].UrcConfig; + const GetPropertyType = (MdmsRes) => MdmsRes["FSM"].PropertyType.filter((property) => property.active && !property.propertyType).map((item) => ({ ...item, @@ -1029,12 +1048,11 @@ const GetVehicleType = (MdmsRes) => }); const GetVehicleMakeModel = (MdmsRes) => - MdmsRes["Vehicle"].VehicleMakeModel.filter((vehicle) => vehicle.active) - .map((vehicleDetails) => { - return { - ...vehicleDetails, - i18nKey: `COMMON_MASTER_VEHICLE_${vehicleDetails.code}`, - }; + MdmsRes["Vehicle"].VehicleMakeModel.filter((vehicle) => vehicle.active).map((vehicleDetails) => { + return { + ...vehicleDetails, + i18nKey: `COMMON_MASTER_VEHICLE_${vehicleDetails.code}`, + }; }); const GetSlumLocalityMapping = (MdmsRes, tenantId) => @@ -1407,6 +1425,8 @@ const transformResponse = (type, MdmsRes, moduleCode, tenantId) => { return GetTripNumber(MdmsRes); case "ReceivedPaymentType": return GetReceivedPaymentType(MdmsRes); + case "UrcConfig": + return getUrcConfig(MdmsRes); default: return MdmsRes; } @@ -1522,6 +1542,9 @@ export const MdmsService = { getApplicationChannel: (tenantId, moduleCode) => { return MdmsService.getDataByCriteria(tenantId, getApplicationChannelCriteria(tenantId, moduleCode), moduleCode); }, + getUrcConfig: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getUrcConfigCriteria(tenantId, moduleCode, type), moduleCode); + }, getPropertyType: (tenantId, moduleCode, type) => { return MdmsService.getDataByCriteria(tenantId, getPropertyTypeCriteria(tenantId, moduleCode, type), moduleCode); }, @@ -1727,11 +1750,11 @@ export const MdmsService = { getDSSFAQsJSONData: (tenantId) => { return MdmsService.call(tenantId, getDSSFAQsJSON(tenantId)); }, - + getDSSAboutJSONData: (tenantId) => { return MdmsService.call(tenantId, getDSSAboutJSON(tenantId)); }, getStaticDataJSON: (tenantId) => { return MdmsService.call(tenantId, getStaticData()); - } -}; + }, +}; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMSV2.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMSV2.js new file mode 100644 index 00000000000..df1d11fab24 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMSV2.js @@ -0,0 +1,1739 @@ +//HAVE TO CHANGE THI +// import { stringReplaceAll } from "@egovernments/digit-ui-module-pt/src/utils"; +import { ApiCacheService } from "../atoms/ApiCacheService"; +import Urls from "../atoms/urls"; +import { Request, ServiceRequest } from "../atoms/Utils/Request"; +import { PersistantStorage } from "../atoms/Utils/Storage"; + +// export const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { +// if (searcher == "") return str; +// while (str.includes(searcher)) { +// str = str.replace(searcher, replaceWith); +// } +// return str; +// }; + +const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { + if (searcher == "") return str; + while (str.includes(searcher)) { + str = str.replace(searcher, replaceWith); + } + return str; +}; + +const SortByName = (na, nb) => { + if (na < nb) { + return -1; + } + if (na > nb) { + return 1; + } + return 0; +}; + +const GetCitiesWithi18nKeys = (MdmsRes, moduleCode) => { + const cityList = (MdmsRes.tenant.citymodule && MdmsRes.tenant.citymodule.find((module) => module.code === moduleCode).tenants) || []; + const citiesMap = cityList.map((city) => city.code); + const cities = MdmsRes.tenant.tenants + .filter((city) => citiesMap.includes(city.code)) + .map(({ code, name, logoId, emailId, address, contactNumber }) => ({ + code, + name, + logoId, + emailId, + address, + contactNumber, + i18nKey: "TENANT_TENANTS_" + code.replace(".", "_").toUpperCase(), + })) + .sort((cityA, cityB) => { + const na = cityA.name.toLowerCase(), + nb = cityB.name.toLowerCase(); + return SortByName(na, nb); + }); + return cities; +}; + +const initRequestBody = (tenantId) => ({ + MdmsCriteria: { + tenantId, + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [{ name: "Department" }, { name: "Designation" }, { name: "StateInfo" }, { name: "wfSlaConfig" }, { name: "uiHomePage" }], + }, + { + moduleName: "tenant", + masterDetails: [{ name: "tenants" }, { name: "citymodule" }], + }, + { + moduleName: "DIGIT-UI", + masterDetails: [{ name: "ApiCachingSettings" }], + }, + ], + }, +}); + +const getCriteria = (tenantId, moduleDetails) => { + return { + MdmsCriteria: { + tenantId, + ...moduleDetails, + }, + }; +}; + +export const getGeneralCriteria = (tenantId, moduleCode, type) => ({ + details: { + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: type, + }, + ], + }, + ], + }, +}); + +export const getMultipleTypes = (tenantId, moduleCode, types) => ({ + details: { + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: types.map((type) => ({ name: type })), + }, + ], + }, +}); +export const getMultipleTypesWithFilter = (moduleCode, masterDetails) => ({ + details: { + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: masterDetails, + }, + ], + }, +}); + +const getReceiptKey = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "uiCommonPay", + }, + ], + }, + ], + }, +}); + +const getBillsGenieKey = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "BusinessService", + }, + ], + }, + { + moduleName: "tenant", + masterDetails: [{ name: "tenants" }, { name: "citymodule" }], + }, + { + moduleName: "common-masters", + masterDetails: [{name: "uiCommonPay"}] + } + ], + }, +}); + +const getModuleServiceDefsCriteria = (tenantId, moduleCode) => ({ + type: "serviceDefs", + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: `RAINMAKER-${moduleCode}`, + masterDetails: [ + { + name: "ServiceDefs", + }, + ], + }, + ], + }, +}); + +const getSanitationTypeCriteria = (tenantId, moduleCode) => ({ + type: "SanitationType", + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "SanitationType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPitTypeCriteria = (tenantId, moduleCode) => ({ + type: "PitType", + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PitType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getApplicationChannelCriteria = (tenantId, moduleCode) => ({ + type: "ApplicationChannel", + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "ApplicationChannel", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPropertyTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PropertyType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPropertyUsageCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PropertyType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getCommonFieldsCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "CommonFieldsConfig", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPreFieldsCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PreFieldsConfig", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPostFieldsCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PostFieldsConfig", + filter: null, + }, + ], + }, + ], + }, +}); + +const getConfig = (tenantId, moduleCode) => ({ + type: "Config", + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "Config", + }, + ], + }, + ], + }, +}); + +const getVehicleTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "VehicleMakeModel", + filter: null, + }, + ], + }, + ], + }, +}); + +const getChecklistCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "CheckList", + filter: null, + }, + ], + }, + ], + }, +}); + +const getSlumLocalityCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "Slum", + }, + ], + }, + ], + }, +}); +const getPropertyOwnerTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "OwnerType" }], + }, + ], + }, +}); + +const getSubPropertyOwnerShipCategoryCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "SubOwnerShipCategory" }], + }, + ], + }, +}); +const getPropertyOwnerShipCategoryCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "OwnerShipCategory" }], + }, + ], + }, +}); + +const getTradeOwnerShipCategoryCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "OwnerShipCategory" }], + }, + ], + }, +}); + +const getDocumentRequiredScreenCategory = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "Documents", + }, + ], + }, + ], + }, +}); + +const getDefaultMapConfig = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "MapConfig", + }, + ], + }, + ], + }, +}); + +const getUsageCategoryList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "UsageCategory" }], + }, + ], + }, +}); + +const getPTPropertyTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "PropertyType" }], + }, + ], + }, +}); + +const getTLStructureTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "StructureType" }], + }, + ], + }, +}); + +const getTLAccessoriesTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "AccessoriesCategory" }], + }, + ], + }, +}); + +const getTLFinancialYearList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "FinancialYear", filter: `[?(@.module == "TL")]` }], + }, + ], + }, +}); + +const getPTFloorList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "Floor" }], + }, + ], + }, +}); + +const getReasonCriteria = (tenantId, moduleCode, type, payload) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: payload.map((mdmsLoad) => ({ + name: mdmsLoad, + })), + }, + ], + }, +}); + +const getBillingServiceForBusinessServiceCriteria = (filter) => ({ + moduleDetails: [ + { + moduleName: "BillingService", + masterDetails: [ + { name: "BusinessService", filter }, + { + name: "TaxHeadMaster", + }, + { + name: "TaxPeriod", + }, + ], + }, + ], +}); + +const getRoleStatusCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "RoleStatusMapping", + filter: null, + }, + ], + }, + ], + }, +}); +const getRentalDetailsCategoryCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "RentalDetails", + }, + ], + }, + ], + }, +}); + +const getChargeSlabsCategoryCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "ChargeSlabs", + }, + ], + }, + ], + }, +}); + +const getGenderTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "GenderType", + }, + ], + }, + ], + }, +}); + +const getMeterStatusTypeList = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "ws-services-calculation", + masterDetails: [ + { + name: "MeterStatus", + filter: `$.*.name` + }, + ], + }, + ], + +}); + +const getBillingPeriodValidation = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "ws-services-masters", + masterDetails: [ + { + name: "billingPeriod", + filter: "*" + }, + ], + }, + ], +}); + +const getDssDashboardCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "dashboard-config", + }, + ], + }, + ], + }, +}); + +const getMCollectBillingServiceCriteria = (tenantId, moduleCode, type, filter) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "BusinessService", filter: filter }], + }, + ], + }, +}); + +const getTradeUnitsDataList = (tenantId, moduleCode, type, filter) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "TradeType", filter: filter }], + }, + ], + }, +}); + +const getMCollectApplicationStatusCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "applicationStatus" }], + }, + ], + }, +}); + +const getHrmsEmployeeRolesandDesignations = () => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { name: "Department", filter: "[?(@.active == true)]" }, + { name: "Designation", filter: "[?(@.active == true)]" }, + ], + }, + { + moduleName: "tenant", + masterDetails: [{ name: "tenants" }], + }, + { + moduleName: "ACCESSCONTROL-ROLES", + masterDetails: [{ name: "roles", filter: "$.[?(@.code!='CITIZEN')]" }], + }, + { moduleName: "egov-location", masterDetails: [{ name: "TenantBoundary" }] }, + ], +}); +const getFSTPPlantCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "FSTPPlantInfo" }], + }, + ], + }, +}); +const getCancelReceiptReason = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "CancelReceiptReason" }], + }, + ], + }, +}); +const getReceiptStatus = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "ReceiptStatus" }], + }, + ], + }, +}); +const getCancelReceiptReasonAndStatus = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "ReceiptStatus" }, { name: "uiCommonPay" }], + }, + ], + }, +}); + +const getDocumentTypesCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "DocTypeMapping", + }, + ], + }, + ], + }, +}); + +const getTradeTypeRoleCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "TradeTypetoRoleMapping", + }, + ], + }, + ], + }, +}); + +const getFSTPORejectionReasonCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "FSTPORejectionReason", + filter: null, + }, + ], + }, + ], + }, +}); + +const getFSMPaymentTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PaymentType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getFSMTripNumberCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "TripNumber", + filter: null, + }, + ], + }, + ], + }, +}); + +const getFSMReceivedPaymentTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "ReceivedPaymentType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getWSTaxHeadMasterCritera = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: "BillingService", + masterDetails: [ + { + name: "TaxHeadMaster", + filter: null, + }, + ], + }, + ], + }, +}); + +const getHowItWorksJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "howItWorks", + }, + ], + }, + ], +}); + +const getFAQsJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "faqs", + }, + ], + }, +], +}); +const getDSSFAQsJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "dss-dashboard", + masterDetails: [ + { + name: "FAQs", + }, + ], + }, +], +}); +const getDSSAboutJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "dss-dashboard", + masterDetails: [ + { + name: "About", + }, + ], + }, +], +}); + +const getStaticData = () => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "StaticData", + }, + ], + }, + ], +}); + +const GetEgovLocations = (MdmsRes) => { + return MdmsRes["egov-location"].TenantBoundary[0].boundary.children.map((obj) => ({ + name: obj.localname, + i18nKey: obj.localname, + })); +}; + +const GetServiceDefs = (MdmsRes, moduleCode) => MdmsRes[`RAINMAKER-${moduleCode}`].ServiceDefs.filter((def) => def.active); + +const GetSanitationType = (MdmsRes) => ["FSM"].SanitationType.filter((type) => type.active); + +const GetPitType = (MdmsRes) => + MdmsRes["FSM"].PitType.filter((item) => item.active).map((type) => ({ ...type, i18nKey: `PITTYPE_MASTERS_${type.code}` })); + +const GetApplicationChannel = (MdmsRes) => + MdmsRes["FSM"].ApplicationChannel.filter((type) => type.active).map((channel) => ({ + ...channel, + i18nKey: `ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_${channel.code}`, + })); + +const GetPropertyType = (MdmsRes) => + MdmsRes["FSM"].PropertyType.filter((property) => property.active && !property.propertyType).map((item) => ({ + ...item, + i18nKey: `PROPERTYTYPE_MASTERS_${item.code}`, + code: item.code, + })); + +const GetPropertySubtype = (MdmsRes) => + MdmsRes["FSM"].PropertyType.filter((property) => property.active && property.propertyType).map((item) => ({ + ...item, + i18nKey: `PROPERTYTYPE_MASTERS_${item.code}`, + code: item.code, + })); + +const GetVehicleType = (MdmsRes) => + MdmsRes["Vehicle"].VehicleMakeModel.filter((vehicle) => vehicle.active) + .filter((vehicle) => vehicle.make) + .map((vehicleDetails) => { + return { + ...vehicleDetails, + i18nKey: `COMMON_MASTER_VEHICLE_${vehicleDetails.code}`, + }; + }); + +const GetVehicleMakeModel = (MdmsRes) => + MdmsRes["Vehicle"].VehicleMakeModel.filter((vehicle) => vehicle.active) + .map((vehicleDetails) => { + return { + ...vehicleDetails, + i18nKey: `COMMON_MASTER_VEHICLE_${vehicleDetails.code}`, + }; + }); + +const GetSlumLocalityMapping = (MdmsRes, tenantId) => + MdmsRes["FSM"].Slum.filter((type) => type.active).reduce((prev, curr) => { + return prev[curr.locality] + ? { + ...prev, + [curr.locality]: [ + ...prev[curr.locality], + { + ...curr, + i18nKey: `${tenantId.toUpperCase().replace(".", "_")}_${curr.locality}_${curr.code}`, + }, + ], + } + : { + ...prev, + [curr.locality]: [ + { + ...curr, + i18nKey: `${tenantId.toUpperCase().replace(".", "_")}_${curr.locality}_${curr.code}`, + }, + ], + }; + }, {}); + +const GetPropertyOwnerShipCategory = (MdmsRes) => + MdmsRes["PropertyTax"].OwnerShipCategory.filter((ownerShip) => ownerShip.active).map((ownerShipDetails) => { + return { + ...ownerShipDetails, + i18nKey: `COMMON_MASTER_OWNER_TYPE_${ownerShipDetails.code}`, + }; + }); + +const GetTradeOwnerShipCategory = (MdmsRes) => + MdmsRes["common-masters"].OwnerShipCategory.filter((ownerShip) => ownerShip.active).map((ownerShipDetails) => { + return { + ...ownerShipDetails, + i18nKey: `COMMON_MASTER_OWNER_TYPE_${ownerShipDetails.code}`, + }; + }); + +const GetPropertyOwnerType = (MdmsRes) => + MdmsRes["PropertyTax"].OwnerType.filter((owner) => owner.active).map((ownerDetails) => { + return { + ...ownerDetails, + i18nKey: `PROPERTYTAX_OWNERTYPE_${ownerDetails.code}`, + }; + }); + +const getSubPropertyOwnerShipCategory = (MdmsRes) => { + MdmsRes["PropertyTax"].SubOwnerShipCategory.filter((category) => category.active).map((subOwnerShipDetails) => { + return { + ...subOwnerShipDetails, + i18nKey: `PROPERTYTAX_BILLING_SLAB_${subOwnerShipDetails.code}`, + }; + }); + sessionStorage.setItem("getSubPropertyOwnerShipCategory", JSON.stringify(MdmsRes)); +}; + +const getDocumentRequiredScreen = (MdmsRes) => { + MdmsRes["PropertyTax"].Documents.filter((Documents) => Documents.active).map((dropdownData) => { + return { + ...Documents, + i18nKey: `${dropdownData.code}`, + }; + }); +}; + +const getTLDocumentRequiredScreen = (MdmsRes) => { + MdmsRes["TradeLicense"].Documents.filter((Documents) => Documents.active).map((dropdownData) => { + return { + ...Documents, + i18nKey: `${dropdownData.code}`, + }; + }); +}; + +const getMapConfig = (MdmsRes) => { + MdmsRes["PropertyTax"].MapConfig.filter((MapConfig) => MapConfig).map((MapData) => { + return { + ...MapConfig, + defaultconfig: MapData.defaultConfig, + }; + }); +}; + +const getUsageCategory = (MdmsRes) => + MdmsRes["PropertyTax"].UsageCategory.filter((UsageCategory) => UsageCategory.active).map((UsageCategorylist) => { + return { + ...UsageCategorylist, + i18nKey: `PROPERTYTAX_BILLING_SLAB_${UsageCategorylist.code}`, + }; + }); + +const getPTPropertyType = (MdmsRes) => + MdmsRes["PropertyTax"].UsageCategory.filter((PropertyType) => PropertyType.active).map((PTPropertyTypelist) => { + return { + ...UsageCategorylist, + i18nKey: `COMMON_PROPTYPE_${stringReplaceAll(PTPropertyTypelist.code, ".", "_")}`, + }; + }); + +const getTLStructureType = (MdmsRes) => + MdmsRes["common-masters"].StructureType.filter((StructureType) => StructureType.active).map((TLStructureTypeList) => { + return { + ...TLStructureTypeList, + i18nKey: `COMMON_MASTERS_STRUCTURETYPE_${stringReplaceAll(TLStructureTypeList.code, ".", "_")}`, + }; + }); + +const getTLAccessoriesType = (MdmsRes) => + MdmsRes["TradeLicense"].AccessoriesCategory.filter((AccessoriesCategory) => AccessoriesCategory.active).map((TLAccessoryTypeList) => { + return { + ...TLAccessoryTypeList, + i18nKey: `TRADELICENSE_ACCESSORIESCATEGORY_${stringReplaceAll(TLAccessoryTypeList.code, ".", "_")}`, + }; + }); + +const getTLFinancialYear = (MdmsRes) => + MdmsRes["egf-master"].FinancialYear.filter((FinancialYear) => FinancialYear.active && FinancialYear.module === "TL").map((FinancialYearList) => { + return { + ...FinancialYearList, + //i18nKey: `TRADELICENSE_ACCESSORIESCATEGORY_${stringReplaceAll(TLAccessoryTypeList.code, ".", "_")}`, + }; + }); +const getFloorList = (MdmsRes) => + MdmsRes["PropertyTax"].Floor.filter((PTFloor) => PTFloor.active).map((PTFloorlist) => { + return { + ...PTFloorlist, + i18nKey: `PROPERTYTAX_FLOOR_${PTFloorlist.code}`, + }; + }); + +const GetReasonType = (MdmsRes, type, moduleCode) => + Object.assign( + {}, + ...Object.keys(MdmsRes[moduleCode]).map((collection) => ({ + [collection]: MdmsRes[moduleCode][collection] + .filter((reason) => reason.active) + .map((reason) => ({ + ...reason, + i18nKey: `ES_ACTION_REASON_${reason.code}`, + })), + })) + ); + +const getRentalDetailsCategory = (MdmsRes) => { + MdmsRes["PropertyTax"].RentalDetails.filter((category) => category.active).map((RentalDetailsInfo) => { + return { + ...RentalDetailsInfo, + i18nKey: `PROPERTYTAX_BILLING_SLAB_${RentalDetailsInfo.code}`, + }; + }); +}; + +const getChargeSlabsCategory = (MdmsRes) => { + MdmsRes["PropertyTax"].ChargeSlabs.filter((category) => category.active).map((ChargeSlabsInfo) => { + return { + ...ChargeSlabsInfo, + }; + }); +}; + +const getGenderType = (MdmsRes) => { + return MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((genderDetails) => { + return { + ...genderDetails, + i18nKey: `PT_COMMON_GENDER_${genderDetails.code}`, + }; + }); + //return MdmsRes; +}; + +const TLGenderType = (MdmsRes) => { + MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((genders) => { + return { + ...genders, + i18nKey: `TL_GENDER_${genders.code}`, + }; + }); +}; + +const PTGenderType = (MdmsRes) => { + MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((formGender) => { + return { + ...formGender, + i18nKey: `PT_FORM3_${formGender.code}`, + }; + }); +}; + +const HRGenderType = (MdmsRes) => { + MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((comGender) => { + return { + ...comGender, + i18nKey: `COMMON_GENDER_${comGender.code}`, + }; + }); +}; + +const GetMCollectBusinessService = (MdmsRes) => + MdmsRes["BillingService"].BusinessService.map((businesServiceDetails) => { + return { + ...businesServiceDetails, + i18nKey: `BILLINGSERVICE_BUSINESSSERVICE_${businesServiceDetails.code}`, + }; + }); + +const GetMCollectApplicationStatus = (MdmsRes) => + MdmsRes["mCollect"].applcationStatus.map((appStatusDetails) => { + return { + ...appStatusDetails, + i18nKey: `BILLINGSERVICE_BUSINESSSERVICE_${appStatusDetails.code}`, + }; + }); + +const getFSMGenderType = (MdmsRes) => { + return MdmsRes["common-masters"].GenderType.map((genderDetails) => { + return { + ...genderDetails, + i18nKey: `COMMON_GENDER_${genderDetails.code}`, + }; + }); +}; + +const GetFSTPORejectionReason = (MdmsRes) => { + return MdmsRes["Vehicle"].FSTPORejectionReason.filter((reason) => reason.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_REASON_${reasonDetails.code}`, + }; + }); +}; + +const GetPaymentType = (MdmsRes) => { + return MdmsRes["FSM"].PaymentType.filter((option) => option.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_${reasonDetails.code}`, + }; + }); +}; + +const GetTripNumber = (MdmsRes) => { + return MdmsRes["FSM"].TripNumber.filter((option) => option.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_TRIP_${reasonDetails.code}`, + }; + }); +}; + +const GetReceivedPaymentType = (MdmsRes) => { + return MdmsRes["FSM"].ReceivedPaymentType.filter((option) => option.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_${reasonDetails.code}`, + }; + }); +}; + +const getDssDashboard = (MdmsRes) => MdmsRes["dss-dashboard"]["dashboard-config"]; + +const GetRoleStatusMapping = (MdmsRes) => MdmsRes["DIGIT-UI"].RoleStatusMapping; +const GetCommonFields = (MdmsRes, moduleCode) => + moduleCode.toUpperCase() === "PROPERTYTAX" ? MdmsRes["PropertyTax"].CommonFieldsConfig : MdmsRes["FSM"].CommonFieldsConfig; + +const GetPreFields = (MdmsRes) => MdmsRes["FSM"].PreFieldsConfig; + +const GetPostFields = (MdmsRes) => MdmsRes["FSM"].PostFieldsConfig; + +const GetFSTPPlantInfo = (MdmsRes) => MdmsRes["FSM"].FSTPPlantInfo; + +const GetDocumentsTypes = (MdmsRes) => MdmsRes["BPA"].DocTypeMapping; + +const GetChecklist = (MdmsRes) => MdmsRes["BPA"].CheckList; + +const transformResponse = (type, MdmsRes, moduleCode, tenantId) => { + switch (type) { + case "citymodule": + return GetCitiesWithi18nKeys(MdmsRes, moduleCode); + case "egovLocation": + return GetEgovLocations(MdmsRes); + case "serviceDefs": + return GetServiceDefs(MdmsRes, moduleCode); + case "ApplicationChannel": + return GetApplicationChannel(MdmsRes); + case "SanitationType": + return GetSanitationType(MdmsRes); + case "PropertyType": + return GetPropertyType(MdmsRes); + case "PropertySubtype": + return GetPropertySubtype(MdmsRes); + case "PitType": + return GetPitType(MdmsRes); + case "VehicleType": + return GetVehicleType(MdmsRes); + case "VehicleMakeModel": + return GetVehicleMakeModel(MdmsRes); + case "Slum": + return GetSlumLocalityMapping(MdmsRes, tenantId); + case "OwnerShipCategory": + return GetPropertyOwnerShipCategory(MdmsRes); + case "TLOwnerShipCategory": + return GetTradeOwnerShipCategory(MdmsRes); + case "OwnerType": + return GetPropertyOwnerType(MdmsRes); + case "SubOwnerShipCategory": + return getSubPropertyOwnerShipCategory(MdmsRes); + case "Documents": + return getDocumentRequiredScreen(MdmsRes); + case "TLDocuments": + return getTLDocumentRequiredScreen(MdmsRes); + case "MapConfig": + return getMapConfig(MdmsRes); + case "UsageCategory": + return getUsageCategory(MdmsRes); + case "PTPropertyType": + return getPTPropertyType(MdmsRes); + case "StructureType": + return getTLStructureType(MdmsRes); + case "AccessoryCategory": + return getTLAccessoriesType(MdmsRes); + case "FinancialYear": + return getTLFinancialYear(MdmsRes); + case "Floor": + return getFloorList(MdmsRes); + case "Reason": + return GetReasonType(MdmsRes, type, moduleCode); + case "RoleStatusMapping": + return GetRoleStatusMapping(MdmsRes); + case "CommonFieldsConfig": + return GetCommonFields(MdmsRes, moduleCode); + case "PreFieldsConfig": + return GetPreFields(MdmsRes); + case "PostFieldsConfig": + return GetPostFields(MdmsRes); + case "RentalDeatils": + return getRentalDetailsCategory(MdmsRes); + case "ChargeSlabs": + return getChargeSlabsCategory(MdmsRes); + case "DssDashboard": + return getDssDashboard(MdmsRes); + case "BusinessService": + return GetMCollectBusinessService(MdmsRes); + case "applcatonStatus": + return GetMCollectApplicationStatus(MdmsRes); + case "FSTPPlantInfo": + return GetFSTPPlantInfo(MdmsRes); + case "GenderType": + return getGenderType(MdmsRes); + case "TLGendertype": + return TLGenderType(MdmsRes); + case "PTGenderType": + return PTGenderType(MdmsRes); + case "HRGenderType": + return HRGenderType(MdmsRes); + case "DocumentTypes": + return GetDocumentsTypes(MdmsRes); + case "CheckList": + return GetChecklist(MdmsRes); + case "FSMGenderType": + return getFSMGenderType(MdmsRes); + case "FSTPORejectionReason": + return GetFSTPORejectionReason(MdmsRes); + case "PaymentType": + return GetPaymentType(MdmsRes); + case "TripNumber": + return GetTripNumber(MdmsRes); + case "ReceivedPaymentType": + return GetReceivedPaymentType(MdmsRes); + default: + return MdmsRes; + } +}; + +const getCacheSetting = (moduleName) => { + return ApiCacheService.getSettingByServiceUrl(Urls.MDMSV2, moduleName); +}; + +const mergedData = {}; +const mergedPromises = {}; +const callAllPromises = (success, promises = [], resData) => { + promises.forEach((promise) => { + if (success) { + promise.resolve(resData); + } else { + promise.reject(resData); + } + }); +}; +const mergeMDMSData = (data, tenantId) => { + if (!mergedData[tenantId] || Object.keys(mergedData[tenantId]).length === 0) { + mergedData[tenantId] = data; + } else { + data.MdmsCriteria.moduleDetails.forEach((dataModuleDetails) => { + const moduleName = dataModuleDetails.moduleName; + const masterDetails = dataModuleDetails.masterDetails; + let found = false; + mergedData[tenantId].MdmsCriteria.moduleDetails.forEach((moduleDetail) => { + if (moduleDetail.moduleName === moduleName) { + found = true; + moduleDetail.masterDetails = [...moduleDetail.masterDetails, ...masterDetails]; + } + }); + if (!found) { + mergedData[tenantId].MdmsCriteria.moduleDetails.push(dataModuleDetails); + } + }); + } +}; +const debouncedCall = ({ serviceName, url, data, useCache, params }, resolve, reject) => { + if (!mergedPromises[params.tenantId] || mergedPromises[params.tenantId].length === 0) { + const cacheSetting = getCacheSetting(); + setTimeout(() => { + let callData = JSON.parse(JSON.stringify(mergedData[params.tenantId])); + mergedData[params.tenantId] = {}; + let callPromises = [...mergedPromises[params.tenantId]]; + mergedPromises[params.tenantId] = []; + ServiceRequest({ + serviceName, + url, + data: callData, + useCache, + params, + }) + .then((data) => { + callAllPromises(true, callPromises, data); + }) + .catch((err) => { + callAllPromises(false, callPromises, err); + }); + }, cacheSetting.debounceTimeInMS || 500); + } + mergeMDMSData(data, params.tenantId); + if (!mergedPromises[params.tenantId]) { + mergedPromises[params.tenantId] = []; + } + mergedPromises[params.tenantId].push({ resolve, reject }); +}; + +export const MdmsServiceV2 = { + init: (stateCode) => + ServiceRequest({ + serviceName: "mdmsInit", + url: Urls.MDMSV2, + data: initRequestBody(stateCode), + useCache: true, + params: { tenantId: stateCode }, + }), + call: (tenantId, details) => { + return new Promise((resolve, reject) => + debouncedCall( + { + serviceName: "mdmsCall", + url: Urls.MDMSV2, + data: getCriteria(tenantId, details), + useCache: true, + params: { tenantId }, + }, + resolve, + reject + ) + ); + }, + getDataByCriteria: async (tenantId, mdmsDetails, moduleCode) => { + const key = `MDMS.${tenantId}.${moduleCode}.${mdmsDetails.type}.${JSON.stringify(mdmsDetails.details)}`; + const inStoreValue = PersistantStorage.get(key); + if (inStoreValue) { + return inStoreValue; + } + const { MdmsRes } = await MdmsServiceV2.call(tenantId, mdmsDetails.details); + const responseValue = transformResponse(mdmsDetails.type, MdmsRes, moduleCode.toUpperCase(), tenantId); + const cacheSetting = getCacheSetting(mdmsDetails.details.moduleDetails[0].moduleName); + PersistantStorage.set(key, responseValue, cacheSetting.cacheTimeInSecs); + return responseValue; + }, + getServiceDefs: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getModuleServiceDefsCriteria(tenantId, moduleCode), moduleCode); + }, + getSanitationType: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getSanitationTypeCriteria(tenantId, moduleCode), moduleCode); + }, + getApplicationChannel: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getApplicationChannelCriteria(tenantId, moduleCode), moduleCode); + }, + getPropertyType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getPropertyTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPropertyUsage: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getPropertyUsageCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPropertySubtype: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getPropertyTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPitType: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getPitTypeCriteria(tenantId, moduleCode), moduleCode); + }, + getVehicleType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getVehicleTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getChecklist: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getChecklistCriteria(tenantId, moduleCode), moduleCode); + }, + getPaymentRules: (tenantId, filter) => { + return MdmsServiceV2.call(tenantId, getBillingServiceForBusinessServiceCriteria(filter)); + }, + + getCustomizationConfig: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getConfig(tenantId, moduleCode), moduleCode); + }, + getSlumLocalityMapping: (tenantId, moduleCode, type) => + MdmsServiceV2.getDataByCriteria(tenantId, getSlumLocalityCriteria(tenantId, moduleCode, type), moduleCode), + + getReason: (tenantId, moduleCode, type, payload) => + MdmsServiceV2.getDataByCriteria(tenantId, getReasonCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getRoleStatus: (tenantId, moduleCode, type) => + MdmsServiceV2.getDataByCriteria(tenantId, getRoleStatusCriteria(tenantId, moduleCode, type), moduleCode), + + getCommonFieldsConfig: (tenantId, moduleCode, type, payload) => + MdmsServiceV2.getDataByCriteria(tenantId, getCommonFieldsCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getPreFieldsConfig: (tenantId, moduleCode, type, payload) => + MdmsServiceV2.getDataByCriteria(tenantId, getPreFieldsCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getPostFieldsConfig: (tenantId, moduleCode, type, payload) => + MdmsServiceV2.getDataByCriteria(tenantId, getPostFieldsCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getPropertyOwnerShipCategory: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getPropertyOwnerShipCategoryCriteria(tenantId, moduleCode, type), moduleCode); + }, + + GetTradeOwnerShipCategory: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getTradeOwnerShipCategoryCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getPropertyOwnerType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getPropertyOwnerTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPropertySubOwnerShipCategory: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getSubPropertyOwnerShipCategoryCriteria(tenantId, moduleCode, type), moduleCode); + }, + getDocumentRequiredScreen: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getDocumentRequiredScreenCategory(tenantId, moduleCode), moduleCode); + }, + getTLDocumentRequiredScreen: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getDocumentRequiredScreenCategory(tenantId, moduleCode), moduleCode); + }, + getTradeUnitsData: (tenantId, moduleCode, type, filter) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getTradeUnitsDataList(tenantId, moduleCode, type, filter), moduleCode); + }, + getMapConfig: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getDefaultMapConfig(tenantId, moduleCode), moduleCode); + }, + getUsageCategory: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getUsageCategoryList(tenantId, moduleCode), moduleCode); + }, + getPTPropertyType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getPTPropertyTypeList(tenantId, moduleCode), moduleCode); + }, + getTLStructureType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getTLStructureTypeList(tenantId, moduleCode), moduleCode); + }, + getTLAccessoriesType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getTLAccessoriesTypeList(tenantId, moduleCode), moduleCode); + }, + getTLFinancialYear: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getTLFinancialYearList(tenantId, moduleCode), moduleCode); + }, + getFloorList: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getPTFloorList(tenantId, moduleCode, type), moduleCode); + }, + getRentalDetails: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getRentalDetailsCategoryCriteria(tenantId, moduleCode), moduleCode); + }, + getChargeSlabs: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getChargeSlabsCategoryCriteria(tenantId, moduleCode), moduleCode); + }, + getDssDashboard: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getDssDashboardCriteria(tenantId, moduleCode), moduleCode); + }, + getPaymentGateway: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getReceiptKey: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getReceiptKey(tenantId, moduleCode), moduleCode); + }, + getHelpText: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getMCollectBillingService: (tenantId, moduleCode, type, filter) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getMCollectBillingServiceCriteria(tenantId, moduleCode, type, filter), moduleCode); + }, + getMCollectApplcationStatus: (tenantId, moduleCode, type, filter) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getMCollectApplicationStatusCriteria(tenantId, moduleCode, type, filter), moduleCode); + }, + getHrmsEmployeeRolesandDesignation: (tenantId) => { + return MdmsServiceV2.call(tenantId, getHrmsEmployeeRolesandDesignations()); + }, + getHrmsEmployeeTypes: (tenantId, moduleCode, type, filter) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getHrmsEmployeeReason: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getMultipleTypes: (tenantId, moduleCode, types) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getMultipleTypes(tenantId, moduleCode, types), moduleCode); + }, + getMultipleTypesWithFilter: (tenantId, moduleCode, types) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getMultipleTypesWithFilter(moduleCode, types), moduleCode); + }, + getFSTPPlantInfo: (tenantId, moduleCode, types) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getFSTPPlantCriteria(tenantId, moduleCode, types), moduleCode); + }, + getCancelReceiptReason: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getCancelReceiptReason(tenantId, moduleCode), moduleCode); + }, + getReceiptStatus: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getReceiptStatus(tenantId, moduleCode), moduleCode); + }, + getCancelReceiptReasonAndStatus: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getCancelReceiptReasonAndStatus(tenantId, moduleCode), moduleCode); + }, + + getGenderType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + TLGenderType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + PTGenderType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + HRGenderType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + getDocumentTypes: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getDocumentTypesCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getTradeTypeRoleTypes: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getTradeTypeRoleCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getFSMGenderType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + getFSTPORejectionReason: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getFSTPORejectionReasonCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getFSMPaymentType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getFSMPaymentTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getBillsGenieKey: (tenantId, moduleCode) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getBillsGenieKey(tenantId, moduleCode), moduleCode); + }, + + getFSMTripNumber: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getFSMTripNumberCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getFSMReceivedPaymentType: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getFSMReceivedPaymentTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getWSTaxHeadMaster: (tenantId, moduleCode, type) => { + return MdmsServiceV2.getDataByCriteria(tenantId, getWSTaxHeadMasterCritera(tenantId, moduleCode, type), moduleCode); + }, + + getMeterStatusType: (tenantId) => { + return MdmsServiceV2.call(tenantId, getMeterStatusTypeList(tenantId)); + }, + + getBillingPeriod: (tenantId) => { + return MdmsServiceV2.call(tenantId, getBillingPeriodValidation(tenantId)); + }, + getHowItWorksJSONData: (tenantId) => { + return MdmsServiceV2.call(tenantId, getHowItWorksJSON(tenantId)); + }, + getFAQsJSONData: (tenantId) => { + return MdmsServiceV2.call(tenantId, getFAQsJSON(tenantId)); + }, + getDSSFAQsJSONData: (tenantId) => { + return MdmsServiceV2.call(tenantId, getDSSFAQsJSON(tenantId)); + }, + + getDSSAboutJSONData: (tenantId) => { + return MdmsServiceV2.call(tenantId, getDSSAboutJSON(tenantId)); + }, + getStaticDataJSON: (tenantId) => { + return MdmsServiceV2.call(tenantId, getStaticData()); + } +}; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Surveys.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Surveys.js index e887d760cf8..eb44942a777 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Surveys.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Surveys.js @@ -51,11 +51,59 @@ export const Surveys = { showResults: (details) => Request({ url: Urls.engagement.surveys.showResults, - // data: details, + // data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + params: { surveyId: details.surveyId } + }), + createSurvey: (details) => + Request({ + url: Urls.engagement.surveys.createSurvey, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + locale: true + }), + cfdefinitionsearch: (filters = {}) => + Request({ + url: Urls.engagement.surveys.cfdefinitionsearch, + useCache: false, + method: "POST", + auth: false, + userService: false, + params: {}, + data: filters + }), + submitSurveyResponse: (details) => + Request({ + url: Urls.engagement.surveys.submitSurveyResponse, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + }), + selectedSurveySearch: (filters = {}) => + Request({ + url: Urls.engagement.surveys.selectedSurveySearch, + useCache: false, + method: "POST", + auth: false, + userService: false, + params: {}, + data: filters + }), + updateSurvey: (details) => + Request({ + url: Urls.engagement.surveys.updateSurvey, + data: details, useCache: true, userService: true, method: "POST", auth: true, - params:{surveyId:details.surveyId} }), }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/WorkFlow.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/WorkFlow.js index 7f8114927f8..eb5801464d2 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/WorkFlow.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/WorkFlow.js @@ -1,22 +1,23 @@ import Urls from "../atoms/urls"; import { Request } from "../atoms/Utils/Request"; import cloneDeep from "lodash/cloneDeep"; +import { PaymentService } from "./Payment"; const getThumbnails = async (ids, tenantId, documents = []) => { tenantId = window.location.href.includes("/obps/") || window.location.href.includes("/pt/") ? Digit.ULBService.getStateId() : tenantId; - + if (window.location.href.includes("/obps/")) { if (documents?.length > 0) { let workflowsDocs = []; - documents?.map(doc => { + documents?.map((doc) => { if (doc?.url) { - const thumbs = doc?.url?.split(",")?.[3] || doc?.url?.split(",")?.[0] + const thumbs = doc?.url?.split(",")?.[3] || doc?.url?.split(",")?.[0]; workflowsDocs.push({ thumbs: [thumbs], - images: [Digit.Utils.getFileUrl(doc.url)] - }) + images: [Digit.Utils.getFileUrl(doc.url)], + }); } - }) + }); return workflowsDocs?.[0]; } else { return null; @@ -24,9 +25,10 @@ const getThumbnails = async (ids, tenantId, documents = []) => { } else { const res = await Digit.UploadServices.Filefetch(ids, tenantId); if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) { - return { - thumbs: res.data.fileStoreIds.map((o) => o.url.split(",")[3] || o.url.split(",")[0]), - images: res.data.fileStoreIds.map((o) => Digit.Utils.getFileUrl(o.url)) }; + return { + thumbs: res.data.fileStoreIds.map((o) => o.url.split(",")[3] || o.url.split(",")[0]), + images: res.data.fileStoreIds.map((o) => Digit.Utils.getFileUrl(o.url)), + }; } else { return null; } @@ -40,53 +42,63 @@ const makeCommentsSubsidariesOfPreviousActions = async (wf) => { let res = {}; if (window.location.href.includes("/obps/")) { - wf?.map(wfData => { - wfData?.documents?.map(wfDoc => { + wf?.map((wfData) => { + wfData?.documents?.map((wfDoc) => { if (wfDoc?.fileStoreId) fileStoreIdsList.push(wfDoc?.fileStoreId); - }) - }) + }); + }); if (fileStoreIdsList?.length > 0) { res = await Digit.UploadServices.Filefetch(fileStoreIdsList, tenantId); } - wf?.forEach(wfData => { - wfData?.documents?.forEach(wfDoc => { + wf?.forEach((wfData) => { + wfData?.documents?.forEach((wfDoc) => { if (wfDoc?.fileStoreId) wfDoc.url = res.data[wfDoc?.fileStoreId]; - }) + }); }); } for (const eventHappened of wf) { if (eventHappened?.documents) { - eventHappened.thumbnailsToShow = await getThumbnails(eventHappened?.documents?.map(e => e?.fileStoreId), eventHappened?.tenantId, eventHappened?.documents) + eventHappened.thumbnailsToShow = await getThumbnails( + eventHappened?.documents?.map((e) => e?.fileStoreId), + eventHappened?.tenantId, + eventHappened?.documents + ); } if (eventHappened.action === "COMMENT") { - const commentAccumulator = TimelineMap.get("tlCommentStack") || [] - TimelineMap.set("tlCommentStack", [...commentAccumulator, eventHappened]) - } - else { - const eventAccumulator = TimelineMap.get("tlActions") || [] - const commentAccumulator = TimelineMap.get("tlCommentStack") || [] - eventHappened.wfComments = [...commentAccumulator, ...eventHappened.comment ? [eventHappened] : []] - TimelineMap.set("tlActions", [...eventAccumulator, eventHappened]) - TimelineMap.delete("tlCommentStack") + const commentAccumulator = TimelineMap.get("tlCommentStack") || []; + TimelineMap.set("tlCommentStack", [...commentAccumulator, eventHappened]); + } else { + const eventAccumulator = TimelineMap.get("tlActions") || []; + const commentAccumulator = TimelineMap.get("tlCommentStack") || []; + eventHappened.wfComments = [...commentAccumulator, ...(eventHappened.comment ? [eventHappened] : [])]; + TimelineMap.set("tlActions", [...eventAccumulator, eventHappened]); + TimelineMap.delete("tlCommentStack"); } } - const response = TimelineMap.get("tlActions") - return response -} + const response = TimelineMap.get("tlActions"); + return response; +}; const getAssignerDetails = (instance, nextStep, moduleCode) => { - let assigner = instance?.assigner - if (moduleCode === "FSM" || moduleCode === "FSM_POST_PAY_SERVICE" || moduleCode === "FSM_ADVANCE_PAY_SERVICE" || moduleCode === "FSM_ADVANCE_PAY_SERVICE_V1"|| moduleCode === "PAY_LATER_SERVICE" || moduleCode === "FSM_ZERO_PAY_SERVICE") { + let assigner = instance?.assigner; + if ( + moduleCode === "FSM" || + moduleCode === "FSM_POST_PAY_SERVICE" || + moduleCode === "FSM_ADVANCE_PAY_SERVICE" || + moduleCode === "FSM_ADVANCE_PAY_SERVICE_V1" || + moduleCode === "PAY_LATER_SERVICE" || + moduleCode === "FSM_ZERO_PAY_SERVICE" + ) { if (instance.state.applicationStatus === "CREATED") { - assigner = instance?.assigner + assigner = instance?.assigner; } else { - assigner = nextStep?.assigner || instance?.assigner + assigner = nextStep?.assigner || instance?.assigner; } } else { - assigner = instance?.assigner + assigner = instance?.assigner; } - return assigner -} + return assigner; +}; export const WorkflowService = { init: (stateCode, businessServices) => { @@ -110,7 +122,7 @@ export const WorkflowService = { }, getDetailsById: async ({ tenantId, id, moduleCode, role, getTripData }) => { - const workflow = await Digit.WorkflowService.getByBusinessId(tenantId, id); + const workflow = await Digit.WorkflowService.getByBusinessId(tenantId, id); const applicationProcessInstance = cloneDeep(workflow?.ProcessInstances); const getLocationDetails = window.location.href.includes("/obps/") || window.location.href.includes("noc/inbox"); const moduleCodeData = getLocationDetails ? applicationProcessInstance?.[0]?.businessService : moduleCode; @@ -125,7 +137,18 @@ export const WorkflowService = { /* To check state is updatable and provide edit option*/ const currentState = businessServiceResponse?.find((state) => state.uuid === processInstances[0]?.state.uuid); if (currentState && currentState?.isStateUpdatable) { - if (moduleCode === "FSM" || moduleCode === "FSM_POST_PAY_SERVICE" || moduleCode === "FSM_ADVANCE_PAY_SERVICE" || moduleCode === "FSM_ADVANCE_PAY_SERVICE_V1" || moduleCode === "FSM_ZERO_PAY_SERVICE" || moduleCode === "PAY_LATER_SERVICE" || moduleCode === "FSM_VEHICLE_TRIP" || moduleCode === "PGR" || moduleCode === "OBPS") null; + if ( + moduleCode === "FSM" || + moduleCode === "FSM_POST_PAY_SERVICE" || + moduleCode === "FSM_ADVANCE_PAY_SERVICE" || + moduleCode === "FSM_ADVANCE_PAY_SERVICE_V1" || + moduleCode === "FSM_ZERO_PAY_SERVICE" || + moduleCode === "PAY_LATER_SERVICE" || + moduleCode === "FSM_VEHICLE_TRIP" || + moduleCode === "PGR" || + moduleCode === "OBPS" + ) + null; else nextActions.push({ action: "EDIT", state: currentState }); } @@ -145,10 +168,12 @@ export const WorkflowService = { })?.[0]; // HANDLING ACTION for NEW VEHICLE LOG FROM UI SIDE - const action_newVehicle = [{ - "action": "READY_FOR_DISPOSAL", - "roles": "FSM_EMP_FSTPO,FSM_EMP_FSTPO" - }] + const action_newVehicle = [ + { + action: "READY_FOR_DISPOSAL", + roles: "FSM_EMP_FSTPO,FSM_EMP_FSTPO", + }, + ]; // const actionRolePair = nextActions?.map((action) => ({ // action: action?.action, @@ -156,15 +181,15 @@ export const WorkflowService = { // })); if (processInstances.length > 0) { - const TLEnrichedWithWorflowData = await makeCommentsSubsidariesOfPreviousActions(processInstances) + const TLEnrichedWithWorflowData = await makeCommentsSubsidariesOfPreviousActions(processInstances); let timeline = TLEnrichedWithWorflowData.map((instance, ind) => { let checkPoint = { performedAction: instance.action, - status: moduleCode === "WS.AMENDMENT" || moduleCode === "SW.AMENDMENT" ? instance.state.state :instance.state.applicationStatus, + status: moduleCode === "WS.AMENDMENT" || moduleCode === "SW.AMENDMENT" ? instance.state.state : instance.state.applicationStatus, state: instance.state.state, assigner: getAssignerDetails(instance, TLEnrichedWithWorflowData[ind - 1], moduleCode), rating: instance?.rating, - wfComment: instance?.wfComments.map(e => e?.comment), + wfComment: instance?.wfComments.map((e) => e?.comment), wfDocuments: instance?.documents, thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, assignes: instance.assignes, @@ -179,101 +204,130 @@ export const WorkflowService = { }; return checkPoint; }); - if (getTripData) { try { const filters = { - businessService: 'FSM_VEHICLE_TRIP', - refernceNos: id + businessService: "FSM_VEHICLE_TRIP", + refernceNos: id, }; - const tripSearchResp = await Digit.FSMService.vehicleSearch(tenantId, filters) + const tripSearchResp = await Digit.FSMService.vehicleSearch(tenantId, filters); if (tripSearchResp && tripSearchResp.vehicleTrip && tripSearchResp.vehicleTrip.length) { - const numberOfTrips = tripSearchResp.vehicleTrip.length - let cretaedTime = 0 - let lastModifiedTime = 0 - let waitingForDisposedCount = 0 - let disposedCount = 0 - let waitingForDisposedAction = [] - let disposedAction = [] + const numberOfTrips = tripSearchResp.vehicleTrip.length; + let cretaedTime = 0; + let lastModifiedTime = 0; + let waitingForDisposedCount = 0; + let disposedCount = 0; + let waitingForDisposedAction = []; + let disposedAction = []; for (const data of tripSearchResp.vehicleTrip) { - const resp = await Digit.WorkflowService.getByBusinessId(tenantId, data.applicationNo) + const resp = await Digit.WorkflowService.getByBusinessId(tenantId, data.applicationNo); resp?.ProcessInstances?.map((instance, ind) => { if (instance.state.applicationStatus === "WAITING_FOR_DISPOSAL") { - waitingForDisposedCount++ - cretaedTime = Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime) - lastModifiedTime = Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime) - waitingForDisposedAction = [{ - performedAction: instance.action, - status: instance.state.applicationStatus, - state: instance.state.state, - assigner: instance?.assigner, - rating: instance?.rating, - thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, - assignes: instance.assignes, - caption: instance.assignes ? instance.assignes.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) : null, - auditDetails: { - created: cretaedTime, - lastModified: lastModifiedTime, + waitingForDisposedCount++; + cretaedTime = Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime); + lastModifiedTime = Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime); + waitingForDisposedAction = [ + { + performedAction: instance.action, + status: instance.state.applicationStatus, + state: instance.state.state, + assigner: instance?.assigner, + rating: instance?.rating, + thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, + assignes: instance.assignes, + caption: instance.assignes + ? instance.assignes.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) + : null, + auditDetails: { + created: cretaedTime, + lastModified: lastModifiedTime, + }, + numberOfTrips: numberOfTrips, }, - numberOfTrips: numberOfTrips - }] + ]; } if (instance.state.applicationStatus === "DISPOSED") { - disposedCount++ - cretaedTime = instance.auditDetails.createdTime > cretaedTime ? Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime) : cretaedTime - lastModifiedTime = instance.auditDetails.lastModifiedTime > lastModifiedTime ? Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime) : lastModifiedTime - disposedAction = [{ - performedAction: instance.action, - status: instance.state.applicationStatus, - state: instance.state.state, - assigner: instance?.assigner, - rating: instance?.rating, - thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, - assignes: instance.assignes, - caption: instance.assignes ? instance.assignes.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) : null, - auditDetails: { - created: cretaedTime, - lastModified: lastModifiedTime, + disposedCount++; + cretaedTime = + instance.auditDetails.createdTime > cretaedTime + ? Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime) + : cretaedTime; + lastModifiedTime = + instance.auditDetails.lastModifiedTime > lastModifiedTime + ? Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime) + : lastModifiedTime; + disposedAction = [ + { + performedAction: instance.action, + status: instance.state.applicationStatus, + state: instance.state.state, + assigner: instance?.assigner, + rating: instance?.rating, + thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, + assignes: instance.assignes, + caption: instance.assignes + ? instance.assignes.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) + : null, + auditDetails: { + created: cretaedTime, + lastModified: lastModifiedTime, + }, + numberOfTrips: disposedCount, }, - numberOfTrips: disposedCount - }] + ]; } - }) + }); } - let tripTimeline = [] - const disposalInProgressPosition = timeline.findIndex((data) => data.status === "DISPOSAL_IN_PROGRESS") + let tripTimeline = []; + const disposalInProgressPosition = timeline.findIndex((data) => data.status === "DISPOSAL_IN_PROGRESS"); if (disposalInProgressPosition !== -1) { - timeline[disposalInProgressPosition].numberOfTrips = numberOfTrips - timeline.splice(disposalInProgressPosition + 1, 0, ...waitingForDisposedAction) - tripTimeline = disposedAction + timeline[disposalInProgressPosition].numberOfTrips = numberOfTrips; + timeline.splice(disposalInProgressPosition + 1, 0, ...waitingForDisposedAction); + tripTimeline = disposedAction; } else { - tripTimeline = disposedAction.concat(waitingForDisposedAction) + tripTimeline = disposedAction.concat(waitingForDisposedAction); } - const feedbackPosition = timeline.findIndex((data) => data.status === "CITIZEN_FEEDBACK_PENDING") + const feedbackPosition = timeline.findIndex((data) => data.status === "CITIZEN_FEEDBACK_PENDING"); if (feedbackPosition !== -1) { - timeline.splice(feedbackPosition + 1, 0, ...tripTimeline) + timeline.splice(feedbackPosition + 1, 0, ...tripTimeline); } else { - timeline = tripTimeline.concat(timeline) + timeline = tripTimeline.concat(timeline); } } - } catch (err) { } + } catch (err) {} } - //Added the condition so that following filter can happen only for fsm and does not affect other module - let nextStep = []; - if(window.location.href?.includes("fsm")){ - // TAKING OUT CURRENT APPL STATUS - const actionRolePair = nextActions?.map((action) => ({ - action: action?.action, - roles: action.state?.actions?.map((action) => action.roles).join(","), - })); - nextStep = location.pathname.includes("new-vehicle-entry") ? action_newVehicle : location.pathname.includes("dso") ? actionRolePair.filter((i)=> i.action !== "PAY") : actionRolePair; - } + //Added the condition so that following filter can happen only for fsm and does not affect other module + let nextStep = []; + if (window.location.href?.includes("fsm")) { + // Cheking whether amount fully paid or not + var isAmountDue = false; + if (window.location.href.includes("application-details")) { + const filters = { + businessService: "FSM.TRIP_CHARGES", + consumerCode: id, + }; + const fetchBill = await PaymentService.fetchBill(tenantId, filters); + isAmountDue = fetchBill?.Bill && fetchBill?.Bill.length > 0 && fetchBill?.Bill[0]?.billDetails[0]?.amount > 0; + } + // TAKING OUT CURRENT APPL STATUS + const actionRolePair = nextActions?.map((action) => ({ + action: action?.action, + roles: action.state?.actions?.map((action) => action.roles).join(","), + })); + nextStep = location.pathname.includes("new-vehicle-entry") + ? action_newVehicle + : location.pathname.includes("dso") + ? actionRolePair.filter((i) => i.action !== "PAY") + : actionRolePair; + const tempCheckStatus = timeline.map((i) => i.status)[0]; + nextStep = tempCheckStatus.includes("WAITING_FOR_DISPOSAL") && !isAmountDue ? nextStep?.filter((i) => i.action !== "PAY") : nextStep; + } if (role !== "CITIZEN" && moduleCode === "PGR") { - const onlyPendingForAssignmentStatusArray = timeline?.filter(e => e?.status === "PENDINGFORASSIGNMENT") - const duplicateCheckpointOfPendingForAssignment = onlyPendingForAssignmentStatusArray.at(-1) + const onlyPendingForAssignmentStatusArray = timeline?.filter((e) => e?.status === "PENDINGFORASSIGNMENT"); + const duplicateCheckpointOfPendingForAssignment = onlyPendingForAssignmentStatusArray.at(-1); // const duplicateCheckpointOfPendingForAssignment = timeline?.find( e => e?.status === "PENDINGFORASSIGNMENT") timeline.push({ ...duplicateCheckpointOfPendingForAssignment, @@ -281,14 +335,22 @@ export const WorkflowService = { }); } - if (timeline[timeline.length - 1].status !== "CREATED" && (moduleCode === "FSM" || moduleCode === "FSM_POST_PAY_SERVICE" || moduleCode==="FSM_ADVANCE_PAY_SERVICE" || moduleCode==="FSM_ADVANCE_PAY_SERVICE_V1"|| moduleCode==="FSM_ZERO_PAY_SERVICE" || moduleCode==="PAY_LATER_SERVICE" )) + if ( + timeline[timeline.length - 1].status !== "CREATED" && + (moduleCode === "FSM" || + moduleCode === "FSM_POST_PAY_SERVICE" || + moduleCode === "FSM_ADVANCE_PAY_SERVICE" || + moduleCode === "FSM_ADVANCE_PAY_SERVICE_V1" || + moduleCode === "FSM_ZERO_PAY_SERVICE" || + moduleCode === "PAY_LATER_SERVICE") + ) timeline.push({ status: "CREATED", }); const details = { timeline, - nextActions : window.location.href?.includes("fsm") ? nextStep : nextActions, + nextActions: window.location.href?.includes("fsm") ? nextStep : nextActions, actionState, applicationBusinessService: workflow?.ProcessInstances?.[0]?.businessService, processInstances: applicationProcessInstance, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/DsoDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/DsoDetails.js index ea05354ae4d..0556fa5523b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/DsoDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/DsoDetails.js @@ -80,7 +80,7 @@ const DsoDetails = async (tenantId, filters = {}) => { const data = dsoDetails.vendor.map((dso) => ({ displayName: dso.name + (dso.owner?.name ? ` - ${dso.owner?.name}` : ""), mobileNumber: dso.owner?.mobileNumber, - name: dso.name, + name: dso.owner?.name, username: dso.owner?.userName, ownerId: dso.ownerId, id: dso.id, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/Search.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/Search.js index 1d590055347..92d456221d1 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/Search.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/Search.js @@ -48,6 +48,7 @@ export const Search = { let dsoDetails = {}; let vehicle = {}; const response = await Search.application(tenantId, filter); + const additionalDetails = response?.address?.additionalDetails; let receivedPayment = response?.additionalDetails?.receivedPayment; if (response?.dsoId) { const dsoFilters = { ids: response.dsoId, vehicleIds: response?.vehicleId }; @@ -83,17 +84,31 @@ export const Search = { const vehicleMake = _vehicle?.i18nKey; const vehicleCapacity = _vehicle?.capacity; + var amountPerTrip = ""; + var totalAmount = ""; const demandDetails = await PaymentService.demandSearch(tenantId, applicationNos, "FSM.TRIP_CHARGES"); - const amountPerTrip = - response?.additionalDetails && response?.additionalDetails.tripAmount - ? response.additionalDetails.tripAmount - : demandDetails?.Demands[0]?.demandDetails[0]?.taxAmount || "N/A"; + if (additionalDetails?.boundaryType === "Village" || additionalDetails?.boundaryType === "GP") { + amountPerTrip = response?.additionalDetails && response?.additionalDetails?.tripAmount ? response?.additionalDetails?.tripAmount : "N/A"; + totalAmount = response?.additionalDetails?.tripAmount ? response?.additionalDetails?.tripAmount * response?.noOfTrips : "N/A"; + } else { + amountPerTrip = + response?.additionalDetails && response?.additionalDetails?.tripAmount + ? response?.additionalDetails?.tripAmount + : demandDetails?.Demands[0]?.demandDetails[0]?.taxAmount || "N/A"; + // const totalAmount = response?.noOfTrips === 0 || amountPerTrip === "N/A" ? "N/A" : response?.noOfTrips * Number(amountPerTrip); + totalAmount = demandDetails?.Demands[0]?.demandDetails?.map((detail) => detail?.taxAmount)?.reduce((a, b) => a + b) || "N/A"; + } const propertyID= response.additionalDetails.propertyID || "N/A"; - //const roadWidth=response.additionalDetails.roadWidth || "N/A"; - - // const totalAmount = response?.noOfTrips === 0 || amountPerTrip === "N/A" ? "N/A" : response?.noOfTrips * Number(amountPerTrip); - const totalAmount = demandDetails?.Demands[0]?.demandDetails?.map((detail) => detail?.taxAmount)?.reduce((a, b) => a + b) || "N/A"; + var balancePaid = demandDetails?.Demands[0]?.demandDetails?.map((detail) => detail?.collectionAmount)?.reduce((a, b) => a + b) || "N/A"; + balancePaid = balancePaid - response?.advanceAmount; + const isFullPaymentDone = + demandDetails?.Demands[0]?.demandDetails[0]?.taxAmount === demandDetails?.Demands[0]?.demandDetails[0]?.collectionAmount; + const isPaymentDone = + demandDetails?.Demands[0]?.demandDetails.length > 1 + ? demandDetails?.Demands[0]?.demandDetails[demandDetails?.Demands[0]?.demandDetails.length - 1]?.collectionAmount > 0 + : demandDetails?.Demands[0]?.demandDetails[0]?.collectionAmount > 0; + const employeeResponse = [ { title: "ES_TITLE_APPLICATION_DETAILS", @@ -124,10 +139,32 @@ export const Search = { { title: "ES_APPLICATION_DETAILS_LOCATION_DETAILS", values: [ - { - title: "ES_APPLICATION_DETAILS_LOCATION_LOCALITY", - value: `${response?.tenantId?.toUpperCase()?.split(".")?.join("_")}_REVENUE_${response?.address?.locality?.code}`, - }, + additionalDetails?.boundaryType === "Locality" + ? { + title: "ES_APPLICATION_DETAILS_LOCATION_LOCALITY", + value: response?.address?.locality?.code + ? t(`${response?.tenantId?.toUpperCase()?.split(".")?.join("_")}_REVENUE_${response?.address?.locality?.code}`) + : "N/A", + } + : null, + additionalDetails?.boundaryType === "GP" + ? { + title: t("CS_GRAM_PANCHAYAT"), + value: additionalDetails?.gramPanchayat?.code + ? t(`${response?.tenantId?.toUpperCase().split(".").join("_")}_REVENUE_${additionalDetails?.gramPanchayat?.code}`) + : "N/A", + } + : null, + additionalDetails?.boundaryType === "GP" + ? { + title: t("CS_VILLAGE_NAME"), + value: additionalDetails?.village?.code + ? t(`${response?.tenantId?.toUpperCase().split(".").join("_")}_REVENUE_${additionalDetails?.village?.code}`) + : additionalDetails?.village + ? additionalDetails?.village + : "N/A", + } + : null, { title: "ES_APPLICATION_DETAILS_LOCATION_CITY", value: response?.address?.city }, { title: "ES_APPLICATION_DETAILS_LOCATION_PINCODE", value: response?.address?.pincode }, { title: "PT_PROPERTY_ADDRESS_STREET_NAME", value: response?.address?.street }, @@ -180,22 +217,36 @@ export const Search = { // title: t("ES_NEW_APPLICATION_DISTANCE_FROM_ROAD"), // value: response?.pitDetail?.distanceFromRoad, // }, + ], + }, + { + title: "ES_APPLICATION_DETAILS_TRIPS_AND_AMOUNT_DETAILS", + values: [ { title: "ES_APPLICATION_DETAILS_PAYMENT_NO_OF_TRIPS", value: response?.noOfTrips === 0 ? "N/A" : response?.noOfTrips }, { title: "ES_APPLICATION_DETAILS_AMOUNT_PER_TRIP", - value: amountPerTrip === "N/A" ? "N/A" : "₹ " + amountPerTrip, + value: amountPerTrip === "N/A" || amountPerTrip === "null" ? "N/A" : "₹ " + amountPerTrip, }, { title: "ES_PAYMENT_DETAILS_TOTAL_AMOUNT", - value: totalAmount === "N/A" ? (amountPerTrip === "N/A" ? "N/A" : "₹ " + response?.noOfTrips * amountPerTrip) : "₹ " + totalAmount, + value: + totalAmount === "N/A" || totalAmount === NaN + ? amountPerTrip === "N/A" || amountPerTrip === "null" + ? "N/A" + : "₹ " + response?.noOfTrips * amountPerTrip + : "₹ " + totalAmount, + }, + { title: "ES_PAYMENT_DETAILS_ADV_AMOUNT_PAID", value: !isPaymentDone ? "N/A" : "₹ " + response?.advanceAmount }, + { + title: "ES_PAYMENT_DETAILS_BLS_AMOUNT_PAID", + value: !isPaymentDone ? "N/A" : "₹ " + balancePaid, }, - { title: "ES_PAYMENT_DETAILS_ADV_AMOUNT", value: response?.advanceAmount === null ? "N/A" : "₹ " + response?.advanceAmount }, ], }, { title: "ES_APPLICATION_DETAILS_DSO_DETAILS", values: [ - { title: "ES_APPLICATION_DETAILS_ASSIGNED_DSO", value: dsoDetails?.displayName || "N/A" }, + { title: "ES_APPLICATION_DETAILS_ASSIGNED_DSO", value: dsoDetails?.name || "N/A" }, // { title: "ES_APPLICATION_DETAILS_VEHICLE_MAKE", value: vehicleMake || "N/A" }, { title: "ES_APPLICATION_DETAILS_VEHICLE_NO", value: vehicle?.registrationNumber || "N/A" }, { title: "ES_APPLICATION_DETAILS_VEHICLE_CAPACITY", value: response?.vehicleCapacity || "N/A" }, @@ -219,6 +270,7 @@ export const Search = { applicationDetails: employeeResponse, additionalDetails: response?.additionalDetails, totalAmount: totalAmount, + isFullPaymentDone: isFullPaymentDone, }; const citizenResp = employeeResponse.reduce((arr, curr) => { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/VehicleDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/VehicleDetails.js index 64ee144f5cc..e5c73bcbbeb 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/VehicleDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/FSM/VehicleDetails.js @@ -3,27 +3,44 @@ import { FSMService } from "../../elements/FSM"; const getResponse = (data, vendorDetails) => { let details = [ { - title: 'ES_FSM_REGISTRY_DETAILS_VEHICLE_DETAILS', + title: "ES_FSM_REGISTRY_DETAILS_VEHICLE_DETAILS", values: [ { title: "ES_FSM_REGISTRY_VEHICLE_NUMBER", value: data?.registrationNumber }, { title: "ES_FSM_REGISTRY_VEHICLE_TYPE", value: `COMMON_MASTER_VEHICLE_${data?.type}` }, { title: "ES_FSM_REGISTRY_VEHICLE_MODEL", value: data?.model }, { title: "ES_FSM_REGISTRY_VEHICLE_CAPACITY", value: data?.tankCapacity }, - { title: "ES_FSM_REGISTRY_VEHICLE_POLLUTION_CERT", value: data?.pollutionCertiValidTill && Digit.DateUtils.ConvertEpochToDate(data?.pollutionCertiValidTill) }, - { title: "ES_FSM_REGISTRY_VEHICLE_ROAD_TAX", value: data?.roadTaxPaidTill && Digit.DateUtils.ConvertEpochToDate(data?.roadTaxPaidTill) }, - { title: "ES_FSM_REGISTRY_VEHICLE_INSURANCE", value: data?.InsuranceCertValidTill && Digit.DateUtils.ConvertEpochToDate(data?.InsuranceCertValidTill) }, + { + title: "ES_FSM_REGISTRY_VEHICLE_POLLUTION_CERT", + value: data?.pollutionCertiValidTill > 0 ? Digit.DateUtils.ConvertEpochToDate(data?.pollutionCertiValidTill) : "N/A", + }, + { + title: "ES_FSM_REGISTRY_VEHICLE_ROAD_TAX", + value: data?.roadTaxPaidTill > 0 ? Digit.DateUtils.ConvertEpochToDate(data?.roadTaxPaidTill) : "N/A", + }, + { + title: "ES_FSM_REGISTRY_VEHICLE_INSURANCE", + value: data?.InsuranceCertValidTill > 0 ? Digit.DateUtils.ConvertEpochToDate(data?.InsuranceCertValidTill) : "N/A", + }, + { + title: "ES_FSM_REGISTRY_VEHICLE_FITNESS", + value: data?.fitnessValidTill > 0 ? Digit.DateUtils.ConvertEpochToDate(data?.fitnessValidTill) : "N/A", + }, { title: "ES_FSM_REGISTRY_VEHICLE_STATUS", value: data.status }, { title: "ES_FSM_REGISTRY_VEHICLE_ADDITIONAL_DETAILS", value: data?.additionalDetails?.description }, - { title: "ES_FSM_REGISTRY_DETAILS_VENDOR_NAME", value: vendorDetails?.vendor?.[0]?.name || "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR", type: "custom" }, + { + title: "ES_FSM_REGISTRY_DETAILS_VENDOR_NAME", + value: vendorDetails?.vendor?.[0]?.name || "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR", + type: "custom", + }, ], - } + }, ]; - return details -} + return details; +}; const VehicleDetails = async (tenantId, filters = {}) => { const vehicleDetails = await FSMService.vehiclesSearch(tenantId, filters); - const id = vehicleDetails?.vehicle?.[0]?.id + const id = vehicleDetails?.vehicle?.[0]?.id; const vendorDetails = await FSMService.vendorSearch(tenantId, { vehicleIds: id }); const data = vehicleDetails.vehicle.map((data) => ({ diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ServiceDefinitions.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ServiceDefinitions.js index 17c076705d8..dc9d966a9e4 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ServiceDefinitions.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ServiceDefinitions.js @@ -1,4 +1,4 @@ -import { MdmsService } from "../elements/MDMS"; +import { MdmsServiceV2 } from "../elements/MDMSV2"; import { Storage } from "../atoms/Utils/Storage"; export const GetServiceDefinitions = { @@ -20,7 +20,7 @@ export const GetServiceDefinitions = { }, }; - const serviceDefs = await MdmsService.getDataByCriteria(tenantId, criteria, "PGR"); + const serviceDefs = await MdmsServiceV2.getDataByCriteria(tenantId, criteria, "PGR"); Storage.set("serviceDefinitions", serviceDefs); return serviceDefs; }, @@ -54,4 +54,4 @@ export const GetServiceDefinitions = { name: t("SERVICEDEFS." + id.serviceCode.toUpperCase()), })); }, -}; +}; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/getLocalities.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/getLocalities.js index 84c713e4e48..9db148f5143 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/getLocalities.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/getLocalities.js @@ -10,4 +10,8 @@ export const getLocalities = { await StoreService.defaultData(tenant, tenant, Digit.StoreData.getCurrentLanguage()); return (await LocationService.getRevenueLocalities(tenant)).TenantBoundary[0]; }, + grampanchayats: async (tenant) => { + await StoreService.defaultData(tenant, tenant, Digit.StoreData.getCurrentLanguage()); + return (await LocationService.getGramPanchayats(tenant)).TenantBoundary[0]; + }, }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/index.js index 3a8dacfb849..1fc692d1687 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/index.js @@ -19,7 +19,7 @@ const amountFormatter = (value, denomination, t) => { } }; -export const formatter = (value, symbol, unit, commaSeparated = true, t, isDecimal) => { +export const formatter = (value, symbol, unit, commaSeparated = true, t) => { if (!value && value !== 0) return ""; switch (symbol) { case "amount": @@ -31,8 +31,6 @@ export const formatter = (value, symbol, unit, commaSeparated = true, t, isDecim if (!commaSeparated) { return parseInt(value); } - if(isDecimal) - return value; const Nformatter = new Intl.NumberFormat("en-IN"); return Nformatter.format(Math.round(value)); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js index c78aca0b09a..4a7119ef33a 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js @@ -88,6 +88,13 @@ const getUnique = (arr) => { return arr.filter((value, index, self) => self.indexOf(value) === index); }; +/* +Digit.Utils.createFunction() +get function from a string */ +const createFunction = (functionAsString) => { + return Function("return " + functionAsString)(); +}; + const getStaticMapUrl = (latitude, longitude) => { const key = globalConfigs?.getConfig("GMAPS_API_KEY"); return `https://maps.googleapis.com/maps/api/staticmap?markers=${latitude},${longitude}&zoom=15&size=400x400&key=${key}&style=element:geometry%7Ccolor:0xf5f5f5&style=element:labels.icon%7Cvisibility:off&style=element:labels.text.fill%7Ccolor:0x616161&style=element:labels.text.stroke%7Ccolor:0xf5f5f5&style=feature:administrative.land_parcel%7Celement:labels.text.fill%7Ccolor:0xbdbdbd&style=feature:poi%7Celement:geometry%7Ccolor:0xeeeeee&style=feature:poi%7Celement:labels.text.fill%7Ccolor:0x757575&style=feature:poi.park%7Celement:geometry%7Ccolor:0xe5e5e5&style=feature:poi.park%7Celement:labels.text.fill%7Ccolor:0x9e9e9e&style=feature:road%7Celement:geometry%7Ccolor:0xffffff&style=feature:road.arterial%7Celement:labels.text.fill%7Ccolor:0x757575&style=feature:road.highway%7Celement:geometry%7Ccolor:0xdadada&style=feature:road.highway%7Celement:labels.text.fill%7Ccolor:0x616161&style=feature:road.local%7Celement:labels.text.fill%7Ccolor:0x9e9e9e&style=feature:transit.line%7Celement:geometry%7Ccolor:0xe5e5e5&style=feature:transit.station%7Celement:geometry%7Ccolor:0xeeeeee&style=feature:water%7Celement:geometry%7Ccolor:0xc9c9c9&style=feature:water%7Celement:labels.text.fill%7Ccolor:0x9e9e9e`; @@ -118,6 +125,10 @@ const didEmployeeHasRole = (role) => { return rolearray?.length; }; +const didEmployeeHasAtleastOneRole = (roles = []) => { + return roles.some((role) => didEmployeeHasRole(role)); +}; + const pgrAccess = () => { const userInfo = Digit.UserService.getUser(); const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); @@ -269,6 +280,7 @@ const swAccess = () => { export default { pdf: PDFUtil, + createFunction, downloadReceipt, downloadBill, downloadPDFFromLink, @@ -294,6 +306,7 @@ export default { mCollectAccess, receiptsAccess, didEmployeeHasRole, + didEmployeeHasAtleastOneRole, hrmsAccess, getPattern, hrmsRoles, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js index 08915d6e7eb..ece127196ca 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js @@ -38,7 +38,6 @@ const DigitUIWrapper = ({ stateCode, enabledModules, moduleReducers }) => { }; export const DigitUI = ({ stateCode, registry, enabledModules, moduleReducers }) => { - const [privacy, setPrivacy] = useState(Digit.Utils.getPrivacyObject() || {}); const userType = Digit.UserService.getType(); const queryClient = new QueryClient({ defaultOptions: { @@ -46,7 +45,7 @@ export const DigitUI = ({ stateCode, registry, enabledModules, moduleReducers }) staleTime: 15 * 60 * 1000, cacheTime: 50 * 60 * 1000, retryDelay: (attemptIndex) => Infinity, - retry:false + retry: false, /* enable this to have auto retry incase of failure retryDelay: attemptIndex => Math.min(1000 * 3 ** attemptIndex, 60000) @@ -54,6 +53,7 @@ export const DigitUI = ({ stateCode, registry, enabledModules, moduleReducers }) }, }, }); + const [privacy, setPrivacy] = useState(Digit.Utils.getPrivacyObject() || {}); const ComponentProvider = Digit.Contexts.ComponentProvider; const PrivacyProvider = Digit.Contexts.PrivacyProvider; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js index 23829f05af6..7f5f4c53885 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/SubMenu.js @@ -54,12 +54,12 @@ const SubMenu = ({ item }) => {
{leftIcon} - {item.navigationURL?.indexOf("/digit-ui") === -1 ? ( + {item.navigationURL?.indexOf("/digit-ui") === -1? ( {trimModuleName} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/EngagementCard.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/EngagementCard.js index acdb588b6ed..449cd54f387 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/EngagementCard.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/EngagementCard.js @@ -46,15 +46,18 @@ const EngagementCard = () => { } ); - const { data: surveysCount, isLoading: isLoadingSurveys } = Digit.Hooks.survey.useSearch( - { tenantIds: tenantId }, - { select: (data) => data?.TotalCount } - ); + const ServiceDefinitionCriteria = { + "tenantId": tenantId, + "code": [], + "module": ["engagement"], + } + + const { data: surveysCount, isLoading: isLoadingSurveys } = Digit.Hooks.survey.useCfdefinitionsearch({ServiceDefinitionCriteria}); const totalDocsCount = useMemo(() => (isLoadingDocs ? "-" : documentsCount), [isLoadingDocs, documentsCount]); const totalEventsCount = useMemo(() => (isLoadingEvents ? "-" : totalEvents), [isLoadingEvents, totalEvents]); const totalMessagesCount = useMemo(() => (isLoadingMessages ? "-" : MessagesCount), [isLoadingMessages, MessagesCount]); - const totalSurveysCount = useMemo(() => (isLoadingSurveys ? "-" : surveysCount), [isLoadingSurveys, surveysCount]); + const totalSurveysCount = useMemo(() => (isLoadingSurveys ? "-" : surveysCount.TotalCount), [isLoadingSurveys, surveysCount]); const { t } = useTranslation(); let result = null; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Modal/Surveys/Delete.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Modal/Surveys/Delete.js index 3236cde7240..19fac453055 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Modal/Surveys/Delete.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Modal/Surveys/Delete.js @@ -24,7 +24,7 @@ const ConfirmationQuestion = ({ t, title }) => (
{" "} - {t("CONFIRM_DELETE_MSG_NEW")} {` ${title}`}{t("COMPLETELY_DELETE")}

{t("COMPLETELY_DELETE_WARN_MSG")} + {t("CONFIRM_DELETE_MSG_NEW")} {` ${title} `}{t("COMPLETELY_DELETE")}

{t("COMPLETELY_DELETE_WARN_MSG")}
); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Modal/Surveys/MarkInActive.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Modal/Surveys/MarkInActive.js index bd5ab77be61..e6fcd75c398 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Modal/Surveys/MarkInActive.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Modal/Surveys/MarkInActive.js @@ -24,7 +24,7 @@ const ConfirmationQuestion = ({ t, title }) => (
{" "} - {t("CONFIRM_INACTIVE_SURVEY_MSG_NEW")} {` ${title}`}{t("CONFIRM_INACTIVE_SURVEY_MSG_TO_INACTIVE")} + {t("CONFIRM_INACTIVE_SURVEY_MSG_NEW")} {` ${title} `}{t("CONFIRM_INACTIVE_SURVEY_MSG_TO_INACTIVE")}

{t("CONFIRM_INACTIVE_SURVEY_WARN_MSG")} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/CitizenSurveyDisplayForm.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/CitizenSurveyDisplayForm.js new file mode 100644 index 00000000000..7ff068faa28 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/CitizenSurveyDisplayForm.js @@ -0,0 +1,184 @@ +import React from "react"; +import { useForm } from "react-hook-form"; +import { ActionBar, Header, Loader, SubmitBar, Toast } from "@egovernments/digit-ui-react-components"; + +import CitizenSurveyQuestion from "./CitizenSurveyQuestion"; +import { useTranslation } from "react-i18next"; + + +const CitizenSurveyDisplayForm = ({ surveyData, onFormSubmit,submitDisabled,formDisabled,formDefaultValues,isLoading, showToast, isSubmitDisabled }) => { + //need to disable this form and fill with default values if formDisabled is true + const { + register: registerRef, + control: controlSurveyForm, + handleSubmit: handleSurveyFormSubmit, + setValue: setSurveyFormValue, + getValues: getSurveyFormValues, + reset: resetSurveyForm, + formState: surveyFormState, + clearErrors: clearSurveyFormsErrors, + } = useForm({ + defaultValues:formDefaultValues + }); + + let surveyQuestion = {...surveyData}; + surveyQuestion.title = surveyData.code; + surveyQuestion.questions = []; + surveyQuestion?.attributes?.map((element, index) => { + surveyQuestion.questions.push( + { + "uuid": element.code, + // "surveyId": element.code, + "questionStatement": element.code, + "options": [ + ...element.additionalDetails.options + ], + "auditDetails": element.auditDetails, + "status": element.isActive?"ACTIVE":"INACTIVE", + "type": element.additionalDetails.type, + "required": element.required, + "qorder": element.order++, + "value": "12345" + } + ); + + }) + +// surveyQuestion.questions = [ +// { +// "uuid": "7d2aee5b-7ff5-4bda-9128-d3bd59e7a388", +// "surveyId": "SY-2023-07-21-000034", +// "questionStatement": "short", +// "options": [ +// "NA" +// ], +// "auditDetails": { +// "createdBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "lastModifiedBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "createdTime": 1689934066437, +// "lastModifiedTime": 1689934066437 +// }, +// "status": "ACTIVE", +// "type": "SHORT_ANSWER_TYPE", +// "required": false, +// "qorder": 1 +// }, +// { +// "uuid": "22b8763a-3cb0-4c57-b794-ad1f88eafe49", +// "surveyId": "SY-2023-07-21-000034", +// "questionStatement": "mul", +// "options": [ +// "1", +// "2", +// "3", +// "4" +// ], +// "auditDetails": { +// "createdBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "lastModifiedBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "createdTime": 1689934066437, +// "lastModifiedTime": 1689934066437 +// }, +// "status": "ACTIVE", +// "type": "MULTIPLE_ANSWER_TYPE", +// "required": false, +// "qorder": 2 +// }, +// { +// "uuid": "d6641081-2c08-49e7-b850-2efb13043b17", +// "surveyId": "SY-2023-07-21-000034", +// "questionStatement": "check", +// "options": [ +// "1", +// "2", +// "3", +// "4" +// ], +// "auditDetails": { +// "createdBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "lastModifiedBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "createdTime": 1689934066438, +// "lastModifiedTime": 1689934066438 +// }, +// "status": "ACTIVE", +// "type": "CHECKBOX_ANSWER_TYPE", +// "required": false, +// "qorder": 3 +// }, +// { +// "uuid": "03cf1483-d2ca-4e97-a58c-a3a730de16a0", +// "surveyId": "SY-2023-07-21-000034", +// "questionStatement": "para", +// "options": [ +// "NA" +// ], +// "auditDetails": { +// "createdBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "lastModifiedBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "createdTime": 1689934066438, +// "lastModifiedTime": 1689934066438 +// }, +// "status": "ACTIVE", +// "type": "LONG_ANSWER_TYPE", +// "required": false, +// "qorder": 4 +// }, +// { +// "uuid": "acc77cf9-fcab-4198-be66-da23e5227627", +// "surveyId": "SY-2023-07-21-000034", +// "questionStatement": "date", +// "options": [ +// "NA" +// ], +// "auditDetails": { +// "createdBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "lastModifiedBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "createdTime": 1689934066438, +// "lastModifiedTime": 1689934066438 +// }, +// "status": "ACTIVE", +// "type": "DATE_ANSWER_TYPE", +// "required": false, +// "qorder": 5 +// }, +// { +// "uuid": "b2461bff-e893-499d-9b24-e32eef51865b", +// "surveyId": "SY-2023-07-21-000034", +// "questionStatement": "time", +// "options": [ +// "NA" +// ], +// "auditDetails": { +// "createdBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "lastModifiedBy": "1fd992e1-7d43-43bb-9666-29d32af6697f", +// "createdTime": 1689934066438, +// "lastModifiedTime": 1689934066438 +// }, +// "status": "ACTIVE", +// "type": "TIME_ANSWER_TYPE", +// "required": false, +// "qorder": 6 +// } +// ] + console.log(surveyQuestion, "surveyQuestion ooo") + + + const {t} = useTranslation() + if(isLoading){ + return + } + return ( +
+
{surveyData?.title?.toUpperCase()}
+
+ {surveyQuestion?.questions?.length ? surveyQuestion.questions.map((config, index) => ) : null} + {showToast && } + + {!submitDisabled && } + + +
+ ); +}; + +export default CitizenSurveyDisplayForm; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/ResultsView/SurveyDetailsView.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/ResultsView/SurveyDetailsView.js index 47c39e03ca8..7609e90e727 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/ResultsView/SurveyDetailsView.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/ResultsView/SurveyDetailsView.js @@ -40,7 +40,7 @@ const SurveyDetailsView = ({surveyTitle,surveyDesc,t,surveyId}) => { >
{t("SURVEY_QUESTIONS")}
*/} - history.push(`/digit-ui/employee/engagement/surveys/inbox/details/${surveyId}`)}> + history.push(`/digit-ui/employee/engagement/surveys/inbox/details/${surveyTitle}`)}> {t("VIEW_SURVEY_QUESTIONS")} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/ResultsView/SurveyResultsView.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/ResultsView/SurveyResultsView.js index b7df3b2866e..262225a36b2 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/ResultsView/SurveyResultsView.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/ResultsView/SurveyResultsView.js @@ -17,7 +17,7 @@ const transformDate = (date) => { ] return { day, - date:`${monthNames[month-1]} ${year}` + date:date?`${monthNames[month-1]} ${year}`:date } // return (

// {`${monthNames[month-1]} ${year} ${day}`} @@ -179,20 +179,20 @@ const displayResult = (ques,ans,type,resCount=0,t) => { } } -const SurveyResultsView = ({surveyInfo,responsesInfoMutation}) => { +const SurveyResultsView = ({surveyInfo,selecedSurveyresults}) => { const { t } = useTranslation(); const [data,setData]=useState(null); const [userInfo,setUserInfo] = useState({}) const tenant = Digit.ULBService.getCurrentTenantId(); useEffect( async() => { - if(responsesInfoMutation.isSuccess){ - const dp = bindQuesWithAns(surveyInfo?.questions,responsesInfoMutation.data.answers) + if(selecedSurveyresults?.answers?.length){ + const dp = bindQuesWithAns(surveyInfo?.questions,selecedSurveyresults.answers) setData(dp) - const ue = await getUserData(responsesInfoMutation.data.answers,tenant.split(".")[0]) + const ue = await getUserData(selecedSurveyresults.answers,tenant.split(".")[0]) setUserInfo(ue); } - },[responsesInfoMutation]) + },[selecedSurveyresults]) // const dp = bindQuesWithAns(surveyInfo?.questions,responsesInfoMutation.data.answers); // setData(dp) @@ -201,7 +201,7 @@ const SurveyResultsView = ({surveyInfo,responsesInfoMutation}) => { const generateExcelObj = (ques,ans) => { const countResponses = parseInt(ans.length/ques.length) - const dp = bindQuesWithAns(surveyInfo?.questions, responsesInfoMutation.data.answers) + const dp = bindQuesWithAns(surveyInfo?.questions, selecedSurveyresults.answers) const result = [] //now in a loop fill all the sampleObj (3 times) and use it to download report @@ -232,11 +232,11 @@ const SurveyResultsView = ({surveyInfo,responsesInfoMutation}) => { } const handleReportDownload = () => { - const result = generateExcelObj(surveyInfo?.questions, responsesInfoMutation.data.answers) - return Digit.Download.Excel(result, responsesInfoMutation.data.title); + const result = generateExcelObj(surveyInfo?.questions, selecedSurveyresults.answers) + return Digit.Download.Excel(result, selecedSurveyresults.Service[0].referenceId); } - if(!data) return + // if(!data) return return (

diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/SurveyForms/SurveyDetailsForms.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/SurveyForms/SurveyDetailsForms.js index f0c7c2f5277..5602e392abe 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/SurveyForms/SurveyDetailsForms.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/components/Surveys/SurveyForms/SurveyDetailsForms.js @@ -7,6 +7,7 @@ const SurveyDetailsForms = ({ t, registerRef, controlSurveyForm, surveyFormState const ulbs = Digit.SessionStorage.get("ENGAGEMENT_TENANTS"); const tenantId = Digit.ULBService.getCurrentTenantId(); const userInfo = Digit.UserService.getUser().info; + console.log(Digit.UserService.getUser(),"userInfo") const userUlbs = ulbs .filter((ulb) => userInfo?.roles?.some((role) => role?.tenantId === ulb?.code)) .sort(alphabeticalSortFunctionForTenantsBasedOnName); @@ -28,7 +29,6 @@ const SurveyDetailsForms = ({ t, registerRef, controlSurveyForm, surveyFormState return false } - return (
@@ -42,6 +42,7 @@ const SurveyDetailsForms = ({ t, registerRef, controlSurveyForm, surveyFormState const renderRemovableTokens = useMemo( () => props?.value?.map((ulb, index) => { + console.log(ulb,"ulb") return ( { +const transformSurveyResponseData = (data,surveyData) => { /** * TODO : handle checkbox */ if (!data) return; const questions = []; + // for (const key in data) { + // questions.push({ + // questionId: key, + // answer: [data[key]], + // }); + // } for (const key in data) { questions.push({ - questionId: key, - answer: [data[key]], + attributeCode: key, + value:data[key]===""? "\"NA\"":JSON.stringify(data[key]) || "\"\"" , + additionalDetails: { + questionId: getQuestionID(key,surveyData) + } }); } return questions; }; +const getQuestionID = (key,surveyData) =>{ + let questionId = ""; + surveyData.attributes.map((ele)=>{ + if (ele.code === key){ + questionId = ele.id + } + }) + return questionId; +} + const FillSurvey = ({ location }) => { - //const surveyData = location?.state; + const user = Digit.UserService.getUser(); const { applicationNumber: surveyId, tenantId } = Digit.Hooks.useQueryParams(); const { data, isLoading } = Digit.Hooks.survey.useSearch({uuid:surveyId,tenantId},{}) - const surveyData = data?.Surveys?.[0] ? data?.Surveys?.[0] : {} + const tenantIds = Digit.ULBService.getCitizenCurrentTenant(); + let ServiceDefinitionCriteria = { + "tenantId": tenantId, + "code": [], + "module": ["engagement"], + } + + const { data: surveyQuestionData, isLoading: isLoadingSurveys } = Digit.Hooks.survey.useCfdefinitionsearch({ServiceDefinitionCriteria},{}) + const surveyData = location?.state?location.state:surveyQuestionData?.ServiceDefinition?.[0] ? surveyQuestionData?.ServiceDefinition?.[0] : {} + let ServiceCriteria = { + tenantId: tenantIds, + ids: [], + serviceDefIds: [], + referenceIds: [surveyData.code], + accountId: user?.info?.uuid || "dda30b0a-ae2d-4f87-8b52-d1fc73ed7643", + } + const { data: selecedSurveyData, } = Digit.Hooks.survey.useSelectedSurveySearch({ServiceCriteria},{}) + const surveyDataOld = data?.Surveys?.[0] ? data?.Surveys?.[0] : {} const {t} = useTranslation(); let initialData = data; const [showToast, setShowToast] = useState(null); //sort survey questions based on qorder field, in surveyData.questions array, here and then render - surveyData?.questions?.sort((a,b)=>a.qorder-b.qorder) + surveyData?.attributes?.sort((a,b)=>a.order-b.order) const history = useHistory(); - useEffect(() => { - if(data && initialData?.Surveys?.[0]?.hasResponded == true || initialData?.Surveys?.[0]?.hasResponded === "true") - setShowToast({ key: true, label: "SURVEY_FORM_IS_ALREADY_SUBMITTED" }); - else if(data && initialData?.Surveys?.[0]?.status == "INACTIVE") - setShowToast({ key: true, label: "SURVEY_FORM_IS_ALREADY_INACTIVE" }); - },[data?.Surveys?.[0]?.hasResponded,initialData?.Surveys?.[0]?.hasResponded]) + // useEffect(() => { + // if(data && initialData?.Surveys?.[0]?.hasResponded == true || initialData?.Surveys?.[0]?.hasResponded === "true") + // setShowToast({ key: true, label: "SURVEY_FORM_IS_ALREADY_SUBMITTED" }); + // else if(data && initialData?.Surveys?.[0]?.status == "INACTIVE") + // setShowToast({ key: true, label: "SURVEY_FORM_IS_ALREADY_INACTIVE" }); + // },[data?.Surveys?.[0]?.hasResponded,initialData?.Surveys?.[0]?.hasResponded]) const onSubmit = (data) => { - const details = { - AnswerEntity: { - surveyId: surveyData.uuid, - answers: transformSurveyResponseData(data), - surveyTitle:surveyData.title, - hasResponded:surveyData.hasResponded, - }, - }; - history.push("/digit-ui/citizen/engagement/surveys/submit-response", details); + const user = Digit.UserService.getUser(); + if (selecedSurveyData.Service[0]){ + setShowToast({ key: true, label: "SURVEY_FORM_IS_ALREADY_SUBMITTED" }); + }else{ + const details = { + // AnswerEntity: { + // surveyId: surveyData.uuid, + // answers: transformSurveyResponseData(data), + // surveyTitle:surveyData.title, + // hasResponded:surveyData.hasResponded, + // }, + "Service": { + "tenantId": tenantId, + "serviceDefId": location.state.id, + "isActive": true, + "referenceId": location.state.code, + "attributes":transformSurveyResponseData(data,surveyData), + "additionalDetails": {}, + "accountId" : user?.info?.uuid || "dda30b0a-ae2d-4f87-8b52-d1fc73ed7643", + } + }; + + history.push("/digit-ui/citizen/engagement/surveys/submit-response", details); + } + + }; - if(Object.keys(surveyData)?.length > 0 || isLoading) - return ; + if(Object.keys(surveyData)?.length > 0 || isLoadingSurveys) + return ; else return }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/Response.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/Response.js index ecf13c978f0..d9048609e1f 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/Response.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/Response.js @@ -30,7 +30,8 @@ const Acknowledgement = (props) => { const queryClient = useQueryClient(); const { t } = useTranslation(); const tenantId = Digit.ULBService.getCurrentTenantId(); - const mutation = Digit.Hooks.survey.useSubmitResponse(); + // const mutation = Digit.Hooks.survey.useSubmitResponse(); + let mutation = Digit.Hooks.survey.useSubmitSurveyResponse(); const { state } = props.location; const surveyTitlev1 = state?.AnswerEntity?.surveyTitle; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/ShowSurvey.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/ShowSurvey.js index 682e1e19ebb..ec02e15c57a 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/ShowSurvey.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/ShowSurvey.js @@ -2,37 +2,53 @@ import { Loader } from "@egovernments/digit-ui-react-components"; import React, { useEffect } from "react"; import { useQueryClient } from "react-query"; import CitizenSurveyForm from "../../../components/Surveys/CitizenSurveyForm"; +import CitizenSurveyDisplayForm from "../../../components/Surveys/CitizenSurveyDisplayForm"; const ShowSurvey = ({ location }) => { const surveyData = location?.state; const questions = surveyData?.questions; const tenantIds = Digit.ULBService.getCitizenCurrentTenant(); + const user = Digit.UserService.getUser(); const mutation = Digit.Hooks.survey.useShowResults(); - const queryClient = useQueryClient(); + let ServiceCriteria = { + tenantId: tenantIds, + ids: [], + serviceDefIds: [], + referenceIds: [surveyData.code], + accountId: user?.info?.uuid || "dda30b0a-ae2d-4f87-8b52-d1fc73ed7643", + } + const { data: selecedSurveyData, isLoading } = Digit.Hooks.survey.useSelectedSurveySearch({ServiceCriteria},{}) + const queryClient = useQueryClient(); useEffect(() => { - const onSuccess = () => { - queryClient.clear(); - }; - mutation.mutate( - { - surveyId: surveyData.uuid, - }, - { - onSuccess, - } - ); + // const onSuccess = () => { + // queryClient.clear(); + // }; + // mutation.mutate( + // { + // surveyId: surveyData.uuid, + // }, + // { + // onSuccess, + // } + // ); }, []); - if (mutation.isLoading && !mutation.isIdle) { + if (isLoading) { return ; } - if (mutation.isError) return
An error occured...
; + // if (mutation.isError) return
An error occured...
; //questionid in answers uuid in surveys needs to be matched - const answers = mutation?.data?.answers; + const answers = selecedSurveyData.Service[0].attributes; + answers?.map((element)=>{ + element.uuid = element.id; + element.questionId = element.attributeCode; + element.answer = [JSON.parse(element.value)]; + element.citizenId = selecedSurveyData.Service.accountId; + }) const formDefaultValues = {}; answers?.map((ans) => { if (ans?.answer.length === 1) formDefaultValues[ans?.questionId] = ans?.answer[0]; @@ -48,7 +64,7 @@ const ShowSurvey = ({ location }) => { // } // }) - return ; + return ; }; export default ShowSurvey; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/SurveyList.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/SurveyList.js index c8565cc8031..a9b4866a039 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/SurveyList.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/citizen/CitizenSurvey/SurveyList.js @@ -1,5 +1,5 @@ import { Header, Loader } from "@egovernments/digit-ui-react-components"; -import React from "react"; +import React, { useState, useEffect } from "react"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; import SurveyListCard from "../../../components/Surveys/SurveyListCard"; @@ -15,39 +15,143 @@ const SurveyList = () => { const { t } = useTranslation(); const history = useHistory(); const tenantIds = Digit.ULBService.getCitizenCurrentTenant(); + const user = Digit.UserService.getUser(); + + let ServiceDefinitionCriteria = { + "tenantId": tenantIds, + "code": [], + "module": ["engagement"], + } + + let Pagination = { + "limit": 100, + "offSet": 0, + "sortBy": "string", + "order": "asc" + } - const { data, isLoading: isLoadingSurveys } = Digit.Hooks.survey.useSearch( - { tenantIds }, + let ServiceCriteria = { + tenantId: tenantIds, + ids: [], + serviceDefIds: [], + referenceIds: [], + accountId: user?.info?.uuid || "dda30b0a-ae2d-4f87-8b52-d1fc73ed7643", + } + const { data: selecedSurveyData } = Digit.Hooks.survey.useSelectedSurveySearch({ServiceCriteria},{}) + const { data, isLoading: isLoadingSurveys } = Digit.Hooks.survey.useCfdefinitionsearch( + { ServiceDefinitionCriteria, Pagination }, { - select: ({ Surveys }) => { + select: ({ ServiceDefinition }) => { // const allSurveys = Surveys.map((survey) => ({ hasResponded: false, responseStatus: "CS_SURVEY_YT_TO_RESPOND", ...survey })); - - const allSurveys = Surveys.map((survey) => { - const isSurveyActive = isActive(survey.startDate, survey.endDate); - let resStatus = ""; - if (isSurveyActive && survey.hasResponded) resStatus = "CS_SURVEY_RESPONDED"; - else if (isSurveyActive) resStatus = "CS_SURVEY_YT_TO_RESPOND"; - else resStatus = "CANNOT_RESPOND_MSG"; - return { hasResponded: false, responseStatus: resStatus, ...survey }; - }); - //why hasResoponded always set to false here + // const allSurveys = Surveys.map((survey) => { + // const isSurveyActive = isActive(survey.startDate, survey.endDate); + // let resStatus = ""; + // if (isSurveyActive && survey.hasResponded) resStatus = "CS_SURVEY_RESPONDED"; + // else if (isSurveyActive) resStatus = "CS_SURVEY_YT_TO_RESPOND"; + // else resStatus = "CANNOT_RESPOND_MSG"; + // return { hasResponded: false, responseStatus: resStatus, ...survey }; + // }); const activeSurveysList = []; const inactiveSurveysList = []; - for (let survey of allSurveys) { - if (survey.status === "ACTIVE" && isActive(survey.startDate, survey.endDate)) { - activeSurveysList.push(survey); - } else { - inactiveSurveysList.push(survey); + let surveyListId = []; + ServiceDefinition?.map((element, index) => { + surveyListId.push(element.code) + if (element.isActive && isActive(element.additionalDetails.startDate, element.additionalDetails.endDate)) { + element.hasResponded = false; + element.responseStatus = "CS_SURVEY_YT_TO_RESPOND"; + activeSurveysList.push(element); + } else if (element.additionalDetails.endDate) { + element.hasResponded = false; + element.responseStatus = "CANNOT_RESPOND_MSG"; + inactiveSurveysList.push(element) } - } + }) + + activeSurveysList.reverse(); + inactiveSurveysList.reverse(); + return { activeSurveysList, inactiveSurveysList, + surveyListId }; }, } ); + ( async() => { + if (data?.surveyListId && selecedSurveyData){ + data?.activeSurveysList.map((element,index)=>{ + selecedSurveyData.Service.map((ele)=>{ + if (element.code === ele.referenceId ){ + data.activeSurveysList[index].hasResponded = true; + data.activeSurveysList[index].responseStatus = "CS_SURVEY_RESPONDED"; + } + }) + }) + + // data?.inactiveSurveysList.map((element,index)=>{ + // selecedSurveyData.Service.map((ele)=>{ + // if (element.code === ele.referenceId ){ + // data.inactiveSurveysList[index].hasResponded = true; + // data.inactiveSurveysList[index].responseStatus = "CS_SURVEY_RESPONDED"; + // } + // }) + // }) + } + })(); + + // useEffect(()=>{ + // if (data?.surveyListId && selecedSurveyData){ + // data?.surveyListId.map((element,index)=>{ + // selecedSurveyData.Service.map((ele)=>{ + // if (element === ele.referenceId && data?.activeSurveysList[index]?.responseStatus){ + // data.activeSurveysList[index].hasResponded = true; + // data.activeSurveysList[index].responseStatus = "CS_SURVEY_RESPONDED"; + // } + + // }) + + // }) + // } + // },[data,selecedSurveyData]) + + + + // const { data, isLoading: isLoadingSurveys } = Digit.Hooks.survey.useSearch( + // { tenantIds }, + // { + // select: ({ Surveys }) => { + // // const allSurveys = Surveys.map((survey) => ({ hasResponded: false, responseStatus: "CS_SURVEY_YT_TO_RESPOND", ...survey })); + + // const allSurveys = Surveys.map((survey) => { + // const isSurveyActive = isActive(survey.startDate, survey.endDate); + // let resStatus = ""; + // if (isSurveyActive && survey.hasResponded) resStatus = "CS_SURVEY_RESPONDED"; + // else if (isSurveyActive) resStatus = "CS_SURVEY_YT_TO_RESPOND"; + // else resStatus = "CANNOT_RESPOND_MSG"; + // return { hasResponded: false, responseStatus: resStatus, ...survey }; + // }); + // //why hasResoponded always set to false here + // const activeSurveysList = []; + // const inactiveSurveysList = []; + // for (let survey of allSurveys) { + // if (survey.status === "ACTIVE" && isActive(survey.startDate, survey.endDate)) { + // activeSurveysList.push(survey); + // } else { + // inactiveSurveysList.push(survey); + // } + // } + // return { + // activeSurveysList, + // inactiveSurveysList, + // }; + // }, + // } + // ); + + + // const handleCardClick = (details) => { // history.push("/digit-ui/citizen/engagement/surveys/fill-survey", details); // }; @@ -56,7 +160,7 @@ const SurveyList = () => { const handleCardClick = (details) => { if (!details.hasResponded) { - history.push(`/digit-ui/citizen/engagement/surveys/fill-survey?applicationNumber=${details?.uuid}&tenantId=${details?.tenantId}`, details); + history.push(`/digit-ui/citizen/engagement/surveys/fill-survey?applicationNumber=${details?.code}&tenantId=${details?.tenantId}`, details); } else { history.push("/digit-ui/citizen/engagement/surveys/show-survey", details); } @@ -68,19 +172,19 @@ const SurveyList = () => { return (
-
{`${t("CS_COMMON_SURVEYS")} (${data?.activeSurveysList.length})`}
+
{`${t("CS_COMMON_SURVEYS")} (${data?.activeSurveysList?.length})`}
{data?.activeSurveysList && data.activeSurveysList.length ? ( data.activeSurveysList.map((data, index) => { return (
handleCardClick(data)} /> @@ -93,19 +197,19 @@ const SurveyList = () => {
)} -
{`${t("CS_COMMON_INACTIVE_SURVEYS")} (${data.inactiveSurveysList.length})`}
+
{`${t("CS_COMMON_INACTIVE_SURVEYS")} (${data?.inactiveSurveysList?.length})`}
{data?.inactiveSurveysList && data.inactiveSurveysList.length ? ( data.inactiveSurveysList.map((data, index) => { return (
diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/index.js index 007447839d2..988868a31ee 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/index.js @@ -17,11 +17,19 @@ const Inbox = ({ parentRoute }) => { .filter((ulb) => userInfo?.roles?.some((role) => role?.tenantId === ulb?.code)) const statuses = [ - { code: "ALL", name: `${t("ES_COMMON_ALL")}` }, - { code: "ACTIVE", name: `${t("ES_COMMON_ACTIVE")}` }, - { code: "INACTIVE", name: `${t("ES_COMMON_INACTIVE")}` } + { code: "All", name: `${t("ES_COMMON_ALL")}` }, + { code: "Active", name: `${t("ES_COMMON_ACTIVE")}` }, + { code: "Inactive", name: `${t("ES_COMMON_INACTIVE")}` } ] + const isActive = (startDate, endDate) => { + const currentDate = new Date().getTime(); + if (startDate < currentDate && currentDate <= endDate) { + return true; + } + return false; + }; + const searchFormDefaultValues = { // tenantIds: tenantId, tenantIds:userUlbs[0], @@ -39,23 +47,59 @@ const Inbox = ({ parentRoute }) => { sortOrder: "DESC" } + const ServiceDefinitionCriteria = { + "tenantId": tenantId, + "code": [], + "module": ["engagement"], + "postedBy":"" + } + function formReducer(state, payload) { switch (payload.action) { case "mutateSearchForm": - Digit.SessionStorage.set("CITIZENSURVEY.INBOX", { ...state, searchForm: payload.data }) - return { ...state, searchForm: payload.data }; + Digit.SessionStorage.set("CITIZENSURVEY.INBOX", { ...state, searchForm: payload.data , ServiceDefinitionCriteria:{ + "code": [], + "postedBy": null, + "module": ["engagement"], + }}) + return { ...state, searchForm: payload.data,ServiceDefinitionCriteria: {"tenantId": tenantId, + "code": [], + "postedBy": null, + "module": ["engagement"], + } }; case "mutateFilterForm": - Digit.SessionStorage.set("CITIZENSURVEY.INBOX", { ...state, filterForm: payload.data }) - return { ...state, filterForm: payload.data }; + // Digit.SessionStorage.set("CITIZENSURVEY.INBOX", { ...state, filterForm: payload.data }) + // return { ...state, filterForm: payload.data }; + Digit.SessionStorage.set("CITIZENSURVEY.INBOX", { ...state, filterForm: payload.data, ServiceDefinitionCriteria:{ + "code": [state.searchForm.title], + "postedBy": state.searchForm.postedBy, + "module": ["engagement"], + "status": payload.data.status.code + }}) + return { ...state, filterForm: payload.data, ServiceDefinitionCriteria: {"tenantId": tenantId, + "code": [state.searchForm.title], + "postedBy": state.searchForm.postedBy, + "module": ["engagement"], + "status": payload.data.status.code + } }; case "mutateTableForm": Digit.SessionStorage.set("CITIZENSURVEY.INBOX", { ...state, tableForm: payload.data }) return { ...state, tableForm: payload.data }; + case "mutateSearchDefinationForm": + Digit.SessionStorage.set("CITIZENSURVEY.INBOX", { ...state, searchForm: payload.data, ServiceDefinitionCriteria: {"tenantId": tenantId, + "code": [payload.data.title], + "postedBy": payload.data.postedBy, + "module": ["engagement"]} }) + return { ...state, searchForm: payload.data, ServiceDefinitionCriteria: {"tenantId": tenantId, + "code": [payload.data.title], + "postedBy": payload.data.postedBy, + "module": ["engagement"]} }; default: break; } } const InboxObjectInSessionStorage = Digit.SessionStorage.get("CITIZENSURVEY.INBOX") - + const onSearchFormReset = (setSearchFormValue) => { setSearchFormValue("postedBy", "") setSearchFormValue("title", "") @@ -72,18 +116,61 @@ const Inbox = ({ parentRoute }) => { return InboxObjectInSessionStorage || { filterForm: filterFormDefaultValues, searchForm: searchFormDefaultValues, - tableForm: tableOrderFormDefaultValues + tableForm: tableOrderFormDefaultValues, + ServiceDefinitionCriteria:ServiceDefinitionCriteria, } } - , [Object.values(InboxObjectInSessionStorage?.filterForm || {}), Object.values(InboxObjectInSessionStorage?.searchForm || {}), Object.values(InboxObjectInSessionStorage?.tableForm || {})]) + , [Object.values(InboxObjectInSessionStorage?.ServiceDefinitionCriteria || {}),Object.values(InboxObjectInSessionStorage?.filterForm || {}), Object.values(InboxObjectInSessionStorage?.searchForm || {}), Object.values(InboxObjectInSessionStorage?.tableForm || {})]) const [formState, dispatch] = useReducer(formReducer, formInitValue) + const onPageSizeChange = (e) => { dispatch({ action: "mutateTableForm", data: { ...formState.tableForm, limit: e.target.value } }) } + let ServiceCriteria = { + tenantId: userUlbs[0].code, + ids: [], + serviceDefIds: [], + referenceIds: [], + } + const { data: selecedSurveyData } = Digit.Hooks.survey.useSelectedSurveySearch({ServiceCriteria},{}) + + // const { data: { Surveys, TotalCount } = {}, isLoading: isInboxLoading, } = Digit.Hooks.survey.useSurveyInbox(formState) + const { data: surveyList, isLoading: isSurveyListLoading } = Digit.Hooks.survey.useCfdefinitionsearch({ServiceDefinitionCriteria:formState.ServiceDefinitionCriteria, Pagination:formState.tableForm}) - const { data: { Surveys, TotalCount } = {}, isLoading: isInboxLoading, } = Digit.Hooks.survey.useSurveyInbox(formState) + if (surveyList?.ServiceDefinition){ + surveyList?.ServiceDefinition.map((element,index)=>{ + element.uuid = element.code; + element.tenantIds = null; + element.title = element.code; + element.status = isActive(element.additionalDetails.startDate,element.additionalDetails.endDate)?"ACTIVE":"INACTIVE";; + element.description = element.additionalDetails.description; + element.startDate = element.additionalDetails.startDate || null; + element.endDate = element.additionalDetails.endDate || null; + element.active = true; + element.insertQuestionsForUpdate = null; + element.postedBy = element.postedBy || ""; + element.answersCount = 0; + element.hasResponded = ""; + + }) + } + + ( async() => { + if (surveyList && selecedSurveyData){ + surveyList?.ServiceDefinition?.map((element)=>{ + selecedSurveyData?.Service?.map((ele)=>{ + if (element.code === ele.referenceId){ + element.answersCount ++; + } + }) + }) + } + + + })(); + const PropsForInboxLinks = { logoIcon: , @@ -111,26 +198,30 @@ const Inbox = ({ parentRoute }) => { const onSearchFormSubmit = (data) => { //setting the offset to 0(In case searched from page other than 1) - dispatch({ action: "mutateTableForm", data: { ...formState.tableForm, offset:0 } }) + // dispatch({ action: "mutateTableForm", data: { ...formState.tableForm, offset:0 } }) - data.hasOwnProperty("") ? delete data?.[""] : null - dispatch({ action: "mutateSearchForm", data }) - } + // data.hasOwnProperty("") ? delete data?.[""] : null + // dispatch({ action: "mutateSearchForm", data }) + console.log(data,"data") + dispatch({ action: "mutateSearchDefinationForm", data }); + + } const onFilterFormSubmit = (data) => { - data.hasOwnProperty("") ? delete data?.[""] : null - dispatch({ action: "mutateFilterForm", data }) + // data.hasOwnProperty("") ? delete data?.[""] : null + // dispatch({ action: "mutateFilterForm", data }) + dispatch({ action: "mutateFilterForm", data }); } - const propsForSearchForm = { SearchFormFields, onSearchFormSubmit, searchFormDefaultValues: formState?.searchForm, resetSearchFormDefaultValues: searchFormDefaultValues, onSearchFormReset } + const propsForSearchForm = { SearchFormFields, onSearchFormSubmit, searchFormDefaultValues: formState?.ServiceDefinitionCriteria?.code[0], resetSearchFormDefaultValues: searchFormDefaultValues, onSearchFormReset } const propsForFilterForm = { FilterFormFields, onFilterFormSubmit, filterFormDefaultValues: formState?.filterForm, resetFilterFormDefaultValues: filterFormDefaultValues, onFilterFormReset } - const propsForInboxTable = useInboxTableConfig({ ...{ parentRoute, onPageSizeChange, formState, totalCount: TotalCount, table: Surveys, noResultsMessage: "CS_SURVEYS_NOT_FOUND", dispatch, inboxStyles:{overflowX:"scroll", overflowY:"hidden"} } }) + const propsForInboxTable = useInboxTableConfig({ ...{ parentRoute, onPageSizeChange, formState, totalCount: "", table: surveyList?.ServiceDefinition||[], noResultsMessage: "CS_SURVEYS_NOT_FOUND", dispatch, inboxStyles:{overflowX:"scroll", overflowY:"hidden"} } }) - const propsForInboxMobileCards = useInboxMobileCardsData({parentRoute, table:Surveys}) + const propsForInboxMobileCards = useInboxMobileCardsData({parentRoute, table:surveyList?.ServiceDefinition||[]}) - return + return } diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/useInboxMobileDataCard.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/useInboxMobileDataCard.js index 1962cd67755..775fc8923f7 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/useInboxMobileDataCard.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/useInboxMobileDataCard.js @@ -15,7 +15,10 @@ const useInboxMobileCardsData = ({parentRoute, table }) => { [t("EVENTS_POSTEDBY_LABEL")]: postedBy, })) - return ({ data:dataForMobileInboxCards, linkPrefix:`${parentRoute}/inbox/`, serviceRequestIdKey:t("TL_COMMON_TABLE_COL_APP_NO")}) + console.log(t("TL_COMMON_TABLE_COL_APP_NO"),"table") + + + return ({ data:dataForMobileInboxCards, linkPrefix:`${parentRoute}/surveys/inbox/details/`, serviceRequestIdKey:t("CS_SURVEY_TITLE")}) } diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/useInboxTableConfig.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/useInboxTableConfig.js index 7fe37529e5e..6c2787ff956 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/useInboxTableConfig.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/Inbox/useInboxTableConfig.js @@ -58,7 +58,7 @@ const useInboxTableConfig = ({ parentRoute, onPageSizeChange, formState, totalCo }, { Header: t("EVENTS_POSTEDBY_LABEL"), - accessor: (row) => row.postedBy, + accessor: (row) => row.additionalDetails.postedBy, }, { Header: t("CS_SURVEY_RESULTS"), diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/NewSurvey.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/NewSurvey.js index dbd9663e177..fd16d51db42 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/NewSurvey.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/NewSurvey.js @@ -62,21 +62,66 @@ const NewSurveys = () => { const onSubmit = (data) => { const { collectCitizenInfo, title, description, tenantIds, fromDate, toDate, fromTime, toTime, questions } = data; const mappedQuestions = mapQuestions(questions); + let serveyMappedQuestions = []; + let userToken = window.localStorage.getItem("token"); + let userInfo = JSON.parse(window.localStorage.getItem("user-info")); + questions && questions.length && questions.map((element,index)=>{ + serveyMappedQuestions.push({ + "tenantId": tenantIds?.[0]?.code, + "code": element.formConfig.questionStatement, + "dataType": "String", + "values": null, + "required": element.formConfig.required, + "isActive": true, + "reGex": null, + "order": index++, + "additionalDetails": { + type: element.formConfig.type.i18Key, + options: element.formConfig.options || ["NA"] + } + }) + }) const details = { - SurveyEntity: { - tenantIds: tenantIds.map(({code})=>(code)), - title, - description, - startDate: new Date(`${fromDate} ${fromTime}`).getTime(), - endDate: new Date(`${toDate} ${toTime}`).getTime(), - questions:mappedQuestions + // SurveyEntity: { + // tenantIds: tenantIds.map(({code})=>(code)), + // title, + // description, + // startDate: new Date(`${fromDate} ${fromTime}`).getTime(), + // endDate: new Date(`${toDate} ${toTime}`).getTime(), + // questions:mappedQuestions + // }, + + ServiceDefinition: { + tenantId:tenantIds?.[0]?.code, + module:"engagement", + code: title, + isActive: true, + additionalDetails:{ + title: title, + description: description, + startDate: new Date(`${fromDate} ${fromTime}`).getTime(), + endDate: new Date(`${toDate} ${toTime}`).getTime(), + postedBy: userInfo.name, + }, + clientId:userInfo.uuid, + attributes:serveyMappedQuestions }, + }; - + try{ - let filters = {tenantIds : tenantIds?.[0]?.code, title : title} - Digit.Surveys.search(filters).then((ob) => { - if(ob?.Surveys?.length>0) + // let filters = {tenantIds : tenantIds?.[0]?.code, title : title} + let searchDetails = { + ServiceDefinitionCriteria:{ + "tenantId": tenantId, + "code": [title], + "module": ["engagement"] + } + + } + + Digit.Surveys.cfdefinitionsearch(searchDetails).then((ob) => { + if(ob?.ServiceDefinition?.length>0) { setShowToast({ key: true, label: "SURVEY_SAME_NAME_SURVEY_ALREADY_PRESENT" }); } diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/SurveyDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/SurveyDetails.js index 308bf79ed49..9ae23956c5c 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/SurveyDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/SurveyDetails.js @@ -21,6 +21,7 @@ const filterQuestion = (question) => { return { ...question, type: question.type.includes("_") ? question.type : answerTypeEnum[question.type],options:question?.options, status:question.status ? question.status : "ACTIVE", qorder:question.qorder }; }; + /**TODO : Think of better to do this possibly in service layer */ const TypeAnswerEnum = { SHORT_ANSWER_TYPE: "Short Answer", @@ -31,6 +32,30 @@ const TypeAnswerEnum = { TIME_ANSWER_TYPE: "Time", }; +const isActive = (startDate, endDate) => { + const currentDate = new Date().getTime(); + if (startDate < currentDate && currentDate <= endDate) { + return true; + } + return false; +}; + +const setSurveyQuestion = (surveyObj) =>{ + let questions = []; + surveyObj.attributes.map((element)=>{ + questions.push({ + questionStatement : element.code, + type : element.additionalDetails.type, + required : element.required, + options : element.additionalDetails.options, + uuid : element.code, + surveyId : surveyObj.code, + status: "ACTIVE" + }) + }) + return questions; +} + const SurveyDetails = ({ location, match }) => { let isMobile = window.Digit.Utils.browser.isMobile(); const { id } = useParams(); @@ -65,36 +90,67 @@ const SurveyDetails = ({ location, match }) => { return (sHours + ":" + sMinutes); } - const { isLoading, data: surveyData } = Digit.Hooks.survey.useSearch( - { tenantIds: tenantIdForInboxSearch, uuid: id }, - { - select: (data) => { - const surveyObj = data?.Surveys?.[0]; - return { - //tenantIds: { code: surveyObj.tenantId }, - uuid: surveyObj.uuid, - title: surveyObj.title, - description: surveyObj.description, - fromDate: format(new Date(surveyObj.startDate), "yyyy-MM-dd"), - toDate: format(new Date(surveyObj.endDate), "yyyy-MM-dd"), - fromTime: convertTime12To24(new Date(surveyObj.startDate).toLocaleString("en-IN",{hour: "numeric", minute:"numeric",hour12:true})), - toTime: convertTime12To24(new Date(surveyObj.endDate).toLocaleString("en-IN",{hour: "numeric", minute:"numeric",hour12:true})), - questions: surveyObj.questions.map(({ questionStatement, type, required, options, uuid, surveyId, qorder, status }) => ({ - questionStatement, - type: /*TypeAnswerEnum[type]*/type, - required, - options, - uuid, - surveyId, - qorder, - status - })), - status: surveyObj.status, - tenantId: { code: surveyObj.tenantId }, - }; - }, - } - ); + let ServiceDefinitionCriteria = { + tenantId: Digit.ULBService.getCurrentTenantId(), + code: [id], + // code:["test 2406231131"], + module: ["engagement"] + } + + const { isLoading, data: surveyData } = Digit.Hooks.survey.useCfdefinitionsearchresult({ServiceDefinitionCriteria},{ + select: (data) => { + const surveyObj = data?.ServiceDefinition?.[0]; + console.log(surveyObj) + return { + uuid: surveyObj.code, + title: surveyObj.code, + description: surveyObj.additionalDetails.description, + fromDate: format(new Date(surveyObj.additionalDetails.startDate), "yyyy-MM-dd"), + toDate: format(new Date(surveyObj.additionalDetails.endDate), "yyyy-MM-dd"), + fromTime: convertTime12To24(new Date(surveyObj.additionalDetails.startDate).toLocaleString("en-IN",{hour: "numeric", minute:"numeric",hour12:true})), + toTime: convertTime12To24(new Date(surveyObj.additionalDetails.endDate).toLocaleString("en-IN",{hour: "numeric", minute:"numeric",hour12:true})), + questions: setSurveyQuestion(surveyObj), + status: isActive(surveyObj.additionalDetails.startDate,surveyObj.additionalDetails.endDate)?"ACTIVE":"INACTIVE", + tenantId: { code: surveyObj.tenantId }, + additionalDetails: surveyObj.additionalDetails, + attributes: surveyObj.attributes, + clientId: surveyObj.clientId, + code: surveyObj.code, + id: surveyObj.id + }; + }, + }) + + // const { data: surveyData } = Digit.Hooks.survey.useSearch( + // { tenantIds: tenantIdForInboxSearch, uuid: id }, + // { + // select: (data) => { + // const surveyObj = data?.Surveys?.[0]; + // return { + // //tenantIds: { code: surveyObj.tenantId }, + // uuid: surveyObj.uuid, + // title: surveyObj.title, + // description: surveyObj.description, + // fromDate: format(new Date(surveyObj.startDate), "yyyy-MM-dd"), + // toDate: format(new Date(surveyObj.endDate), "yyyy-MM-dd"), + // fromTime: convertTime12To24(new Date(surveyObj.startDate).toLocaleString("en-IN",{hour: "numeric", minute:"numeric",hour12:true})), + // toTime: convertTime12To24(new Date(surveyObj.endDate).toLocaleString("en-IN",{hour: "numeric", minute:"numeric",hour12:true})), + // questions: surveyObj.questions.map(({ questionStatement, type, required, options, uuid, surveyId, qorder, status }) => ({ + // questionStatement, + // type: /*TypeAnswerEnum[type]*/type, + // required, + // options, + // uuid, + // surveyId, + // qorder, + // status + // })), + // status: surveyObj.status, + // tenantId: { code: surveyObj.tenantId }, + // }; + // }, + // } + // ); const isSurveyActive = useMemo(() => { const surveyStartTime = new Date(`${surveyData?.fromDate} ${surveyData?.fromTime}`).getTime(); @@ -133,24 +189,59 @@ const SurveyDetails = ({ location, match }) => { const onEdit = (data) => { const { collectCitizenInfo, title, description, tenantIds, fromDate, toDate, fromTime, toTime, questions } = data; const mappedQuestions = mapQuestions(questions,surveyData); + let serveyMappedQuestions = []; + let userToken = window.localStorage.getItem("token") + questions && questions.length && questions.map((element,index)=>{ + serveyMappedQuestions.push({ + "tenantId": tenantIds?.[0]?.code, + "code": element.formConfig.questionStatement, + "dataType": "String", + "values": null, + "required": element.formConfig.required, + "isActive": true, + "reGex": null, + "order": index++, + "additionalDetails": { + type: element.formConfig.type.i18Key, + options: element.formConfig.options || ["NA"] + } + }) + }) const details = { - SurveyEntity: { - uuid: surveyData.uuid, - //tenantIds: tenantIds.map(({ code }) => code), - tenantId: tenantIds[0]?.code ? tenantIds[0]?.code : surveyData.tenantId.code, - title, - description, - startDate: new Date(`${fromDate} ${fromTime}`).getTime(), - endDate: new Date(`${toDate} ${toTime}`).getTime(), - questions: mappedQuestions, - status:isSurveyActive?"ACTIVE":"INACTIVE", - // active:true, - // answersCount:0, - // postedBy:"BPAREG Approver", - //lastmodifiedby:"BPAREG Approver", - //lastmodifiedtime:"1645074240234" - //These are not required to update, only status was required that we were not sending.. - }, + // SurveyEntity: { + // uuid: surveyData.uuid, + // //tenantIds: tenantIds.map(({ code }) => code), + // tenantId: tenantIds[0]?.code ? tenantIds[0]?.code : surveyData.tenantId.code, + // title, + // description, + // startDate: new Date(`${fromDate} ${fromTime}`).getTime(), + // endDate: new Date(`${toDate} ${toTime}`).getTime(), + // questions: mappedQuestions, + // status:isSurveyActive?"ACTIVE":"INACTIVE", + // // active:true, + // // answersCount:0, + // // postedBy:"BPAREG Approver", + // //lastmodifiedby:"BPAREG Approver", + // //lastmodifiedtime:"1645074240234" + // //These are not required to update, only status was required that we were not sending.. + // }, + + ServiceDefinition: { + tenantId: surveyData.tenantId.code, + code: title, + module: "engagement", + isActive: true, + attributes:serveyMappedQuestions, + additionalDetails:{ + title: title, + description: description, + startDate: new Date(`${fromDate} ${fromTime}`).getTime(), + endDate: new Date(`${toDate} ${toTime}`).getTime(), + postedBy: surveyData.additionalDetails.postedBy + }, + clientId: surveyData.clientId, + id: surveyData.id, + } }; try{ @@ -171,8 +262,29 @@ const SurveyDetails = ({ location, match }) => { }; const handleDelete = () => { + // const details = { + // SurveyEntity: { ...surveyData, tenantId: tenantId?.code ? tenantId?.code : tenantId }, + // }; + // history.push("/digit-ui/employee/engagement/surveys/delete-response", details); const details = { - SurveyEntity: { ...surveyData, tenantId: tenantId?.code ? tenantId?.code : tenantId }, + // SurveyEntity: { ...surveyData, + // tenantId, + // questions: surveyData.questions.map(filterQuestion), + // status: "INACTIVE", + // }, + ServiceDefinition: { + tenantId: surveyData.tenantId.code, + code: surveyData.code, + module: "engagement", + isActive: false, + attributes: surveyData.attributes, + additionalDetails: { + ...surveyData.additionalDetails, + }, + clientId: surveyData.clientId, + id: surveyData.id + + } }; history.push("/digit-ui/employee/engagement/surveys/delete-response", details); }; @@ -181,25 +293,55 @@ const SurveyDetails = ({ location, match }) => { const handleMarkActive = (data) => { const { fromDate, toDate, fromTime, toTime } = data; const details = { - SurveyEntity: { - ...surveyData, - status: "ACTIVE", - startDate: new Date(`${fromDate} ${fromTime}`).getTime(), - endDate: new Date(`${toDate} ${toTime}`).getTime(), - questions: surveyData.questions.map(filterQuestion), - tenantId, - }, + // SurveyEntity: { + // ...surveyData, + // status: "ACTIVE", + // startDate: new Date(`${fromDate} ${fromTime}`).getTime(), + // endDate: new Date(`${toDate} ${toTime}`).getTime(), + // questions: surveyData.questions.map(filterQuestion), + // tenantId, + // }, + ServiceDefinition: { + tenantId: surveyData.tenantId.code, + code: surveyData.code, + module: "engagement", + isActive: true, + attributes: surveyData.attributes, + additionalDetails: { + ...surveyData.additionalDetails, + endDate: new Date(`${toDate} ${toTime}`).getTime(), + startDate: new Date(`${fromDate} ${fromTime}`).getTime(), + }, + clientId: surveyData.clientId, + id: surveyData.id, + } + }; history.push("/digit-ui/employee/engagement/surveys/update-response", details); }; const handleMarkInactive = () => { const details = { - SurveyEntity: { ...surveyData, - tenantId, - questions: surveyData.questions.map(filterQuestion), - status: "INACTIVE", - }, + // SurveyEntity: { ...surveyData, + // tenantId, + // questions: surveyData.questions.map(filterQuestion), + // status: "INACTIVE", + // }, + ServiceDefinition: { + tenantId: surveyData.tenantId.code, + code: surveyData.code, + module: "engagement", + isActive: true, + attributes: surveyData.attributes, + additionalDetails: { + ...surveyData.additionalDetails, + startDate:null, + endDate:null + + }, + clientId: surveyData.clientId, + id: surveyData.id, + } }; history.push("/digit-ui/employee/engagement/surveys/update-response", details); }; @@ -216,7 +358,6 @@ const SurveyDetails = ({ location, match }) => { if (isLoading) return ; - return (
{t("CS_COMMON_SURVEYS")}
diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/SurveyResults.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/SurveyResults.js index 05750696848..a907bfebdea 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/SurveyResults.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/SurveyResults.js @@ -6,6 +6,28 @@ import { ActionBar, Card, SubmitBar, Menu,Loader } from "@egovernments/digit-ui- import { format } from "date-fns"; import SurveyResultsView from '../../../components/Surveys/ResultsView/SurveyResultsView'; +const isActive = (startDate, endDate) => { + const currentDate = new Date().getTime(); + if (startDate < currentDate && currentDate <= endDate) { + return true; + } + return false; +}; + +const setSurveyQuestion = (surveyObj) =>{ + let questions = []; + surveyObj.attributes.map((element)=>{ + questions.push({ + questionStatement : element.code, + type : TypeAnswerEnum[element.additionalDetails.type], + required : element.required, + options : element?.additionalDetails?.options || ["NA"], + uuid : element.code, + surveyId : surveyObj.code + }) + }) + return questions; +} const TypeAnswerEnum = { SHORT_ANSWER_TYPE: "Short Answer", @@ -19,54 +41,108 @@ const TypeAnswerEnum = { const SurveyResults = () => { const tenantId = Digit.ULBService.getCurrentTenantId(); const params = useParams(); - const mutation = Digit.Hooks.survey.useShowResults(); + // const mutation = Digit.Hooks.survey.useShowResults(); const queryClient = useQueryClient(); + const user = Digit.UserService.getUser(); + + let ServiceDefinitionCriteria = { + tenantId: Digit.ULBService.getCurrentTenantId(), + code: [params.id], + module: ["engagement"] + } + + let ServiceCriteria = { + tenantId: Digit.ULBService.getCurrentTenantId(), + ids: [], + serviceDefIds: [], + referenceIds: [params.id], + } + + const { data: selecedSurveyresults } = Digit.Hooks.survey.useSelectedSurveySearch({ServiceCriteria},{}) + if (selecedSurveyresults?.Service?.length){ + let questions = [] + selecedSurveyresults?.Service.map((element)=>{ + element.attributes.map((ele)=>{ + questions.push({ + answer: typeof(JSON.parse(ele.value)) === "string" ? [JSON.parse(ele.value)] : JSON.parse(ele.value), + citizenId: element.accountId, + questionId: ele.attributeCode, + uuid: ele.id, + auditDetails: element.auditDetails + }) + }) + + }) + selecedSurveyresults.answers = questions; + + } + + const { data: selecedSurveyData, isLoading } = Digit.Hooks.survey.useCfdefinitionsearchresult({ServiceDefinitionCriteria},{ + select: (data) => { + const surveyObj = data?.ServiceDefinition?.[0]; + return{ + // uuid: surveyObj.code, + title: surveyObj.code, + description: surveyObj.additionalDetails.description, + fromDate: format(new Date(surveyObj.additionalDetails.startDate), "yyyy-MM-dd"), + toDate: format(new Date(surveyObj.additionalDetails.endDate), "yyyy-MM-dd"), + fromTime: format(new Date(surveyObj.additionalDetails.startDate), "hh:mm"), + toTime: format(new Date(surveyObj.additionalDetails.endDate), "hh:mm"), + questions:setSurveyQuestion(surveyObj), + status: isActive(surveyObj.additionalDetails.startDate,surveyObj.additionalDetails.endDate)?"ACTIVE":"INACTIVE", + answersCount:1, + } + + } + }) + + useEffect(() => { - const onSuccess = () => { - queryClient.clear(); - }; - mutation.mutate({ - surveyId:params.id - }, { - onSuccess, - }); + // const onSuccess = () => { + // queryClient.clear(); + // }; + // mutation.mutate({ + // surveyId:params.id + // }, { + // onSuccess, + // }); }, []); - const { isLoading, data: surveyData } = Digit.Hooks.survey.useSearch( - { tenantIds: tenantId, uuid: params.id }, - { - select: (data) => { - const surveyObj = data?.Surveys?.[0]; - return { - //tenantIds: { code: surveyObj.tenantId }, - uuid: surveyObj.uuid, - title: surveyObj.title, - description: surveyObj.description, - fromDate: format(new Date(surveyObj.startDate), "yyyy-MM-dd"), - toDate: format(new Date(surveyObj.endDate), "yyyy-MM-dd"), - fromTime: format(new Date(surveyObj.startDate), "hh:mm"), - toTime: format(new Date(surveyObj.endDate), "hh:mm"), - questions: surveyObj.questions.map(({ questionStatement, type, required, options, uuid, surveyId }) => ({ - questionStatement, - type: TypeAnswerEnum[type], - required, - options, - uuid, - surveyId - })), - status: surveyObj.status, - answersCount:surveyObj.answersCount, - }; - }, - } - ); + // const { data: surveyData } = Digit.Hooks.survey.useSearch( + // { tenantIds: tenantId, uuid: params.id }, + // { + // select: (data) => { + // const surveyObj = data?.Surveys?.[0]; + // return { + // //tenantIds: { code: surveyObj.tenantId }, + // // uuid: surveyObj.uuid, + // title: surveyObj.title, + // description: surveyObj.description, + // fromDate: format(new Date(surveyObj.startDate), "yyyy-MM-dd"), + // toDate: format(new Date(surveyObj.endDate), "yyyy-MM-dd"), + // fromTime: format(new Date(surveyObj.startDate), "hh:mm"), + // toTime: format(new Date(surveyObj.endDate), "hh:mm"), + // questions: surveyObj.questions.map(({ questionStatement, type, required, options, uuid, surveyId }) => ({ + // questionStatement, + // type: TypeAnswerEnum[type], + // required, + // options, + // uuid, + // surveyId + // })), + // status: surveyObj.status, + // answersCount:surveyObj.answersCount, + // }; + // }, + // } + // ); + if(isLoading) return // else if(mutation.isLoading) return // //if(mutation.isError) return
An error occured...
- - return + return } diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/responses/create.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/responses/create.js index 32d6e8be529..edcc8efeba8 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/responses/create.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/responses/create.js @@ -4,12 +4,13 @@ import React, { useEffect,useState } from "react"; import { useTranslation } from "react-i18next"; import { Link,useHistory } from "react-router-dom"; const getMessage = (mutation) => { - if (mutation.isSuccess) return mutation.data?.Surveys?.[0]?.uuid; + if (mutation.isSuccess) return mutation.data?.ServiceDefinition?.[0]?.id; return ""; }; const BannerPicker = (props) => { const { t } = useTranslation(); + console.log(props.mutation,"props.mutation") return ( { const queryClient = useQueryClient(); const { t } = useTranslation(); const tenantId = Digit.ULBService.getCurrentTenantId(); - const mutation = Digit.Hooks.survey.useCreate(); + const mutation = Digit.Hooks.survey.useServeyCreateDef(); const { state } = props.location; const history = useHistory(); const [isActionClicked,setIsActionClicked] = useState(false) @@ -61,6 +62,7 @@ const Acknowledgement = (props) => { if(option === t("GO_BACK_TO_HOME")) history.push("/digit-ui/employee") else if(option === t("CREATE_ANOTHER_SURVEY")) history.push("/digit-ui/employee/engagement/surveys/create") } + return ( { const queryClient = useQueryClient(); const { t } = useTranslation(); const tenantId = Digit.ULBService.getCurrentTenantId(); - const mutation = Digit.Hooks.survey.useDelete(); + // const mutation = Digit.Hooks.survey.useDelete(); + const mutation = Digit.Hooks.survey.useUpdateSurvey(); const { state } = props.location; useEffect(() => { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/responses/update.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/responses/update.js index 00f5e1f22a8..0090fe92c86 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/responses/update.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/engagement/src/pages/employee/CitizenSurveys/responses/update.js @@ -5,21 +5,19 @@ import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; const getMessage = (mutation) => { - if (mutation.isSuccess && mutation?.data?.Surveys?.[0]?.uuid){ - return mutation?.data?.Surveys?.[0]?.uuid - } - if (mutation.isSuccess) return mutation.data?.Documents?.[0]?.uuid; + if (mutation.isSuccess) return mutation.data?.ServiceDefinition?.[0]?.id; return ""; }; const BannerPicker = (props) => { const { t } = useTranslation(); + console.log(props,"props") return ( ); }; @@ -28,7 +26,7 @@ const Response = (props) => { const queryClient = useQueryClient(); const { t } = useTranslation(); const tenantId = Digit.ULBService.getCurrentTenantId(); - const mutation = Digit.Hooks.survey.useUpdate(); + const mutation = Digit.Hooks.survey.useUpdateSurvey(); const { state } = props.location; useEffect(() => { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/Module.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/Module.js index b77e725dd76..7612d888d49 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/Module.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/Module.js @@ -60,6 +60,7 @@ import AdvanceCollection from "./pageComponents/AdvanceCollection"; import SelectTrips from "./pageComponents/SelectTrips"; import PlusMinusInput from "./pageComponents/PlusMinusInput"; import ConfirmationBox from "./components/Confirmation"; +import SelectLocalityOrGramPanchayat from "./pageComponents/SelectLocalityOrGramPanchayat"; const FSMModule = ({ stateCode, userType, tenants }) => { const moduleCode = "FSM"; @@ -216,6 +217,7 @@ const componentsToRegister = { SelectTrips, PlusMinusInput, ConfirmationBox, + SelectLocalityOrGramPanchayat, }; export const initFSMComponents = () => { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/ApplicationTimeline.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/ApplicationTimeline.js index 476133bc5cf..61e49d3bb69 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/ApplicationTimeline.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/ApplicationTimeline.js @@ -2,19 +2,19 @@ import React, { Fragment } from "react"; import { useTranslation } from "react-i18next"; import { Link, useHistory, useParams } from "react-router-dom"; import { - Header, + // Header, ActionLinks, - Card, + // Card, CardSectionHeader, ConnectingCheckPoints, CheckPoint, - KeyNote, + // KeyNote, SubmitBar, - LinkButton, + // LinkButton, Loader, Rating, } from "@egovernments/digit-ui-react-components"; -import _ from "lodash"; +// import _ from "lodash"; import TLCaption from "./TLCaption"; export const ApplicationTimeline = (props) => { @@ -85,15 +85,15 @@ export const ApplicationTimeline = (props) => { if (checkpoint?.numberOfTrips) caption.comment = `${t("NUMBER_OF_TRIPS")}: ${checkpoint?.numberOfTrips}`; return ; } - else if (checkpoint.status === "PENDING_PAYYY") { + /* else if (checkpoint.status === "PENDING_PAYYY") { const caption = { name: checkpoint?.assigner, mobileNumber: checkpoint?.assigner?.mobileNumber, date: `${t("CS_FSM_EXPECTED_DATE")} ${Digit.DateUtils.ConvertTimestampToDate(props.application?.possibleServiceDate)}`, }; - return ; + return ; */ }; -} +// } const showNextActions = (nextAction) => { switch (nextAction?.action) { @@ -106,7 +106,7 @@ export const ApplicationTimeline = (props) => { state: { tenantId: props.application.tenantId }, }} > - {window.location.href.includes("citizen/fsm/") && } +
); @@ -125,7 +125,7 @@ export const ApplicationTimeline = (props) => { return ; } - +/* let deepCopy = _.cloneDeep( data ) let index1 =0 deepCopy?.timeline.map((check,index) => { @@ -137,7 +137,7 @@ deepCopy?.timeline.map((check,index) => { data.timeline[index].status ="ASSING_DSO_PAY" data.timeline.splice(index, 0, obj); } -}) +}) */ return ( {!isLoading && ( @@ -148,7 +148,8 @@ deepCopy?.timeline.map((check,index) => { )} {data?.timeline && data?.timeline?.length === 1 ? ( - + + ) : ( {data?.timeline && @@ -158,7 +159,7 @@ deepCopy?.timeline.map((check,index) => { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/DesktopInbox.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/DesktopInbox.js index 170819ecc0e..7d322a63806 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/DesktopInbox.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/DesktopInbox.js @@ -135,7 +135,7 @@ const DesktopInbox = (props) => { let citizen_info = props?.fstprequest?.find((i) => row.original.tripDetails[0].referenceNo === i.applicationNo); return (
- {t(`${citizen_info?.address?.locality?.code}`)} + {t(`${citizen_info?.address?.locality?.name}`)}
); }, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/FsmCard.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/FsmCard.js index 6e0e69b516e..cd288a66eda 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/FsmCard.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/FsmCard.js @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { ArrowRightInbox, ShippingTruck, EmployeeModuleCard, AddNewIcon, ViewReportIcon, InboxIcon } from "@egovernments/digit-ui-react-components"; -import { checkForEmployee } from "../utils"; +// import { checkForEmployee } from "../utils"; const ArrowRight = ({ to }) => ( @@ -18,6 +18,8 @@ const FSMCard = () => { const FSM_CREATOR = Digit.UserService.hasAccess("FSM_CREATOR_EMP") || false; const isFSTPOperator = Digit.UserService.hasAccess("FSM_EMP_FSTPO") || false; + const [total, setTotal] = useState("-"); + // Septage ready for Disposal ( 10 KL) // Septage disposed today ( 50 KL) const tenantId = Digit.ULBService.getCurrentTenantId(); @@ -61,7 +63,7 @@ const FSMCard = () => { else return { uuid: { code: "ASSIGNED_TO_ME", name: t("ES_INBOX_ASSIGNED_TO_ME") } }; }; - const { data: inbox, isFetching: pendingApprovalRefetching, isLoading: isInboxLoading } = Digit.Hooks.fsm.useInbox( + const { data: inbox, isFetching: pendingApprovalRefetching } = Digit.Hooks.fsm.useInbox( tenantId, { ...filters, limit: 10, offset: 0, ...getUUIDFilter() }, { @@ -69,16 +71,33 @@ const FSMCard = () => { } ); + useEffect(() => { + if (inbox) { + const total = inbox?.totalCount || 0; + setTotal(total); + } + }, [inbox]); + + const moduleForSomeFSMAdmin = FSM_ADMIN + ? [ + { + link: "/digit-ui/employee/fsm/registry", + label: t("ES_TITLE_FSM_REGISTRY"), + icon: , + }, + ] + : []; + const propsForFSTPO = { Icon: , - moduleName: t("ES_COMMON_FSTP_OPERATION"), + moduleName: t("ES_TITLE_VEHICLE_LOG"), // kpis: isSuccess ? Object.keys(info).map((key, index) => ({ // label: t(key), // count: t(info[key]), // link: "/digit-ui/employee/fsm/fstp-inbox" // })): [], links: [ - { + /*{ label: t("ES_COMMON_INBOX"), link: "/digit-ui/employee/fsm/fstp-inbox", }, @@ -90,64 +109,69 @@ const FSMCard = () => { label: t("ES_FSM_VIEW_REPORTS_BUTTON"), link: "/employee/report/fsm/FSMFSTPPlantWithVehicleLogReport", hyperlink: true, + }, */ + { + label: t("ES_COMMON_HOME"), + link: "/digit-ui/employee/fsm/fstp-operations", }, ], }; - let links = [ - { - link: "/employee/report/fsm/FSMDailyDesludingReport", - hyperlink: true, - label: t("ES_FSM_VIEW_REPORTS_BUTTON"), - roles: ["FSM_ADMIN"], - }, - { - label: t("ES_TITLE_FSM_REGISTRY"), - link: `/digit-ui/employee/fsm/registry`, - roles: ["FSM_ADMIN"], - }, - { - label: t("ES_TITLE_NEW_DESULDGING_APPLICATION"), - link: `/digit-ui/employee/fsm/new-application`, - roles: ["FSM_CREATOR_EMP", "FSM_ADMIN"], - }, - { - label: t("ES_TITILE_SEARCH_APPLICATION"), - link: `/digit-ui/employee/fsm/search`, - }, - ]; + if (isFSTPOperator && isSuccess) { + return ; + } - links = links.filter((link) => (link.roles ? checkForEmployee(link.roles) : true)); + const linksForSomeFSMEmployees = + !DSO && !COLLECTOR && !FSM_EDITOR + ? [ + { + label: t("ES_TITLE_NEW_DESULDGING_APPLICATION"), + link: `/digit-ui/employee/fsm/new-application`, + }, + ] + : []; - const propsForModuleCard = { - Icon: , - moduleName: t("ES_TITLE_FAECAL_SLUDGE_MGMT"), - kpis: [ - { - count: isInboxLoading ? "-" : inbox?.totalCount, - label: t("TOTAL_FSM"), - link: `/digit-ui/employee/fsm/inbox`, - }, - { - count: isInboxLoading ? "-" : inbox?.nearingSlaCount, - label: t("TOTAL_NEARING_SLA"), - link: `/digit-ui/employee/fsm/inbox`, - }, - ], - links: [ - { - count: isInboxLoading ? "-" : inbox?.totalCount, - link: "/digit-ui/employee/fsm/inbox", - label: t("ES_COMMON_INBOX"), - }, - ...links, - ], - }; + const propsForModuleCard = isFSTPOperator + ? { + Icon: , + moduleName: t("ES_TITLE_VEHICLE_LOG"), + // kpis: isSuccess ? Object.keys(info).map((key, index) => ({ + // label: t(key), + // count: t(info[key]), + // link: "/digit-ui/employee/fsm/fstp-inbox" + // })): [], + links: [ + { + label: t("ES_COMMON_HOME"), + link: "/digit-ui/employee/fsm/fstp-operations", + }, + ], + } + : { + Icon: , + moduleName: t("ES_TITLE_FAECAL_SLUDGE_MGMT"), + kpis: [ + { + count: total, + label: t("TOTAL_FSM"), + link: `/digit-ui/employee/fsm/inbox`, + }, + { + label: t("TOTAL_NEARING_SLA"), + link: `/digit-ui/employee/fsm/inbox`, + }, + ], + links: [ + { + count: total, + label: t("ES_COMMON_INBOX"), + link: `/digit-ui/employee/fsm/inbox`, + }, + ...linksForSomeFSMEmployees, + ...moduleForSomeFSMAdmin, + ], + }; - return isFSTPOperator ? ( - - ) : ( - - ); + return ; }; -export default FSMCard; +export default FSMCard; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/RegistrySearch.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/RegistrySearch.js index 2c94330e716..b5891626081 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/RegistrySearch.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/RegistrySearch.js @@ -182,14 +182,14 @@ const SearchApplication = ({ onSearch, type, onClose, onTabChange, isFstpOperato
{showAddMenu && ( - + )}
{searchFields?.map((input, index) => ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/TLTimelineInFSM.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/TLTimelineInFSM.js index f3bc3234a53..46368270571 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/TLTimelineInFSM.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/TLTimelineInFSM.js @@ -10,7 +10,7 @@ const getAction = (flow) => { break; case "APPLY": actions = [ 'FSM_TIMELINE_PROPERTY_DETAILS', - // 'FSM_GENDER_DETAILS', + 'FSM_GENDER_DETAILS', 'FSM_PAYMENT_DETAILS', 'FSM_TIMELINE_SUMMARY', ] diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/inbox/Filter.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/inbox/Filter.js index b2b9166f6d7..a2806b67d6f 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/inbox/Filter.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/inbox/Filter.js @@ -46,16 +46,13 @@ const Filter = ({ searchParams, paginationParms, onFilterChange, onSearch, remov const clearAll = () => { if (isFstpOperator) return onFilterChange(); - onFilterChange({ applicationStatus: [], locality: [] }); + // onFilterChange({ applicationStatus: [], locality: [] }); // props?.onClose?.(); }; return ( - {((!DSO && !isFstpOperator && searchParams && (searchParams?.applicationStatus?.length > 0 || searchParams?.locality?.length > 0)) || - mergedRoleDetails?.statuses?.length > 0 || - isFstpOperatorRequest) && ( -
+ {((!DSO && !isFstpOperator && searchParams) || (mergedRoleDetails?.statuses?.length > 0) || (isFstpOperatorRequest)) &&
{t("ES_COMMON_FILTER_BY")}:
@@ -73,15 +70,15 @@ const Filter = ({ searchParams, paginationParms, onFilterChange, onSearch, remov )}
- {/*
+
{!DSO && !isFstpOperator && searchParams && ( )} -
*/} - {/* {GetSelectOptions(t("ES_INBOX_LOCALITY"), localities, selectedLocality, onSelectLocality, "code", onRemove, "locality", "name")} */} - {/*
*/} +
+ {/* {GetSelectOptions(t("ES_INBOX_LOCALITY"), localities, selectedLocality, onSelectLocality, "code", onRemove, "locality", "name")} */} +
{/* */} - {/*
*/} +
{mergedRoleDetails?.statuses?.length > 0 || isFstpOperatorRequest ? (
@@ -119,8 +116,8 @@ const Filter = ({ searchParams, paginationParms, onFilterChange, onSearch, remov
- )} - {props.type === "mobile" && ( + } + {props.type === "mobile" && props.onClose && ( { - onSearch(); + if (props.type === "mobile") onSearch({ delete: ["applicationNos"] }); + else onSearch(); }} style={{ flex: 1 }} /> diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/inbox/search.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/inbox/search.js index 7f9b866dc98..b1624bc6159 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/inbox/search.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/inbox/search.js @@ -131,7 +131,7 @@ const SearchApplication = ({ onSearch, type, onClose, isFstpOperator, searchFiel
)} -
+
{searchFields?.map((input, index) => ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/getPDFData.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/getPDFData.js index 2bee8d7d134..02728f7e06a 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/getPDFData.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/getPDFData.js @@ -9,6 +9,17 @@ const getSlumName = (application, t) => { } return application?.slum?.i18nKey ? t(`${application?.slum?.i18nKey}`) : "N/A"; }; +/* +const getDistanceofPitFromRoad = (distancefromroad) => { + if (!distancefromroad) + return "N/A"; + return distancefromroad;}; + +const getRoadWidth = (roadWidth) => { + if (!roadWidth) + return "N/A"; + return roadWidth;}; +*/ const getApplicationVehicleCapacity = (vehicleCapacity) => { if (!vehicleCapacity) return "N/A"; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/AdvanceCollection.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/AdvanceCollection.js index 7ee2f3ab84b..42c53147432 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/AdvanceCollection.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/AdvanceCollection.js @@ -38,7 +38,7 @@ const AdvanceCollection = ({ t, config, onSelect, formData, userType, FSMTextFie title: t("ES_NEW_APPLICATION_AMOUNT_INVALID"), }, - default: formData?.advanceAmount, + default: url.includes("modify") ? applicationData?.advanceAmount : formData?.advanceAmount, isMandatory: true, }, ]; @@ -56,7 +56,13 @@ const AdvanceCollection = ({ t, config, onSelect, formData, userType, FSMTextFie setVehicle({ label: formData?.tripData?.vehicleType?.capacity }); } - if (formData?.propertyType && formData?.subtype && formData?.address && formData?.tripData?.vehicleType?.capacity) { + if ( + formData?.propertyType && + formData?.subtype && + formData?.address && + formData?.tripData?.vehicleType?.capacity && + formData?.address?.propertyLocation?.code === "WITHIN_ULB_LIMITS" + ) { const capacity = formData?.tripData?.vehicleType.capacity; const { slum: slumDetails } = formData.address; const slum = slumDetails ? "YES" : "NO"; @@ -78,11 +84,11 @@ const AdvanceCollection = ({ t, config, onSelect, formData, userType, FSMTextFie Digit.SessionStorage.set("advance_amount", advanceBalanceAmount); setTotalAmount(totaltripAmount); setAdvanceAmounts(advanceBalanceAmount); - !url.includes("modify") || (url.includes("modify") && advanceBalanceAmount > formData?.advancepaymentPreference?.advanceAmount) - ? setValue({ - advanceAmount: advanceBalanceAmount, - }) - : null; + if (!url.includes("modify") || (url.includes("modify") && advanceBalanceAmount > formData?.advancepaymentPreference?.advanceAmount)) { + setValue({ + advanceAmount: advanceBalanceAmount, + }); + } setError(false); } else { sessionStorage.removeItem("Digit.total_amount"); @@ -92,6 +98,37 @@ const AdvanceCollection = ({ t, config, onSelect, formData, userType, FSMTextFie } })(); }, [formData?.propertyType, formData?.subtype, formData?.address?.slum, formData?.tripData?.vehicleType?.capacity, formData?.tripData?.noOfTrips]); + + useEffect(() => { + (async () => { + if (formData?.address?.propertyLocation?.code === "FROM_GRAM_PANCHAYAT" && formData.tripData.noOfTrips && formData.tripData.amountPerTrip) { + const totaltripAmount = formData.tripData.amountPerTrip * formData.tripData.noOfTrips; + + const { advanceAmount: advanceBalanceAmount } = await Digit.FSMService.advanceBalanceCalculate(tenantId, { + totalTripAmount: totaltripAmount, + }); + Digit.SessionStorage.set("total_amount", totaltripAmount); + Digit.SessionStorage.set("advance_amount", advanceBalanceAmount); + setTotalAmount(totaltripAmount); + setAdvanceAmounts(advanceBalanceAmount); + if (formData?.address?.propertyLocation?.code === "FROM_GRAM_PANCHAYAT" && url.includes("modify")) { + setValue({ + advanceAmount: 0, + }); + } else if ( + !url.includes("modify") || + url.includes("modify") || + (formData?.advancepaymentPreference?.advanceAmount > 0 && advanceBalanceAmount > formData?.advancepaymentPreference?.advanceAmount) + ) { + setValue({ + advanceAmount: advanceBalanceAmount, + }); + } + + setError(false); + } + })(); + }, [formData.tripData.noOfTrips, formData.tripData.amountPerTrip]); return isVehicleMenuLoading && isDsoLoading ? ( ) : ( @@ -99,7 +136,6 @@ const AdvanceCollection = ({ t, config, onSelect, formData, userType, FSMTextFie {formData?.tripData?.amountPerTrip !== 0 && inputs?.map((input, index) => { let currentValue = formData && formData[config.key] && formData[config.key][input.name]; - return ( @@ -110,15 +146,17 @@ const AdvanceCollection = ({ t, config, onSelect, formData, userType, FSMTextFie
0 + ? false + : true : false } type={input.type} key={input.name} style={FSMTextFieldStyle} onChange={(e) => setAdvanceAmount(e.target.value)} - value={input.default ? input.default : formData && formData[config.key] ? formData[config.key][input.name] : null} + value={formData && formData[config.key] ? formData[config.key][input.name] : applicationData?.advanceAmount} {...input.validation} /> {currentValue > TotalAmount && ( @@ -132,11 +170,11 @@ const AdvanceCollection = ({ t, config, onSelect, formData, userType, FSMTextFie )} {url.includes("modify-application") && - Number(AdvanceAmount) === 0 && applicationData?.advanceAmount > 0 && + Number(formData?.tripData?.amountPerTrip) > 0 && Number(currentValue) === 0 && ( - {t("FSM_ADVANCE_AMOUNT_NOT_ZERO")} + {t("FSM_ADVANCE_AMOUNT_LESS_THAN_AMOUNT_PER_TRIP")} )}
diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/CheckSlum.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/CheckSlum.js index 9f0eed0a632..841104b71a2 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/CheckSlum.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/CheckSlum.js @@ -13,9 +13,12 @@ const CheckSlum = ({ t, config, onSelect, userType, formData }) => { const onSkip = () => onSelect(); function goNext() { - sessionStorage.removeItem("Digit.total_amount") + sessionStorage.removeItem("Digit.total_amount"); onSelect(config.key, { slumArea }); } + useEffect(() => { + if (formData?.address?.propertyLocation?.code === "FROM_GRAM_PANCHAYAT") onSkip(); + }, [formData]); return ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/FSMSelectAddress.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/FSMSelectAddress.js index 7f14a804c36..4464a06ec60 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/FSMSelectAddress.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/FSMSelectAddress.js @@ -1,11 +1,33 @@ import React, { useEffect, useState } from "react"; import { FormStep, CardLabel, Dropdown, RadioButtons, LabelFieldPair, RadioOrSelect } from "@egovernments/digit-ui-react-components"; import Timeline from "../components/TLTimelineInFSM"; +import { useLocation } from "react-router-dom"; const FSMSelectAddress = ({ t, config, onSelect, userType, formData }) => { const allCities = Digit.Hooks.fsm.useTenants(); let tenantId = Digit.ULBService.getCurrentTenantId(); + if (userType !== "employee") { + tenantId = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; + } + const location = useLocation(); + const isNewVendor = location.pathname.includes("new-vendor"); + const isEditVendor = location.pathname.includes("modify-vendor"); + const inputs = [ + { + active: true, + code: "WITHIN_ULB_LIMITS", + i18nKey: "WITHIN_ULB_LIMITS", + name: "Witnin ULB Limits", + }, + { + active: true, + code: "FROM_GRAM_PANCHAYAT", + i18nKey: "FROM_GRAM_PANCHAYAT", + name: "From Gram Panchayat", + }, + ]; + const { pincode, city } = formData?.address || ""; const cities = userType === "employee" @@ -14,7 +36,10 @@ const FSMSelectAddress = ({ t, config, onSelect, userType, formData }) => { ? allCities.filter((city) => city?.pincode?.some((pin) => pin == pincode)) : allCities; - const [selectedCity, setSelectedCity] = useState(() => formData?.address?.city || Digit.SessionStorage.get("fsm.file.address.city") || null); + const [selectedCity, setSelectedCity] = useState( + () => formData?.address?.city || Digit.SessionStorage.get("fsm.file.address.city") || Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY") + ); + const [newLocality, setNewLocality] = useState(); const { data: fetchedLocalities } = Digit.Hooks.useBoundaryLocalities( selectedCity?.code, "revenue", @@ -23,6 +48,17 @@ const FSMSelectAddress = ({ t, config, onSelect, userType, formData }) => { }, t ); + + const { data: urcConfig } = Digit.Hooks.fsm.useMDMS(tenantId, "FSM", "UrcConfig"); + const isUrcEnable = urcConfig && urcConfig.length > 0 && urcConfig[0].URCEnable; + const [selectLocation, setSelectLocation] = useState(() => + formData?.address?.propertyLocation + ? formData?.address?.propertyLocation + : Digit.SessionStorage.get("locationType") + ? Digit.SessionStorage.get("locationType") + : inputs[0] + ); + const [localities, setLocalities] = useState(); const [selectedLocality, setSelectedLocality] = useState(); @@ -35,7 +71,16 @@ const FSMSelectAddress = ({ t, config, onSelect, userType, formData }) => { }, [cities]); useEffect(() => { - if (selectedCity && fetchedLocalities) { + if (selectedCity && selectLocation) { + if (userType === "employee") { + onSelect(config.key, { + ...formData[config.key], + city: selectedCity, + propertyLocation: selectLocation, + }); + } + } + if ((!isUrcEnable || isNewVendor || isEditVendor) && selectedCity && fetchedLocalities) { let __localityList = fetchedLocalities; let filteredLocalityList = []; @@ -59,7 +104,7 @@ const FSMSelectAddress = ({ t, config, onSelect, userType, formData }) => { } } } - }, [selectedCity, formData?.address?.pincode, fetchedLocalities]); + }, [selectedCity, selectLocation, fetchedLocalities]); function selectCity(city) { setSelectedLocality(null); @@ -68,6 +113,29 @@ const FSMSelectAddress = ({ t, config, onSelect, userType, formData }) => { setSelectedCity(city); } + function selectedValue(value) { + setSelectLocation(value); + Digit.SessionStorage.set("locationType", value); + if (userType === "employee") { + if (value.code === "FROM_GRAM_PANCHAYAT") { + onSelect("tripData", { + ...formData["tripData"], + amountPerTrip: "", + amount: "", + }); + onSelect(config.key, { + ...formData[config.key], + propertyLocation: value, + }); + } else { + onSelect(config.key, { + ...formData[config.key], + propertyLocation: value, + }); + } + } + } + function selectLocality(locality) { setSelectedLocality(locality); if (userType === "employee") { @@ -75,8 +143,18 @@ const FSMSelectAddress = ({ t, config, onSelect, userType, formData }) => { } } + const onNewLocality = (value) => { + setNewLocality(value); + if (userType === "employee") { + onSelect(config.key, { ...formData[config.key], newLocality: value }); + } + }; + function onSubmit() { - onSelect(config.key, { city: selectedCity, locality: selectedLocality }); + onSelect(config.key, { + city: selectedCity, + propertyLocation: Digit.SessionStorage.get("locationType") ? Digit.SessionStorage.get("locationType") : selectLocation, + }); } if (userType === "employee") { @@ -98,41 +176,70 @@ const FSMSelectAddress = ({ t, config, onSelect, userType, formData }) => { t={t} />
- - - {t("ES_NEW_APPLICATION_LOCATION_MOHALLA")} - {config.isMandatory ? " * " : null} - - - + {!isUrcEnable || isNewVendor || isEditVendor ? ( +
+ + + {t("ES_NEW_APPLICATION_LOCATION_MOHALLA")} + {config.isMandatory ? " * " : null} + + + + {!isNewVendor && !isEditVendor && !isUrcEnable && formData?.address?.locality?.name === "Other" && ( + + {`${t("ES_INBOX_PLEASE_SPECIFY_LOCALITY")} *`} +
+ onNewLocality(e.target.value)} /> +
+
+ )} +
+ ) : ( + + {`${t("CS_PROPERTY_LOCATION")} *`} +
+ +
+
+ )}
); } return ( - + + {isUrcEnable && ( + + {`${t("CS_PROPERTY_LOCATION")} *`} + + + )} {`${t("MYCITY_CODE_LABEL")} *`} - {selectedCity && localities && {`${t("CS_CREATECOMPLAINT_MOHALLA")} *`}} - {selectedCity && localities && ( - - )} ); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectGender.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectGender.js index 8c2467c7f8e..83f6281d478 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectGender.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectGender.js @@ -44,7 +44,7 @@ const SelectGender = ({ config, onSelect, t, userType, formData }) => { className="payment-form-text-input-correction" isMandatory={config.isMandatory} selected={genderType} - option={GenderData} + option={GenderData?.sort((a, b) => a.code.localeCompare(b.code))} select={selectGenderType} optionKey="i18nKey" disable={config.disable} @@ -58,7 +58,7 @@ const SelectGender = ({ config, onSelect, t, userType, formData }) => { a.code.localeCompare(b.code))} selectedOption={genderType} optionKey="i18nKey" onSelect={selectGenderType} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectLocalityOrGramPanchayat.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectLocalityOrGramPanchayat.js new file mode 100644 index 00000000000..144d413b404 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectLocalityOrGramPanchayat.js @@ -0,0 +1,369 @@ +import { CardLabel, Dropdown, FormStep, LabelFieldPair, TextInput } from "@egovernments/digit-ui-react-components"; +import _ from "lodash"; +import React, { useEffect, useState } from "react"; +import { useForm } from "react-hook-form"; +import Timeline from "../components/TLTimelineInFSM"; + +const SelectLocalityOrGramPanchayat = ({ t, config, onSelect, userType, formData, formState }) => { + const allCities = Digit.Hooks.fsm.useTenants(); + let tenantId = Digit.ULBService.getCurrentTenantId(); + if (userType !== "employee") { + tenantId = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; + } + const { data: urcConfig } = Digit.Hooks.fsm.useMDMS(tenantId, "FSM", "UrcConfig"); + const isUrcEnable = urcConfig && urcConfig.length > 0 && urcConfig[0].URCEnable; + const { pincode, city, propertyLocation } = formData?.address || ""; + const cities = + userType === "employee" + ? allCities.filter((city) => city?.code === tenantId) + : pincode + ? allCities.filter((city) => city?.pincode?.some((pin) => pin == pincode)) + : allCities; + const [selectedLocality, setSelectedLocality] = useState(); + const [localities, setLocalities] = useState(); + const [gramPanchayats, setGramPanchayats] = useState(); + const [selectedGp, setSelectedGp] = useState(() => + formData?.address?.additionalDetails?.gramPanchayat ? formData?.address?.additionalDetails?.gramPanchayat : {} + ); + const [villages, setVillages] = useState([]); + const [selectedVillage, setSelectedVillage] = useState(() => + formData?.address?.additionalDetails?.village ? formData?.address?.additionalDetails?.village : {} + ); + const [newVillage, setNewVillage] = useState(); + const [newGp, setNewGp] = useState(); + const [newLocality, setNewLocality] = useState(); + const [selectedCity, setSelectedCity] = useState(() => formData?.address?.city || Digit.SessionStorage.get("fsm.file.address.city") || null); + useEffect(() => { + if (cities) { + if (cities.length === 1) { + setSelectedCity(cities[0]); + } + } + }, [cities]); + var { data: fetchedGramPanchayats } = Digit.Hooks.useBoundaryLocalities( + selectedCity?.code, + "gramPanchayats", + { + enabled: !!selectedCity, + }, + t + ); + + var { data: fetchedLocalities } = Digit.Hooks.useBoundaryLocalities( + selectedCity?.code, + "revenue", + { + enabled: !!selectedCity, + }, + t + ); + + useEffect(() => { + if (selectedCity && fetchedLocalities) { + let __localityList = fetchedLocalities; + let filteredLocalityList = []; + + if (formData?.address?.locality && formData?.address?.additionalDetails?.boundaryType === "Locality") { + setSelectedLocality(formData.address.locality); + setNewLocality(formData?.address?.additionalDetails?.newLocality); + } + + if (formData?.address?.pincode) { + filteredLocalityList = __localityList.filter((obj) => obj.pincode?.find((item) => item == formData.address.pincode)); + if (!formData?.address?.locality) setSelectedLocality(); + } + setLocalities(() => (filteredLocalityList.length > 0 ? filteredLocalityList : __localityList)); + + if (filteredLocalityList.length === 1) { + setSelectedLocality(filteredLocalityList[0]); + if (userType === "employee") { + onSelect(config.key, { + ...formData[config.key], + locality: filteredLocalityList[0], + }); + } + } + } + }, [selectedCity, fetchedLocalities]); + + useEffect(() => { + if (fetchedGramPanchayats) { + if (fetchedGramPanchayats && fetchedGramPanchayats.length > 0) { + setGramPanchayats(fetchedGramPanchayats); + } + if (formData?.address?.additionalDetails?.gramPanchayat?.code) { + const filteredGramPanchayat = fetchedGramPanchayats.filter( + (obj) => obj?.code === formData?.address?.additionalDetails?.gramPanchayat?.code + )[0]; + setSelectedGp(filteredGramPanchayat); + setNewGp(formData?.address?.additionalDetails?.newGp); + var villageUnderGp = filteredGramPanchayat?.children.filter((obj) => obj?.code === formData?.address?.additionalDetails?.village?.code); + if (villageUnderGp.length > 0) { + villageUnderGp[0].i18nkey = tenantId.replace(".", "_").toUpperCase() + "_REVENUE_" + villageUnderGp[0]?.code; + setSelectedVillage(villageUnderGp[0]); + setVillages(villageUnderGp); + } else { + setNewVillage(typeof formData?.address?.additionalDetails?.village === "string" ? formData?.address?.additionalDetails?.village : ""); + } + } + } + }, [fetchedGramPanchayats, formData?.address?.additionalDetails?.gramPanchayat?.code]); + if (userType !== "employee" && propertyLocation?.code === "FROM_GRAM_PANCHAYAT") { + config.texts.cardText = "CS_FILE_APPLICATION_PROPERTY_LOCATION_GRAM_PANCHAYAT_TEXT"; + } + + function selectLocality(locality) { + setSelectedLocality(locality); + if (userType === "employee") { + onSelect(config.key, { ...formData[config.key], locality: locality }); + } + } + + function selectGramPanchayat(value) { + setSelectedGp(value); + const filteredVillages = fetchedGramPanchayats.filter((items) => items?.code === value?.code)[0].children; + const localitiesWithLocalizationKeys = filteredVillages?.map((obj) => ({ + ...obj, + i18nkey: tenantId.replace(".", "_").toUpperCase() + "_REVENUE_" + obj?.code, + })); + if (localitiesWithLocalizationKeys?.length > 0) { + setVillages(localitiesWithLocalizationKeys); + } + if (userType === "employee") { + onSelect(config.key, { ...formData[config.key], gramPanchayat: value }); + } + Digit.SessionStorage.del("locationType"); + } + + function selectVillage(value) { + setSelectedVillage(value); + if (userType === "employee") { + onSelect(config.key, { ...formData[config.key], village: value }); + } + } + + const onChangeVillage = (value) => { + setNewVillage(value); + if (userType === "employee") { + onSelect(config.key, { ...formData[config.key], newVillage: value }); + } + }; + const onNewGpChange = (value) => { + setNewGp(value); + if (userType === "employee") { + onSelect(config.key, { ...formData[config.key], newGp: value }); + } + }; + const onNewLocality = (value) => { + setNewLocality(value); + if (userType === "employee") { + onSelect(config.key, { ...formData[config.key], newLocality: value }); + } + }; + function onSubmit() { + if (propertyLocation?.code === "FROM_GRAM_PANCHAYAT") { + onSelect(config.key, { + gramPanchayat: selectedGp, + village: selectedVillage, + newGramPanchayat: newGp, + newVillage: newVillage, + }); + } else { + onSelect(config.key, { + locality: selectedLocality, + newLocality: newLocality, + }); + } + } + if (userType === "employee") { + return ( +
+ {propertyLocation?.code === "FROM_GRAM_PANCHAYAT" ? ( +
+ + + {t("CS_GRAM_PANCHAYAT")} + {config.isMandatory ? " * " : null} + + a.name.localeCompare(b.name))} + select={selectGramPanchayat} + optionKey="i18nkey" + t={t} + /> + + {selectedGp?.name === "Other" && ( + + {`${t("ES_INBOX_PLEASE_SPECIFY_GRAM_PANCHAYAT")} *`} +
+ onNewGpChange(e.target.value)} /> +
+
+ )} + {villages.length > 0 && ( + + {t("CS_VILLAGE_NAME")} + a.name.localeCompare(b.name))} + select={selectVillage} + optionKey="i18nkey" + t={t} + /> + + )} + {villages.length === 0 && ( + + {t("CS_VILLAGE_NAME")} +
+ onChangeVillage(e.target.value)} /> +
+
+ )} +
+ ) : ( + isUrcEnable && ( +
+ + + {t("CS_CREATECOMPLAINT_MOHALLA")} + {config.isMandatory ? " * " : null} + + a.name.localeCompare(b.name))} + select={selectLocality} + optionKey="i18nkey" + t={t} + /> + + {formData?.address?.locality?.name === "Other" && ( + + {`${t("ES_INBOX_PLEASE_SPECIFY_LOCALITY")} *`} +
+ onNewLocality(e.target.value)} /> +
+
+ )} +
+ ) + )} +
+ ); + } + return ( + + + + {propertyLocation?.code === "WITHIN_ULB_LIMITS" ? ( +
+ + + {`${t("CS_CREATECOMPLAINT_MOHALLA")} *`} + {/* {config.isMandatory ? " * " : null} */} + + a.name.localeCompare(b.name))} + select={selectLocality} + optionKey="i18nkey" + t={t} + /> + + {selectedLocality?.name === "Other" && ( + + {`${t("ES_INBOX_PLEASE_SPECIFY_LOCALITY")} *`} + onNewLocality(e.target.value)} + /> + + )} +
+ ) : ( +
+ + + {`${t("CS_GRAM_PANCHAYAT")} *`} + {/* {config.isMandatory ? " * " : null} */} + + a.name.localeCompare(b.name))} + select={selectGramPanchayat} + optionKey="i18nkey" + t={t} + /> + + {selectedGp?.name === "Other" && ( + + {`${t("ES_INBOX_PLEASE_SPECIFY_GRAM_PANCHAYAT")} *`} + onNewGpChange(e.target.value)} + /> + + )} + {villages.length > 0 && ( + + {t("CS_VILLAGE_NAME")} + a.name.localeCompare(b.name))} + select={selectVillage} + optionKey="i18nkey" + t={t} + /> + + )} + {villages.length === 0 && ( + + {t("CS_VILLAGE_NAME")} + onChangeVillage(e.target.value)} + /> + + )} +
+ )} +
+
+ ); +}; + +export default SelectLocalityOrGramPanchayat; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectName.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectName.js index a1413119307..a2e379ebe8b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectName.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectName.js @@ -33,7 +33,14 @@ const SelectName = ({ t, config, onSelect, formData = {}, userType, register, er }, componentInFront:
+91
, isMandatory: true, - } + }, + { + label: "COMMON_APPLICANT_GENDER", + type: "dropdown", + name: "applicantGender", + options: genderTypes, + isMandatory: false, + }, ]; useEffect(() => { @@ -84,7 +91,7 @@ const SelectName = ({ t, config, onSelect, formData = {}, userType, register, er
a.code.localeCompare(b.code))} optionKey="i18nKey" id="dropdown" selected={formData && formData[config.key] ? input.options.find((data) => data.code === formData[config.key][input.name]) : null} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPaymentPreference.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPaymentPreference.js index e81896e27f9..218958e515c 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPaymentPreference.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPaymentPreference.js @@ -49,24 +49,34 @@ const SelectPaymentPreference = ({ config, formData, t, onSelect, userType }) => useEffect(() => { (async () => { - if (formData?.propertyType && formData?.subtype && formData?.address && formData?.selectTripNo?.vehicleCapacity.capacity) { + if (formData?.propertyType && formData?.subtype && formData?.address && formData?.selectTripNo?.vehicleCapacity.capacity && + formData?.address?.propertyLocation?.code === "WITHIN_ULB_LIMITS") { const capacity = formData?.selectTripNo?.vehicleCapacity.capacity; const { slum: slumDetails } = formData.address; const slum = slumDetails ? "YES" : "NO"; - const billingDetails = await Digit.FSMService.billingSlabSearch(tenantId, { - propertyType: formData?.subtype?.code, - capacity, - slum, - }); + const billingDetails = await Digit.FSMService.billingSlabSearch( + tenantId === formData?.address?.city?.code + ? tenantId + : formData?.address?.city?.code, + { + propertyType: formData?.subtype?.code, + capacity, + slum, + }); const billSlab = billingDetails?.billingSlab?.length && billingDetails?.billingSlab[0]; Digit.SessionStorage.set("amount_per_trip", billSlab.price); if (billSlab?.price) { let totaltripAmount = billSlab.price * formData?.selectTripNo?.tripNo?.code; - const { advanceAmount: advanceBalanceAmount } = await Digit.FSMService.advanceBalanceCalculate(tenantId, { - totalTripAmount: totaltripAmount, - }); + const { advanceAmount: advanceBalanceAmount } = + await Digit.FSMService.advanceBalanceCalculate( + tenantId === formData?.address?.city?.code + ? tenantId + : formData?.address?.city?.code, + { + totalTripAmount: totaltripAmount, + }); setMinAmount(advanceBalanceAmount); setTotalAmount(totaltripAmount); Digit.SessionStorage.set("total_amount", totaltripAmount); @@ -84,6 +94,10 @@ const SelectPaymentPreference = ({ config, formData, t, onSelect, userType }) => sessionStorage.removeItem("Digit.advance_amount"); setError(true); } + } else { + setAdvanceAmount(0); + Digit.SessionStorage.set("advance_amount", 0); + Digit.SessionStorage.set("amount_per_trip", null); } })(); }, [ @@ -115,7 +129,27 @@ const SelectPaymentPreference = ({ config, formData, t, onSelect, userType }) => isDisabled={currentValue > max ? true : false || currentValue < min ? true : false} t={t} > - + + {formData?.address?.propertyLocation?.code === + "FROM_GRAM_PANCHAYAT" && ( + + {t("FSM_TOTAL_AMOUNT_NOTE")} + + )} {inputs?.map((input, index) => { return ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPincode.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPincode.js index 51e92511cfa..8984065b620 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPincode.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPincode.js @@ -23,6 +23,7 @@ const SelectPincode = ({ t, config, onSelect, formData = {}, userType, register, max: "9999999", title: t("CORE_COMMON_PINCODE_INVALID"), }, + disable: true, }, ]; @@ -79,7 +80,7 @@ const SelectPincode = ({ t, config, onSelect, formData = {}, userType, register, {config.isMandatory ? " * " : null}
- +
{pincodeServicability && ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPitType.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPitType.js index 187a5c1eb28..bc7af913d00 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPitType.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPitType.js @@ -29,7 +29,16 @@ const SelectPitType = ({ t, formData, config, onSelect, userType }) => { return ; } if (userType === "employee") { - return ; + return ( + a.name.localeCompare(b.name))} + optionKey="i18nKey" + select={selectPitType} + selected={pitType} + t={t} + /> + ); } return ( @@ -38,7 +47,7 @@ const SelectPitType = ({ t, formData, config, onSelect, userType }) => { {t("CS_FILE_APPLICATION_PIT_TYPE_LABEL")} a.name.localeCompare(b.name))} selectedOption={pitType} optionKey="i18nKey" onSelect={selectPitType} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPropertySubtype.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPropertySubtype.js index 05f00aa3cf0..64a9db85ea1 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPropertySubtype.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPropertySubtype.js @@ -60,14 +60,30 @@ const SelectPropertySubtype = ({ config, onSelect, t, userType, formData }) => { // }, [propertyType]) if (userType === "employee") { - return ; + return ( + a.name.localeCompare(b.name))} + optionKey="i18nKey" + id="propertySubType" + selected={subtype} + select={selectedSubType} + t={t} + disable={url.includes("/modify-application/") || url.includes("/new-application") ? false : true} + /> + ); } else { return ( {`${t("CS_FILE_APPLICATION_PROPERTY_SUBTYPE_LABEL")} *`} - + a.name.localeCompare(b.name))} + selectedOption={subtype} + optionKey="i18nKey" + onSelect={selectedValue} + t={t} + /> ); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPropertyType.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPropertyType.js index ec4ccdf4c59..8937d5d7ef3 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPropertyType.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPropertyType.js @@ -33,23 +33,55 @@ const SelectPropertyType = ({ config, onSelect, t, userType, formData }) => { onSelect(config.key, value.code); } + const getInfoContent = () => { + let content = t("CS_DEFAULT_INFO_TEXT"); + if (formData && formData.selectPaymentPreference && formData.selectPaymentPreference.code === "PRE_PAY") { + content = t("CS_CHECK_INFO_PAY_NOW"); + } else { + content = t("CS_CHECK_INFO_PAY_LATER"); + } + return content; + }; + if (propertyTypesData.isLoading) { return ; } if (userType === "employee") { - return ; + return ( + a.name.localeCompare(b.name))} + optionKey="i18nKey" + id="propertyType" + selected={propertyType} + select={selectedType} + t={t} + disable={url.includes("/modify-application/") || url.includes("/new-application") ? false : true} + /> + ); } else { return ( {`${t("CS_FILE_APPLICATION_PROPERTY_LABEL")} *`} - + a.name.localeCompare(b.name))} + selectedOption={propertyType} + optionKey="i18nKey" + onSelect={selectedValue} + t={t} + /> - {propertyType && } + {propertyType && ( + + )} ); } }; export default SelectPropertyType; + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectRoadDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectRoadDetails.js index e988a5ed161..0df0d9dd83e 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectRoadDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectRoadDetails.js @@ -102,6 +102,7 @@ console.log("formData",formData) onSelect={(data) => onSelect(config.key, data)} isDisabled={roadWidth && distance ? false : true} t={t} + onSkip={onSkip} /> ); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectSlumName.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectSlumName.js index c190ecdd968..fca3dbbe30e 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectSlumName.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectSlumName.js @@ -66,6 +66,11 @@ const SelectSlumName = ({ config, onSelect, t, userType, formData }) => { } }, [slumDataLoading, formData?.address?.locality?.code]); + useEffect(() => { + if (formData?.address?.propertyLocation?.code === "FROM_GRAM_PANCHAYAT") + onSkip(); + }, [formData?.address?.propertyLocation?.code]); + function selectSlum(value) { setSlum(value); onSelect(config.key, { ...formData[config.key], slum: value.code }); @@ -83,10 +88,12 @@ const SelectSlumName = ({ config, onSelect, t, userType, formData }) => { if (slumDataLoading) return ; return userType === "employee" ? ( + formData?.address?.propertyLocation !== "FROM_GRAM_PANCHAYAT" && ( {t("ES_NEW_APPLICATION_SLUM_NAME")} + ) ) : ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTripData.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTripData.js index 7016d596a69..f1a7d4755b8 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTripData.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTripData.js @@ -54,7 +54,9 @@ const SelectTripData = ({ t, config, onSelect, formData = {}, userType }) => { title: t("ES_APPLICATION_BILL_SLAB_ERROR"), }, default: formData?.tripData?.amountPerTrip, - disable: true, + disable: formData?.address?.propertyLocation?.code === "FROM_GRAM_PANCHAYAT" + ? false + : true, isMandatory: true, }, { @@ -75,6 +77,14 @@ const SelectTripData = ({ t, config, onSelect, formData = {}, userType }) => { onSelect(config.key, { ...formData[config.key], noOfTrips: value }); } + function setAmount(value) { + onSelect(config.key, { + ...formData[config.key], + amountPerTrip: value, + amount: value * formData.tripData.noOfTrips, + }); + } + function selectVehicle(value) { setVehicle({ label: value.capacity }); onSelect(config.key, { ...formData[config.key], vehicleType: value }); @@ -89,7 +99,8 @@ const SelectTripData = ({ t, config, onSelect, formData = {}, userType }) => { setVehicle({ label: formData?.tripData?.vehicleType?.capacity }); } - if (formData?.propertyType && formData?.subtype && formData?.address && formData?.tripData?.vehicleType?.capacity) { + if (formData?.propertyType && formData?.subtype && formData?.address && formData?.tripData?.vehicleType?.capacity && + formData?.address?.propertyLocation?.code === "WITHIN_ULB_LIMITS") { const capacity = formData?.tripData?.vehicleType.capacity; const { slum: slumDetails } = formData.address; const slum = slumDetails ? "YES" : "NO"; @@ -112,10 +123,18 @@ const SelectTripData = ({ t, config, onSelect, formData = {}, userType }) => { amount: "", }); setError(true); - } + } + } else if ( + formData?.address?.propertyLocation?.code === "FROM_GRAM_PANCHAYAT" && + formData.tripData.noOfTrips && + formData.tripData.amountPerTrip + ) { + setValue({ + amount: formData.tripData.amountPerTrip * formData.tripData.noOfTrips, + }); } })(); - }, [formData?.propertyType, formData?.subtype, formData?.address?.slum, formData?.tripData?.vehicleType?.capacity, formData?.tripData?.noOfTrips]); + }, [formData?.propertyType, formData?.subtype, formData?.address?.slum, formData?.tripData?.vehicleType?.capacity, formData?.tripData?.noOfTrips && formData?.address?.propertyLocation?.code]); return isVehicleMenuLoading && isDsoLoading ? ( @@ -130,7 +149,13 @@ const SelectTripData = ({ t, config, onSelect, formData = {}, userType }) => {
setTripNum(e.target.value)} + onChange={(e) => + index === 0 && + formData.address.propertyLocation?.code === + "FROM_GRAM_PANCHAYAT" + ? setAmount(e.target.value) + : setTripNum(e.target.value) + } key={input.name} value={input.default ? input.default : formData && formData[config.key] ? formData[config.key][input.name] : null} {...input.validation} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTripNo.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTripNo.js index dbb84a5bdc8..3149b69ad12 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTripNo.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTripNo.js @@ -5,12 +5,15 @@ const SelectTripNo = ({ config, formData, t, onSelect, userType }) => { const state = Digit.ULBService.getStateId(); const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); + const selectedCity = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; const { data: tripNumberData, isLoading } = Digit.Hooks.fsm.useMDMS(stateId, "FSM", "TripNumber"); - const { data: dsoData, isLoading: isDsoLoading, isSuccess: isDsoSuccess, error: dsoError } = Digit.Hooks.fsm.useDsoSearch(tenantId, { + const { data: dsoData, isLoading: isDsoLoading, isSuccess: isDsoSuccess, error: dsoError } = Digit.Hooks.fsm.useDsoSearch(selectedCity, { limit: -1, status: "ACTIVE", }); - const { isLoading: isVehicleMenuLoading, data: vehicleData } = Digit.Hooks.fsm.useMDMS(state, "Vehicle", "VehicleType", { staleTime: Infinity }); + const { isLoading: isVehicleMenuLoading, data: vehicleData } = Digit.Hooks.fsm.useMDMS(state, "Vehicle", "VehicleType", { + staleTime: Infinity, + }); const [tripNo, setTripNo] = useState(formData?.tripNo); const [vehicleCapacity, setVehicleCapacity] = useState(formData?.capacity); const [vehicleMenu, setVehicleMenu] = useState([]); @@ -47,14 +50,14 @@ const SelectTripNo = ({ config, formData, t, onSelect, userType }) => { const SelectTrip = (value) => { setTripNo(value); if (userType === "employee") { - null; + return null; } }; const selectVehicle = (value) => { setVehicleCapacity(value); if (userType === "employee") { - null; + return null; } }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTrips.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTrips.js index e4fd2ecbee2..7ac710ab9ec 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTrips.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTrips.js @@ -90,7 +90,21 @@ const SelectTrips = ({ t, config, onSelect, formData = {}, userType, styles, FSM setVehicle({ label: formData?.tripData?.vehicleType?.capacity }); } - if (formData?.propertyType && formData?.subtype && formData?.address && formData?.tripData?.vehicleType?.capacity) { + if ( + formData?.address?.propertyLocation?.code === "FROM_GRAM_PANCHAYAT" && + formData.tripData.noOfTrips && + formData.tripData.amountPerTrip + ) { + setValue({ + amount: formData.tripData.amountPerTrip * formData.tripData.noOfTrips, + }); + } else if ( + formData?.propertyType && + formData?.subtype && + formData?.address && + formData?.tripData?.vehicleType?.capacity && + formData?.address?.propertyLocation?.code === "WITHIN_ULB_LIMITS" + ) { const capacity = formData?.tripData?.vehicleType.capacity; const { slum: slumDetails } = formData.address; const slum = slumDetails ? "YES" : "NO"; @@ -116,7 +130,7 @@ const SelectTrips = ({ t, config, onSelect, formData = {}, userType, styles, FSM } } })(); - }, [formData?.propertyType, formData?.subtype, formData?.address, formData?.tripData?.vehicleType?.capacity, formData?.tripData?.noOfTrips]); + }, [formData?.propertyType, formData?.subtype, formData?.address, formData?.tripData?.vehicleType?.capacity, formData?.tripData?.noOfTrips, formData?.address?.propertyLocation?.code]); return isVehicleMenuLoading && isDsoLoading ? ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectVehicleType.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectVehicleType.js index 210f516b574..3d705f281a6 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectVehicleType.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectVehicleType.js @@ -20,7 +20,7 @@ const SelectVehicleType = ({ t, config, onSelect, userType, formData, setValue } setSelectedType(...vehicleType); setSelectedCapacity(formData?.vehicle?.tankCapacity); } - }, [formData?.vehicle, vehicleData]); + }, [vehicleData]); useEffect(() => { if (selectedModal?.code && selectedModal?.code !== formData?.vehicle?.modal) { @@ -37,6 +37,8 @@ const SelectVehicleType = ({ t, config, onSelect, userType, formData, setValue } useEffect(() => { if (vehicleData) { const vehicleModals = vehicleData.filter((vehicle) => vehicle.make === undefined); + const types = vehicleData.filter((vehicle) => formData?.vehicle?.modal != undefined && vehicle?.make === formData?.vehicle?.modal?.code); + setTypes(types); setModals(vehicleModals); } }, [vehicleData]); @@ -66,7 +68,7 @@ const SelectVehicleType = ({ t, config, onSelect, userType, formData, setValue } isMandatory selected={selectedModal} disable={false} - option={modals} + option={modals?.sort((a, b) => a.name.localeCompare(b.name))} select={selectModal} optionKey="name" t={t} @@ -77,7 +79,15 @@ const SelectVehicleType = ({ t, config, onSelect, userType, formData, setValue } {t("ES_FSM_REGISTRY_VEHICLE_TYPE")} {config.isMandatory ? " * " : null} - + a.name.localeCompare(b.name))} + select={selectType} + optionKey="name" + t={t} + /> diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/Response.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/Response.js index dca73360a50..e350c7d6a8e 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/Response.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/Response.js @@ -29,7 +29,7 @@ const DisplayText = (action, isSuccess, isEmployee, t, data) => { }; const BannerPicker = (props) => { - let actionMessage = props?.action ? props.action : "CREATE"; + let actionMessage = props?.action ? props.action : props.data?.fsm?.[0].applicationStatus; let labelMessage = GetLabel(props.data?.fsm?.[0].applicationStatus || props.action, props.isSuccess, props.isEmployee, props.t); if (props.errorInfo && props.errorInfo !== null && props.errorInfo !== "" && typeof props.errorInfo === "string" && props.action !== "SCHEDULE") { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/MyApplications/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/MyApplications/index.js index d2201406f77..f640cb4c195 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/MyApplications/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/MyApplications/index.js @@ -1,5 +1,5 @@ import React from "react"; -import { Header, Loader } from "@egovernments/digit-ui-react-components"; +import { Header, Loader, Card } from "@egovernments/digit-ui-react-components"; import MyApplication from "./MyApplication"; import { useTranslation } from "react-i18next"; @@ -27,6 +27,11 @@ export const MyApplications = () => {
))} + {applicationsList.length === 0 && ( + +

{`${t("FSM_NO_APPLICATION")} ${userInfo.mobileNumber}`}

+
+ )}
); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/NewApplication/CheckPage.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/NewApplication/CheckPage.js index 235fee85fe2..70b98822b30 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/NewApplication/CheckPage.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/NewApplication/CheckPage.js @@ -43,7 +43,6 @@ const CheckPage = ({ onSubmit, value }) => { return previous + current + "m x "; } }, ""); - return ( @@ -69,7 +68,7 @@ const CheckPage = ({ onSubmit, value }) => { {selectGender && ( } /> )} @@ -80,19 +79,19 @@ const CheckPage = ({ onSubmit, value }) => { /> } /> } /> } /> {address?.landmark?.trim() && ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/NewApplication/Response.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/NewApplication/Response.js index 4c72f53c897..0a48107e416 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/NewApplication/Response.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/NewApplication/Response.js @@ -14,7 +14,7 @@ const BannerPicker = (props) => { return ( @@ -58,7 +58,22 @@ const Response = ({ data, onSuccess }) => { const amount = Digit.SessionStorage.get("total_amount"); const amountPerTrip = Digit.SessionStorage.get("amount_per_trip"); const { subtype, propertyID, pitDetail, address, pitType, source, selectGender, selectPaymentPreference, selectTripNo } = data; - const { city, locality, geoLocation, pincode, street, doorNo, landmark, slum } = address; + const { + city, + locality, + geoLocation, + pincode, + street, + doorNo, + landmark, + slum, + gramPanchayat, + village, + propertyLocation, + newLocality, + newGramPanchayat, + newVillage, + } = address; setPaymentPreference(selectPaymentPreference?.code); const advanceAmount = amount === 0 ? null : selectPaymentPreference?.advanceAmount; amount === 0 ? setZeroPay(true) : setZeroPay(false); @@ -68,21 +83,35 @@ const Response = ({ data, onSuccess }) => { citizen: { gender: selectGender?.code, }, - tenantId: city.code, + tenantId: city?.code, additionalDetails: {}, - propertyUsage: subtype.code, + propertyUsage: subtype?.code, address: { - tenantId: city.code, - additionalDetails: null, + tenantId: city?.code, + additionalDetails: { + boundaryType: propertyLocation?.code === "FROM_GRAM_PANCHAYAT" ? "GP" : "Locality", + gramPanchayat: { + code: gramPanchayat?.code, + name: gramPanchayat?.name, + }, + village: village?.code + ? { + code: village?.code ? village?.code : "", + name: village?.name ? village?.name : "", + } + : newVillage, + newLocality: newLocality, + newGramPanchayat: newGramPanchayat, + }, street: street?.trim(), doorNo: doorNo?.trim(), landmark: landmark?.trim(), slumName: slum, - city: city.name, + city: city?.name, pincode, locality: { - code: locality.code, - name: locality.name, + code: propertyLocation?.code === "WITHIN_ULB_LIMITS" ? locality?.code : gramPanchayat?.code, + name: propertyLocation?.code === "WITHIN_ULB_LIMITS" ? locality?.name : gramPanchayat?.name, }, geoLocation: { latitude: geoLocation?.latitude, @@ -104,12 +133,12 @@ const Response = ({ data, onSuccess }) => { vehicleCapacity: selectTripNo ? selectTripNo?.vehicleCapacity?.capacity : "", additionalDetails: { totalAmount: amount, - tripAmount: amountPerTrip, + tripAmount: typeof amountPerTrip === "number" ? JSON.stringify(amountPerTrip) : amountPerTrip, propertyID : propertyID?.propertyID, - distancefromroad : data.roadWidth.distancefromroad, - roadWidth: data.roadWidth.roadWidth, + distancefromroad : data?.roadWidth?.distancefromroad, + roadWidth: data?.roadWidth?.roadWidth, }, - advanceAmount, + advanceAmount: typeof advanceAmount === "number" ? JSON.stringify(advanceAmount) : advanceAmount, }, workflow: null, }; @@ -121,6 +150,7 @@ const Response = ({ data, onSuccess }) => { }, }); sessionStorage.removeItem("Digit.total_amount"); + sessionStorage.removeItem("Digit.fsm.file.address.city"); } catch (err) {} } }, []); @@ -134,14 +164,20 @@ const Response = ({ data, onSuccess }) => { Digit.Utils.pdf.generate(data); }; const isSuccess = !successData ? mutation?.isSuccess : true; -console.log("mutation",mutation,mutationHappened) + return mutation.isLoading || (mutation.isIdle && !mutationHappened) ? ( ) : ( - {t((paymentPreference && paymentPreference == "POST_PAY") || advancePay ? "CS_FILE_PROPERTY_RESPONSE_POST_PAY" : zeroPay ? "CS_FSM_RESPONSE_CREATE_DISPLAY_ZERO_PAY" : "CS_FILE_PROPERTY_RESPONSE")} + {t( + (paymentPreference && paymentPreference == "POST_PAY") || advancePay + ? "CS_FILE_PROPERTY_RESPONSE_POST_PAY" + : zeroPay + ? "CS_FSM_RESPONSE_CREATE_DISPLAY_ZERO_PAY" + : "CS_FILE_PROPERTY_RESPONSE" + )} {isSuccess && ( { name: "comments", className: "Hello", }, - { + /*{ type: "text", label: t("CS_NO_TRIPS"), name: "noOfTrips", className: "Hello", - }, + }, */ ], }; return ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/index.js index 179fa3174d0..0f60d94c0a9 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/citizen/index.js @@ -19,7 +19,11 @@ const CitizenApp = ({ path }) => { return (
- {location.pathname.includes("/response") || location.pathname.split("/").includes("check") ? null : {t("CS_COMMON_BACK")}} + {location.pathname.includes("/response") || location.pathname.split("/").includes("check") ? null : location.pathname.includes("/street") ? ( + -4}>{t("CS_COMMON_BACK")} + ) : ( + {t("CS_COMMON_BACK")} + )} { + /*useEffect(() => { if (!receivedPaymentLoad) { setReceivedPaymentType(ReceivedPaymentTypeData) } - }, [receivedPaymentLoad, ReceivedPaymentTypeData]); + }, [receivedPaymentLoad, ReceivedPaymentTypeData]); */ useEffect(() => { if (isSuccess && isVehicleDataLoaded && applicationData) { @@ -286,7 +286,7 @@ const ActionModal = ({ t, action, tenantId, state, id, closeModal, submitAction, if (data.subtype && typeof (data.subtype) === "object") applicationData.propertyUsage = data.subtype.code; if (data.subtype && typeof (data.subtype) === "string") applicationData.propertyUsage = data.subtype; if (data.noOfTrips) applicationData.noOfTrips = data.noOfTrips; - if (data.paymentMode) applicationData.additionalDetails.receivedPayment = data.paymentMode.code; + // if (data.paymentMode) applicationData.additionalDetails.receivedPayment = data.paymentMode.code; if (fileStoreId) { if (applicationData.pitDetail.additionalDetails && applicationData.pitDetail.additionalDetails.fileStoreId) { @@ -309,6 +309,8 @@ const ActionModal = ({ t, action, tenantId, state, id, closeModal, submitAction, } useEffect(() => { switch (action) { + case "SCHEDULE": + case "ES_FSM_SCHEDULE": case "UPDATE": setFormValve(true); return setConfig( @@ -382,7 +384,7 @@ const ActionModal = ({ t, action, tenantId, state, id, closeModal, submitAction, case "COMPLETE": case "COMPLETED": setFormValve(true); - return setConfig(configCompleteApplication({ t, vehicle, vehicleCapacity: applicationData?.vehicleCapacity, noOfTrips: applicationData?.noOfTrips, applicationCreatedTime: applicationData?.auditDetails?.createdTime, receivedPaymentType: ReceivedPaymentTypeData, action, module })); + return setConfig(configCompleteApplication({ t, vehicle, vehicleCapacity: applicationData?.vehicleCapacity, noOfTrips: applicationData?.noOfTrips, applicationCreatedTime: applicationData?.auditDetails?.createdTime, action, module })); case "SUBMIT": case "FSM_SUBMIT": return history.push("/digit-ui/employee/fsm/modify-application/" + applicationNumber); @@ -425,7 +427,7 @@ const ActionModal = ({ t, action, tenantId, state, id, closeModal, submitAction, action, }) ); - case "SCHEDULE": + /* case "SCHEDULE": case "ES_FSM_SCHEDULE": setFormValve(true); return setConfig( @@ -440,7 +442,7 @@ const ActionModal = ({ t, action, tenantId, state, id, closeModal, submitAction, action, noOfTrips: applicationData?.noOfTrips }) - ); + ); */ case "PAY": case "ADDITIONAL_PAY_REQUEST": diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/AssignDso.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/AssignDso.js index aecbdc14e61..aee87b083f7 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/AssignDso.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/AssignDso.js @@ -19,7 +19,7 @@ function todayDate() { } function getFilteredDsoData(dsoData, vehicle, vehicleCapacity) { - return dsoData?.filter((e) => e.vehicles?.find((veh) => veh?.capacity == vehicleCapacity)); + return dsoData?.filter((e) => e.vehicles?.find((veh) => veh?.capacity == vehicleCapacity))?.sort((a, b) => a.name.localeCompare(b.name)); } export const configAssignDso = ({ t, dsoData, dso, selectDSO, vehicleMenu, vehicle, vehicleCapacity, selectVehicle, action }) => { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/CompleteApplication.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/CompleteApplication.js index 852fae55ff8..d95a25134ca 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/CompleteApplication.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/CompleteApplication.js @@ -3,7 +3,7 @@ import { DatePicker } from "@egovernments/digit-ui-react-components"; import { RadioButtons } from "@egovernments/digit-ui-react-components"; -export const configCompleteApplication = ({ t, vehicle, vehicleCapacity, noOfTrips, applicationCreatedTime = 0, receivedPaymentType, action, module }) => ({ +export const configCompleteApplication = ({ t, vehicle, vehicleCapacity, noOfTrips, applicationCreatedTime = 0, action, module }) => ({ label: { heading: `ES_FSM_ACTION_TITLE_${action}`, @@ -148,7 +148,7 @@ export const configCompleteApplication = ({ t, vehicle, vehicleCapacity, noOfTri disable: true, // disable: customizationConfig ? !customizationConfig?.noOfTrips?.override : true, }, - module !== "FSM_ZERO_PAY_SERVICE" && { + /*module !== "FSM_ZERO_PAY_SERVICE" && { label: "FSM_PAYMENT_RECEIVED", isMandatory: true, type: "custom", @@ -175,7 +175,7 @@ export const configCompleteApplication = ({ t, vehicle, vehicleCapacity, noOfTri /> ), }, - }, + }, */ ], }, ], diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/RejectApplication.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/RejectApplication.js index d6a41117ed8..c706cdc0992 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/RejectApplication.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/RejectApplication.js @@ -14,7 +14,16 @@ export const configRejectApplication = ({ t, rejectMenu, setReason, reason, acti { label: t(`ES_FSM_ACTION_${action.toUpperCase()}_REASON`), type: "dropdown", - populators: , + populators: ( + a.name.localeCompare(b.name))} + id="reason" + optionKey="i18nKey" + selected={reason} + select={setReason} + /> + ), isMandatory: true, }, { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/RejectFstpo.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/RejectFstpo.js index 75d099111f3..86a641c5b2e 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/RejectFstpo.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/RejectFstpo.js @@ -17,7 +17,7 @@ export const configRejectFstpo = ({ t, rejectMenu, selectReason, reason, action type: "dropdown", populators: ( a.name.localeCompare(b.name))} autoComplete="off" optionKey="i18nKey" id="Reason" diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/index.js index af4a1aa6632..d3b7423bb8d 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/index.js @@ -29,7 +29,7 @@ import { useQueryClient } from "react-query"; import { Link, useHistory, useParams } from "react-router-dom"; import { ViewImages } from "../../../components/ViewImages"; -import _ from "lodash"; +// import _ from "lodash"; const ApplicationDetails = (props) => { const tenantId = Digit.ULBService.getCurrentTenantId(); const state = Digit.ULBService.getStateId(); @@ -75,7 +75,7 @@ const ApplicationDetails = (props) => { : applicationData?.advanceAmount === 0 ? "PAY_LATER_SERVICE" : applicationData?.advanceAmount > 0 - ? "FSM_ADVANCE_PAY_SERVICE_V1" + ? "FSM_ADVANCE_PAY_SERVICE" : applicationData?.paymentPreference === null && applicationData?.additionalDetails?.tripAmount === 0 && applicationData?.additionalDetails?.propertyID===0 && @@ -100,7 +100,7 @@ const ApplicationDetails = (props) => { useEffect(() => { switch (selectedAction) { - case DSO && "SCHEDULE": + case "SCHEDULE": case "DSO_ACCEPT": case "ACCEPT": case "ASSIGN": @@ -119,7 +119,7 @@ const ApplicationDetails = (props) => { return setShowModal(true); case "SUBMIT": case "FSM_SUBMIT": - case !DSO && "SCHEDULE": + // case !DSO && "SCHEDULE": return history.push("/digit-ui/employee/fsm/modify-application/" + applicationNumber); case "PAY": case "FSM_PAY": @@ -196,14 +196,14 @@ const ApplicationDetails = (props) => { date: `${t("CS_FSM_EXPECTED_DATE")} ${Digit.DateUtils.ConvertTimestampToDate(applicationData?.possibleServiceDate)}`, }; return ; - } + /*} else if (checkpoint.status === "PENDING_PAYYY") { const caption = { name: checkpoint?.assigner, mobileNumber: checkpoint?.assigner?.mobileNumber, date: `${t("CS_FSM_EXPECTED_DATE")} ${Digit.DateUtils.ConvertTimestampToDate(applicationData?.possibleServiceDate)}`, }; - return ; + return ; */ }else if (checkpoint.status === "COMPLETED") { return (
@@ -227,7 +227,7 @@ const ApplicationDetails = (props) => { if (checkpoint?.numberOfTrips) caption.comment = `${t("NUMBER_OF_TRIPS")}: ${checkpoint?.numberOfTrips}`; return ; } - else if(checkpoint.status === "ASSING_DSO_PAY") + /*else if(checkpoint.status === "ASSING_DSO_PAY") { const caption = { name: checkpoint?.assigner, @@ -235,13 +235,13 @@ const ApplicationDetails = (props) => { date: `${t("CS_FSM_EXPECTED_DATE")} ${Digit.DateUtils.ConvertTimestampToDate(applicationData?.possibleServiceDate)}`, }; return ; - } + } */ }; if (isLoading) { return ; } - +/* let deepCopy = _.cloneDeep( workflowDetails ) let index1 =0 deepCopy?.data?.timeline.map((check,index) => { @@ -253,7 +253,7 @@ deepCopy?.data?.timeline.map((check,index) => { workflowDetails.data.timeline[index].status ="ASSING_DSO_PAY" workflowDetails.data.timeline.splice(index, 0, obj); } -}) +}) */ return ( {!isLoading ? ( diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/EditApplication/EditForm.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/EditApplication/EditForm.js index bbab2b08384..c79adecc714 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/EditApplication/EditForm.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/EditApplication/EditForm.js @@ -1,6 +1,6 @@ -import React, { useState, useEffect, Fragment } from "react"; +import React, { useState, useEffect } from "react"; import { useHistory } from "react-router-dom"; -import { FormComposer, Header, Loader } from "@egovernments/digit-ui-react-components"; +import { FormComposer, Loader } from "@egovernments/digit-ui-react-components"; import { useTranslation } from "react-i18next"; const isConventionalSpecticTank = (tankDimension) => tankDimension === "lbd"; @@ -22,7 +22,7 @@ const EditForm = ({ tenantId, applicationData, channelMenu, vehicleMenu, sanitat clearSuccessData(); clearError(); }, []); - const defaultValues = { + var defaultValues = { channel: channelMenu.filter((channel) => channel.code === applicationData.source)[0], applicationData: { applicantName: applicationData.citizen.name, @@ -31,8 +31,11 @@ const EditForm = ({ tenantId, applicationData, channelMenu, vehicleMenu, sanitat }, tripData: { noOfTrips: applicationData.noOfTrips, - amountPerTrip: applicationData.additionalDetails.tripAmount, - amount: applicationData.noOfTrips * applicationData.additionalDetails.tripAmount || undefined, + amountPerTrip: applicationData.additionalDetails.tripAmount !== "null" ? applicationData.additionalDetails.tripAmount : "", + amount: + applicationData.additionalDetails.tripAmount !== "null" + ? applicationData.noOfTrips * applicationData.additionalDetails.tripAmount + : undefined, vehicleType: { capacity: applicationData?.vehicleCapacity }, vehicleCapacity: applicationData?.vehicleCapacity, }, @@ -42,7 +45,7 @@ const EditForm = ({ tenantId, applicationData, channelMenu, vehicleMenu, sanitat pincode: applicationData.address.pincode, locality: { ...applicationData.address.locality, - i18nkey: `${applicationData.tenantId.toUpperCase().split(".").join("_")}_REVENUE_${applicationData.address.locality.code}`, + i18nkey: `${applicationData.tenantId.toUpperCase().split(".").join("_")}_REVENUE_${applicationData?.address?.locality?.code}`, }, slum: applicationData.address.slumName, street: applicationData.address.street, @@ -52,20 +55,57 @@ const EditForm = ({ tenantId, applicationData, channelMenu, vehicleMenu, sanitat pitType: sanitationMenu.filter((type) => type.code === applicationData.sanitationtype)[0], pitDetail: applicationData.pitDetail, paymentPreference: applicationData.paymentPreference, - advancepaymentPreference: { advanceAmount: applicationData?.advanceAmount }, + advanceAmount: applicationData.advanceAmount, }; + if ( + (applicationData && applicationData?.address?.additionalDetails?.boundaryType === "Village") || + applicationData?.address?.additionalDetails?.boundaryType === "GP" + ) { + defaultValues.address = { + ...defaultValues.address, + propertyLocation: { + active: true, + code: "FROM_GRAM_PANCHAYAT", + i18nKey: "FROM_GRAM_PANCHAYAT", + name: "From Gram Panchayat", + }, + additionalDetails: { + boundaryType: applicationData?.address?.additionalDetails?.boundaryType, + gramPanchayat: applicationData?.address?.additionalDetails?.gramPanchayat, + village: applicationData?.address?.additionalDetails?.village, + newGp: applicationData?.address?.additionalDetails?.newGramPanchayat, + }, + }; + } else if (applicationData && applicationData?.address?.additionalDetails?.boundaryType === "Locality") { + defaultValues.address = { + ...defaultValues.address, + propertyLocation: { + active: true, + code: "WITHIN_ULB_LIMITS", + i18nKey: "WITHIN_ULB_LIMITS", + name: "Witnin ULB Limits", + }, + additionalDetails: { + boundaryType: applicationData?.address?.additionalDetails?.boundaryType, + newLocality: applicationData?.address?.additionalDetails?.newLocality, + }, + }; + } + const onFormValueChange = (setValue, formData) => { if ( formData?.propertyType && formData?.subtype && - formData?.address?.locality?.code && + (formData?.address?.locality?.code || + (formData?.address?.propertyLocation?.code === "FROM_GRAM_PANCHAYAT" && + (formData?.address?.gramPanchayat?.code || formData?.address?.additionalDetails?.gramPanchayat?.code))) && formData?.tripData?.vehicleType && (formData?.tripData?.amountPerTrip || formData?.tripData?.amountPerTrip === 0) ) { setSubmitValve(true); const pitDetailValues = formData?.pitDetail ? Object.values(formData?.pitDetail).filter((value) => value > 0) : null; - let min = Digit.SessionStorage.get("advance_amount"); + // let min = Digit.SessionStorage.get("advance_amount"); if (formData?.pitType) { if (pitDetailValues === null || pitDetailValues?.length === 0) { setSubmitValve(true); @@ -75,12 +115,12 @@ const EditForm = ({ tenantId, applicationData, channelMenu, vehicleMenu, sanitat setSubmitValve(true); } else setSubmitValve(false); } - if (formData?.tripData?.amountPerTrip !== 0 && (formData?.advancepaymentPreference?.advanceAmount > formData?.tripData?.amount || formData?.advancepaymentPreference?.advanceAmount < min)) { + /*if (formData?.tripData?.amountPerTrip !== 0 && (formData?.advancepaymentPreference?.advanceAmount > formData?.tripData?.amount || formData?.advancepaymentPreference?.advanceAmount < min)) { setSubmitValve(false); } if (applicationData?.advanceAmount > 0 && formData?.advancepaymentPreference?.advanceAmount <= 0) { setSubmitValve(false); - } + } */ } else { setSubmitValve(false); } @@ -111,16 +151,32 @@ const EditForm = ({ tenantId, applicationData, channelMenu, vehicleMenu, sanitat const localityCode = data?.address?.locality?.code; const localityName = data?.address?.locality?.name; const propertyUsage = data?.subtype; - const advanceAmount = amount === 0 ? null : data?.advancepaymentPreference?.advanceAmount; + // const advanceAmount = amount === 0 ? null : data?.advancepaymentPreference?.advanceAmount; const { height, length, width, diameter } = pitDimension; + const advanceAmount = + amount === 0 + ? null + : data?.advancepaymentPreference?.advanceAmount + ? data?.advancepaymentPreference?.advanceAmount + : applicationData.advanceAmount; + const totalAmount = amount * noOfTrips; + const gramPanchayat = data?.address?.gramPanchayat || data?.address?.additionalDetails?.gramPanchayat; + const village = data?.address?.village || data?.address?.additionalDetails?.village; + const propertyLocation = data?.address?.propertyLocation?.code; + const newGp = data?.address?.newGp || data?.address?.additionalDetails?.newGramPanchayat; + const newVillage = data?.address?.newVillage || data?.address?.additionalDetails?.village; + const newLocality = data?.address?.newLocality || data?.address?.additionalDetails?.newLocality; + + const formData = { ...applicationData, sanitationtype: sanitationtype, source: applicationChannel.code, additionalDetails: { ...applicationData.additionalDetails, - tripAmount: amount, + tripAmount: typeof amount === "number" ? JSON.stringify(amount) : amount, + totalAmount: typeof totalAmount === "number" ? JSON.stringify(totalAmount) : totalAmount, }, propertyUsage, vehicleType: data.tripData.vehicleType.type, @@ -144,16 +200,31 @@ const EditForm = ({ tenantId, applicationData, channelMenu, vehicleMenu, sanitat slumName: slum, locality: { ...applicationData.address.locality, - code: localityCode, - name: localityName, + code: propertyLocation === "FROM_GRAM_PANCHAYAT" ? gramPanchayat?.code : localityCode, + name: propertyLocation === "FROM_GRAM_PANCHAYAT" ? gramPanchayat?.name : localityName, }, geoLocation: { ...applicationData.address.geoLocation, latitude: data?.address?.latitude ? data?.address?.latitude : applicationData.address.geoLocation.latitude, longitude: data?.address?.longitude ? data?.address?.longitude : applicationData.address.geoLocation.longitude, }, + additionalDetails: { + boundaryType: propertyLocation === "FROM_GRAM_PANCHAYAT" ? (village?.code ? "Village" : "GP") : "Locality", + gramPanchayat: { + code: gramPanchayat?.code, + name: gramPanchayat?.name, + }, + village: village?.code + ? { + code: village?.code ? village?.code : "", + code: village?.code ? village?.code : "", + } + : newVillage, + newGramPanchayat: newGp, + newLocality: newLocality, + }, }, - advanceAmount, + advanceAmount: typeof advanceAmount === "number" ? JSON.stringify(advanceAmount) : advanceAmount, }; delete formData["responseInfo"]; @@ -177,10 +248,10 @@ const EditForm = ({ tenantId, applicationData, channelMenu, vehicleMenu, sanitat const configs = [...preFields, ...commonFields]; return ( - <> -
-
{t("ES_TITLE_MODIFY_DESULDGING_APPLICATION")}
-
+ // <> + //
+ //
{t("ES_TITLE_MODIFY_DESULDGING_APPLICATION")}
+ //
- + // ); }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Driver/AddDriver.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Driver/AddDriver.js index cbbe57d1ac7..0d171e35f60 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Driver/AddDriver.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Driver/AddDriver.js @@ -41,7 +41,7 @@ const AddDriver = ({ parentUrl, heading }) => { }; const onFormValueChange = (setValue, formData) => { - if (formData?.driverName && formData?.phone && formData?.selectGender) { + if (formData?.driverName && formData?.selectGender) { setSubmitValve(true); } else { setSubmitValve(false); @@ -57,7 +57,7 @@ const AddDriver = ({ parentUrl, heading }) => { const license = data?.license; const gender = data?.selectGender?.code; const emailId = data?.emailId; - const phone = data?.phone; + // const phone = data?.phone; const dob = new Date(`${data.dob}`).getTime() || new Date(`1/1/1970`).getTime(); const additionalDetails = data?.additionalDetails; const formData = { @@ -75,7 +75,7 @@ const AddDriver = ({ parentUrl, heading }) => { gender: gender, dob: dob, emailId: emailId || "abc@egov.com", - mobileNumber: phone, + // mobileNumber: phone, }, vendorDriverStatus: "INACTIVE", }, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Driver/EditDriver.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Driver/EditDriver.js index 5a2cfd2bf11..6b74298355b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Driver/EditDriver.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Driver/EditDriver.js @@ -45,7 +45,7 @@ const EditDriver = ({ parentUrl, heading }) => { selectGender: driverDetails?.driverData?.owner?.gender, dob: driverDetails?.driverData?.owner?.dob && Digit.DateUtils.ConvertTimestampToDate(driverDetails?.driverData?.owner?.dob, "yyyy-MM-dd"), emailId: driverDetails?.driverData?.owner?.emailId === "abc@egov.com" ? "" : driverDetails?.driverData?.owner?.emailId, - phone: driverDetails?.driverData?.owner?.mobileNumber, + // phone: driverDetails?.driverData?.owner?.mobileNumber, additionalDetails: driverDetails?.driverData?.additionalDetails?.description, }; setDefaultValues(values); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Vehicle/EditVehicle.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Vehicle/EditVehicle.js index 57ec101841b..83358d93033 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Vehicle/EditVehicle.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/Vehicle/EditVehicle.js @@ -87,10 +87,10 @@ const EditVehicle = ({ parentUrl, heading }) => { const vehicleType = data?.vehicle?.type?.code || data?.vehicle?.type; const vehicleModal = data?.vehicle?.modal?.code || data?.vehicle?.modal; const tankCapacity = data?.vehicle?.type?.capacity || data?.vehicle?.tankCapacity; - const pollutionCert = new Date(`${data?.pollutionCert}`).getTime(); - const insurance = new Date(`${data?.insurance}`).getTime(); - const roadTax = new Date(`${data?.roadTax}`).getTime(); - const fitnessValidity = new Date(`${data?.fitnessValidity}`).getTime(); + const pollutionCert = data?.pollutionCert > 0 || data?.pollutionCert?.length > 0 ? new Date(`${data?.pollutionCert}`).getTime() : null; + const insurance = data?.insurance > 0 || data?.insurance?.length > 0 ? new Date(`${data?.insurance}`).getTime() : null; + const roadTax = data?.roadTax > 0 || data?.roadTax?.length > 0 ? new Date(`${data?.roadTax}`).getTime() : null; + const fitnessValidity = data?.fitnessValidity > 0 || data?.fitnessValidity?.length > 0 ? new Date(`${data?.fitnessValidity}`).getTime() : null; const additionalDetails = data?.additionalDetails; const formData = { vehicle: { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/index.js index a039fc0e046..df073249ccb 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FSMRegistry/index.js @@ -60,7 +60,7 @@ const FSMRegistry = () => { { vehicleIds: vehicleIds, driverIds: driverIds, - status: "ACTIVE", + // status: "ACTIVE", }, { enabled: false } ); @@ -173,7 +173,7 @@ const FSMRegistry = () => { { label: t("ES_FSM_REGISTRY_SEARCH_VEHICLE_NUMBER"), name: "registrationNumber", - pattern: `[A-Z]{2}\\s{1}[0-9]{2}\\s{0,1}[A-Z]{1,2}\\s{1}[0-9]{4}`, + pattern: `[A-Z]{2}\\s{0,1}[0-9]{2}\\s{0,1}[A-Z]{0,2}\\s{0,1}[0-9]{4}`, title: t("ES_FSM_VEHICLE_FORMAT_TIP"), }, ] diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpAddVehicle.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpAddVehicle.js index 5d8c912dbc9..3ad84d7f905 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpAddVehicle.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpAddVehicle.js @@ -23,7 +23,7 @@ const FstpAddVehicle = ({ onSelect }) => { name: "vehicleNumber", validation: { // "pattern": "[a-zA-Z0-9 ]{1,20}", - pattern: `[A-Z]{2}\\s{1}[0-9]{2}\\s{0,1}[A-Z]{1,2}\\s{1}[0-9]{4}`, + pattern: `[A-Z]{2}[0-9]{2}[A-Z]{0,2}[0-9]{4}`, title: t("ES_FSM_VEHICLE_FORMAT_TIP"), }, }, @@ -36,7 +36,7 @@ const FstpAddVehicle = ({ onSelect }) => { }; function onChange(e) { - e.target.value.trim().length != 0 ? setVehicleNumber(e.target.value) : null; + return e.target.value.trim().length != 0 ? setVehicleNumber(e.target.value) : null; } const isMobile = window.Digit.Utils.browser.isMobile(); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpOperatorDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpOperatorDetails.js index f3b191b791a..593254bffcb 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpOperatorDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpOperatorDetails.js @@ -1,7 +1,7 @@ import React, { Fragment, useState, useEffect, useRef } from "react"; import { useParams, useHistory, useLocation } from "react-router-dom"; import TimePicker from "react-time-picker"; -import { Dropdown, Header, MultiUploadWrapper, TextArea } from "@egovernments/digit-ui-react-components"; +import { Dropdown, Header, MultiUploadWrapper, RadioButtons, TextArea } from "@egovernments/digit-ui-react-components"; import { Card, CardLabel, @@ -41,8 +41,49 @@ const FstpOperatorDetails = () => { const history = useHistory(); const queryClient = useQueryClient(); const tenantId = Digit.ULBService.getCurrentTenantId(); + const allCities = Digit.Hooks.fsm.useTenants(); const state = Digit.ULBService.getStateId(); let { id: applicationNos } = useParams(); + const isNew = history.location.pathname.includes("new") ? true : false; + const { data: urcConfig } = Digit.Hooks.fsm.useMDMS(tenantId, "FSM", "UrcConfig"); + const isUrcEnable = urcConfig && urcConfig.length > 0 && urcConfig[0].URCEnable; + const [selectedCity, setSelectedCity] = useState(() => allCities.filter((city) => city?.code === tenantId)[0] || null); + let inputs = [ + { + active: true, + code: "WITHIN_ULB_LIMITS", + i18nKey: "WITHIN_ULB_LIMITS", + name: "Witnin ULB Limits", + }, + { + active: true, + code: "FROM_GRAM_PANCHAYAT", + i18nKey: "FROM_GRAM_PANCHAYAT", + name: "From Gram Panchayat", + }, + { + active: true, + code: "FROM_OTHER_ULB", + i18nKey: "FROM_OTHER_ULB", + name: "From Other/Outside ULBs", + }, + ]; + const { data: fetchedLocalities } = Digit.Hooks.useBoundaryLocalities( + selectedCity?.code, + "revenue", + { + enabled: !!selectedCity, + }, + t + ); + var { data: fetchedGramPanchayats } = Digit.Hooks.useBoundaryLocalities( + selectedCity?.code, + "gramPanchayats", + { + enabled: !!selectedCity, + }, + t + ); const [filters, setFilters] = useState(applicationNos != undefined ? { applicationNos } : { applicationNos: "null" }); const [isVehicleSearchCompleted, setIsVehicleSearchCompleted] = useState(false); const [searchParams, setSearchParams] = useState({}); @@ -76,6 +117,15 @@ const FstpOperatorDetails = () => { const [newDsoName, setNewDsoName] = useState(null); const [comments, setComments] = useState(); const location = useLocation(); + const [selectLocation, setSelectLocation] = useState(isNew ? inputs[0] : null); + const [gramPanchayats, setGramPanchayats] = useState(); + const [selectedGp, setSelectedGp] = useState(); + const [villages, setVillages] = useState([]); + const [selectedVillage, setSelectedVillage] = useState(); + const [newGramPanchayat, setNewGramPanchayat] = useState(null); + const [newVillage, setNewVillage] = useState(); + const [selectedLocality, setSelectedLocality] = useState(); + const [localities, setLocalities] = useState(); const onChangeVehicleNumber = (value) => { setNewVehicleNumber(value); @@ -102,7 +152,16 @@ const FstpOperatorDetails = () => { enabled: !!isVehicleSearchCompleted, } ); - + useEffect(() => { + if (fetchedLocalities && fetchedLocalities.length > 0) { + setLocalities(fetchedLocalities); + } + }, [fetchedLocalities]); + useEffect(() => { + if (fetchedGramPanchayats && fetchedGramPanchayats.length > 0) { + setGramPanchayats(fetchedGramPanchayats); + } + }, [fetchedGramPanchayats]); useEffect(() => { filterVehicle?.length == 0 ? setCurrentTrip(1) : setCurrentTrip(tripNo - filterVehicle?.length + 1); }, [tripNo, filterVehicle, totalvehicle, totalsuccess, isSuccess]); @@ -218,7 +277,9 @@ const FstpOperatorDetails = () => { }; const handleCreate = () => { - const re = new RegExp("^[A-Z]{2}\\s{1}[0-9]{2}\\s{0,1}[A-Z]{1,2}\\s{1}[0-9]{4}$"); + const re = new RegExp("[A-Z]{2}\\s{0,1}[0-9]{2}\\s{0,1}[A-Z]{0,2}\\s{0,1}[0-9]{4}"); + const dsoName = new RegExp(/^[A-Za-z0-9 ]*$/); + const locality = new RegExp(/^[A-Za-z0-9 ]*$/); if (!re.test(newVehicleNumber)) { setShowToast({ key: "error", action: `ES_FSM_VEHICLE_FORMAT_TIP` }); setTimeout(() => { @@ -226,20 +287,35 @@ const FstpOperatorDetails = () => { }, 5000); return; } - if (newDsoName === null || newDsoName?.trim()?.length === 0) { + if (newDsoName === null || newDsoName?.trim()?.length === 0 || !dsoName.test(newDsoName)) { setShowToast({ key: "error", action: `ES_FSTP_INVALID_DSO_NAME` }); setTimeout(() => { closeToast(); }, 2000); return; } - if (newLocality === null || newLocality?.trim()?.length === 0) { + if ( + selectLocation?.code !== "FROM_GRAM_PANCHAYAT" && + (selectedLocality === undefined || selectedLocality?.name === "Other") && + (newLocality === null || newLocality?.trim()?.length === 0 || !locality.test(newLocality)) + ) { setShowToast({ key: "error", action: `ES_FSTP_INVALID_LOCALITY` }); setTimeout(() => { closeToast(); }, 2000); return; } + if ( + selectLocation?.code === "FROM_GRAM_PANCHAYAT" && + (selectedGp === undefined || selectedGp?.name === "Other") && + (newGramPanchayat === null || newGramPanchayat?.trim()?.length === 0) + ) { + setShowToast({ key: "error", action: `ES_FSTP_SELECT_GRAMPANCHAYAT` }); + setTimeout(() => { + closeToast(); + }, 2000); + return; + } if (tripStartTime === null) { setErrors({ tripStartTime: "ES_FSTP_INVALID_START_TIME" }); tripStartTimeRef.current.scrollIntoView({ behavior: "smooth", block: "center" }); @@ -285,6 +361,13 @@ const FstpOperatorDetails = () => { vehiclecapacity : vehicleCapacity, fileStoreId: uploadedFile, comments: comments, + gramPanchayat: selectedGp, + village: selectedVillage, + newGramPanchayat: newGramPanchayat, + newVillage: newVillage, + boundaryType: selectLocation?.code === "FROM_GRAM_PANCHAYAT" ? "GP" : "Locality", + propertyLocation: selectLocation?.code, + newLocality: newLocality, }; temp.businessService = "FSM_VEHICLE_TRIP"; temp.tripDetails = [ @@ -335,7 +418,7 @@ const FstpOperatorDetails = () => { setShowToast({ key: "success", action: `ES_FSM_DISPOSE_UPDATE_SUCCESS` }); setTimeout(() => { closeToast(); - history.push(`/digit-ui/employee/fsm/fstp-operations`); + history.push(`/digit-ui/employee`); }, 5000); }; @@ -382,16 +465,6 @@ const FstpOperatorDetails = () => { /> ), }, - { - title: `${t("ES_INBOX_LOCALITY")} *`, - value: (tripDetails && tripDetails[0]?.address?.locality?.name) || ( - onChangeLocality(e.target.value)} - value={newLocality} - /> - ), - }, ]; const handleTimeChange = (value, cb) => { @@ -424,6 +497,44 @@ const FstpOperatorDetails = () => { selectfile(newArr[newArr.length - 1]); }; + function selectedValue(value) { + setSelectLocation(value); + } + + function selectGramPanchayat(value) { + setSelectedGp(value); + if (value.name !== "Other") { + const filteredVillages = gramPanchayats.filter((items) => items.code === value.code)[0]?.children; + var localitiesWithLocalizationKeys = filteredVillages.map((obj) => ({ + ...obj, + i18nkey: tenantId.replace(".", "_").toUpperCase() + "_" + obj.code, + })); + if (localitiesWithLocalizationKeys.length > 0) { + localitiesWithLocalizationKeys.push({ + code: "OTHER", + name: "Other", + i18nkey: tenantId.replace(".", "_").toUpperCase() + "_OTHER", + }); + setVillages(localitiesWithLocalizationKeys); + } + } + } + + function selectVillage(value) { + setSelectedVillage(value); + } + + const onChangeGramPanchayat = (value) => { + setNewGramPanchayat(value); + }; + + const onChangeVillage = (value) => { + setNewVillage(value); + }; + function selectLocality(locality) { + setSelectedLocality(locality); + } + return (
{t("ES_INBOX_VEHICLE_LOG")}
@@ -442,6 +553,227 @@ const FstpOperatorDetails = () => { labelStyle={{ fontWeight: "normal" }} /> ))} + {isNew && isUrcEnable && ( +
+ {`${t("CS_PROPERTY_LOCATION")} *`} +
+ +
+
+ )} + {(selectLocation?.code === "FROM_GRAM_PANCHAYAT" || + (tripDetails && tripDetails.length > 0 && tripDetails[0]?.address?.additionalDetails?.boundaryType === "Village") || + (tripDetails && tripDetails.length > 0 && tripDetails[0]?.address?.additionalDetails?.boundaryType === "GP")) && ( +
+ 0 ? ( + tripDetails[0]?.address?.additionalDetails?.gramPanchayat?.name + ) : ( + + ) + } + last={false} + labelStyle={{ fontWeight: "normal" }} + /> + {selectedGp?.name === "Other" && ( +
+ 0 ? ( + tripDetails[0]?.address?.locality?.name + ) : ( + onChangeGramPanchayat(e.target.value)} value={newGramPanchayat} /> + ) + } + last={false} + labelStyle={{ fontWeight: "normal" }} + /> + 0 ? ( + tripDetails[0]?.address?.locality?.name + ) : ( + onChangeVillage(e.target.value)} value={newVillage} /> + ) + } + last={false} + labelStyle={{ fontWeight: "normal" }} + /> +
+ )} + {selectedGp?.name !== "Other" && ( + 0 ? ( + tripDetails[0]?.address?.additionalDetails?.village?.name ? ( + tripDetails[0]?.address?.additionalDetails?.village?.name + ) : ( + "N/A" + ) + ) : villages.length > 0 ? ( + + ) : ( + onChangeVillage(e.target.value)} value={newVillage} /> + ) + } + last={false} + labelStyle={{ fontWeight: "normal" }} + /> + )} + {selectedVillage?.code === "OTHER" && ( + 0 ? ( + tripDetails[0]?.address?.locality?.name + ) : ( + onChangeVillage(e.target.value)} value={newVillage} /> + ) + } + last={false} + labelStyle={{ fontWeight: "normal" }} + /> + )} +
+ )} + {(selectLocation?.code === "WITHIN_ULB_LIMITS" || + (tripDetails && tripDetails.length > 0 && tripDetails[0]?.address?.additionalDetails?.boundaryType === "Locality")) && ( +
+ 0 ? ( + tripDetails[0]?.address?.locality?.name + ) : ( + a.name.localeCompare(b.name))} + select={selectLocality} + optionKey="i18nkey" + style={{ width: "100%" }} + t={t} + /> + ) + } + last={false} + labelStyle={{ fontWeight: "normal" }} + /> + {selectedLocality?.name === "Other" && ( + 0 ? ( + tripDetails[0]?.address?.locality?.name + ) : ( + onChangeLocality(e.target.value)} value={newLocality} /> + ) + } + last={false} + labelStyle={{ fontWeight: "normal" }} + /> + )} +
+ )} + {selectLocation?.code === "FROM_OTHER_ULB" && ( +
+ 0 ? ( + tripDetails[0]?.address?.locality?.name + ) : ( + onChangeLocality(e.target.value)} value={newLocality} /> + ) + } + last={false} + labelStyle={{ fontWeight: "normal" }} + /> +
+ )}
{t(errors.tripStartTime)}
@@ -525,7 +857,7 @@ const FstpOperatorDetails = () => { className="form-field" onChange={(e) => { if (e.target.value.length > 1024) { - null; + return null; } else { setComments(e.target.value); } diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/NewApplication/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/NewApplication/index.js index 5558e734ba5..3509b02ad08 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/NewApplication/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/NewApplication/index.js @@ -47,7 +47,9 @@ export const NewApplication = ({ parentUrl, heading }) => { formData?. propertyID && formData?.propertyType && formData?.subtype && - formData?.address?.locality?.code && + ((formData?.address?.locality?.name === "Other" ? formData?.address?.newLocality : formData?.address?.locality?.code) || + (formData?.address?.propertyLocation?.code === "FROM_GRAM_PANCHAYAT" && + (formData?.address?.gramPanchayat?.name === "Other" ? formData?.address?.newGp : formData?.address?.gramPanchayat?.code))) && formData?.tripData?.vehicleType && formData?.channel && formData?.pitType && @@ -106,9 +108,15 @@ export const NewApplication = ({ parentUrl, heading }) => { const localityName = data?.address?.locality?.name; const gender = data.applicationData.applicantGender; const paymentPreference = amount === 0 ? null : data?.paymentPreference ? data?.paymentPreference : null; - const advanceAmount = amount === 0 ? null : data?.advancepaymentPreference?.advanceAmount; + const advanceAmount = amount === 0 ? null : data?.advancepaymentPreference?.advanceAmount === null ? 0 : data?.advancepaymentPreference?.advanceAmount; const distancefromroad=data?.tripData?.distancefromroad; const roadWidth= data?.tripData?.roadWidth; + const gramPanchayat = data?.address.gramPanchayat; + const village = data?.address.village; + const propertyLocation = data?.address?.propertyLocation?.code; + const newLocality = data?.address?.newLocality; + const newGp = data?.address?.newGp; + const newVillage = data?.address?.newVillage; const formData = { fsm: { citizen: { @@ -120,7 +128,7 @@ export const NewApplication = ({ parentUrl, heading }) => { sanitationtype: sanitationtype, source: applicationChannel.code, additionalDetails: { - tripAmount: amount, + tripAmount: typeof amount === "number" ? JSON.stringify(amount) : amount, distancefromroad:distancefromroad, roadWidth:roadWidth, propertyID : propertyID, @@ -141,17 +149,32 @@ export const NewApplication = ({ parentUrl, heading }) => { pincode, slumName: slum, locality: { - code: localityCode, - name: localityName, + code: propertyLocation === "FROM_GRAM_PANCHAYAT" ? gramPanchayat?.code : localityCode, + name: propertyLocation === "FROM_GRAM_PANCHAYAT" ? gramPanchayat?.name : localityName, }, geoLocation: { latitude: data?.address?.latitude, longitude: data?.address?.longitude, }, + additionalDetails: { + boundaryType: propertyLocation === "FROM_GRAM_PANCHAYAT" ? "GP" : "Locality", + gramPanchayat: { + code: gramPanchayat?.code, + name: gramPanchayat?.name, + }, + village: village?.code + ? { + code: village?.code ? village?.code : "", + name: village?.name ? village?.name : "", + } + : newVillage, + newLocality: newLocality, + newGramPanchayat: newGp, + }, }, noOfTrips, paymentPreference, - advanceAmount, + advanceAmount: typeof advanceAmount === "number" ? JSON.stringify(advanceAmount) : advanceAmount, }, workflow: null, }; @@ -169,6 +192,7 @@ export const NewApplication = ({ parentUrl, heading }) => { } const configs = [...preFields, ...commonFields]; + return (
diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/configs/DriverConfig.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/configs/DriverConfig.js index 63c5bbddb0e..dd3264fbfb6 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/configs/DriverConfig.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/configs/DriverConfig.js @@ -97,7 +97,7 @@ const DriverConfig = (t, disabled = false) => { className: "payment-form-text-input-correction", }, }, - { + /* { label: "ES_FSM_REGISTRY_DRIVER_PHONE", isMandatory: true, type: "mobileNumber", @@ -114,7 +114,7 @@ const DriverConfig = (t, disabled = false) => { className: "payment-form-text-input-correction", labelStyle: { border: "1px solid black", borderRight: "none" }, }, - }, + }, */ ], }, ]; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/configs/VehicleConfig.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/configs/VehicleConfig.js index 4698b54412d..b90b22078d0 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/configs/VehicleConfig.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/configs/VehicleConfig.js @@ -15,7 +15,7 @@ const VehicleConfig = (t, disabled = false) => { name: "registrationNumber", ValidationRequired: true, validation: { - pattern: `[A-Z]{2}\\s{1}[0-9]{2}\\s{0,1}[A-Z]{1,2}\\s{1}[0-9]{4}`, + pattern: `[A-Z]{2}[0-9]{2}[A-Z]{0,2}[0-9]{4}`, title: t("ES_FSM_VEHICLE_FORMAT_TIP"), }, error: t("FSM_REGISTRY_INVALID_REGISTRATION_NUMBER"), diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/ArchitectInbox/ApplicationLinks.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/obps/src/pages/citizen/ArchitectInbox/ApplicationLinks.js old mode 100755 new mode 100644 diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/PropertySearchForm.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/PropertySearchForm.js index bc807cc173d..fffb7772817 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/PropertySearchForm.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/PropertySearchForm.js @@ -22,7 +22,7 @@ const SearchPTID = ({ tenantId, t, onSubmit, onReset, searchBy, PTSearchFields, } }); const stateId = Digit.ULBService.getStateId(); - const { data: usageMenu = {}, isLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", [ + const { data: usageMenu = {}, isLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", [ "UsageCategory", "OccupancyType", "Floor", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/PropertySearchResults.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/PropertySearchResults.js index d221b18b1b6..5c3e281c0cb 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/PropertySearchResults.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/PropertySearchResults.js @@ -26,7 +26,7 @@ const SearchPTID = ({ tenantId, t, payload, showToast, setShowToast,ptSearchConf const mutation = Digit.Hooks.pt.usePropertyAPI(tenantId, false); const UpdatePropertyNumberComponent = Digit?.ComponentRegistryService?.getComponent("EmployeeUpdateOwnerNumber"); - const { data: updateNumberConfig } = Digit.Hooks.useCommonMDMS(Digit.ULBService.getStateId(), "PropertyTax", ["UpdateNumber"], { + const { data: updateNumberConfig } = Digit.Hooks.useCommonMDMSV2(Digit.ULBService.getStateId(), "PropertyTax", ["UpdateNumber"], { select: (data) => { return data?.PropertyTax?.UpdateNumber?.[0]; }, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/SearchDefaulter.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/SearchDefaulter.js index 76dd0ff0f76..648754544ed 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/SearchDefaulter.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/components/search/SearchDefaulter.js @@ -27,7 +27,7 @@ const { isLoading, error, data, isSuccess } = useQuery(["propertySearchList", te const mutation = Digit.Hooks.pt.usePropertyAPI(tenantId, false); const UpdatePropertyNumberComponent = Digit?.ComponentRegistryService?.getComponent("EmployeeUpdateOwnerNumber"); - const { data: updateNumberConfig } = Digit.Hooks.useCommonMDMS(Digit.ULBService.getStateId(), "PropertyTax", ["UpdateNumber"], { + const { data: updateNumberConfig } = Digit.Hooks.useCommonMDMSV2(Digit.ULBService.getStateId(), "PropertyTax", ["UpdateNumber"], { select: (data) => { return data?.PropertyTax?.UpdateNumber?.[0]; }, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/config/Create/config.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/config/Create/config.js index cc6548996a3..5818e4d9997 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/config/Create/config.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/config/Create/config.js @@ -1,180 +1,180 @@ export const newConfig =[ - { - "head": "ES_NEW_APPLICATION_LOCATION_DETAILS", - "body": [ - { - "route": "map", - "component": "PTSelectGeolocation", - "nextStep": "pincode", - "hideInEmployee": true, - "key": "address", - "texts": { - "header": "PT_GEOLOCATON_HEADER", - "cardText": "PT_GEOLOCATION_TEXT", - "nextText": "PT_COMMON_NEXT", - "skipAndContinueText": "CORE_COMMON_SKIP_CONTINUE" - } - }, - { - "route": "pincode", - "component": "PTSelectPincode", - "texts": { - "headerCaption": "PT_PROPERTY_LOCATION_CAPTION", - "header": "PT_PINCODE_LABEL", - "cardText": "PT_PINCODE_TEXT", - "submitBarLabel": "PT_COMMON_NEXT", - "skipText": "CORE_COMMON_SKIP_CONTINUE" - }, - "withoutLabel": true, - "key": "address", - "nextStep": "address", - "type": "component" - }, - { - "route": "address", - "component": "PTSelectAddress", - "withoutLabel": true, - "texts": { - "headerCaption": "PT_PROPERTY_LOCATION_CAPTION", - "header": "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT", - "cardText": "CS_FILE_APPLICATION_PROPERTY_LOCATION_CITY_MOHALLA_TEXT", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "address", - "nextStep": "street", - "isMandatory": true, - "type": "component" - }, - { - "type": "component", - "route": "street", - "component": "PTSelectStreet", - "key": "address", - "withoutLabel": true, - "texts": { - "headerCaption": "PT_PROPERTY_LOCATION_CAPTION", - "header": "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT", - "cardText": "PT_STREET_TEXT", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "nextStep": "landmark" - }, - { - "type": "component", - "route": "landmark", - "component": "PTSelectLandmark", - "withoutLabel": true, - "texts": { - "headerCaption": "PT_PROPERTY_LOCATION_CAPTION", - "header": "CS_FILE_APPLICATION_PROPERTY_LOCATION_PROVIDE_LANDMARK_TITLE", - "cardText": "CS_FILE_APPLICATION_PROPERTY_LOCATION_PROVIDE_LANDMARK_TEXT", - "submitBarLabel": "PT_COMMON_NEXT", - "skipText": "CORE_COMMON_SKIP_CONTINUE" - }, - "key": "address", - "nextStep": "proof", - "hideInEmployee": true - }, - { - "type": "component", - "route": "proof", - "component": "Proof", - "withoutLabel": true, - "texts": { - "headerCaption": "PT_PROPERTY_LOCATION_CAPTION", - "header": "PT_PROOF_OF_ADDRESS_HEADER", - "cardText": "", - "nextText": "PT_COMMONS_NEXT", - "submitBarLabel": "PT_COMMONS_NEXT" - }, - "key": "address", - "nextStep": "owner-ship-details@0", - "hideInEmployee": true - } - ] - }, - { - "head": "ES_NEW_APPLICATION_PROPERTY_ASSESSMENT", - "body": [ - { - "route": "info", - "component": "PropertyTax", - "nextStep": "property-type", - "hideInEmployee": true, - "key": "Documents" - }, - { - "type": "component", - "route": "isResidential", - "isMandatory": true, - "component": "IsResidential", - "texts": { - "headerCaption": "", - "header": "PT_PROPERTY_DETAILS_RESIDENTIAL_PROPERTY_HEADER", - "cardText": "PT_PROPERTY_DETAILS_RESIDENTIAL_PROPERTY_TEXT", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "isResdential", - "withoutLabel": true, - "hideInEmployee": true, - "nextStep": { - "PT_COMMON_YES": "property-type", - "PT_COMMON_NO": "property-usage-type" - } - }, - { - "type": "component", - "route": "property-usage-type", - "isMandatory": true, - "component": "PropertyUsageType", - "texts": { - "headerCaption": "PT_ASSESMENT_INFO_USAGE_TYPE", - "header": "PT_PROPERTY_DETAILS_USAGE_TYPE_HEADER", - "cardText": "PT_PROPERTY_DETAILS_USAGE_TYPE_TEXT", - "submitBarLabel": "PT_COMMONS_NEXT" - }, - "nextStep": "property-type", - "key": "usageCategoryMajor", - "withoutLabel": true - }, - { - "type": "component", - "isMandatory": true, - "component": "ProvideSubUsageType", - "key": "usageCategoryMinor", - "withoutLabel": true - }, - { - "type": "component", - "route": "provide-sub-usage-type", - "isMandatory": true, - "component": "ProvideSubUsageType", - "texts": { - "headerCaption": "PT_ASSESMENT_INFO_USAGE_TYPE", - "header": "PT_ASSESSMENT_FLOW_SUBUSAGE_HEADER", - "cardText": "PT_ASSESSMENT_FLOW_SUBUSAGE_TEXT", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "units", - "withoutLabel": true, - "nextStep": { - "yes": "is-any-part-of-this-floor-unoccupied", - "no": "provide-sub-usage-type-of-rented-area" - }, - "hideInEmployee": true - }, - { - "type": "component", - "route": "property-type", - "isMandatory": true, - "component": "PropertyType", - "key":"PropertyType", - "texts": { - "headerCaption": "", - "header": "PT_ASSESMENT1_PROPERTY_TYPE", - "cardText": "", - "submitBarLabel": "PT_COMMONS_NEXT" - }, + { + "head": "ES_NEW_APPLICATION_LOCATION_DETAILS", + "body": [ + { + "route": "map", + "component": "PTSelectGeolocation", + "nextStep": "pincode", + "hideInEmployee": true, + "key": "address", + "texts": { + "header": "PT_GEOLOCATON_HEADER", + "cardText": "PT_GEOLOCATION_TEXT", + "nextText": "PT_COMMON_NEXT", + "skipAndContinueText": "CORE_COMMON_SKIP_CONTINUE" + } + }, + { + "route": "pincode", + "component": "PTSelectPincode", + "texts": { + "headerCaption": "PT_PROPERTY_LOCATION_CAPTION", + "header": "PT_PINCODE_LABEL", + "cardText": "PT_PINCODE_TEXT", + "submitBarLabel": "PT_COMMON_NEXT", + "skipText": "CORE_COMMON_SKIP_CONTINUE" + }, + "withoutLabel": true, + "key": "address", + "nextStep": "address", + "type": "component" + }, + { + "route": "address", + "component": "PTSelectAddress", + "withoutLabel": true, + "texts": { + "headerCaption": "PT_PROPERTY_LOCATION_CAPTION", + "header": "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT", + "cardText": "CS_FILE_APPLICATION_PROPERTY_LOCATION_CITY_MOHALLA_TEXT", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "address", + "nextStep": "street", + "isMandatory": true, + "type": "component" + }, + { + "type": "component", + "route": "street", + "component": "PTSelectStreet", + "key": "address", + "withoutLabel": true, + "texts": { + "headerCaption": "PT_PROPERTY_LOCATION_CAPTION", + "header": "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT", + "cardText": "PT_STREET_TEXT", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "nextStep": "landmark" + }, + { + "type": "component", + "route": "landmark", + "component": "PTSelectLandmark", + "withoutLabel": true, + "texts": { + "headerCaption": "PT_PROPERTY_LOCATION_CAPTION", + "header": "CS_FILE_APPLICATION_PROPERTY_LOCATION_PROVIDE_LANDMARK_TITLE", + "cardText": "CS_FILE_APPLICATION_PROPERTY_LOCATION_PROVIDE_LANDMARK_TEXT", + "submitBarLabel": "PT_COMMON_NEXT", + "skipText": "CORE_COMMON_SKIP_CONTINUE" + }, + "key": "address", + "nextStep": "proof", + "hideInEmployee": true + }, + { + "type": "component", + "route": "proof", + "component": "Proof", + "withoutLabel": true, + "texts": { + "headerCaption": "PT_PROPERTY_LOCATION_CAPTION", + "header": "PT_PROOF_OF_ADDRESS_HEADER", + "cardText": "", + "nextText": "PT_COMMONS_NEXT", + "submitBarLabel": "PT_COMMONS_NEXT" + }, + "key": "address", + "nextStep": "owner-ship-details@0", + "hideInEmployee": true + } + ] + }, + { + "head": "ES_NEW_APPLICATION_PROPERTY_ASSESSMENT", + "body": [ + { + "route": "info", + "component": "PropertyTax", + "nextStep": "property-type", + "hideInEmployee": true, + "key": "Documents" + }, + { + "type": "component", + "route": "isResidential", + "isMandatory": true, + "component": "IsResidential", + "texts": { + "headerCaption": "", + "header": "PT_PROPERTY_DETAILS_RESIDENTIAL_PROPERTY_HEADER", + "cardText": "PT_PROPERTY_DETAILS_RESIDENTIAL_PROPERTY_TEXT", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "isResdential", + "withoutLabel": true, + "hideInEmployee": true, + "nextStep": { + "PT_COMMON_YES": "property-type", + "PT_COMMON_NO": "property-usage-type" + } + }, + { + "type": "component", + "route": "property-usage-type", + "isMandatory": true, + "component": "PropertyUsageType", + "texts": { + "headerCaption": "PT_ASSESMENT_INFO_USAGE_TYPE", + "header": "PT_PROPERTY_DETAILS_USAGE_TYPE_HEADER", + "cardText": "PT_PROPERTY_DETAILS_USAGE_TYPE_TEXT", + "submitBarLabel": "PT_COMMONS_NEXT" + }, + "nextStep": "property-type", + "key": "usageCategoryMajor", + "withoutLabel": true + }, + { + "type": "component", + "isMandatory": true, + "component": "ProvideSubUsageType", + "key": "usageCategoryMinor", + "withoutLabel": true + }, + { + "type": "component", + "route": "provide-sub-usage-type", + "isMandatory": true, + "component": "ProvideSubUsageType", + "texts": { + "headerCaption": "PT_ASSESMENT_INFO_USAGE_TYPE", + "header": "PT_ASSESSMENT_FLOW_SUBUSAGE_HEADER", + "cardText": "PT_ASSESSMENT_FLOW_SUBUSAGE_TEXT", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "units", + "withoutLabel": true, + "nextStep": { + "yes": "is-any-part-of-this-floor-unoccupied", + "no": "provide-sub-usage-type-of-rented-area" + }, + "hideInEmployee": true + }, + { + "type": "component", + "route": "property-type", + "isMandatory": true, + "component": "PropertyType", + "key":"PropertyType", + "texts": { + "headerCaption": "", + "header": "PT_ASSESMENT1_PROPERTY_TYPE", + "cardText": "", + "submitBarLabel": "PT_COMMONS_NEXT" + }, "nextStep": "electricity-number", @@ -211,413 +211,409 @@ export const newConfig =[ "cardText": "", "submitBarLabel": "PT_COMMONS_NEXT" }, - "nextStep": { - "COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY": "landarea", - "COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY": "PtUnits", - "COMMON_PROPTYPE_VACANT": "area" - }, - "key": "uid", - "withoutLabel": true - - }, - { - "type": "component", - "isMandatory": true, - "component": "Area", - "key": "landarea", - "withoutLabel": true - }, - { - "type": "component", - "route": "PtUnits", - "isMandatory": true, - "component": "SelectPTUnits", - "texts": { - "headerCaption": "", - "header": "PT_FLAT_DETAILS", - "cardText": "PT_FLAT_DETAILS_DESC", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "units", - "withoutLabel": true, - "nextStep": "map", - "hideInEmployee": true - }, - { - "type": "component", - "route": "landarea", - "isMandatory": true, - "component": "PTLandArea", - "texts": { - "headerCaption": "", - "header": "PT_PLOT_SIZE_HEADER", - "cardText": "", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "units", - "withoutLabel": true, - "nextStep": "number-of-floors", - "hideInEmployee": true - }, - { - "type": "component", - "route": "area", - "isMandatory": true, - "component": "Area", - "texts": { - "headerCaption": "", - "header": "PT_PLOT_SIZE_HEADER", - "cardText": "PT_FORM2_PLOT_SIZE_PLACEHOLDER", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "units", - "withoutLabel": true, - "nextStep": "map", - "hideInEmployee": true - }, - { - "type": "component", - "route": "number-of-floors", - "isMandatory": true, - "component": "PropertyBasementDetails", - "texts": { - "headerCaption": "", - "header": "PT_PROPERTY_DETAILS_NO_OF_BASEMENTS_HEADER", - "cardText": "", - "submitBarLabel": "PT_COMMONS_NEXT" - }, - "nextStep": "number-of-basements@0", - "key": "noOofBasements", - "withoutLabel": true - }, - { - "type": "component", - "component": "Units", - "key": "units", - "withoutLabel": true - }, - { - "type": "component", - "route": "provide-floor-no", - "isMandatory": true, - "component": "ProvideFloorNo", - "texts": { - "headerCaption": "", - "header": "PT_FLOOR_NUMBER_HEADER", - "cardText": "", - "submitBarLabel": "PT_COMMONS_NEXT" - }, - "nextStep": "units", - "key": "Floorno", - "withoutLabel": true, - "hideInEmployee": true - }, - { - "type": "component", - "route": "is-this-floor-self-occupied", - "isMandatory": true, - "component": "IsThisFloorSelfOccupied", - "texts": { - "headerCaption": "", - "header": "PT_ASSESSMENT_FLOW_FLOOR_OCC_HEADER", - "cardText": "PT_ASSESSMENT_FLOW_FLOOR_OCC_TEXT", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "units", - "withoutLabel": true, - "nextStep": { - "PT_YES_IT_IS_SELFOCCUPIED": "provide-sub-usage-type", - "PT_YES_IT_IS_SELFOCCUPIED1": "is-any-part-of-this-floor-unoccupied", - "PT_PARTIALLY_RENTED_OUT": "area", - "PT_PARTIALLY_RENTED_OUT1": "area", - "PT_FULLY_RENTED_OUT": "provide-sub-usage-type-of-rented-area", - "PT_FULLY_RENTED_OUT1": "rental-details" - }, - "hideInEmployee": true - }, - { - "type": "component", - "route": "number-of-basements@0", - "isMandatory": true, - "component": "PropertyFloorDetails", - "texts": { - "headerCaption": "", - "header": "BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL", - "cardText": "PT_PROPERTY_DETAILS_NO_OF_FLOORS_TEXT", - "submitBarLabel": "PT_COMMONS_NEXT" - }, - "nextStep": { - "PT_NO_BASEMENT_OPTION": "units", - "PT_ONE_BASEMENT_OPTION": "units", - "PT_TWO_BASEMENT_OPTION": "units" - }, - "key": "noOfFloors", - "withoutLabel": true, - "hideInEmployee": true - }, - { - "type": "component", - "route": "units", - "isMandatory": true, - "component": "SelectPTUnits", - "texts": { - "headerCaption": "", - "header": "PT_FLAT_DETAILS", - "cardText": "PT_FLAT_DETAILS_DESC", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "nextStep": "map", - "key": "units", - "withoutLabel": true, - "hideInEmployee": true - }, - { - "type": "component", - "route": "rental-details", - "isMandatory": true, - "component": "RentalDetails", - "texts": { - "header": "PT_ASSESSMENT_FLOW_RENTAL_DETAIL_HEADER", - "cardText": "", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "units", - "withoutLabel": true, - "nextStep": "is-any-part-of-this-floor-unoccupied", - "hideInEmployee": true - }, - { - "type": "component", - "route": "provide-sub-usage-type-of-rented-area", - "isMandatory": true, - "component": "ProvideSubUsageTypeOfRentedArea", - "texts": { - "headerCaption": "PT_ASSESMENT_INFO_USAGE_TYPE", - "header": "PT_ASSESSMENT_FLOW_RENT_SUB_USAGE_HEADER", - "cardText": "PT_ASSESSMENT_FLOW_SUBUSAGE_TEXT", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "units", - "withoutLabel": true, - "nextStep": "rental-details", - "hideInEmployee": true - }, - { - "type": "component", - "route": "is-any-part-of-this-floor-unoccupied", - "isMandatory": true, - "component": "IsAnyPartOfThisFloorUnOccupied", - "texts": { - "header": "PT_ASSESSMENT_FLOW_ISUNOCCUPIED_HEADER", - "cardText": "PT_ASSESSMENT_FLOW_ISUNOCCUPIED_TEXT", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "units", - "withoutLabel": true, - "nextStep": { - "PT_COMMON_NO": "map", - "PT_COMMON_YES": "un-occupied-area" - }, - "hideInEmployee": true - }, - { - "type": "component", - "route": "un-occupied-area", - "isMandatory": true, - "component": "UnOccupiedArea", - "texts": { - "header": "PT_ASSESSMENT_FLOW_UNOCCUPIED_AREA_HEADER", - "cardText": "PT_ASSESSMENT_FLOW_UNOCCUPIED_AREA_TEXT", - "submitBarLabel": "PT_COMMON_NEXT", - "skipText": "" - }, - "key": "units", - "withoutLabel": true, - "nextStep": "map", - "hideInEmployee": true - } - - - ] - }, - { - "head": "ES_NEW_APPLICATION_OWNERSHIP_DETAILS", - "body": [ - { - "type": "component", - "route": "owner-ship-details@0", - "isMandatory": true, - "component": "SelectOwnerShipDetails", - "texts": { - "headerCaption": "PT_PROPERTIES_OWNERSHIP", - "header": "PT_PROVIDE_OWNERSHIP_DETAILS", - "cardText": "PT_PROVIDE_OWNERSHI_DETAILS_SUB_TEXT", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "ownershipCategory", - "withoutLabel": true, - "nextStep": { - "INSTITUTIONALPRIVATE": "inistitution-details", - "INSTITUTIONALGOVERNMENT": "inistitution-details", - "INDIVIDUAL.SINGLEOWNER": "owner-details", - "INDIVIDUAL.MULTIPLEOWNERS": "owner-details" - } - }, - { - "isMandatory": true, - "type": "component", - "route": "owner-details", - "key": "owners", - "component": "SelectOwnerDetails", - "texts": { - "headerCaption": "", - "header": "PT_OWNERSHIP_INFO_SUB_HEADER", - "cardText": "PT_FORM3_HEADER_MESSAGE", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "withoutLabel": true, - "nextStep": "special-owner-category", - "hideInEmployee": true - }, - { - "type": "component", - "route": "special-owner-category", - "isMandatory": true, - "component": "SelectSpecialOwnerCategoryType", - "texts": { - "headerCaption": "PT_OWNERS_DETAILS", - "header": "PT_SPECIAL_OWNER_CATEGORY", - "cardText": "PT_FORM3_HEADER_MESSAGE", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "owners", - "withoutLabel": true, - "nextStep": "owner-address", - "hideInEmployee": true - }, - { - "type": "component", - "route": "owner-address", - "isMandatory": true, - "component": "SelectOwnerAddress", - "texts": { - "headerCaption": "PT_OWNERS_DETAILS", - "header": "PT_OWNERS_ADDRESS", - "cardText": "", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "owners", - "withoutLabel": true, - "nextStep": "special-owner-category-proof", - "hideInEmployee": true - }, - { - "type": "component", - "component": "SelectAltContactNumber", - "key": "owners", - "withoutLabel": true, - "hideInEmployee": true - }, - { - "type": "component", - "route": "special-owner-category-proof", - "isMandatory": true, - "component": "SelectSpecialProofIdentity", - "texts": { - "headerCaption": "PT_OWNERS_DETAILS", - "header": "PT_SPECIAL_OWNER_CATEGORY_PROOF_HEADER", - "cardText": "", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "owners", - "withoutLabel": true, - "nextStep": "proof-of-identity", - "hideInEmployee": true - }, - { - "type": "component", - "route": "proof-of-identity", - "isMandatory": true, - "component": "SelectProofIdentity", - "texts": { - "headerCaption": "PT_DOCUMENT_DETAILS", - "header": "PT_PROOF_IDENTITY_HEADER", - "cardText": "", - "submitBarLabel": "PT_COMMON_NEXT", - "addMultipleText": "PT_COMMON_ADD_APPLICANT_LABEL" - }, - "key": "owners", - "withoutLabel": true, - "nextStep": null, - "hideInEmployee": true - }, - { - "type": "component", - "route": "inistitution-details", - "isMandatory": true, - "component": "SelectInistitutionOwnerDetails", - "texts": { - "headerCaption": "", - "header": "PT_INSTITUTION_DETAILS_HEADER", - "cardText": "PT_FORM3_HEADER_MESSAGE", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "owners", - "withoutLabel": true, - "nextStep": "institutional-owner-address", - "hideInEmployee": true - }, - { - "type": "component", - "route": "institutional-owner-address", - "isMandatory": true, - "component": "SelectOwnerAddress", - "texts": { - "headerCaption": "PT_OWNERS_DETAILS", - "header": "PT_OWNERS_ADDRESS", - "cardText": "", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "owners", - "withoutLabel": true, - "nextStep": "institutional-proof-of-identity", - "hideInEmployee": true - }, - { - "type": "component", - "route": "institutional-proof-of-identity", - "isMandatory": true, - "component": "SelectProofIdentity", - "texts": { - "headerCaption": "PT_OWNERS_DETAILS", - "header": "PT_PROOF_IDENTITY_HEADER", - "cardText": "", - "submitBarLabel": "PT_COMMON_NEXT" - }, - "key": "owners", - "withoutLabel": true, - "nextStep": null, - "hideInEmployee": true - }, - { - "type": "component", - "component": "PTEmployeeOwnershipDetails", - "key": "owners", - "withoutLabel": true, - "hideInCitizen": true - } - ] - }, - { - "head": "ES_NEW_APPLICATION_DOCUMENTS_REQUIRED", - "body": [ - { - "component": "SelectDocuments", - "withoutLabel": true, - "key": "documents", - "type": "component" - } - ] - } - - ]; \ No newline at end of file + "nextStep": { + "COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY": "landarea", + "COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY": "PtUnits", + "COMMON_PROPTYPE_VACANT": "area" + }, + "key": "uid", + "withoutLabel": true + }, + { + "type": "component", + "isMandatory": true, + "component": "Area", + "key": "landarea", + "withoutLabel": true + }, + { + "type": "component", + "route": "PtUnits", + "isMandatory": true, + "component": "SelectPTUnits", + "texts": { + "headerCaption": "", + "header": "PT_FLAT_DETAILS", + "cardText": "PT_FLAT_DETAILS_DESC", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "units", + "withoutLabel": true, + "nextStep": "map", + "hideInEmployee": true + }, + { + "type": "component", + "route": "landarea", + "isMandatory": true, + "component": "PTLandArea", + "texts": { + "headerCaption": "", + "header": "PT_PLOT_SIZE_HEADER", + "cardText": "", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "units", + "withoutLabel": true, + "nextStep": "number-of-floors", + "hideInEmployee": true + }, + { + "type": "component", + "route": "area", + "isMandatory": true, + "component": "Area", + "texts": { + "headerCaption": "", + "header": "PT_PLOT_SIZE_HEADER", + "cardText": "PT_FORM2_PLOT_SIZE_PLACEHOLDER", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "units", + "withoutLabel": true, + "nextStep": "map", + "hideInEmployee": true + }, + { + "type": "component", + "route": "number-of-floors", + "isMandatory": true, + "component": "PropertyBasementDetails", + "texts": { + "headerCaption": "", + "header": "PT_PROPERTY_DETAILS_NO_OF_BASEMENTS_HEADER", + "cardText": "", + "submitBarLabel": "PT_COMMONS_NEXT" + }, + "nextStep": "number-of-basements@0", + "key": "noOofBasements", + "withoutLabel": true + }, + { + "type": "component", + "component": "Units", + "key": "units", + "withoutLabel": true + }, + { + "type": "component", + "route": "provide-floor-no", + "isMandatory": true, + "component": "ProvideFloorNo", + "texts": { + "headerCaption": "", + "header": "PT_FLOOR_NUMBER_HEADER", + "cardText": "", + "submitBarLabel": "PT_COMMONS_NEXT" + }, + "nextStep": "units", + "key": "Floorno", + "withoutLabel": true, + "hideInEmployee": true + }, + { + "type": "component", + "route": "is-this-floor-self-occupied", + "isMandatory": true, + "component": "IsThisFloorSelfOccupied", + "texts": { + "headerCaption": "", + "header": "PT_ASSESSMENT_FLOW_FLOOR_OCC_HEADER", + "cardText": "PT_ASSESSMENT_FLOW_FLOOR_OCC_TEXT", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "units", + "withoutLabel": true, + "nextStep": { + "PT_YES_IT_IS_SELFOCCUPIED": "provide-sub-usage-type", + "PT_YES_IT_IS_SELFOCCUPIED1": "is-any-part-of-this-floor-unoccupied", + "PT_PARTIALLY_RENTED_OUT": "area", + "PT_PARTIALLY_RENTED_OUT1": "area", + "PT_FULLY_RENTED_OUT": "provide-sub-usage-type-of-rented-area", + "PT_FULLY_RENTED_OUT1": "rental-details" + }, + "hideInEmployee": true + }, + { + "type": "component", + "route": "number-of-basements@0", + "isMandatory": true, + "component": "PropertyFloorDetails", + "texts": { + "headerCaption": "", + "header": "BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL", + "cardText": "PT_PROPERTY_DETAILS_NO_OF_FLOORS_TEXT", + "submitBarLabel": "PT_COMMONS_NEXT" + }, + "nextStep": { + "PT_NO_BASEMENT_OPTION": "units", + "PT_ONE_BASEMENT_OPTION": "units", + "PT_TWO_BASEMENT_OPTION": "units" + }, + "key": "noOfFloors", + "withoutLabel": true, + "hideInEmployee": true + }, + { + "type": "component", + "route": "units", + "isMandatory": true, + "component": "SelectPTUnits", + "texts": { + "headerCaption": "", + "header": "PT_FLAT_DETAILS", + "cardText": "PT_FLAT_DETAILS_DESC", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "nextStep": "map", + "key": "units", + "withoutLabel": true, + "hideInEmployee": true + }, + { + "type": "component", + "route": "rental-details", + "isMandatory": true, + "component": "RentalDetails", + "texts": { + "header": "PT_ASSESSMENT_FLOW_RENTAL_DETAIL_HEADER", + "cardText": "", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "units", + "withoutLabel": true, + "nextStep": "is-any-part-of-this-floor-unoccupied", + "hideInEmployee": true + }, + { + "type": "component", + "route": "provide-sub-usage-type-of-rented-area", + "isMandatory": true, + "component": "ProvideSubUsageTypeOfRentedArea", + "texts": { + "headerCaption": "PT_ASSESMENT_INFO_USAGE_TYPE", + "header": "PT_ASSESSMENT_FLOW_RENT_SUB_USAGE_HEADER", + "cardText": "PT_ASSESSMENT_FLOW_SUBUSAGE_TEXT", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "units", + "withoutLabel": true, + "nextStep": "rental-details", + "hideInEmployee": true + }, + { + "type": "component", + "route": "is-any-part-of-this-floor-unoccupied", + "isMandatory": true, + "component": "IsAnyPartOfThisFloorUnOccupied", + "texts": { + "header": "PT_ASSESSMENT_FLOW_ISUNOCCUPIED_HEADER", + "cardText": "PT_ASSESSMENT_FLOW_ISUNOCCUPIED_TEXT", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "units", + "withoutLabel": true, + "nextStep": { + "PT_COMMON_NO": "map", + "PT_COMMON_YES": "un-occupied-area" + }, + "hideInEmployee": true + }, + { + "type": "component", + "route": "un-occupied-area", + "isMandatory": true, + "component": "UnOccupiedArea", + "texts": { + "header": "PT_ASSESSMENT_FLOW_UNOCCUPIED_AREA_HEADER", + "cardText": "PT_ASSESSMENT_FLOW_UNOCCUPIED_AREA_TEXT", + "submitBarLabel": "PT_COMMON_NEXT", + "skipText": "" + }, + "key": "units", + "withoutLabel": true, + "nextStep": "map", + "hideInEmployee": true + } + ] + }, + { + "head": "ES_NEW_APPLICATION_OWNERSHIP_DETAILS", + "body": [ + { + "type": "component", + "route": "owner-ship-details@0", + "isMandatory": true, + "component": "SelectOwnerShipDetails", + "texts": { + "headerCaption": "PT_PROPERTIES_OWNERSHIP", + "header": "PT_PROVIDE_OWNERSHIP_DETAILS", + "cardText": "PT_PROVIDE_OWNERSHI_DETAILS_SUB_TEXT", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "ownershipCategory", + "withoutLabel": true, + "nextStep": { + "INSTITUTIONALPRIVATE": "inistitution-details", + "INSTITUTIONALGOVERNMENT": "inistitution-details", + "INDIVIDUAL.SINGLEOWNER": "owner-details", + "INDIVIDUAL.MULTIPLEOWNERS": "owner-details" + } + }, + { + "isMandatory": true, + "type": "component", + "route": "owner-details", + "key": "owners", + "component": "SelectOwnerDetails", + "texts": { + "headerCaption": "", + "header": "PT_OWNERSHIP_INFO_SUB_HEADER", + "cardText": "PT_FORM3_HEADER_MESSAGE", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "withoutLabel": true, + "nextStep": "special-owner-category", + "hideInEmployee": true + }, + { + "type": "component", + "route": "special-owner-category", + "isMandatory": true, + "component": "SelectSpecialOwnerCategoryType", + "texts": { + "headerCaption": "PT_OWNERS_DETAILS", + "header": "PT_SPECIAL_OWNER_CATEGORY", + "cardText": "PT_FORM3_HEADER_MESSAGE", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "owners", + "withoutLabel": true, + "nextStep": "owner-address", + "hideInEmployee": true + }, + { + "type": "component", + "route": "owner-address", + "isMandatory": true, + "component": "SelectOwnerAddress", + "texts": { + "headerCaption": "PT_OWNERS_DETAILS", + "header": "PT_OWNERS_ADDRESS", + "cardText": "", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "owners", + "withoutLabel": true, + "nextStep": "special-owner-category-proof", + "hideInEmployee": true + }, + { + "type": "component", + "component": "SelectAltContactNumber", + "key": "owners", + "withoutLabel": true, + "hideInEmployee": true + }, + { + "type": "component", + "route": "special-owner-category-proof", + "isMandatory": true, + "component": "SelectSpecialProofIdentity", + "texts": { + "headerCaption": "PT_OWNERS_DETAILS", + "header": "PT_SPECIAL_OWNER_CATEGORY_PROOF_HEADER", + "cardText": "", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "owners", + "withoutLabel": true, + "nextStep": "proof-of-identity", + "hideInEmployee": true + }, + { + "type": "component", + "route": "proof-of-identity", + "isMandatory": true, + "component": "SelectProofIdentity", + "texts": { + "headerCaption": "PT_DOCUMENT_DETAILS", + "header": "PT_PROOF_IDENTITY_HEADER", + "cardText": "", + "submitBarLabel": "PT_COMMON_NEXT", + "addMultipleText": "PT_COMMON_ADD_APPLICANT_LABEL" + }, + "key": "owners", + "withoutLabel": true, + "nextStep": null, + "hideInEmployee": true + }, + { + "type": "component", + "route": "inistitution-details", + "isMandatory": true, + "component": "SelectInistitutionOwnerDetails", + "texts": { + "headerCaption": "", + "header": "PT_INSTITUTION_DETAILS_HEADER", + "cardText": "PT_FORM3_HEADER_MESSAGE", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "owners", + "withoutLabel": true, + "nextStep": "institutional-owner-address", + "hideInEmployee": true + }, + { + "type": "component", + "route": "institutional-owner-address", + "isMandatory": true, + "component": "SelectOwnerAddress", + "texts": { + "headerCaption": "PT_OWNERS_DETAILS", + "header": "PT_OWNERS_ADDRESS", + "cardText": "", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "owners", + "withoutLabel": true, + "nextStep": "institutional-proof-of-identity", + "hideInEmployee": true + }, + { + "type": "component", + "route": "institutional-proof-of-identity", + "isMandatory": true, + "component": "SelectProofIdentity", + "texts": { + "headerCaption": "PT_OWNERS_DETAILS", + "header": "PT_PROOF_IDENTITY_HEADER", + "cardText": "", + "submitBarLabel": "PT_COMMON_NEXT" + }, + "key": "owners", + "withoutLabel": true, + "nextStep": null, + "hideInEmployee": true + }, + { + "type": "component", + "component": "PTEmployeeOwnershipDetails", + "key": "owners", + "withoutLabel": true, + "hideInCitizen": true + } + ] + }, + { + "head": "ES_NEW_APPLICATION_DOCUMENTS_REQUIRED", + "body": [ + { + "component": "SelectDocuments", + "withoutLabel": true, + "key": "documents", + "type": "component" + } + ] + } +]; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/IsAnyPartOfThisFloorUnOccupied.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/IsAnyPartOfThisFloorUnOccupied.js index 04a0a779c66..92ff9c42b71 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/IsAnyPartOfThisFloorUnOccupied.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/IsAnyPartOfThisFloorUnOccupied.js @@ -13,7 +13,7 @@ const IsAnyPartOfThisFloorUnOccupied = ({ t, config, onSelect, userType, formDat } else { [IsAnyPartOfThisFloorUnOccupied, setSelfOccupied] = useState(formData?.IsAnyPartOfThisFloorUnOccupied); } - //const { data: Menu, isLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "OwnerType"); + //const { data: Menu, isLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "OwnerType"); const data = [ { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Mutate/ReasonForTransfer.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Mutate/ReasonForTransfer.js index 133512aa416..55b4f062699 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Mutate/ReasonForTransfer.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Mutate/ReasonForTransfer.js @@ -5,7 +5,7 @@ import Timeline from "../../components/TLTimeline"; const ReasonForTransfer = (props) => { const { t, config, onSelect, userType, formData, setError, clearErrors, errors } = props; - const { data, isLoading } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "PropertyTax", "ReasonForTransfer", {}); + const { data, isLoading } = Digit.Hooks.pt.useMDMSV2(Digit.ULBService.getStateId(), "PropertyTax", "ReasonForTransfer", {}); const [menu, setMenu] = useState([]); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Mutate/transferReasonDocument.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Mutate/transferReasonDocument.js index 64cdb8304ea..a0849d135a5 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Mutate/transferReasonDocument.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Mutate/transferReasonDocument.js @@ -19,7 +19,7 @@ const TransferProof = ({ t, config, onSelect, userType, formData }) => { let dropdownData = []; const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: Documentsob } = Digit.Hooks.pt.useMDMS(stateId, "PropertyTax", "MutationDocuments"); + const { data: Documentsob } = Digit.Hooks.pt.useMDMSV2(stateId, "PropertyTax", "MutationDocuments"); const docs = Documentsob?.PropertyTax?.MutationDocuments; const transferReason = Array.isArray(docs) && docs.filter((doc) => doc.code.includes("OWNER.TRANSFERREASONDOCUMENT")); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/OwnerDetailsEmployee.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/OwnerDetailsEmployee.js index fef70433db3..15e9daf2acd 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/OwnerDetailsEmployee.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/OwnerDetailsEmployee.js @@ -1,10 +1,19 @@ -import { CardLabel, CardLabelError, Dropdown, LabelFieldPair, LinkButton, MobileNumber, TextInput,Toast } from "@egovernments/digit-ui-react-components"; +import { + CardLabel, + CardLabelError, + Dropdown, + LabelFieldPair, + LinkButton, + MobileNumber, + TextInput, + Toast, +} from "@egovernments/digit-ui-react-components"; import _ from "lodash"; import React, { useEffect, useMemo, useState } from "react"; import { Controller, useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { useLocation } from "react-router-dom"; -import { stringReplaceAll,CompareTwoObjects } from "../utils"; +import { stringReplaceAll, CompareTwoObjects } from "../utils"; const createOwnerDetails = () => ({ name: "", @@ -23,13 +32,13 @@ const PTEmployeeOwnershipDetails = ({ config, onSelect, userType, formData, setE const { t } = useTranslation(); const { pathname } = useLocation(); - const isEditScreen = pathname.includes("/modify-application/" ) + const isEditScreen = pathname.includes("/modify-application/"); const [owners, setOwners] = useState(formData?.owners || [createOwnerDetails()]); const [focusIndex, setFocusIndex] = useState({ index: -1, type: "" }); const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: mdmsData, isLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", [ + const { data: mdmsData, isLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", [ "UsageCategory", "OccupancyType", "Floor", @@ -40,7 +49,7 @@ const PTEmployeeOwnershipDetails = ({ config, onSelect, userType, formData, setE "OwnerShipCategory", ]); - const { data: Menu } = Digit.Hooks.pt.usePTGenderMDMS(stateId, "common-masters", "GenderType"); + const { data: Menu } = Digit.Hooks.pt.usePTGenderMDMSV2(stateId, "common-masters", "GenderType"); let menu = []; @@ -122,8 +131,8 @@ const OwnerForm = (_props) => { } = _props; const { originalData = {} } = formData; const { institution = {} } = originalData; -const [uuid, setUuid]= useState(null) -const [showToast, setShowToast] = useState(null); + const [uuid, setUuid] = useState(null); + const [showToast, setShowToast] = useState(null); const { control, formState: localFormState, watch, setError: setLocalError, clearErrors: clearLocalErrors, setValue, trigger } = useForm(); const formValue = watch(); const { errors } = localFormState; @@ -139,8 +148,8 @@ const [showToast, setShowToast] = useState(null); const specialDocsMenu = useMemo( () => mdmsData?.PropertyTax?.Documents?.filter((e) => e.code === "OWNER.SPECIALCATEGORYPROOF")?.[0] - .dropdownData?.filter((e) => e.parentValue.includes(formValue?.ownerType?.code)) - .map?.((e) => ({ + ?.dropdownData?.filter((e) => e.parentValue.includes(formValue?.ownerType?.code)) + ?.map?.((e) => ({ i18nKey: e.code?.replaceAll(".", "_"), code: e.code, })) || [], @@ -159,10 +168,12 @@ const [showToast, setShowToast] = useState(null); if (ownerTypesMenu?.length > 0) { ownerTypesMenu ? ownerTypesMenu.sort((a, b) => a.code.localeCompare(b.code)) : ""; ownerTypesMenu?.forEach((data, index) => { - if (data.code == "NONE") data.order = 0 - else data.order = index + 1 + if (data.code == "NONE") data.order = 0; + else data.order = index + 1; + }); + ownerTypesMenu.sort(function (a, b) { + return a.order - b.order; }); - ownerTypesMenu.sort(function (a, b) { return a.order - b.order; }); } const isIndividualTypeOwner = useMemo(() => formData?.ownershipCategory?.code.includes("INDIVIDUAL"), [formData?.ownershipCategory?.code]); @@ -176,14 +187,13 @@ const [showToast, setShowToast] = useState(null); trigger(); }, []); - const [part, setPart] = React.useState({}); - useEffect(() => { + useEffect(() => { let _ownerType = isIndividualTypeOwner ? {} : { ownerType: { code: "NONE" } }; if (!_.isEqual(part, formValue)) { - setPart({...formValue}); + setPart({ ...formValue }); setOwners((prev) => prev.map((o) => (o.key && o.key === owner.key ? { ...o, ...formValue, ..._ownerType } : { ...o }))); trigger(); } @@ -201,18 +211,17 @@ const [showToast, setShowToast] = useState(null); const propertyDetails = await Digit.PTService.search({ tenantId, filters: { documentNumbers: uuid } }); if (propertyDetails?.Properties.length > 0) { setShowToast({ - error: true,label: `Please enter a valid document number` - }) - } - else { + error: true, + label: `Please enter a valid document number`, + }); + } else { setShowToast({ - label: `Valid document number` - }) + label: `Valid document number`, + }); } - }, 1000) - return () => clearTimeout(getData) - }, [uuid]) - + }, 1000); + return () => clearTimeout(getData); + }, [uuid]); return ( @@ -239,7 +248,7 @@ const [showToast, setShowToast] = useState(null); { props.onChange(e.target.value); - setFocusIndex({ index: owner.key, type: "institution.name"}); + setFocusIndex({ index: owner.key, type: "institution.name" }); }} onBlur={(e) => { setFocusIndex({ index: -1 }); @@ -273,12 +282,16 @@ const [showToast, setShowToast] = useState(null); ( ( { - setUuid(e.target.value) - props.onChange(e); - setFocusIndex({ index: owner.key, type: "documents.documentUid" }); + setUuid(e.target.value); + props.onChange(e); + setFocusIndex({ index: owner.key, type: "documents.documentUid" }); }} labelStyle={{ marginTop: "unset" }} onBlur={props.onBlur} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PTSelectGeolocation.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PTSelectGeolocation.js index 415c8b8525d..d63a15d4eea 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PTSelectGeolocation.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PTSelectGeolocation.js @@ -11,7 +11,7 @@ const PTSelectGeolocation = ({ t, config, onSelect, formData = {} }) => { const isEditProperty = formData?.isEditProperty || false; const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: defaultConfig = {} } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "MapConfig"); + const { data: defaultConfig = {} } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "MapConfig"); const defaultcoord = defaultConfig?.PropertyTax?.MapConfig; let defaultcoord1 = defaultcoord ? defaultcoord[0] : {}; const onSkip = () => onSelect(); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Proof.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Proof.js index 4f099172e5c..ea915b3456e 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Proof.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Proof.js @@ -25,7 +25,7 @@ const Proof = ({ t, config, onSelect, userType, formData }) => { let dropdownData = []; const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: Documentsob = {} } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "Documents"); + const { data: Documentsob = {} } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "Documents"); const docs = Documentsob?.PropertyTax?.Documents; const proofOfAddress = Array.isArray(docs) && docs.filter((doc) => doc.code.includes("ADDRESSPROOF")); if (proofOfAddress.length > 0) { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyFloorDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyFloorDetails.js index 94c759fdcb8..ce9a619c70c 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyFloorDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyFloorDetails.js @@ -5,7 +5,7 @@ import Timeline from "../components/TLTimeline"; const PropertyFloorsDetails = ({ t, config, onSelect, formData, userType }) => { const [FloorDetails, setFloorDetails] = useState(formData?.noOfFloors); const stateId = Digit.ULBService.getStateId(); - const { data: Menu = {} } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "Floor") || {}; + const { data: Menu = {} } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "Floor") || {}; const menu = [ { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyTax.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyTax.js index b5adfcf85fd..d56ee5242ae 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyTax.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyTax.js @@ -10,7 +10,7 @@ const PropertyTax = ({ t, config, onSelect, userType, formData }) => { const docType = config?.isMutation ? ["MutationDocuments"] : "Documents"; - const { isLoading, data: Documentsob = {} } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", docType); + const { isLoading, data: Documentsob = {} } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", docType); let docs = Documentsob?.PropertyTax?.[config?.isMutation ? docType[0] : docType]; if (!config?.isMutation) docs = docs?.filter((doc) => doc["digit-citizen"]); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyType.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyType.js index 7379f8bb09b..3dec35e07e6 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyType.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyType.js @@ -17,7 +17,7 @@ const PropertyType = ({ t, config, onSelect, userType, formData, setError, clear const [BuildingType, setBuildingType] = useState(formData?.PropertyType); const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: Menu = {}, isLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "PTPropertyType") || {}; + const { data: Menu = {}, isLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "PTPropertyType") || {}; let proptype = []; proptype = Menu?.PropertyTax?.PropertyType; let i; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyUsageType.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyUsageType.js index 6aeab26a510..87cb52aa90b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyUsageType.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/PropertyUsageType.js @@ -17,11 +17,11 @@ const PropertyUsageType = ({ t, config, onSelect, userType, formData, formState, ? { code: `${formData?.usageCategoryMajor?.code}`, i18nKey: `PROPERTYTAX_BILLING_SLAB_OTHERS` } : formData?.usageCategoryMajor ); - // const { data: Menu, isLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "OccupancyType"); + // const { data: Menu, isLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "OccupancyType"); const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: Menu = {}, isLoading: menuLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "UsageCategory") || {}; + const { data: Menu = {}, isLoading: menuLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "UsageCategory") || {}; let usagecat = []; usagecat = Menu?.PropertyTax?.UsageCategory || []; let i; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideFloorNo.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideFloorNo.js index 493cb78c1c5..a64d15752b7 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideFloorNo.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideFloorNo.js @@ -10,7 +10,7 @@ const ProvideFloorNo = ({ t, config, onSelect, userType, formData }) => { //const [SubUsageTypeOfRentedArea, setSelfOccupied] = useState(formData?.ProvideSubUsageTypeOfRentedArea); const [Floorno, setFloorno] = useState(formData?.Floorno || ""); - const { data: floordata } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "Floor") || {}; + const { data: floordata } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "Floor") || {}; let floorlist = []; floorlist = floordata?.PropertyTax?.Floor; let i; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideSubUsageType.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideSubUsageType.js index 2dc56e1ca18..68d8a6677d5 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideSubUsageType.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideSubUsageType.js @@ -15,7 +15,7 @@ const ProvideSubUsageType = ({ t, config, onSelect, userType, formData }) => { [SubUsageType, setSelfOccupied] = useState(formData.subusagetype?.SubUsageType); } - const { data: Menu = {} } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "UsageCategory") || {}; + const { data: Menu = {} } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "UsageCategory") || {}; let subusageoption = []; subusageoption = Menu?.PropertyTax?.UsageCategory || []; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideSubUsageTypeOfRentedArea.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideSubUsageTypeOfRentedArea.js index d891fd193b4..14cd943b816 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideSubUsageTypeOfRentedArea.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/ProvideSubUsageTypeOfRentedArea.js @@ -16,7 +16,7 @@ const ProvideSubUsageTypeOfRentedArea = ({ t, config, onSelect, userType, formDa } else { [SubUsageTypeOfRentedArea, setSelfOccupied] = useState(formData.Subusagetypeofrentedarea?.SubUsageTypeOfRentedArea || ""); } - const { data: Menu = {} } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "UsageCategory") || {}; + const { data: Menu = {} } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "UsageCategory") || {}; let subusageoption = []; subusageoption = Menu?.PropertyTax?.UsageCategory || []; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/RentalDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/RentalDetails.js index 4a4f303401c..e9c4a65309c 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/RentalDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/RentalDetails.js @@ -18,7 +18,7 @@ const RentalDetails = ({ t, config, onSelect, value, userType, formData }) => { } const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: Menu, isLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "RentalDetails"); + const { data: Menu, isLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "RentalDetails"); if (Menu) { config.texts.cardText = Menu?.PropertyTax?.RentalDetails[0]?.code diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectDocuments.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectDocuments.js index 8e51d12fb40..f9b755fc831 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectDocuments.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectDocuments.js @@ -27,7 +27,7 @@ const SelectDocuments = ({ t, config, onSelect, userType, formData, setError: se const propertyInitialValues = JSON.parse(sessionStorage.getItem("PropertyInitials")); - const { isLoading, data } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", [ + const { isLoading, data } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", [ "UsageCategory", "OccupancyType", "Floor", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectOwnerDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectOwnerDetails.js index b2cbb80da40..e162cd8fe59 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectOwnerDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectOwnerDetails.js @@ -29,7 +29,7 @@ const SelectOwnerDetails = ({ t, config, onSelect, userType, formData, ownerInde const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: Menu } = Digit.Hooks.pt.useGenderMDMS(stateId, "common-masters", "GenderType"); + const { data: Menu } = Digit.Hooks.pt.useGenderMDMSV2(stateId, "common-masters", "GenderType"); let menu = []; Menu && diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectOwnerShipDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectOwnerShipDetails.js index de6a245435c..aba3994d8ff 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectOwnerShipDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectOwnerShipDetails.js @@ -20,8 +20,8 @@ const SelectOwnerShipDetails = ({ t, config, onSelect, userType, formData, onBlu let isEditProperty = formData?.isEditProperty || false; const [ownershipCategory, setOwnershipCategory] = useState(formData?.ownershipCategory); const [loader, setLoader] = useState(true); - const { data: SubOwnerShipCategoryOb, isLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "SubOwnerShipCategory"); - const { data: OwnerShipCategoryOb, isLoading: ownerShipCatLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "OwnerShipCategory"); + const { data: SubOwnerShipCategoryOb, isLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "SubOwnerShipCategory"); + const { data: OwnerShipCategoryOb, isLoading: ownerShipCatLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "OwnerShipCategory"); const ownerShipdropDown = []; let subCategoriesInOwnersType = ["INDIVIDUAL"]; let OwnerShipCategory = {}; @@ -73,7 +73,7 @@ const SelectOwnerShipDetails = ({ t, config, onSelect, userType, formData, onBlu if (userType === "employee") { const arr = ownerShipdropDown ?.filter((e) => e.code.split(".").length <= 2) - ?.splice(0, 4) + ?.splice(0, 10) ?.map((ownerShipDetails) => ({ ...ownerShipDetails, i18nKey: `PT_OWNERSHIP_${ @@ -86,7 +86,7 @@ const SelectOwnerShipDetails = ({ t, config, onSelect, userType, formData, onBlu return ( ownerShipdropDown && ownerShipdropDown.length && - ownerShipdropDown.splice(0, 4).map((ownerShipDetails) => ({ + ownerShipdropDown.splice(0, 10).map((ownerShipDetails) => ({ ...ownerShipDetails, i18nKey: `PT_OWNERSHIP_${ownerShipDetails.value.split(".")[1] ? ownerShipDetails.value.split(".")[1] : ownerShipDetails.value.split(".")[0]}`, })) @@ -162,7 +162,11 @@ const SelectOwnerShipDetails = ({ t, config, onSelect, userType, formData, onBlu return ( - {window.location.href.includes("/citizen/pt/property/property-mutation") ? : } + {window.location.href.includes("/citizen/pt/property/property-mutation") ? ( + + ) : ( + + )}
doc.code.includes("IDENTITYPROOF")); if (proofIdentity.length > 0) { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectSpecialOwnerCategoryType.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectSpecialOwnerCategoryType.js index 9807043e87a..e279bfe5659 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectSpecialOwnerCategoryType.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectSpecialOwnerCategoryType.js @@ -17,7 +17,7 @@ const SelectSpecialOwnerCategoryType = ({ t, config, onSelect, userType, formDat const [ownerType, setOwnerType] = useState( (formData.owners && formData.owners[index] && formData.owners[index]?.ownerType) || formData.owners?.ownerType || {} ); - const { data: Menu, isLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "OwnerType"); + const { data: Menu, isLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "OwnerType"); Menu ? Menu.sort((a, b) => a.name.localeCompare(b.name)) : ""; if (Menu?.length > 0) { Menu?.forEach((data, index) => { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectSpecialProofIdentity.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectSpecialProofIdentity.js index 4f93ddd44bb..ab1f0e58bbb 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectSpecialProofIdentity.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/SelectSpecialProofIdentity.js @@ -21,7 +21,7 @@ const SelectSpecialProofIdentity = ({ t, config, onSelect, userType, formData, o let dropdownData = []; const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: Documentsob = {} } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "Documents"); + const { data: Documentsob = {} } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "Documents"); const docs = Documentsob?.PropertyTax?.Documents; const specialProofIdentity = Array.isArray(docs) && docs.filter((doc) => doc.code.includes("SPECIALCATEGORYPROOF")); if (specialProofIdentity.length > 0) { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Units.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Units.js index ca4aaa4dccd..7692b1f5919 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Units.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pageComponents/Units.js @@ -33,7 +33,7 @@ const Units = ({ t, config, onSelect, userType, formData, setError, formState, c const [loader, setLoader] = useState(true); const { data: Menu, isLoading } = - Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", [ + Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", [ "UsageCategory", "OccupancyType", "Floor", @@ -436,7 +436,7 @@ function Unit({ usageCategoryMajorMenu, subUsageCategoryMenu, }) { - const { data: usageMenu = {}, isLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", [ + const { data: usageMenu = {}, isLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", [ "UsageCategory", "OccupancyType", "Floor", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/Create/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/Create/index.js index 56b8ef4f540..6920749bc15 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/Create/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/Create/index.js @@ -15,8 +15,7 @@ const CreateProperty = ({ parentRoute }) => { const stateId = Digit.ULBService.getStateId(); let config = []; const [params, setParams, clearParams] = Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY", {}); - let { data: commonFields, isLoading } = Digit.Hooks.pt.useMDMS(stateId, "PropertyTax", "CommonFieldsConfig"); - const [searchData, setSearchData] = useState({}); + let { data: commonFields, isLoading } = Digit.Hooks.pt.useMDMSV2(stateId, "PropertyTax", "CommonFieldsConfig"); const [searchData, setSearchData] = useState({}); const { data: propertyData, isLoading: propertyDataLoading, error, isSuccess, billData } = Digit.Hooks.pt.usePropertySearchWithDue({ tenantId: searchData?.city, filters: searchData?.filters, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/EditProperty/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/EditProperty/index.js index 98165ae7b99..3da9d2f4bf4 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/EditProperty/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/EditProperty/index.js @@ -419,7 +419,7 @@ const EditProperty = ({ parentRoute }) => { let config = []; const [params, setParams, clearParams] = Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY", { }); const stateId = Digit.ULBService.getStateId(); - let { data: commonFields, isLoading } = Digit.Hooks.pt.useMDMS(stateId, "PropertyTax", "CommonFieldsConfig"); + let { data: commonFields, isLoading } = Digit.Hooks.pt.useMDMSV2(stateId, "PropertyTax", "CommonFieldsConfig"); const tenantId = Digit.ULBService.getCurrentTenantId(); const acknowledgementIds = window.location.href.split("/").pop(); const propertyIds = window.location.href.split("/").pop(); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/Mutate/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/Mutate/index.js index 0bae905db5b..d6a6ba3ef99 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/Mutate/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/Mutate/index.js @@ -16,7 +16,7 @@ const MutationCitizen = (props) => { const tenantId = Digit.ULBService.getCurrentTenantId(); - const { data: mutationDocs, isLoading } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "PropertyTax", "MutationDocuments"); + const { data: mutationDocs, isLoading } = Digit.Hooks.pt.useMDMSV2(Digit.ULBService.getStateId(), "PropertyTax", "MutationDocuments"); const selectParams = (key, data) => { setParams((prev) => ({ ...prev, [key]: data })); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/MyProperties/propertyInformation.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/MyProperties/propertyInformation.js index 92564bbf696..b5366e9c81d 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/MyProperties/propertyInformation.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/MyProperties/propertyInformation.js @@ -65,7 +65,7 @@ const [isWarningPop, setWarningPopUp] = useState(false); const businessService="PT" const state = Digit.ULBService.getStateId(); const tenantId = Digit.ULBService.getCurrentTenantId(); - const { data: UpdateNumberConfig } = Digit.Hooks.useCommonMDMS(Digit.ULBService.getStateId(),"PropertyTax",["UpdateNumber"],{ + const { data: UpdateNumberConfig } = Digit.Hooks.useCommonMDMSV2(Digit.ULBService.getStateId(),"PropertyTax",["UpdateNumber"],{ select: (data) => { return data?.PropertyTax?.UpdateNumber?.[0]; }, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/SearchProperty/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/SearchProperty/index.js index aab85622377..d3154a64ed6 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/SearchProperty/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/SearchProperty/index.js @@ -30,4 +30,4 @@ const SearchProperty = () => { ); }; -export default SearchProperty; +export default SearchProperty; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/SearchProperty/searchProperty.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/SearchProperty/searchProperty.js index 51c421b5861..f32684d3ada 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/SearchProperty/searchProperty.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/citizen/SearchProperty/searchProperty.js @@ -39,7 +39,7 @@ const SearchProperty = ({ config: propsConfig, onSelect }) => { useEffect(() => { if ( !(searchData?.filters?.mobileNumber && Object.keys(searchData?.filters)?.length == 1) && propertyData?.Properties.length > 0 && - ptSearchConfig.maxResultValidation && + ptSearchConfig?.maxResultValidation && propertyData?.Properties.length > ptSearchConfig.maxPropertyResult && !errorShown ) { @@ -70,7 +70,7 @@ const SearchProperty = ({ config: propsConfig, onSelect }) => { getActionBar(); }, []); - const { data: ptSearchConfig, isLoading } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "DIGIT-UI", "HelpText", { + const { data: ptSearchConfig, isLoading } = Digit.Hooks.pt.useMDMSV2(Digit.ULBService.getStateId(), "DIGIT-UI", "HelpText", { select: (data) => { return data?.["DIGIT-UI"]?.["HelpText"]?.[0]?.PT; }, @@ -313,7 +313,7 @@ const SearchProperty = ({ config: propsConfig, onSelect }) => { const onPropertySearch = async (data) => { if ( - ptSearchConfig.maxResultValidation && + ptSearchConfig?.maxResultValidation && propertyData?.Properties.length > 0 && propertyData?.Properties.length > ptSearchConfig.maxPropertyResult && errorShown @@ -406,7 +406,7 @@ const SearchProperty = ({ config: propsConfig, onSelect }) => { return ; } - let validation = ptSearchConfig.maxResultValidation && !(searchData?.filters?.mobileNumber && Object.keys(searchData?.filters)?.length == 1) ? propertyData?.Properties.length { data: ptCalculationEstimateData, mutate: ptCalculationEstimateMutate, } = Digit.Hooks.pt.usePtCalculationEstimate(tenantId); - const { data: ChargeSlabsMenu, isLoading: isChargeSlabsLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "ChargeSlabs"); + const { data: ChargeSlabsMenu, isLoading: isChargeSlabsLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "ChargeSlabs"); const fetchBillParams = { consumerCode : propertyId }; let ptCalculationEstimateDataCopy; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/EditApplication/EditForm.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/EditApplication/EditForm.js index ff43a1e1221..d40e7ca9c7e 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/EditApplication/EditForm.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/EditApplication/EditForm.js @@ -11,7 +11,7 @@ const EditForm = ({ applicationData }) => { const [canSubmit, setSubmitValve] = useState(false); const [mutationHappened, setMutationHappened, clear] = Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED", false); const [successData, setsuccessData, clearSuccessData] = Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA", {}); - const { data: commonFields, isLoading } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "PropertyTax", "CommonFieldsConfig"); + const { data: commonFields, isLoading } = Digit.Hooks.pt.useMDMSV2(Digit.ULBService.getStateId(), "PropertyTax", "CommonFieldsConfig"); useEffect(() => { setMutationHappened(false); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyDetails.js index bd67fb513c2..e1f19d85ebe 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyDetails.js @@ -57,7 +57,7 @@ const PropertyDetails = () => { ); const mutation = Digit.Hooks.pt.usePropertyAPI(tenantId, false); - const { data: UpdateNumberConfig } = Digit.Hooks.useCommonMDMS(Digit.ULBService.getStateId(), "PropertyTax", ["UpdateNumber"], { + const { data: UpdateNumberConfig } = Digit.Hooks.useCommonMDMSV2(Digit.ULBService.getStateId(), "PropertyTax", ["UpdateNumber"], { select: (data) => { return data?.PropertyTax?.UpdateNumber?.[0]; }, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyMutation/docsRequired.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyMutation/docsRequired.js index 3c44b9bf899..413b13a1f7b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyMutation/docsRequired.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyMutation/docsRequired.js @@ -13,7 +13,7 @@ const RequiredDoc = () => { const history = useHistory(); const { id } = useParams(); const [docs, setDocs] = useState([]); - const { isLoading, data: Documentsob } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", ["MutationDocuments"]); + const { isLoading, data: Documentsob } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", ["MutationDocuments"]); const OnSubmit = () => { history.push(`/digit-ui/employee/pt/property-mutate/${id}`); }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyMutation/mutationForm.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyMutation/mutationForm.js index e7d360f9f0f..5eb30330801 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyMutation/mutationForm.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/PropertyMutation/mutationForm.js @@ -8,7 +8,7 @@ const MutationForm = ({ applicationData, tenantId }) => { const { t } = useTranslation(); const [canSubmit, setSubmitValve] = useState(false); - const { data: mutationDocs, isLoading } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "PropertyTax", "MutationDocuments"); + const { data: mutationDocs, isLoading } = Digit.Hooks.pt.useMDMSV2(Digit.ULBService.getStateId(), "PropertyTax", "MutationDocuments"); const defaultValues = { originalData: applicationData, }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/Search.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/Search.js index 4ab1b34e0e8..fc9fa678803 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/Search.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/Search.js @@ -160,7 +160,7 @@ const Search = () => { const SearchComponent = memo(Digit.ComponentRegistryService.getComponent("PropertySearchForm")); const SearchResultComponent = memo(Digit.ComponentRegistryService.getComponent("PropertySearchResults")); const SearchPTIDPropComponent = memo(Digit.ComponentRegistryService.getComponent("SearchPTIDProp")); - const { data: ptSearchConfig, isLoading } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "DIGIT-UI", "HelpText", { + const { data: ptSearchConfig, isLoading } = Digit.Hooks.pt.useMDMSV2(Digit.ULBService.getStateId(), "DIGIT-UI", "HelpText", { select: (data) => { return data?.["DIGIT-UI"]?.["HelpText"]?.[0]?.PT; }, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/UlbAssesment.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/UlbAssesment.js index 0f9ec4c3702..9a881d58396 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/UlbAssesment.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/pt/src/pages/employee/UlbAssesment.js @@ -69,7 +69,7 @@ const UlbAssesment = ({path}) => { // ); const { isLoading, isSuccess,error,count, mutate: assessmentMutate } = Digit.Hooks.pt.UseAssessmentCreateUlb("pg.citya"); - const { isLoading: financialYearsLoading, data: financialYearsData } = Digit.Hooks.pt.useMDMS( + const { isLoading: financialYearsLoading, data: financialYearsData } = Digit.Hooks.pt.useMDMSV2( tenantId, "pt", "FINANCIAL_YEARLS", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/templates/ApplicationDetails/Modal/PTActionModal.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/templates/ApplicationDetails/Modal/PTActionModal.js index 7e37de54da8..1153e741bda 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/templates/ApplicationDetails/Modal/PTActionModal.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/templates/ApplicationDetails/Modal/PTActionModal.js @@ -32,7 +32,7 @@ const ActionModal = ({ t, action, tenantId, state, id, closeModal, submitAction, }, { enabled: !action?.isTerminateState } ); - const { isLoading: financialYearsLoading, data: financialYearsData } = Digit.Hooks.pt.useMDMS( + const { isLoading: financialYearsLoading, data: financialYearsData } = Digit.Hooks.pt.useMDMSV2( tenantId, businessService, "FINANCIAL_YEARLS", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/Proof.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/Proof.js index 4235e4c4418..11927e2d186 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/Proof.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/Proof.js @@ -15,7 +15,7 @@ const Proof = ({ t, config, onSelect, userType, formData }) => { // let dropdownData = []; const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: Documentsob = {} } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "Documents"); + const { data: Documentsob = {} } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "Documents"); const docs = Documentsob?.PropertyTax?.Documents; const ownerPhotoProof = Array.isArray(docs) && docs.filter((doc) => doc.code.includes("ADDRESSPROOF")); // if (ownerPhotoProof.length > 0) { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectDocuments.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectDocuments.js index d156a1211ef..3d46b17b20b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectDocuments.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectDocuments.js @@ -9,7 +9,7 @@ const SelectDocuments = ({ t, config, onSelect, userType, formData, setError: se const { action = "create" } = Digit.Hooks.useQueryParams(); - const { isLoading, data } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", [ + const { isLoading, data } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", [ "UsageCategory", "OccupancyType", "Floor", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectOwnershipProof.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectOwnershipProof.js index 13b76801962..6188b77d9dd 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectOwnershipProof.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectOwnershipProof.js @@ -13,7 +13,7 @@ const SelectOwnershipProof = ({ t, config, onSelect, userType, formData }) => { //let dropdownData = []; const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: Documentsob = { } } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "Documents"); + const { data: Documentsob = { } } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "Documents"); const docs = Documentsob?.PropertyTax?.Documents; const proofOfOwnership = Array.isArray(docs) && docs.filter((doc) => doc.code.includes("ADDRESSPROOF")); // if (proofOfOwnership.length > 0) { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectProofIdentity.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectProofIdentity.js index f804026e24e..b241f71cb33 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectProofIdentity.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/SelectProofIdentity.js @@ -14,7 +14,7 @@ const SelectProofIdentity = ({ t, config, onSelect, userType, formData }) => { //let dropdownData = []; const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: Documentsob = { } } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "Documents"); + const { data: Documentsob = { } } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "Documents"); const docs = Documentsob?.PropertyTax?.Documents; const proofOfIdentity = Array.isArray(docs) && docs.filter((doc) => doc.code.includes("ADDRESSPROOF")); // if (proofOfIdentity.length > 0) { diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLDocumentsEmployee.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLDocumentsEmployee.js index a656403ed04..5d5aecd633c 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLDocumentsEmployee.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLDocumentsEmployee.js @@ -16,7 +16,7 @@ const TLDocumentsEmployee = ({ t, config, onSelect, userType, formData, setError if (isEditScreen) action = "update"; - const { isLoading, data: documentsData } = Digit.Hooks.pt.usePropertyMDMS(stateId, "TradeLicense", ["documentObj"]); + const { isLoading, data: documentsData } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "TradeLicense", ["documentObj"]); const ckeckingLocation = window.location.href.includes("renew-application-details"); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLOwnerDetailsEmployee.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLOwnerDetailsEmployee.js index 58c6a6122a3..54ac4c5c449 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLOwnerDetailsEmployee.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLOwnerDetailsEmployee.js @@ -657,7 +657,7 @@ const TLOwnerDetailsEmployee = ({ config, onSelect, userType, formData, setError const [isErrors, setIsErrors] = useState(false); const [previousLicenseDetails, setPreviousLicenseDetails] = useState(formData?.tradedetils1 || []); - const { data: mdmsData, isLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", [ + const { data: mdmsData, isLoading } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", [ "UsageCategory", "OccupancyType", "Floor", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLSelectGeolocation.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLSelectGeolocation.js index 5c1de37a0e4..0fe25ccc7be 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLSelectGeolocation.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/pageComponents/TLSelectGeolocation.js @@ -10,7 +10,7 @@ const TLSelectGeolocation = ({ t, config, onSelect, formData = {} }) => { let isEditProperty = window.location.href.includes("edit-application")||window.location.href.includes("renew-trade"); const tenantId = Digit.ULBService.getCurrentTenantId(); const stateId = Digit.ULBService.getStateId(); - const { data: defaultConfig = {} } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "MapConfig"); + const { data: defaultConfig = {} } = Digit.Hooks.pt.usePropertyMDMSV2(stateId, "PropertyTax", "MapConfig"); const defaultcoord = defaultConfig?.PropertyTax?.MapConfig; let defaultcoord1 = defaultcoord ? defaultcoord[0] : {}; const onSkip = () => onSelect(); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/utils/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/utils/index.js index 6bd484c8354..5b1ecbbfdb8 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/utils/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/tl/src/utils/index.js @@ -503,14 +503,15 @@ export const convertToUpdateTrade = (data = {}, datafromflow, tenantId) => { } export const getvalidfromdate = (date, fy) => { - let temp = parseInt(fy[0].id); + let temp = parseInt(fy[0].code); let object = fy?.[0]; fy && fy.map((ob) => { - if (parseInt(ob.id) > temp) { + if (parseInt(ob.code) > temp) { object = ob; - temp = parseInt(ob.id); + temp = parseInt(ob.code); } }) + console.log(object,"object"); return object; } diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSActivationDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSActivationDetails.js old mode 100755 new mode 100644 index f69d6a5cfc2..4bc505a2d3d --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSActivationDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSActivationDetails.js @@ -1,71 +1,71 @@ -import { CardLabel, DatePicker, LabelFieldPair, TextInput } from "@egovernments/digit-ui-react-components"; -import React from "react"; - -const WSActivationDetails = ({ t, config, userType, formData, onSelect }) => { - const [activationDetails, setActivationDetails] = React.useState({ - meterId: "", - meterInstallationDate: "", - meterInitialReading: "", - connectionExecutionDate: "", - }); - - React.useEffect(() => { - if (formData) { - } - }); - - return ( - - - {`${t(`WS_METER_ID`)}`} -
- { - setActivationDetails({ ...activationDetails, meterId: ev.target.value }); - }} - > -
-
- - {`${t(`WS_METER_INSTALLATION_DATE`)}`} -
- { - setActivationDetails({ ...activationDetails, meterInstallationDate: date }); - }} - > -
-
- - {`${t(`WS_INIT_METER_READING`)}`} -
- { - setActivationDetails({ ...activationDetails, meterInitialReading: ev.target.value }); - }} - > -
-
- - {`${t(`WS_CONN_EXEC_DATE`)}`} -
- { - setActivationDetails({ ...activationDetails, connectionExecutionDate: date }); - }} - > -
-
-
- ); -}; - -export default WSActivationDetails; +import { CardLabel, DatePicker, LabelFieldPair, TextInput } from "@egovernments/digit-ui-react-components"; +import React from "react"; + +const WSActivationDetails = ({ t, config, userType, formData, onSelect }) => { + const [activationDetails, setActivationDetails] = React.useState({ + meterId: "", + meterInstallationDate: "", + meterInitialReading: "", + connectionExecutionDate: "", + }); + + React.useEffect(() => { + if (formData) { + } + }); + + return ( + + + {`${t(`WS_METER_ID`)}`} +
+ { + setActivationDetails({ ...activationDetails, meterId: ev.target.value }); + }} + > +
+
+ + {`${t(`WS_METER_INSTALLATION_DATE`)}`} +
+ { + setActivationDetails({ ...activationDetails, meterInstallationDate: date }); + }} + > +
+
+ + {`${t(`WS_INIT_METER_READING`)}`} +
+ { + setActivationDetails({ ...activationDetails, meterInitialReading: ev.target.value }); + }} + > +
+
+ + {`${t(`WS_CONN_EXEC_DATE`)}`} +
+ { + setActivationDetails({ ...activationDetails, connectionExecutionDate: date }); + }} + > +
+
+
+ ); +}; + +export default WSActivationDetails; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionDetails.js old mode 100755 new mode 100644 index 6180ec792f2..b373ba5b423 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionDetails.js @@ -1,363 +1,363 @@ -import { CardLabel, Dropdown, LabelFieldPair, Loader, TextInput, CardLabelError, CheckBox } from "@egovernments/digit-ui-react-components"; -import React, { useEffect, useState } from "react"; -import { getPattern } from "../utils"; -import { useForm, Controller } from "react-hook-form"; -import { useTranslation } from "react-i18next"; -import { useLocation } from "react-router-dom"; -import _, { keys } from "lodash"; -import * as func from "../utils"; - -const createConnectionDetails = () => ({ - water: true, - sewerage: false, - - proposedPipeSize: "", - proposedTaps: "", - - - proposedToilets: "", - proposedWaterClosets: "" -}); - - -const WSConnectionDetails = ({ config, onSelect, userType, formData, setError, formState, clearErrors }) => { - - - const { t } = useTranslation(); - const { pathname } = useLocation(); - const [connectionDetails, setConnectionDetails] = useState(formData?.ConnectionDetails ? [formData?.ConnectionDetails?.[0]] : [createConnectionDetails()]); - const [focusIndex, setFocusIndex] = useState({ index: -1, type: "" }); - const stateCode = Digit.ULBService.getStateId(); - const [isErrors, setIsErrors] = useState(false); - const [waterSewarageSelection, setWaterSewarageSelection] = useState({ water: true, sewerage: false }); - - const [pipeSizeList, setPipesizeList] = useState([]); - - const { isWSServicesCalculationLoading, data: wsServicesCalculationData } = Digit.Hooks.ws.useMDMS(stateCode, "ws-services-calculation", ["PipeSize"]); - - - useEffect(() => { - const data = connectionDetails.map((e) => { - return e; - }); - onSelect(config?.key, data); - }, [connectionDetails]); - - - useEffect(() => { - const list = wsServicesCalculationData?.["ws-services-calculation"]?.PipeSize || []; - list?.forEach(data => data.i18nKey = data.size); - setPipesizeList(list); - }, [wsServicesCalculationData]); - - useEffect(() => { - if (userType === "employee") { - onSelect(config.key, { ...formData[config.key], ...connectionDetails }); - } - if (connectionDetails?.[0]?.water) setWaterSewarageSelection({ water: true, sewerage: false }) - - if (connectionDetails?.[0]?.sewerage) setWaterSewarageSelection({ water: false, sewerage: true }) - }, [connectionDetails]); - - useEffect(() => { - if (!formData?.ConnectionDetails) { - setConnectionDetails([createConnectionDetails()]); - } - }, [formData?.ConnectionDetails]); - - if (isWSServicesCalculationLoading) return - - const commonProps = { - focusIndex, - connectionDetails, - setFocusIndex, - formData, - formState, - t, - setError, - clearErrors, - config, - setConnectionDetails, - setIsErrors, - isErrors, - pipeSizeList, - wsServicesCalculationData, - waterSewarageSelection, - formData - }; - - return ( - - {connectionDetails.map((connectionDetail, index) => ( - - ))} - - ); -}; - -const ConnectionDetails = (_props) => { - const { - connectionDetail, - focusIndex, - setFocusIndex, - t, - config, - setError, - clearErrors, - formState, - setIsErrors, - isErrors, - connectionTypeList, - setConnectionDetails, - wsServicesCalculationData, - pipeSizeList, - connectionDetails, - waterSewarageSelection, - formData - } = _props; - - const { control, formState: localFormState, watch, setError: setLocalError, clearErrors: clearLocalErrors, setValue, trigger, getValues } = useForm(); - const formValue = watch(); - const { errors } = localFormState; - - useEffect(() => { - trigger(); - }, []); - - useEffect(() => { - if (Object.entries(formValue).length > 0) { - const keys = Object.keys(formValue); - const part = {}; - keys.forEach((key) => (part[key] = connectionDetail[key])); - if (!_.isEqual(formValue, part)) { - let isErrorsFound = true; - Object.keys(formValue).map(data => { - if (!formValue[data] && isErrorsFound) { - isErrorsFound = false - setIsErrors(false); - } - }); - if (isErrorsFound) setIsErrors(true); - let ob = [{ ...formValue }]; - setConnectionDetails(ob); - trigger(); - } - } - }, [formValue, connectionDetails]); - - useEffect(() => { - let isClear = true; - Object.keys(connectionDetails?.[0])?.map(data => { - if (!connectionDetails[0][data] && connectionDetails[0][data] != false && isClear) isClear = false - }) - if (isClear && Object.keys(connectionDetails?.[0])?.length > 1) { - clearErrors("ConnectionDetails"); - } - - if (!connectionDetails?.[0]?.sewerage) { - clearErrors(config.key, { type: "proposedToilets" }) - clearErrors(config.key, { type: "proposedWaterClosets" }) - } - - if (!connectionDetails?.[0]?.water) { - clearErrors(config.key, { type: "proposedPipeSize" }) - clearErrors(config.key, { type: "proposedTaps" }) - } - trigger(); - }, [connectionDetails, waterSewarageSelection, formData?.DocumentsRequired?.documents]); - - - useEffect(() => { - if (Object.keys(errors).length && !_.isEqual(formState.errors[config.key]?.type || {}, errors)) { - setError(config.key, { type: errors }); - } - else if (!Object.keys(errors).length && formState.errors[config.key] && isErrors) { - clearErrors(config.key); - } - }, [errors]); - - const errorStyle = { width: "70%", marginLeft: "30%", fontSize: "12px", marginTop: "-21px" }; - const isMobile = window.Digit.Utils.browser.isMobile(); - const isEmployee = window.location.href.includes("/employee") - const titleStyle = isMobile ? { marginBottom: "40px", color: "#505A5F", fontWeight: "700", fontSize: "16px"} :{marginTop: "-40px", marginBottom: "40px", color: "#505A5F", fontWeight: "700", fontSize: "16px"} - return ( -
- {/* {window.location.href.includes("/ws/new") ?
{t("WS_CONNECTION_DETAILS_HEADER_SUB_TEXT_LABEL")}
: null} */} -
- {`${t("WS_APPLY_FOR")}*`} -
- ( - { - if (e.target.checked || connectionDetail?.sewerage) { - props.onChange(e.target.checked); - setFocusIndex({ index: connectionDetail?.key, type: "water" }); - } - }} - checked={connectionDetail?.water} - style={{ paddingBottom: "10px", paddingTop: "3px" }} - onBlur={props.onBlur} - /> - )} - /> - ( - { - if (e.target.checked || connectionDetail?.water) { - props.onChange(e.target.checked); - setFocusIndex({ index: connectionDetail?.key, type: "sewerage" }); - } - }} - checked={connectionDetail?.sewerage} - style={{ paddingBottom: "10px", paddingTop: "3px" }} - onBlur={props.onBlur} - /> - - )} - /> - -
- {connectionDetail?.water && ( -
- - {`${t("WS_NO_OF_PROPOSED_TAPS_LABEL")}*`} -
- ((parseInt(e)>0 && e && getPattern("WSOnlyNumbers").test(e)) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), required: t("REQUIRED_FIELD") }} - type="number" - isMandatory={true} - render={(props) => ( - { - props.onChange(e.target.value); - setFocusIndex({ index: connectionDetail?.key, type: "proposedTaps" }); - }} - labelStyle={{ marginTop: "unset" }} - onBlur={props.onBlur} - /> - )} - /> -
-
- {localFormState.touched.proposedTaps ? errors?.proposedTaps?.message : ""} - - {`${t("WS_PROPOSED_PIPE_SIZE_IN_INCHES_LABEL")}*`} - ( - { - props.onChange(e); - }} - optionKey="i18nKey" - onBlur={props.onBlur} - t={t} - /> - )} - /> - - {localFormState.touched.proposedPipeSize ? errors?.proposedPipeSize?.message : ""} -
- )} - {connectionDetail?.sewerage && ( -
- - {`${t("WS_PROPOSED_WATER_CLOSETS_LABEL")}*`} -
- ((parseInt(e)>0 && e && getPattern("WSOnlyNumbers").test(e)) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), required: t("REQUIRED_FIELD") }} - type="number" - isMandatory={true} - render={(props) => ( - { - props.onChange(e.target.value); - setFocusIndex({ index: connectionDetail?.key, type: "proposedWaterClosets" }); - }} - labelStyle={{ marginTop: "unset" }} - onBlur={props.onBlur} - /> - )} - /> -
-
- {localFormState.touched.proposedWaterClosets ? errors?.proposedWaterClosets?.message : ""} - - {`${t("WS_PROPOSED_WATER_TOILETS_LABEL")}*`} -
- ((parseInt(e)>0 && e && getPattern("WSOnlyNumbers").test(e)) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), required: t("REQUIRED_FIELD") }} - type="number" - isMandatory={true} - render={(props) => ( - { - props.onChange(e.target.value); - setFocusIndex({ index: connectionDetail?.key, type: "proposedToilets" }); - }} - labelStyle={{ marginTop: "unset" }} - onBlur={props.onBlur} - /> - )} - /> -
-
- {localFormState.touched.proposedToilets ? errors?.proposedToilets?.message : ""} -
- )} -
-
- ); -}; - - -export default WSConnectionDetails; +import { CardLabel, Dropdown, LabelFieldPair, Loader, TextInput, CardLabelError, CheckBox } from "@egovernments/digit-ui-react-components"; +import React, { useEffect, useState } from "react"; +import { getPattern } from "../utils"; +import { useForm, Controller } from "react-hook-form"; +import { useTranslation } from "react-i18next"; +import { useLocation } from "react-router-dom"; +import _, { keys } from "lodash"; +import * as func from "../utils"; + +const createConnectionDetails = () => ({ + water: true, + sewerage: false, + + proposedPipeSize: "", + proposedTaps: "", + + + proposedToilets: "", + proposedWaterClosets: "" +}); + + +const WSConnectionDetails = ({ config, onSelect, userType, formData, setError, formState, clearErrors }) => { + + + const { t } = useTranslation(); + const { pathname } = useLocation(); + const [connectionDetails, setConnectionDetails] = useState(formData?.ConnectionDetails ? [formData?.ConnectionDetails?.[0]] : [createConnectionDetails()]); + const [focusIndex, setFocusIndex] = useState({ index: -1, type: "" }); + const stateCode = Digit.ULBService.getStateId(); + const [isErrors, setIsErrors] = useState(false); + const [waterSewarageSelection, setWaterSewarageSelection] = useState({ water: true, sewerage: false }); + + const [pipeSizeList, setPipesizeList] = useState([]); + + const { isWSServicesCalculationLoading, data: wsServicesCalculationData } = Digit.Hooks.ws.useMDMS(stateCode, "ws-services-calculation", ["PipeSize"]); + + + useEffect(() => { + const data = connectionDetails.map((e) => { + return e; + }); + onSelect(config?.key, data); + }, [connectionDetails]); + + + useEffect(() => { + const list = wsServicesCalculationData?.["ws-services-calculation"]?.PipeSize || []; + list?.forEach(data => data.i18nKey = data.size); + setPipesizeList(list); + }, [wsServicesCalculationData]); + + useEffect(() => { + if (userType === "employee") { + onSelect(config.key, { ...formData[config.key], ...connectionDetails }); + } + if (connectionDetails?.[0]?.water) setWaterSewarageSelection({ water: true, sewerage: false }) + + if (connectionDetails?.[0]?.sewerage) setWaterSewarageSelection({ water: false, sewerage: true }) + }, [connectionDetails]); + + useEffect(() => { + if (!formData?.ConnectionDetails) { + setConnectionDetails([createConnectionDetails()]); + } + }, [formData?.ConnectionDetails]); + + if (isWSServicesCalculationLoading) return + + const commonProps = { + focusIndex, + connectionDetails, + setFocusIndex, + formData, + formState, + t, + setError, + clearErrors, + config, + setConnectionDetails, + setIsErrors, + isErrors, + pipeSizeList, + wsServicesCalculationData, + waterSewarageSelection, + formData + }; + + return ( + + {connectionDetails.map((connectionDetail, index) => ( + + ))} + + ); +}; + +const ConnectionDetails = (_props) => { + const { + connectionDetail, + focusIndex, + setFocusIndex, + t, + config, + setError, + clearErrors, + formState, + setIsErrors, + isErrors, + connectionTypeList, + setConnectionDetails, + wsServicesCalculationData, + pipeSizeList, + connectionDetails, + waterSewarageSelection, + formData + } = _props; + + const { control, formState: localFormState, watch, setError: setLocalError, clearErrors: clearLocalErrors, setValue, trigger, getValues } = useForm(); + const formValue = watch(); + const { errors } = localFormState; + + useEffect(() => { + trigger(); + }, []); + + useEffect(() => { + if (Object.entries(formValue).length > 0) { + const keys = Object.keys(formValue); + const part = {}; + keys.forEach((key) => (part[key] = connectionDetail[key])); + if (!_.isEqual(formValue, part)) { + let isErrorsFound = true; + Object.keys(formValue).map(data => { + if (!formValue[data] && isErrorsFound) { + isErrorsFound = false + setIsErrors(false); + } + }); + if (isErrorsFound) setIsErrors(true); + let ob = [{ ...formValue }]; + setConnectionDetails(ob); + trigger(); + } + } + }, [formValue, connectionDetails]); + + useEffect(() => { + let isClear = true; + Object.keys(connectionDetails?.[0])?.map(data => { + if (!connectionDetails[0][data] && connectionDetails[0][data] != false && isClear) isClear = false + }) + if (isClear && Object.keys(connectionDetails?.[0])?.length > 1) { + clearErrors("ConnectionDetails"); + } + + if (!connectionDetails?.[0]?.sewerage) { + clearErrors(config.key, { type: "proposedToilets" }) + clearErrors(config.key, { type: "proposedWaterClosets" }) + } + + if (!connectionDetails?.[0]?.water) { + clearErrors(config.key, { type: "proposedPipeSize" }) + clearErrors(config.key, { type: "proposedTaps" }) + } + trigger(); + }, [connectionDetails, waterSewarageSelection, formData?.DocumentsRequired?.documents]); + + + useEffect(() => { + if (Object.keys(errors).length && !_.isEqual(formState.errors[config.key]?.type || {}, errors)) { + setError(config.key, { type: errors }); + } + else if (!Object.keys(errors).length && formState.errors[config.key] && isErrors) { + clearErrors(config.key); + } + }, [errors]); + + const errorStyle = { width: "70%", marginLeft: "30%", fontSize: "12px", marginTop: "-21px" }; + const isMobile = window.Digit.Utils.browser.isMobile(); + const isEmployee = window.location.href.includes("/employee") + const titleStyle = isMobile ? { marginBottom: "40px", color: "#505A5F", fontWeight: "700", fontSize: "16px"} :{marginTop: "-40px", marginBottom: "40px", color: "#505A5F", fontWeight: "700", fontSize: "16px"} + return ( +
+ {/* {window.location.href.includes("/ws/new") ?
{t("WS_CONNECTION_DETAILS_HEADER_SUB_TEXT_LABEL")}
: null} */} +
+ {`${t("WS_APPLY_FOR")}*`} +
+ ( + { + if (e.target.checked || connectionDetail?.sewerage) { + props.onChange(e.target.checked); + setFocusIndex({ index: connectionDetail?.key, type: "water" }); + } + }} + checked={connectionDetail?.water} + style={{ paddingBottom: "10px", paddingTop: "3px" }} + onBlur={props.onBlur} + /> + )} + /> + ( + { + if (e.target.checked || connectionDetail?.water) { + props.onChange(e.target.checked); + setFocusIndex({ index: connectionDetail?.key, type: "sewerage" }); + } + }} + checked={connectionDetail?.sewerage} + style={{ paddingBottom: "10px", paddingTop: "3px" }} + onBlur={props.onBlur} + /> + + )} + /> + +
+ {connectionDetail?.water && ( +
+ + {`${t("WS_NO_OF_PROPOSED_TAPS_LABEL")}*`} +
+ ((parseInt(e)>0 && e && getPattern("WSOnlyNumbers").test(e)) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), required: t("REQUIRED_FIELD") }} + type="number" + isMandatory={true} + render={(props) => ( + { + props.onChange(e.target.value); + setFocusIndex({ index: connectionDetail?.key, type: "proposedTaps" }); + }} + labelStyle={{ marginTop: "unset" }} + onBlur={props.onBlur} + /> + )} + /> +
+
+ {localFormState.touched.proposedTaps ? errors?.proposedTaps?.message : ""} + + {`${t("WS_PROPOSED_PIPE_SIZE_IN_INCHES_LABEL")}*`} + ( + { + props.onChange(e); + }} + optionKey="i18nKey" + onBlur={props.onBlur} + t={t} + /> + )} + /> + + {localFormState.touched.proposedPipeSize ? errors?.proposedPipeSize?.message : ""} +
+ )} + {connectionDetail?.sewerage && ( +
+ + {`${t("WS_PROPOSED_WATER_CLOSETS_LABEL")}*`} +
+ ((parseInt(e)>0 && e && getPattern("WSOnlyNumbers").test(e)) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), required: t("REQUIRED_FIELD") }} + type="number" + isMandatory={true} + render={(props) => ( + { + props.onChange(e.target.value); + setFocusIndex({ index: connectionDetail?.key, type: "proposedWaterClosets" }); + }} + labelStyle={{ marginTop: "unset" }} + onBlur={props.onBlur} + /> + )} + /> +
+
+ {localFormState.touched.proposedWaterClosets ? errors?.proposedWaterClosets?.message : ""} + + {`${t("WS_PROPOSED_WATER_TOILETS_LABEL")}*`} +
+ ((parseInt(e)>0 && e && getPattern("WSOnlyNumbers").test(e)) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), required: t("REQUIRED_FIELD") }} + type="number" + isMandatory={true} + render={(props) => ( + { + props.onChange(e.target.value); + setFocusIndex({ index: connectionDetail?.key, type: "proposedToilets" }); + }} + labelStyle={{ marginTop: "unset" }} + onBlur={props.onBlur} + /> + )} + /> +
+
+ {localFormState.touched.proposedToilets ? errors?.proposedToilets?.message : ""} +
+ )} +
+
+ ); +}; + + +export default WSConnectionDetails; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionHolder.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionHolder.js old mode 100755 new mode 100644 index 8882ededc89..d7b67542ce5 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionHolder.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionHolder.js @@ -1,307 +1,307 @@ -import { CardLabel, CheckBox, Dropdown, FormStep, Loader, MobileNumber, RadioButtons, TextInput, UploadFile } from "@egovernments/digit-ui-react-components"; -import React, { useEffect, useState } from "react"; -import Timeline from "../components/Timeline"; -import { stringReplaceAll } from "../utils"; - -const WSConnectionHolder = ({ t, config, onSelect, userType, formData, ownerIndex }) => { - let validation = {}; - const [name, setName] = useState(formData?.ConnectionHolderDetails?.name || formData?.formData?.ConnectionHolderDetails?.name || ""); - const [guardian, setguardian] = useState(formData?.ConnectionHolderDetails?.guardian || formData?.formData?.ConnectionHolderDetails?.guardian || ""); - const [gender, setGender] = useState(formData?.ConnectionHolderDetails?.gender || formData?.formData?.ConnectionHolderDetails?.gender); - const [relationship, setrelationship] = useState(formData?.ConnectionHolderDetails?.relationship || formData?.formData?.ConnectionHolderDetails?.relationship); - const [mobileNumber, setMobileNumber] = useState(formData?.ConnectionHolderDetails?.mobileNumber || formData?.formData?.ConnectionHolderDetails?.mobileNumber || ""); - const [address, setaddress] = useState(formData?.ConnectionHolderDetails?.address || formData?.formData?.ConnectionHolderDetails?.address || ""); - const [documentId, setdocumentId] = useState(formData?.ConnectionHolderDetails?.documentId || formData?.formData?.ConnectionHolderDetails?.documentId || ""); - const [isOwnerSame, setisOwnerSame] = useState((formData?.ConnectionHolderDetails?.isOwnerSame == false || formData?.formData?.ConnectionHolderDetails?.isOwnerSame == false) ? false : true); - const [uploadedFile, setUploadedFile] = useState(formData?.[config.key]?.fileStoreId || null); - const [file, setFile] = useState(null); - const [error, setError] = useState(null); - const [dropdownValue, setDropdownValue] = useState(formData?.ConnectionHolderDetails?.documentType || ""); - const [ownerType, setOwnerType] = useState( formData?.ConnectionHolderDetails?.specialCategoryType || {}); - let isMobile = window.Digit.Utils.browser.isMobile(); - - const tenantId = Digit.ULBService.getCurrentTenantId(); - const stateId = Digit.ULBService.getStateId(); - let dropdownData = []; - const { data: Documentsob = { } } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "Documents"); - const docs = Documentsob?.PropertyTax?.Documents; - const specialProofIdentity = Array.isArray(docs) && docs.filter((doc) => doc.code.includes("SPECIALCATEGORYPROOF")); - if (specialProofIdentity.length > 0) { - dropdownData = specialProofIdentity[0]?.dropdownData; - dropdownData.forEach((data) => { - data.i18nKey = stringReplaceAll(data.code, ".", "_"); - }); - dropdownData = dropdownData?.filter((dropdown) => dropdown.parentValue.includes(ownerType?.code)); - if (dropdownData.length == 1 && dropdownValue != dropdownData[0]) { - setTypeOfDropdownValue(dropdownData[0]); - } - } - - const GuardianOptions = [ - { name: "Father", code: "FATHER", i18nKey: "COMMON_MASTERS_OWNERTYPE_FATHER" }, - { name: "HUSBAND", code: "HUSBAND", i18nKey: "COMMON_MASTERS_OWNERTYPE_HUSBAND" }, - ]; - - const { isLoading, data: genderTypeData } = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]); - - const { data: Menu, isLoading : isSpecialcategoryLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "OwnerType"); - Menu ? Menu.sort((a, b) => a.name.localeCompare(b.name)) : ""; - - let menu = []; - genderTypeData && - genderTypeData["common-masters"].GenderType.filter(data => data.active).map((genderDetails) => { - menu.push({ i18nKey: `COMMON_GENDER_${genderDetails.code}`, code: `${genderDetails.code}`, value: `${genderDetails.code}` }); - }); - - - useEffect(() => { - (async () => { - setError(null); - if (file) { - if (file.size >= 2000000) { - setError(t("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED")); - } else { - try { - const response = await Digit.UploadServices.Filestorage("property-upload", file, Digit.ULBService.getStateId()); - if (response?.data?.files?.length > 0) { - setUploadedFile(response?.data?.files[0]?.fileStoreId); - } else { - setError(t("PT_FILE_UPLOAD_ERROR")); - } - } catch (err) { - // console.error("Modal -> err ", err); - setError(t("PT_FILE_UPLOAD_ERROR")); - } - } - } - })(); - }, [file]); - - function selectChecked(e) { - setisOwnerSame(!isOwnerSame); - } - - function setTypeOfDropdownValue(dropdownValue) { - setDropdownValue(dropdownValue); - } - function SelectName(e) { - setName(e.target.value); - } - function selectguardian(e) { - setguardian(e.target.value); - } - function setGenderName(value) { - setGender(value); - } - function setRelationshipName(value) { - setrelationship(value); - } - function setMobileNo(e) { - setMobileNumber(e.target.value); - } - function selectaddress(e) { - setaddress(e.target.value); - } - function selectdocumentId(e) { - setdocumentId(e.target.value); - } - function setTypeOfOwner(value) { - setOwnerType(value); - } - function selectfile(e) { - setFile(e.target.files[0]); - } - - - const goNext = () => { - - if(isOwnerSame == true) - { - //need to add property data here from previous screen - let ConnectionDet = { - isOwnerSame:isOwnerSame, - name: formData?.cpt?.details?.owners?.[0]?.name, - mobileNumber: formData?.cpt?.details?.owners?.[0]?.mobileNumber, - gender: formData?.cpt?.details?.owners?.[0]?.gender ? {code:formData?.cpt?.details?.owners?.[0]?.gender, i18nKey:`COMMON_GENDER_${formData?.cpt?.details?.owners?.[0]?.gender}`} : null, - guardian: formData?.cpt?.details?.owners?.[0]?.fatherOrHusbandName, - address: formData?.cpt?.details?.owners?.[0]?.permanentAddress, - relationship:formData?.cpt?.details?.owners?.[0]?.relationship ? {code : formData?.cpt?.details?.owners?.[0]?.relationship, i18nKey:`COMMON_MASTERS_OWNERTYPE_${formData?.cpt?.details?.owners?.[0]?.relationship}`} : null, - specialCategoryType:ownerType, - documentId:documentId, - fileStoreId:uploadedFile, - documentType:dropdownValue - } - onSelect(config.key, ConnectionDet); - } - else - { - let ConnectionDet = { isOwnerSame:isOwnerSame, name: name, mobileNumber: mobileNumber, gender: gender, guardian: guardian, address: address, relationship:relationship,specialCategoryType:ownerType, documentId:documentId, fileStoreId:uploadedFile, documentType:dropdownValue } - onSelect(config.key, ConnectionDet); - } - }; - - const onSkip = () => onSelect(); - - return ( -
- {userType === "citizen" && ()} - {!isLoading ? - -
- selectChecked(e)} - // value={field.isPrimaryOwner} - checked={isOwnerSame} - style={{ paddingBottom: "10px", paddingTop: "3px" }} - /> -
- {!isOwnerSame &&
- {`${t("WS_OWN_DETAIL_NAME")}*`} - - {`${t("WS_OWN_DETAIL_GENDER_LABEL")}*`} - - {`${t("WS_OWN_MOBILE_NO")}*`} - setMobileNo({ target: { value } })} - style={{background:"#FAFAFA"}} - //disable={mobileNumber && !isOpenLinkFlow ? true : false} - {...{ required: true, pattern: "[6-9]{1}[0-9]{9}", type: "tel", title: t("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID") }} - /> - {`${t("WS_OWN_DETAIL_GUARDIAN_LABEL")}*`} - - {`${t("WS_OWN_DETAIL_RELATIONSHIP_LABEL")}*`} - - {`${t("WS_COMMON_TABLE_COL_ADDRESS")}*`} - - {`${t("WS_OWN_SPECIAL_CAT_LABEL")}*`} - - {/* {ownerType && Object.entries(ownerType).length>0 && ownerType?.code !== "NONE" &&
- {`${t("WS_DOCUMENT_ID_LABEL")}`} - - {`${t("WS_DOCUMENT_TYPE_LABEL")}`} - - { - setUploadedFile(null); - }} - message={uploadedFile ? `1 ${t(`WS_ACTION_FILEUPLOADED`)}` : t(`WS_ACTION_NO_FILEUPLOADED`)} - error={error} - /> - {error ?
{error}
: ""} -
} */} -
} -
: } -
- ); -}; - +import { CardLabel, CheckBox, Dropdown, FormStep, Loader, MobileNumber, RadioButtons, TextInput, UploadFile } from "@egovernments/digit-ui-react-components"; +import React, { useEffect, useState } from "react"; +import Timeline from "../components/Timeline"; +import { stringReplaceAll } from "../utils"; + +const WSConnectionHolder = ({ t, config, onSelect, userType, formData, ownerIndex }) => { + let validation = {}; + const [name, setName] = useState(formData?.ConnectionHolderDetails?.name || formData?.formData?.ConnectionHolderDetails?.name || ""); + const [guardian, setguardian] = useState(formData?.ConnectionHolderDetails?.guardian || formData?.formData?.ConnectionHolderDetails?.guardian || ""); + const [gender, setGender] = useState(formData?.ConnectionHolderDetails?.gender || formData?.formData?.ConnectionHolderDetails?.gender); + const [relationship, setrelationship] = useState(formData?.ConnectionHolderDetails?.relationship || formData?.formData?.ConnectionHolderDetails?.relationship); + const [mobileNumber, setMobileNumber] = useState(formData?.ConnectionHolderDetails?.mobileNumber || formData?.formData?.ConnectionHolderDetails?.mobileNumber || ""); + const [address, setaddress] = useState(formData?.ConnectionHolderDetails?.address || formData?.formData?.ConnectionHolderDetails?.address || ""); + const [documentId, setdocumentId] = useState(formData?.ConnectionHolderDetails?.documentId || formData?.formData?.ConnectionHolderDetails?.documentId || ""); + const [isOwnerSame, setisOwnerSame] = useState((formData?.ConnectionHolderDetails?.isOwnerSame == false || formData?.formData?.ConnectionHolderDetails?.isOwnerSame == false) ? false : true); + const [uploadedFile, setUploadedFile] = useState(formData?.[config.key]?.fileStoreId || null); + const [file, setFile] = useState(null); + const [error, setError] = useState(null); + const [dropdownValue, setDropdownValue] = useState(formData?.ConnectionHolderDetails?.documentType || ""); + const [ownerType, setOwnerType] = useState( formData?.ConnectionHolderDetails?.specialCategoryType || {}); + let isMobile = window.Digit.Utils.browser.isMobile(); + + const tenantId = Digit.ULBService.getCurrentTenantId(); + const stateId = Digit.ULBService.getStateId(); + let dropdownData = []; + const { data: Documentsob = { } } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "Documents"); + const docs = Documentsob?.PropertyTax?.Documents; + const specialProofIdentity = Array.isArray(docs) && docs.filter((doc) => doc.code.includes("SPECIALCATEGORYPROOF")); + if (specialProofIdentity.length > 0) { + dropdownData = specialProofIdentity[0]?.dropdownData; + dropdownData.forEach((data) => { + data.i18nKey = stringReplaceAll(data.code, ".", "_"); + }); + dropdownData = dropdownData?.filter((dropdown) => dropdown.parentValue.includes(ownerType?.code)); + if (dropdownData.length == 1 && dropdownValue != dropdownData[0]) { + setTypeOfDropdownValue(dropdownData[0]); + } + } + + const GuardianOptions = [ + { name: "Father", code: "FATHER", i18nKey: "COMMON_MASTERS_OWNERTYPE_FATHER" }, + { name: "HUSBAND", code: "HUSBAND", i18nKey: "COMMON_MASTERS_OWNERTYPE_HUSBAND" }, + ]; + + const { isLoading, data: genderTypeData } = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]); + + const { data: Menu, isLoading : isSpecialcategoryLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "OwnerType"); + Menu ? Menu.sort((a, b) => a.name.localeCompare(b.name)) : ""; + + let menu = []; + genderTypeData && + genderTypeData["common-masters"].GenderType.filter(data => data.active).map((genderDetails) => { + menu.push({ i18nKey: `COMMON_GENDER_${genderDetails.code}`, code: `${genderDetails.code}`, value: `${genderDetails.code}` }); + }); + + + useEffect(() => { + (async () => { + setError(null); + if (file) { + if (file.size >= 2000000) { + setError(t("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED")); + } else { + try { + const response = await Digit.UploadServices.Filestorage("property-upload", file, Digit.ULBService.getStateId()); + if (response?.data?.files?.length > 0) { + setUploadedFile(response?.data?.files[0]?.fileStoreId); + } else { + setError(t("PT_FILE_UPLOAD_ERROR")); + } + } catch (err) { + // console.error("Modal -> err ", err); + setError(t("PT_FILE_UPLOAD_ERROR")); + } + } + } + })(); + }, [file]); + + function selectChecked(e) { + setisOwnerSame(!isOwnerSame); + } + + function setTypeOfDropdownValue(dropdownValue) { + setDropdownValue(dropdownValue); + } + function SelectName(e) { + setName(e.target.value); + } + function selectguardian(e) { + setguardian(e.target.value); + } + function setGenderName(value) { + setGender(value); + } + function setRelationshipName(value) { + setrelationship(value); + } + function setMobileNo(e) { + setMobileNumber(e.target.value); + } + function selectaddress(e) { + setaddress(e.target.value); + } + function selectdocumentId(e) { + setdocumentId(e.target.value); + } + function setTypeOfOwner(value) { + setOwnerType(value); + } + function selectfile(e) { + setFile(e.target.files[0]); + } + + + const goNext = () => { + + if(isOwnerSame == true) + { + //need to add property data here from previous screen + let ConnectionDet = { + isOwnerSame:isOwnerSame, + name: formData?.cpt?.details?.owners?.[0]?.name, + mobileNumber: formData?.cpt?.details?.owners?.[0]?.mobileNumber, + gender: formData?.cpt?.details?.owners?.[0]?.gender ? {code:formData?.cpt?.details?.owners?.[0]?.gender, i18nKey:`COMMON_GENDER_${formData?.cpt?.details?.owners?.[0]?.gender}`} : null, + guardian: formData?.cpt?.details?.owners?.[0]?.fatherOrHusbandName, + address: formData?.cpt?.details?.owners?.[0]?.permanentAddress, + relationship:formData?.cpt?.details?.owners?.[0]?.relationship ? {code : formData?.cpt?.details?.owners?.[0]?.relationship, i18nKey:`COMMON_MASTERS_OWNERTYPE_${formData?.cpt?.details?.owners?.[0]?.relationship}`} : null, + specialCategoryType:ownerType, + documentId:documentId, + fileStoreId:uploadedFile, + documentType:dropdownValue + } + onSelect(config.key, ConnectionDet); + } + else + { + let ConnectionDet = { isOwnerSame:isOwnerSame, name: name, mobileNumber: mobileNumber, gender: gender, guardian: guardian, address: address, relationship:relationship,specialCategoryType:ownerType, documentId:documentId, fileStoreId:uploadedFile, documentType:dropdownValue } + onSelect(config.key, ConnectionDet); + } + }; + + const onSkip = () => onSelect(); + + return ( +
+ {userType === "citizen" && ()} + {!isLoading ? + +
+ selectChecked(e)} + // value={field.isPrimaryOwner} + checked={isOwnerSame} + style={{ paddingBottom: "10px", paddingTop: "3px" }} + /> +
+ {!isOwnerSame &&
+ {`${t("WS_OWN_DETAIL_NAME")}*`} + + {`${t("WS_OWN_DETAIL_GENDER_LABEL")}*`} + + {`${t("WS_OWN_MOBILE_NO")}*`} + setMobileNo({ target: { value } })} + style={{background:"#FAFAFA"}} + //disable={mobileNumber && !isOpenLinkFlow ? true : false} + {...{ required: true, pattern: "[6-9]{1}[0-9]{9}", type: "tel", title: t("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID") }} + /> + {`${t("WS_OWN_DETAIL_GUARDIAN_LABEL")}*`} + + {`${t("WS_OWN_DETAIL_RELATIONSHIP_LABEL")}*`} + + {`${t("WS_COMMON_TABLE_COL_ADDRESS")}*`} + + {`${t("WS_OWN_SPECIAL_CAT_LABEL")}*`} + + {/* {ownerType && Object.entries(ownerType).length>0 && ownerType?.code !== "NONE" &&
+ {`${t("WS_DOCUMENT_ID_LABEL")}`} + + {`${t("WS_DOCUMENT_TYPE_LABEL")}`} + + { + setUploadedFile(null); + }} + message={uploadedFile ? `1 ${t(`WS_ACTION_FILEUPLOADED`)}` : t(`WS_ACTION_NO_FILEUPLOADED`)} + error={error} + /> + {error ?
{error}
: ""} +
} */} +
} +
: } +
+ ); +}; + export default WSConnectionHolder; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionHolderDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionHolderDetails.js old mode 100755 new mode 100644 index bcdd1299eab..5a022f17a9c --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionHolderDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSConnectionHolderDetails.js @@ -1,829 +1,829 @@ -import { - CardLabel, - CardLabelError, - CheckBox, - Dropdown, - LabelFieldPair, - TextInput, - WrapUnMaskComponent, -} from "@egovernments/digit-ui-react-components"; -import _ from "lodash"; -import React, { useEffect, useState } from "react"; -import { Controller, useForm } from "react-hook-form"; -import { useTranslation } from "react-i18next"; -import { useLocation } from "react-router-dom"; -import * as func from "../utils"; -import { getPattern, stringReplaceAll } from "../utils"; - -const createConnectionHolderDetails = () => ({ - sameAsOwnerDetails: true, - name: "", - gender: "", - mobileNumber: "", - guardian: "", - relationship: "", - address: "", - ownerType: "", - documentId: "", - documentType: "", - file: "", -}); - -const WSConnectionHolderDetails = ({ config, onSelect, userType, formData, setError, formState, clearErrors }) => { - const { t } = useTranslation(); - const { pathname } = useLocation(); - const filters = func.getQueryStringParams(location.search); - const [connectionHolderDetails, setConnectionHolderDetails] = useState( - formData?.ConnectionHolderDetails ? [{ ...formData?.ConnectionHolderDetails?.[0] }] : [createConnectionHolderDetails()] - ); - const [focusIndex, setFocusIndex] = useState({ index: -1, type: "" }); - const stateId = Digit.ULBService.getStateId(); - const [isErrors, setIsErrors] = useState(false); - const [uploadedFile, setUploadedFile] = useState(formData?.[config.key]?.fileStoreId || null); - const [file, setFile] = useState(null); - - const { isLoading, data: genderTypeData } = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]); - - let menu = []; - genderTypeData && - genderTypeData["common-masters"].GenderType.filter((data) => data.active).map((genderDetails) => { - menu.push({ i18nKey: `COMMON_GENDER_${genderDetails.code}`, code: `${genderDetails.code}`, value: `${genderDetails.code}` }); - }); - - let dropdownData = []; - const { data: Documentsob = {} } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "Documents"); - const docs = Documentsob?.PropertyTax?.Documents; - const specialProofIdentity = Array.isArray(docs) && docs.filter((doc) => doc.code.includes("SPECIALCATEGORYPROOF")); - if (specialProofIdentity.length > 0) { - dropdownData = specialProofIdentity[0]?.dropdownData; - dropdownData.forEach((data) => { - data.i18nKey = stringReplaceAll(data.code, ".", "_"); - }); - dropdownData = dropdownData?.filter((dropdown) => dropdown.parentValue.includes(connectionHolderDetails?.[0]?.ownerType)); - if (dropdownData.length == 1 && dropdownValue != dropdownData[0]) { - setTypeOfDropdownValue(dropdownData[0]); - } - } - - const GuardianOptions = [ - { name: "HUSBAND", code: "HUSBAND", i18nKey: "COMMON_MASTERS_OWNERTYPE_HUSBAND" }, - { name: "Father", code: "FATHER", i18nKey: "COMMON_MASTERS_OWNERTYPE_FATHER" }, - ]; - - const { data: Menu, isLoading: isSpecialcategoryLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "OwnerType"); - Menu ? Menu.sort((a, b) => a.name.localeCompare(b.name)) : ""; - - useEffect(() => { - const data = connectionHolderDetails.map((e) => { - return e; - }); - onSelect(config?.key, data); - }, [connectionHolderDetails]); - - useEffect(() => { - if (userType === "employee") { - //onSelect(config.key, { ...formData[config.key], ...connectionHolderDetails }); - onSelect(config.key, [{ ...formData[config.key]?.[0], ...connectionHolderDetails?.[0] }]); - } - }, [connectionHolderDetails]); - - function ispagereloadingenabled(eyeclick) { - if ( - (window.location.href.includes("edit") || window.location.href.includes("modify")) && - formData?.ConnectionHolderDetails && - Object.values(formData?.ConnectionHolderDetails?.[0])?.length > 1 - ) { - if ( - eyeclick === "gender" && - connectionHolderDetails?.[0]?.gender?.code && - formData?.ConnectionHolderDetails?.[0]?.gender?.code !== connectionHolderDetails?.[0]?.gender?.code - ) - return true; - else if ( - eyeclick === "connectionHoldersMobileNumber" && - connectionHolderDetails?.[0]?.mobileNumber && - formData?.ConnectionHolderDetails?.[0]?.mobileNumber !== connectionHolderDetails?.[0]?.mobileNumber - ) - return true; - else if ( - eyeclick === "fatherOrHusbandName" && - connectionHolderDetails?.[0]?.guardian && - formData?.ConnectionHolderDetails?.[0]?.guardian !== connectionHolderDetails?.[0]?.guardian - ) - return true; - else if ( - eyeclick === "relationship" && - connectionHolderDetails?.[0]?.relationship?.code && - formData?.ConnectionHolderDetails?.[0]?.relationship?.code !== connectionHolderDetails?.[0]?.relationship?.code - ) - return true; - else if ( - eyeclick === "correspondenceAddress" && - connectionHolderDetails?.[0]?.address && - formData?.ConnectionHolderDetails?.[0]?.address !== connectionHolderDetails?.[0]?.address - ) - return true; - else if ( - eyeclick === "ownerType" && - connectionHolderDetails?.[0]?.ownerType?.code && - formData?.ConnectionHolderDetails?.[0]?.ownerType?.code !== connectionHolderDetails?.[0]?.ownerType?.code - ) - return true; - else return false; - } else return false; - } - - useEffect(() => { - let eyeclick = sessionStorage.getItem("eyeIconClicked"); - if (ispagereloadingenabled(eyeclick)) { - sessionStorage.removeItem("eyeIconClicked"); - window.location.reload(); - } - }, [formData?.ConnectionHolderDetails?.[0], connectionHolderDetails, formData]); - - useEffect(() => { - if (!formData?.ConnectionHolderDetails) { - setConnectionHolderDetails([createConnectionHolderDetails()]); - } - }, [formData?.ConnectionHolderDetails]); - - const commonProps = { - focusIndex, - connectionHolderDetails, - setFocusIndex, - formData, - formState, - t, - setError, - clearErrors, - config, - setConnectionHolderDetails, - setIsErrors, - isErrors, - connectionHolderDetails, - filters, - menu, - uploadedFile, - setUploadedFile, - file, - setFile, - dropdownData, - GuardianOptions, - Menu, - }; - - return ( - - {connectionHolderDetails.map((connectionHolderDetail, index) => ( - - ))} - - ); -}; - -const ConnectionDetails = (_props) => { - const { - connectionHolderDetail, - focusIndex, - setFocusIndex, - t, - formData, - config, - setError, - clearErrors, - formState, - connectionHolderDetails, - setIsErrors, - isErrors, - setConnectionHolderDetails, - menu, - GuardianOptions, - Menu, - } = _props; - - const { - control, - formState: localFormState, - watch, - setError: setLocalError, - clearErrors: clearLocalErrors, - setValue, - trigger, - getValues, - } = useForm(); - // const formValue = watch(); - const [name, setName] = useState(connectionHolderDetail?.name); - const [gender, setGender] = useState(connectionHolderDetail?.gender); - const [mobileNumber, setMobileNumber] = useState(connectionHolderDetail?.mobileNumber); - const [guardian, setGuardian] = useState(connectionHolderDetail?.guardian); - const [relationship, setRelationship] = useState(connectionHolderDetail?.relationship); - const [address, setAddress] = useState(connectionHolderDetail?.address); - const [ownerType, setOwnerType] = useState(connectionHolderDetail?.ownerType); - const [sameAsOwnerDetails, setSameAsOwnerDetails] = useState(connectionHolderDetail?.sameAsOwnerDetails); - const [uuid, setuuid] = useState(connectionHolderDetail?.uuid); - const formValue = { name, gender, mobileNumber, guardian, relationship, ownerType, sameAsOwnerDetails, address, uuid }; - const { errors } = localFormState; - const isMobile = window.Digit.Utils.browser.isMobile(); - const isEmployee = window.location.href.includes("/employee") - - const { isLoading, data: privacyData } = Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(), "DataSecurity", [{ name: "SecurityPolicy" }], { - select: (data) => data?.DataSecurity?.SecurityPolicy?.find((elem) => elem?.model == "User") || {}, - }); - - useEffect(() => { - trigger(); - }, []); - - useEffect(() => { - if ((Object.entries(formValue).length > 0 && formValue?.name) || formValue?.uuid) { - const keys = Object.keys(formValue); - const part = {}; - keys.forEach((key) => (part[key] = connectionHolderDetail[key])); - if (!_.isEqual(formValue, part)) { - let isErrorsFound = true; - Object.keys(formValue).map((data) => { - if (!formValue[data] && isErrorsFound) { - isErrorsFound = false; - setIsErrors(false); - } - }); - if (isErrorsFound) setIsErrors(true); - let ob = [{ ...formValue }]; - setConnectionHolderDetails(ob); - trigger(); - } - } - }, [formValue]); - - useEffect(() => { - let isClear = true; - Object.keys(connectionHolderDetails?.[0])?.map((data) => { - if (!connectionHolderDetails[0][data] && connectionHolderDetails[0][data] != false && isClear) isClear = false; - }); - if (connectionHolderDetails?.[0]?.sameAsOwnerDetails || (isClear && Object.keys(connectionHolderDetails?.[0])?.length > 1)) { - clearErrors("ConnectionHolderDetails"); - } else { - trigger(); - } - }, [connectionHolderDetails]); - - useEffect(() => { - if (sameAsOwnerDetails) { - clearErrors("ConnectionHolderDetails"); - } else { - trigger(); - } - }, [sameAsOwnerDetails]) - - useEffect(() => { - if (Object.keys(errors).length && !_.isEqual(formState.errors[config.key]?.type || {}, errors)) { - setError(config.key, { type: errors }); - } else if (!Object.keys(errors).length && formState.errors[config.key] && isErrors) { - clearErrors(config.key); - } - }, [errors]); - - const checkifPrivacyValid = () => { - if (window.location.href.includes("edit") || window.location.href.includes("modify")) return true; - else return false; - }; - const errorStyle = { width: "70%", marginLeft: "30%", fontSize: "12px", marginTop: "-21px" }; - return ( -
-
- ( - { - setSameAsOwnerDetails(e.target.checked); - props.onChange(e.target.checked); - setFocusIndex({ index: connectionHolderDetail?.key, type: "sameAsOwnerDetails" }); - }} - checked={sameAsOwnerDetails} - style={{ paddingBottom: "10px", paddingTop: "3px" }} - onBlur={props.onBlur} - /> - )} - /> -
- - {!sameAsOwnerDetails ? ( -
- - {`${t("WS_OWN_DETAIL_NAME")}*`} -
- ((e && getPattern("Name").test(e)) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), - required: t("REQUIRED_FIELD"), - }} - isMandatory={true} - render={(props) => ( -
- { - setName(e.target.value); - props.onChange(e.target.value); - setFocusIndex({ index: connectionHolderDetail?.key, type: "name" }); - }} - labelStyle={{ marginTop: "unset" }} - onBlur={props.onBlur} - style={ - checkifPrivacyValid() && !getValues("name")?.includes("*") - ? !Digit.Utils.checkPrivacy(privacyData, { uuid: connectionHolderDetail?.uuid, fieldName: "name", model: "User" }) && - !Digit.Utils.checkPrivacy(privacyData, { uuid: connectionHolderDetail?.uuid, fieldName: "mobileNumber", model: "User" }) - ? ((isMobile && isEmployee) ? {} :{ width: "96%" }) - : ((isMobile && isEmployee) ? {} :{ width: "96%" }) - : {} - } - /> - {checkifPrivacyValid() && ( -
- { - setName(e); - props.onChange(e); - }} - iseyevisible={getValues("name")?.includes("*") ? true : false} - privacy={{ - uuid: connectionHolderDetail?.uuid, - fieldName: "name", - model: "WnSConnectionOwner", - loadData: { - serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", - requestBody: {}, - requestParam: { - tenantId: formData?.cpt?.details?.tenantId, - applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, - }, - jsonPath: formData?.ConnectionDetails?.[0]?.water - ? "WaterConnection[0].connectionHolders[0].name" - : "SewerageConnections[0].connectionHolders[0].name", - isArray: false, - }, - }} - > -
- )} -
- )} - /> -
-
- {localFormState.touched.name ? errors?.name?.message : ""} - - {`${t( - "WS_CONN_HOLDER_OWN_DETAIL_GENDER_LABEL" - )}*`} -
- ( -
- { - setGender(e); - props.onChange(e); - }} - optionKey="i18nKey" - onBlur={props.onBlur} - t={t} - /> - {checkifPrivacyValid() && ( -
- { - const r = { code: e, i18nKey: `COMMON_GENDER_${e}`, name: e }; - setGender(r); - props.onChange(r); - }} - iseyevisible={gender["i18nKey"]?.includes("*") ? true : false} - privacy={{ - uuid: connectionHolderDetail?.uuid, - fieldName: "gender", - model: "WnSConnectionOwner", - loadData: { - serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", - requestBody: {}, - requestParam: { - tenantId: formData?.cpt?.details?.tenantId, - applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, - }, - jsonPath: formData?.ConnectionDetails?.[0]?.water - ? "WaterConnection[0].connectionHolders[0].gender" - : "SewerageConnections[0].connectionHolders[0].gender", - isArray: false, - }, - }} - > -
- )} -
- )} - /> -
-
- {localFormState.touched.gender ? errors?.gender?.message : ""} - - {`${t( - "CORE_COMMON_MOBILE_NUMBER" - )}*`} -
- - (e && getPattern("MobileNoWithPrivacy").test(e)) || !e || e.includes("*") ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG"), - required: t("REQUIRED_FIELD"), - }} - //type="number" - isMandatory={true} - render={(props) => ( -
-
- +91 -
- { - setMobileNumber(e.target.value); - props.onChange(e.target.value); - setFocusIndex({ index: connectionHolderDetail?.key, type: "mobileNumber" }); - }} - labelStyle={{ marginTop: "unset" }} - onBlur={props.onBlur} - style={ - checkifPrivacyValid() && !getValues("mobileNumber")?.includes("*") - ? !Digit.Utils.checkPrivacy(privacyData, { - uuid: connectionHolderDetail?.uuid, - fieldName: "connectionHoldersMobileNumber", - model: "WnSConnectionOwner", - }) && - !Digit.Utils.checkPrivacy(privacyData, { uuid: connectionHolderDetail?.uuid, fieldName: "mobileNumber", model: "User" }) - ? ((isMobile && isEmployee) ? {} :{ width: "96%" }) - : ((isMobile && isEmployee) ? {} :{ width: "96%", background: "#FAFAFA" }) - : { background: "#FAFAFA" } - } - /> - {checkifPrivacyValid() && ( -
- { - setMobileNumber(e); - props.onChange(e); - }} - iseyevisible={getValues("mobileNumber")?.includes("*") ? true : false} - privacy={{ - uuid: connectionHolderDetail?.uuid, - fieldName: "connectionHoldersMobileNumber", - model: "WnSConnectionOwner", - loadData: { - serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", - requestBody: {}, - requestParam: { - tenantId: formData?.cpt?.details?.tenantId, - applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, - }, - jsonPath: formData?.ConnectionDetails?.[0]?.water - ? "WaterConnection[0].connectionHolders[0].mobileNumber" - : "SewerageConnections[0].connectionHolders[0].mobileNumber", - isArray: false, - }, - }} - > -
- )} -
- )} - /> -
-
- {localFormState.touched.mobileNumber ? errors?.mobileNumber?.message : ""} - - {`${t( - "WS_OWN_DETAIL_GUARDIAN_LABEL" - )}*`} -
- ((e && getPattern("Name").test(e)) || !e || e.includes("*") ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), - required: t("REQUIRED_FIELD"), - }} - isMandatory={true} - render={(props) => ( -
- { - setGuardian(e.target.value); - props.onChange(e.target.value); - setFocusIndex({ index: connectionHolderDetail?.key, type: "guardian" }); - }} - labelStyle={{ marginTop: "unset" }} - onBlur={props.onBlur} - style={ - checkifPrivacyValid() && !getValues("guardian")?.includes("*") - ? !Digit.Utils.checkPrivacy(privacyData, { - uuid: connectionHolderDetail?.uuid, - fieldName: "fatherOrHusbandName", - model: "WnSConnectionOwner", - }) && - !Digit.Utils.checkPrivacy(privacyData, { uuid: connectionHolderDetail?.uuid, fieldName: "mobileNumber", model: "User" }) - ? ((isMobile && isEmployee) ? {} :{ width: "96%" }) - : ((isMobile && isEmployee) ? {} :{ width: "96.2%" }) - : {} - } - /> - {checkifPrivacyValid() && ( -
- { - setGuardian(e); - props.onChange(e); - }} - iseyevisible={getValues("guardian")?.includes("*") ? true : false} - privacy={{ - uuid: connectionHolderDetail?.uuid, - fieldName: "fatherOrHusbandName", - model: "WnSConnectionOwner", - loadData: { - serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", - requestBody: {}, - requestParam: { - tenantId: formData?.cpt?.details?.tenantId, - applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, - }, - jsonPath: formData?.ConnectionDetails?.[0]?.water - ? "WaterConnection[0].connectionHolders[0].fatherOrHusbandName" - : "SewerageConnections[0].connectionHolders[0].fatherOrHusbandName", - isArray: false, - }, - }} - > -
- )} -
- )} - /> -
-
- {localFormState.touched.guardian ? errors?.guardian?.message : ""} - - {`${t( - "WS_CONN_HOLDER_OWN_DETAIL_RELATION_LABEL" - )}*`} -
- ( -
- { - setRelationship(e); - props.onChange(e); - }} - optionKey="i18nKey" - onBlur={props.onBlur} - t={t} - /> - {checkifPrivacyValid() && ( -
- { - const r = { code: e, i18nKey: `COMMON_MASTERS_OWNERTYPE_${e}`, name: e }; - setRelationship(r); - props.onChange(r); - }} - iseyevisible={relationship?.i18nKey?.includes("*") ? true : false} - privacy={{ - uuid: connectionHolderDetail?.uuid, - fieldName: "relationship", - model: "WnSConnection", - loadData: { - serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", - requestBody: {}, - requestParam: { - tenantId: formData?.cpt?.details?.tenantId, - applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, - }, - jsonPath: formData?.ConnectionDetails?.[0]?.water - ? "WaterConnection[0].connectionHolders[0].relationship" - : "SewerageConnections[0].connectionHolders[0].relationship", - isArray: false, - }, - }} - > -
- )} -
- )} - /> -
-
- {localFormState.touched.relationship ? errors?.relationship?.message : ""} - - {`${t( - "WS_CORRESPONDANCE_ADDRESS_LABEL" - )}*`} -
- ((e && getPattern("Address").test(e)) || !e || e.includes("*") ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), - required: t("REQUIRED_FIELD"), - }} - isMandatory={true} - render={(props) => ( -
- { - setAddress(e.target.value); - props.onChange(e.target.value); - setFocusIndex({ index: connectionHolderDetail?.key, type: "address" }); - }} - labelStyle={{ marginTop: "unset" }} - onBlur={props.onBlur} - style={ - checkifPrivacyValid() && !getValues("address")?.includes("*") - ? !Digit.Utils.checkPrivacy(privacyData, { - uuid: connectionHolderDetail?.uuid, - fieldName: "correspondenceAddress", - model: "WnSConnectionOwner", - }) && - !Digit.Utils.checkPrivacy(privacyData, { uuid: connectionHolderDetail?.uuid, fieldName: "mobileNumber", model: "User" }) - ? ((isMobile && isEmployee) ? {} :{ width: "96%" }) - : ((isMobile && isEmployee) ? {} :{ width: "96.2%" }) - : {} - } - /> - {checkifPrivacyValid() && ( -
- { - setAddress(e); - props.onChange(e); - }} - iseyevisible={getValues("address")?.includes("*") ? true : false} - privacy={{ - uuid: connectionHolderDetail?.uuid, - fieldName: "correspondenceAddress", - model: "WnSConnectionOwner", - loadData: { - serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", - requestBody: {}, - requestParam: { - tenantId: formData?.cpt?.details?.tenantId, - applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, - }, - jsonPath: formData?.ConnectionDetails?.[0]?.water - ? "WaterConnection[0].connectionHolders[0].correspondenceAddress" - : "SewerageConnections[0].connectionHolders[0].correspondenceAddress", - isArray: false, - }, - }} - > -
- )} -
- )} - /> -
-
- {localFormState.touched.address ? errors?.address?.message : ""} - - {`${t( - "WS_OWNER_SPECIAL_CATEGORY" - )}*`} -
- ( -
- { - setOwnerType(e); - props.onChange(e); - }} - optionKey="i18nKey" - onBlur={props.onBlur} - t={t} - /> - {checkifPrivacyValid() && ( -
- { - const r = { code: e, i18nKey: `COMMON_MASTERS_OWNERTYPE_${e}`, name: e }; - setOwnerType(r); - props.onChange(r); - }} - iseyevisible={ownerType?.i18nKey?.includes("*") ? true : false} - privacy={{ - uuid: connectionHolderDetail?.uuid, - fieldName: "ownerType", - model: "WnSConnection", - loadData: { - serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", - requestBody: {}, - requestParam: { - tenantId: formData?.cpt?.details?.tenantId, - applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, - }, - jsonPath: formData?.ConnectionDetails?.[0]?.water - ? "WaterConnection[0].connectionHolders[0].ownerType" - : "SewerageConnections[0].connectionHolders[0].ownerType", - isArray: false, - }, - }} - > -
- )} -
- )} - /> -
-
- {localFormState.touched.ownerType ? errors?.ownerType?.message : ""} -
- ) : null} -
- ); -}; -export default WSConnectionHolderDetails; +import { + CardLabel, + CardLabelError, + CheckBox, + Dropdown, + LabelFieldPair, + TextInput, + WrapUnMaskComponent, +} from "@egovernments/digit-ui-react-components"; +import _ from "lodash"; +import React, { useEffect, useState } from "react"; +import { Controller, useForm } from "react-hook-form"; +import { useTranslation } from "react-i18next"; +import { useLocation } from "react-router-dom"; +import * as func from "../utils"; +import { getPattern, stringReplaceAll } from "../utils"; + +const createConnectionHolderDetails = () => ({ + sameAsOwnerDetails: true, + name: "", + gender: "", + mobileNumber: "", + guardian: "", + relationship: "", + address: "", + ownerType: "", + documentId: "", + documentType: "", + file: "", +}); + +const WSConnectionHolderDetails = ({ config, onSelect, userType, formData, setError, formState, clearErrors }) => { + const { t } = useTranslation(); + const { pathname } = useLocation(); + const filters = func.getQueryStringParams(location.search); + const [connectionHolderDetails, setConnectionHolderDetails] = useState( + formData?.ConnectionHolderDetails ? [{ ...formData?.ConnectionHolderDetails?.[0] }] : [createConnectionHolderDetails()] + ); + const [focusIndex, setFocusIndex] = useState({ index: -1, type: "" }); + const stateId = Digit.ULBService.getStateId(); + const [isErrors, setIsErrors] = useState(false); + const [uploadedFile, setUploadedFile] = useState(formData?.[config.key]?.fileStoreId || null); + const [file, setFile] = useState(null); + + const { isLoading, data: genderTypeData } = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]); + + let menu = []; + genderTypeData && + genderTypeData["common-masters"].GenderType.filter((data) => data.active).map((genderDetails) => { + menu.push({ i18nKey: `COMMON_GENDER_${genderDetails.code}`, code: `${genderDetails.code}`, value: `${genderDetails.code}` }); + }); + + let dropdownData = []; + const { data: Documentsob = {} } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "Documents"); + const docs = Documentsob?.PropertyTax?.Documents; + const specialProofIdentity = Array.isArray(docs) && docs.filter((doc) => doc.code.includes("SPECIALCATEGORYPROOF")); + if (specialProofIdentity.length > 0) { + dropdownData = specialProofIdentity[0]?.dropdownData; + dropdownData.forEach((data) => { + data.i18nKey = stringReplaceAll(data.code, ".", "_"); + }); + dropdownData = dropdownData?.filter((dropdown) => dropdown.parentValue.includes(connectionHolderDetails?.[0]?.ownerType)); + if (dropdownData.length == 1 && dropdownValue != dropdownData[0]) { + setTypeOfDropdownValue(dropdownData[0]); + } + } + + const GuardianOptions = [ + { name: "HUSBAND", code: "HUSBAND", i18nKey: "COMMON_MASTERS_OWNERTYPE_HUSBAND" }, + { name: "Father", code: "FATHER", i18nKey: "COMMON_MASTERS_OWNERTYPE_FATHER" }, + ]; + + const { data: Menu, isLoading: isSpecialcategoryLoading } = Digit.Hooks.pt.usePropertyMDMS(stateId, "PropertyTax", "OwnerType"); + Menu ? Menu.sort((a, b) => a.name.localeCompare(b.name)) : ""; + + useEffect(() => { + const data = connectionHolderDetails.map((e) => { + return e; + }); + onSelect(config?.key, data); + }, [connectionHolderDetails]); + + useEffect(() => { + if (userType === "employee") { + //onSelect(config.key, { ...formData[config.key], ...connectionHolderDetails }); + onSelect(config.key, [{ ...formData[config.key]?.[0], ...connectionHolderDetails?.[0] }]); + } + }, [connectionHolderDetails]); + + function ispagereloadingenabled(eyeclick) { + if ( + (window.location.href.includes("edit") || window.location.href.includes("modify")) && + formData?.ConnectionHolderDetails && + Object.values(formData?.ConnectionHolderDetails?.[0])?.length > 1 + ) { + if ( + eyeclick === "gender" && + connectionHolderDetails?.[0]?.gender?.code && + formData?.ConnectionHolderDetails?.[0]?.gender?.code !== connectionHolderDetails?.[0]?.gender?.code + ) + return true; + else if ( + eyeclick === "connectionHoldersMobileNumber" && + connectionHolderDetails?.[0]?.mobileNumber && + formData?.ConnectionHolderDetails?.[0]?.mobileNumber !== connectionHolderDetails?.[0]?.mobileNumber + ) + return true; + else if ( + eyeclick === "fatherOrHusbandName" && + connectionHolderDetails?.[0]?.guardian && + formData?.ConnectionHolderDetails?.[0]?.guardian !== connectionHolderDetails?.[0]?.guardian + ) + return true; + else if ( + eyeclick === "relationship" && + connectionHolderDetails?.[0]?.relationship?.code && + formData?.ConnectionHolderDetails?.[0]?.relationship?.code !== connectionHolderDetails?.[0]?.relationship?.code + ) + return true; + else if ( + eyeclick === "correspondenceAddress" && + connectionHolderDetails?.[0]?.address && + formData?.ConnectionHolderDetails?.[0]?.address !== connectionHolderDetails?.[0]?.address + ) + return true; + else if ( + eyeclick === "ownerType" && + connectionHolderDetails?.[0]?.ownerType?.code && + formData?.ConnectionHolderDetails?.[0]?.ownerType?.code !== connectionHolderDetails?.[0]?.ownerType?.code + ) + return true; + else return false; + } else return false; + } + + useEffect(() => { + let eyeclick = sessionStorage.getItem("eyeIconClicked"); + if (ispagereloadingenabled(eyeclick)) { + sessionStorage.removeItem("eyeIconClicked"); + window.location.reload(); + } + }, [formData?.ConnectionHolderDetails?.[0], connectionHolderDetails, formData]); + + useEffect(() => { + if (!formData?.ConnectionHolderDetails) { + setConnectionHolderDetails([createConnectionHolderDetails()]); + } + }, [formData?.ConnectionHolderDetails]); + + const commonProps = { + focusIndex, + connectionHolderDetails, + setFocusIndex, + formData, + formState, + t, + setError, + clearErrors, + config, + setConnectionHolderDetails, + setIsErrors, + isErrors, + connectionHolderDetails, + filters, + menu, + uploadedFile, + setUploadedFile, + file, + setFile, + dropdownData, + GuardianOptions, + Menu, + }; + + return ( + + {connectionHolderDetails.map((connectionHolderDetail, index) => ( + + ))} + + ); +}; + +const ConnectionDetails = (_props) => { + const { + connectionHolderDetail, + focusIndex, + setFocusIndex, + t, + formData, + config, + setError, + clearErrors, + formState, + connectionHolderDetails, + setIsErrors, + isErrors, + setConnectionHolderDetails, + menu, + GuardianOptions, + Menu, + } = _props; + + const { + control, + formState: localFormState, + watch, + setError: setLocalError, + clearErrors: clearLocalErrors, + setValue, + trigger, + getValues, + } = useForm(); + // const formValue = watch(); + const [name, setName] = useState(connectionHolderDetail?.name); + const [gender, setGender] = useState(connectionHolderDetail?.gender); + const [mobileNumber, setMobileNumber] = useState(connectionHolderDetail?.mobileNumber); + const [guardian, setGuardian] = useState(connectionHolderDetail?.guardian); + const [relationship, setRelationship] = useState(connectionHolderDetail?.relationship); + const [address, setAddress] = useState(connectionHolderDetail?.address); + const [ownerType, setOwnerType] = useState(connectionHolderDetail?.ownerType); + const [sameAsOwnerDetails, setSameAsOwnerDetails] = useState(connectionHolderDetail?.sameAsOwnerDetails); + const [uuid, setuuid] = useState(connectionHolderDetail?.uuid); + const formValue = { name, gender, mobileNumber, guardian, relationship, ownerType, sameAsOwnerDetails, address, uuid }; + const { errors } = localFormState; + const isMobile = window.Digit.Utils.browser.isMobile(); + const isEmployee = window.location.href.includes("/employee") + + const { isLoading, data: privacyData } = Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(), "DataSecurity", [{ name: "SecurityPolicy" }], { + select: (data) => data?.DataSecurity?.SecurityPolicy?.find((elem) => elem?.model == "User") || {}, + }); + + useEffect(() => { + trigger(); + }, []); + + useEffect(() => { + if ((Object.entries(formValue).length > 0 && formValue?.name) || formValue?.uuid) { + const keys = Object.keys(formValue); + const part = {}; + keys.forEach((key) => (part[key] = connectionHolderDetail[key])); + if (!_.isEqual(formValue, part)) { + let isErrorsFound = true; + Object.keys(formValue).map((data) => { + if (!formValue[data] && isErrorsFound) { + isErrorsFound = false; + setIsErrors(false); + } + }); + if (isErrorsFound) setIsErrors(true); + let ob = [{ ...formValue }]; + setConnectionHolderDetails(ob); + trigger(); + } + } + }, [formValue]); + + useEffect(() => { + let isClear = true; + Object.keys(connectionHolderDetails?.[0])?.map((data) => { + if (!connectionHolderDetails[0][data] && connectionHolderDetails[0][data] != false && isClear) isClear = false; + }); + if (connectionHolderDetails?.[0]?.sameAsOwnerDetails || (isClear && Object.keys(connectionHolderDetails?.[0])?.length > 1)) { + clearErrors("ConnectionHolderDetails"); + } else { + trigger(); + } + }, [connectionHolderDetails]); + + useEffect(() => { + if (sameAsOwnerDetails) { + clearErrors("ConnectionHolderDetails"); + } else { + trigger(); + } + }, [sameAsOwnerDetails]) + + useEffect(() => { + if (Object.keys(errors).length && !_.isEqual(formState.errors[config.key]?.type || {}, errors)) { + setError(config.key, { type: errors }); + } else if (!Object.keys(errors).length && formState.errors[config.key] && isErrors) { + clearErrors(config.key); + } + }, [errors]); + + const checkifPrivacyValid = () => { + if (window.location.href.includes("edit") || window.location.href.includes("modify")) return true; + else return false; + }; + const errorStyle = { width: "70%", marginLeft: "30%", fontSize: "12px", marginTop: "-21px" }; + return ( +
+
+ ( + { + setSameAsOwnerDetails(e.target.checked); + props.onChange(e.target.checked); + setFocusIndex({ index: connectionHolderDetail?.key, type: "sameAsOwnerDetails" }); + }} + checked={sameAsOwnerDetails} + style={{ paddingBottom: "10px", paddingTop: "3px" }} + onBlur={props.onBlur} + /> + )} + /> +
+ + {!sameAsOwnerDetails ? ( +
+ + {`${t("WS_OWN_DETAIL_NAME")}*`} +
+ ((e && getPattern("Name").test(e)) || !e ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), + required: t("REQUIRED_FIELD"), + }} + isMandatory={true} + render={(props) => ( +
+ { + setName(e.target.value); + props.onChange(e.target.value); + setFocusIndex({ index: connectionHolderDetail?.key, type: "name" }); + }} + labelStyle={{ marginTop: "unset" }} + onBlur={props.onBlur} + style={ + checkifPrivacyValid() && !getValues("name")?.includes("*") + ? !Digit.Utils.checkPrivacy(privacyData, { uuid: connectionHolderDetail?.uuid, fieldName: "name", model: "User" }) && + !Digit.Utils.checkPrivacy(privacyData, { uuid: connectionHolderDetail?.uuid, fieldName: "mobileNumber", model: "User" }) + ? ((isMobile && isEmployee) ? {} :{ width: "96%" }) + : ((isMobile && isEmployee) ? {} :{ width: "96%" }) + : {} + } + /> + {checkifPrivacyValid() && ( +
+ { + setName(e); + props.onChange(e); + }} + iseyevisible={getValues("name")?.includes("*") ? true : false} + privacy={{ + uuid: connectionHolderDetail?.uuid, + fieldName: "name", + model: "WnSConnectionOwner", + loadData: { + serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", + requestBody: {}, + requestParam: { + tenantId: formData?.cpt?.details?.tenantId, + applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, + }, + jsonPath: formData?.ConnectionDetails?.[0]?.water + ? "WaterConnection[0].connectionHolders[0].name" + : "SewerageConnections[0].connectionHolders[0].name", + isArray: false, + }, + }} + > +
+ )} +
+ )} + /> +
+
+ {localFormState.touched.name ? errors?.name?.message : ""} + + {`${t( + "WS_CONN_HOLDER_OWN_DETAIL_GENDER_LABEL" + )}*`} +
+ ( +
+ { + setGender(e); + props.onChange(e); + }} + optionKey="i18nKey" + onBlur={props.onBlur} + t={t} + /> + {checkifPrivacyValid() && ( +
+ { + const r = { code: e, i18nKey: `COMMON_GENDER_${e}`, name: e }; + setGender(r); + props.onChange(r); + }} + iseyevisible={gender["i18nKey"]?.includes("*") ? true : false} + privacy={{ + uuid: connectionHolderDetail?.uuid, + fieldName: "gender", + model: "WnSConnectionOwner", + loadData: { + serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", + requestBody: {}, + requestParam: { + tenantId: formData?.cpt?.details?.tenantId, + applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, + }, + jsonPath: formData?.ConnectionDetails?.[0]?.water + ? "WaterConnection[0].connectionHolders[0].gender" + : "SewerageConnections[0].connectionHolders[0].gender", + isArray: false, + }, + }} + > +
+ )} +
+ )} + /> +
+
+ {localFormState.touched.gender ? errors?.gender?.message : ""} + + {`${t( + "CORE_COMMON_MOBILE_NUMBER" + )}*`} +
+ + (e && getPattern("MobileNoWithPrivacy").test(e)) || !e || e.includes("*") ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG"), + required: t("REQUIRED_FIELD"), + }} + //type="number" + isMandatory={true} + render={(props) => ( +
+
+ +91 +
+ { + setMobileNumber(e.target.value); + props.onChange(e.target.value); + setFocusIndex({ index: connectionHolderDetail?.key, type: "mobileNumber" }); + }} + labelStyle={{ marginTop: "unset" }} + onBlur={props.onBlur} + style={ + checkifPrivacyValid() && !getValues("mobileNumber")?.includes("*") + ? !Digit.Utils.checkPrivacy(privacyData, { + uuid: connectionHolderDetail?.uuid, + fieldName: "connectionHoldersMobileNumber", + model: "WnSConnectionOwner", + }) && + !Digit.Utils.checkPrivacy(privacyData, { uuid: connectionHolderDetail?.uuid, fieldName: "mobileNumber", model: "User" }) + ? ((isMobile && isEmployee) ? {} :{ width: "96%" }) + : ((isMobile && isEmployee) ? {} :{ width: "96%", background: "#FAFAFA" }) + : { background: "#FAFAFA" } + } + /> + {checkifPrivacyValid() && ( +
+ { + setMobileNumber(e); + props.onChange(e); + }} + iseyevisible={getValues("mobileNumber")?.includes("*") ? true : false} + privacy={{ + uuid: connectionHolderDetail?.uuid, + fieldName: "connectionHoldersMobileNumber", + model: "WnSConnectionOwner", + loadData: { + serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", + requestBody: {}, + requestParam: { + tenantId: formData?.cpt?.details?.tenantId, + applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, + }, + jsonPath: formData?.ConnectionDetails?.[0]?.water + ? "WaterConnection[0].connectionHolders[0].mobileNumber" + : "SewerageConnections[0].connectionHolders[0].mobileNumber", + isArray: false, + }, + }} + > +
+ )} +
+ )} + /> +
+
+ {localFormState.touched.mobileNumber ? errors?.mobileNumber?.message : ""} + + {`${t( + "WS_OWN_DETAIL_GUARDIAN_LABEL" + )}*`} +
+ ((e && getPattern("Name").test(e)) || !e || e.includes("*") ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), + required: t("REQUIRED_FIELD"), + }} + isMandatory={true} + render={(props) => ( +
+ { + setGuardian(e.target.value); + props.onChange(e.target.value); + setFocusIndex({ index: connectionHolderDetail?.key, type: "guardian" }); + }} + labelStyle={{ marginTop: "unset" }} + onBlur={props.onBlur} + style={ + checkifPrivacyValid() && !getValues("guardian")?.includes("*") + ? !Digit.Utils.checkPrivacy(privacyData, { + uuid: connectionHolderDetail?.uuid, + fieldName: "fatherOrHusbandName", + model: "WnSConnectionOwner", + }) && + !Digit.Utils.checkPrivacy(privacyData, { uuid: connectionHolderDetail?.uuid, fieldName: "mobileNumber", model: "User" }) + ? ((isMobile && isEmployee) ? {} :{ width: "96%" }) + : ((isMobile && isEmployee) ? {} :{ width: "96.2%" }) + : {} + } + /> + {checkifPrivacyValid() && ( +
+ { + setGuardian(e); + props.onChange(e); + }} + iseyevisible={getValues("guardian")?.includes("*") ? true : false} + privacy={{ + uuid: connectionHolderDetail?.uuid, + fieldName: "fatherOrHusbandName", + model: "WnSConnectionOwner", + loadData: { + serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", + requestBody: {}, + requestParam: { + tenantId: formData?.cpt?.details?.tenantId, + applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, + }, + jsonPath: formData?.ConnectionDetails?.[0]?.water + ? "WaterConnection[0].connectionHolders[0].fatherOrHusbandName" + : "SewerageConnections[0].connectionHolders[0].fatherOrHusbandName", + isArray: false, + }, + }} + > +
+ )} +
+ )} + /> +
+
+ {localFormState.touched.guardian ? errors?.guardian?.message : ""} + + {`${t( + "WS_CONN_HOLDER_OWN_DETAIL_RELATION_LABEL" + )}*`} +
+ ( +
+ { + setRelationship(e); + props.onChange(e); + }} + optionKey="i18nKey" + onBlur={props.onBlur} + t={t} + /> + {checkifPrivacyValid() && ( +
+ { + const r = { code: e, i18nKey: `COMMON_MASTERS_OWNERTYPE_${e}`, name: e }; + setRelationship(r); + props.onChange(r); + }} + iseyevisible={relationship?.i18nKey?.includes("*") ? true : false} + privacy={{ + uuid: connectionHolderDetail?.uuid, + fieldName: "relationship", + model: "WnSConnection", + loadData: { + serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", + requestBody: {}, + requestParam: { + tenantId: formData?.cpt?.details?.tenantId, + applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, + }, + jsonPath: formData?.ConnectionDetails?.[0]?.water + ? "WaterConnection[0].connectionHolders[0].relationship" + : "SewerageConnections[0].connectionHolders[0].relationship", + isArray: false, + }, + }} + > +
+ )} +
+ )} + /> +
+
+ {localFormState.touched.relationship ? errors?.relationship?.message : ""} + + {`${t( + "WS_CORRESPONDANCE_ADDRESS_LABEL" + )}*`} +
+ ((e && getPattern("Address").test(e)) || !e || e.includes("*") ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), + required: t("REQUIRED_FIELD"), + }} + isMandatory={true} + render={(props) => ( +
+ { + setAddress(e.target.value); + props.onChange(e.target.value); + setFocusIndex({ index: connectionHolderDetail?.key, type: "address" }); + }} + labelStyle={{ marginTop: "unset" }} + onBlur={props.onBlur} + style={ + checkifPrivacyValid() && !getValues("address")?.includes("*") + ? !Digit.Utils.checkPrivacy(privacyData, { + uuid: connectionHolderDetail?.uuid, + fieldName: "correspondenceAddress", + model: "WnSConnectionOwner", + }) && + !Digit.Utils.checkPrivacy(privacyData, { uuid: connectionHolderDetail?.uuid, fieldName: "mobileNumber", model: "User" }) + ? ((isMobile && isEmployee) ? {} :{ width: "96%" }) + : ((isMobile && isEmployee) ? {} :{ width: "96.2%" }) + : {} + } + /> + {checkifPrivacyValid() && ( +
+ { + setAddress(e); + props.onChange(e); + }} + iseyevisible={getValues("address")?.includes("*") ? true : false} + privacy={{ + uuid: connectionHolderDetail?.uuid, + fieldName: "correspondenceAddress", + model: "WnSConnectionOwner", + loadData: { + serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", + requestBody: {}, + requestParam: { + tenantId: formData?.cpt?.details?.tenantId, + applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, + }, + jsonPath: formData?.ConnectionDetails?.[0]?.water + ? "WaterConnection[0].connectionHolders[0].correspondenceAddress" + : "SewerageConnections[0].connectionHolders[0].correspondenceAddress", + isArray: false, + }, + }} + > +
+ )} +
+ )} + /> +
+
+ {localFormState.touched.address ? errors?.address?.message : ""} + + {`${t( + "WS_OWNER_SPECIAL_CATEGORY" + )}*`} +
+ ( +
+ { + setOwnerType(e); + props.onChange(e); + }} + optionKey="i18nKey" + onBlur={props.onBlur} + t={t} + /> + {checkifPrivacyValid() && ( +
+ { + const r = { code: e, i18nKey: `COMMON_MASTERS_OWNERTYPE_${e}`, name: e }; + setOwnerType(r); + props.onChange(r); + }} + iseyevisible={ownerType?.i18nKey?.includes("*") ? true : false} + privacy={{ + uuid: connectionHolderDetail?.uuid, + fieldName: "ownerType", + model: "WnSConnection", + loadData: { + serviceName: formData?.ConnectionDetails?.[0]?.water ? "/ws-services/wc/_search" : "/sw-services/swc/_search", + requestBody: {}, + requestParam: { + tenantId: formData?.cpt?.details?.tenantId, + applicationNumber: formData?.ConnectionDetails?.[0]?.applicationNo, + }, + jsonPath: formData?.ConnectionDetails?.[0]?.water + ? "WaterConnection[0].connectionHolders[0].ownerType" + : "SewerageConnections[0].connectionHolders[0].ownerType", + isArray: false, + }, + }} + > +
+ )} +
+ )} + /> +
+
+ {localFormState.touched.ownerType ? errors?.ownerType?.message : ""} +
+ ) : null} +
+ ); +}; +export default WSConnectionHolderDetails; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocsRequired.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocsRequired.js old mode 100755 new mode 100644 index 94ebdec858d..df85b7ac28c --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocsRequired.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocsRequired.js @@ -1,115 +1,115 @@ -import React, { Fragment } from "react"; -import { Card, CardHeader, SubmitBar, CitizenInfoLabel, CardText, Loader, CardSubHeader, BackButton, BreadCrumb, Header, CardLabel, CardSectionHeader, CardCaption, ActionBar, PrintBtnCommon } from "@egovernments/digit-ui-react-components"; -import { useTranslation } from "react-i18next"; -import { useHistory, useRouteMatch } from "react-router-dom"; - -const WSDocsRequired = ({ onSelect, userType, onSkip, config }) => { - const { t } = useTranslation(); - const history = useHistory() - const match = useRouteMatch(); - const tenantId = Digit.ULBService.getStateId(); - const goNext = () => { - onSelect("DocsReq", ""); - } - - sessionStorage.removeItem("Digit.PT_CREATE_EMP_WS_NEW_FORM"); - sessionStorage.removeItem("IsDetailsExists"); - sessionStorage.removeItem("FORMSTATE_ERRORS"); - - const { isLoading: wsDocsLoading, data: wsDocs } = Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesMasters(tenantId); - - if (userType === "citizen") { - return ( - - - {t(`WS_COMMON_APPL_NEW_CONNECTION`)} - - {t(`WS_NEW_CONNECTION_TEST_1`)} - {t(`WS_NEW_CONNECTION_TEST_2`)} - {t("WS_DOC_REQ_SCREEN_LABEL")} - {t(`WS_NEW_CONNECTION_TEST_3`)} - {wsDocsLoading ? - : - - {wsDocs?.Documents?.map((doc, index) => ( -
-
-
-
{`${index + 1}.`} 
-
{` ${t(doc?.code.replace('.', '_'))}`}
-
-
-
- {doc?.dropdownData?.map((value, index) => doc?.dropdownData?.length !== index + 1 ? {`${t(value?.i18nKey)}, `} : {`${t(value?.i18nKey)}`})} -
-
- ))} -
- } - -
-
- ); - } - - const printDiv = () => { - let content = document.getElementById("documents-div").innerHTML; - //APK button to print required docs - if(window.mSewaApp && window.mSewaApp.isMsewaApp()){ - window.mSewaApp.downloadBase64File(window.btoa(content), t("WS_REQ_DOCS")); - } - else{ - let printWindow = window.open("", ""); - printWindow.document.write(`${content}`); - printWindow.document.close(); - printWindow.focus(); - printWindow.print(); - } - }; - - - return ( -
-
-
-
- {t("WS_WATER_AND_SEWERAGE_NEW_CONNECTION_LABEL")} -
-
-
{"Print"}
-
-
-
- - {wsDocsLoading ? - : -
- {wsDocs?.Documents?.map((doc, index) => ( -
- {t(doc?.code.replace('.', '_'))} - {doc.dropdownData && doc.dropdownData.length > 1 &&

{t(`${doc?.code.replace('.', '_')}_DESCRIPTION`)}

} -
- {doc?.dropdownData?.map((value, idx) =>

{`${idx + 1}. ${t(value?.i18nKey)}`}

)} -
-

{t(`${doc?.code.replace('.', '_')}_BELOW_DESCRIPTION`)}

-
- ))} -
- } - - { - { - history.push(match.path.replace("create-application", "new-application")); - }} - style={{ margin: "10px 10px 0px 0px" }} - disabled={wsDocsLoading ? true : false} - />} - -
-
- ) -}; - +import React, { Fragment } from "react"; +import { Card, CardHeader, SubmitBar, CitizenInfoLabel, CardText, Loader, CardSubHeader, BackButton, BreadCrumb, Header, CardLabel, CardSectionHeader, CardCaption, ActionBar, PrintBtnCommon } from "@egovernments/digit-ui-react-components"; +import { useTranslation } from "react-i18next"; +import { useHistory, useRouteMatch } from "react-router-dom"; + +const WSDocsRequired = ({ onSelect, userType, onSkip, config }) => { + const { t } = useTranslation(); + const history = useHistory() + const match = useRouteMatch(); + const tenantId = Digit.ULBService.getStateId(); + const goNext = () => { + onSelect("DocsReq", ""); + } + + sessionStorage.removeItem("Digit.PT_CREATE_EMP_WS_NEW_FORM"); + sessionStorage.removeItem("IsDetailsExists"); + sessionStorage.removeItem("FORMSTATE_ERRORS"); + + const { isLoading: wsDocsLoading, data: wsDocs } = Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesMasters(tenantId); + + if (userType === "citizen") { + return ( + + + {t(`WS_COMMON_APPL_NEW_CONNECTION`)} + + {t(`WS_NEW_CONNECTION_TEST_1`)} + {t(`WS_NEW_CONNECTION_TEST_2`)} + {t("WS_DOC_REQ_SCREEN_LABEL")} + {t(`WS_NEW_CONNECTION_TEST_3`)} + {wsDocsLoading ? + : + + {wsDocs?.Documents?.map((doc, index) => ( +
+
+
+
{`${index + 1}.`} 
+
{` ${t(doc?.code.replace('.', '_'))}`}
+
+
+
+ {doc?.dropdownData?.map((value, index) => doc?.dropdownData?.length !== index + 1 ? {`${t(value?.i18nKey)}, `} : {`${t(value?.i18nKey)}`})} +
+
+ ))} +
+ } + +
+
+ ); + } + + const printDiv = () => { + let content = document.getElementById("documents-div").innerHTML; + //APK button to print required docs + if(window.mSewaApp && window.mSewaApp.isMsewaApp()){ + window.mSewaApp.downloadBase64File(window.btoa(content), t("WS_REQ_DOCS")); + } + else{ + let printWindow = window.open("", ""); + printWindow.document.write(`${content}`); + printWindow.document.close(); + printWindow.focus(); + printWindow.print(); + } + }; + + + return ( +
+
+
+
+ {t("WS_WATER_AND_SEWERAGE_NEW_CONNECTION_LABEL")} +
+
+
{"Print"}
+
+
+
+ + {wsDocsLoading ? + : +
+ {wsDocs?.Documents?.map((doc, index) => ( +
+ {t(doc?.code.replace('.', '_'))} + {doc.dropdownData && doc.dropdownData.length > 1 &&

{t(`${doc?.code.replace('.', '_')}_DESCRIPTION`)}

} +
+ {doc?.dropdownData?.map((value, idx) =>

{`${idx + 1}. ${t(value?.i18nKey)}`}

)} +
+

{t(`${doc?.code.replace('.', '_')}_BELOW_DESCRIPTION`)}

+
+ ))} +
+ } + + { + { + history.push(match.path.replace("create-application", "new-application")); + }} + style={{ margin: "10px 10px 0px 0px" }} + disabled={wsDocsLoading ? true : false} + />} + +
+
+ ) +}; + export default WSDocsRequired; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocumentDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocumentDetails.js old mode 100755 new mode 100644 index 9a05141d8b4..7921636e12c --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocumentDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocumentDetails.js @@ -1,148 +1,148 @@ -import React, { useEffect, useState } from "react"; -import { CardLabel, Dropdown, UploadFile, Toast, Loader, FormStep } from "@egovernments/digit-ui-react-components"; -import Timeline from "../components/Timeline"; - -const WSDocumentDetails = ({ t, config, onSelect, userType, formData, setError: setFormError, clearErrors: clearFormErrors, formState }) => { - const tenantId = Digit.ULBService.getStateId(); - const [documents, setDocuments] = useState(formData?.documents?.documents || []); - const [error, setError] = useState(null); - const [enableSubmit, setEnableSubmit] = useState(true); - const [checkRequiredFields, setCheckRequiredFields] = useState(false); - - const { isLoading: wsDocsLoading, data: wsDocs } = Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesMasters(tenantId); - - const handleSubmit = () => { - let document = formData.documents; - let documentStep; - documentStep = { ...document, documents: documents }; - onSelect(config.key, documentStep); - }; - const onSkip = () => onSelect(); - function onAdd() {} - - useEffect(() => { - let count = 0; - wsDocs?.Documents.map((doc) => { - let isRequired = false; - documents.map((data) => { - if (doc.required && data?.documentType.includes(doc.code)) isRequired = true; - }); - if (!isRequired && doc.required) count = count + 1; - }); - if ((count == "0" || count == 0) && documents.length > 0) setEnableSubmit(false); - else setEnableSubmit(true); - }, [documents, checkRequiredFields]); - - return ( -
- {userType === "citizen" && } - {!wsDocsLoading ? ( - - {wsDocs?.Documents?.map((document, index) => { - return ( - - ); - })} - {error && setError(null)} error />} - - ) : ( - - )} -
- ); -}; - -function SelectDocument({ t, key, document: doc, setDocuments, error, setError, documents, setCheckRequiredFields }) { - const filteredDocument = documents?.filter((item) => item?.documentType?.includes(doc?.code))[0]; - const tenantId = Digit.ULBService.getCurrentTenantId(); - const [selectedDocument, setSelectedDocument] = useState( - filteredDocument - ? { ...filteredDocument, active: true, code: filteredDocument?.documentType, i18nKey: filteredDocument?.documentType } - : doc?.dropdownData?.length === 1 - ? doc?.dropdownData[0] - : {} - ); - const [file, setFile] = useState(null); - const [uploadedFile, setUploadedFile] = useState(() => filteredDocument?.fileStoreId || null); - - const handleSelectDocument = (value) => setSelectedDocument(value); - - function selectfile(e) { - setFile(e.target.files[0]); - } - - useEffect(() => { - if (selectedDocument?.code) { - setDocuments((prev) => { - const filteredDocumentsByDocumentType = prev?.filter((item) => item?.documentType !== selectedDocument?.code); - if (uploadedFile?.length === 0 || uploadedFile === null) return filteredDocumentsByDocumentType; - const filteredDocumentsByFileStoreId = filteredDocumentsByDocumentType?.filter((item) => item?.fileStoreId !== uploadedFile); - return [ - ...filteredDocumentsByFileStoreId, - { - documentType: selectedDocument?.code, - fileStoreId: uploadedFile, - documentUid: selectedDocument?.documentUid || null, - id: selectedDocument?.id || null, - fileName: file?.name || "", - status: "ACTIVE", - }, - ]; - }); - } - }, [uploadedFile, selectedDocument]); - - useEffect(() => { - (async () => { - setError(null); - if (file) { - if (file.size >= 5242880) { - setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")); - } else { - try { - setUploadedFile(null); - const response = await Digit.UploadServices.Filestorage("WS", file, tenantId?.split(".")[0]); - if (response?.data?.files?.length > 0) { - setUploadedFile(response?.data?.files[0]?.fileStoreId); - } else { - setError(t("CS_FILE_UPLOAD_ERROR")); - } - } catch (err) { - // console.error("Modal -> err ", err); - setError(t("CS_FILE_UPLOAD_ERROR")); - } - } - } - })(); - }, [file]); - - return ( -
- {doc?.required ? `${t(doc?.i18nKey)} *` : `${t(doc?.i18nKey)}`} - - { - setUploadedFile(null); - setCheckRequiredFields(true); - }} - message={uploadedFile ? `1 ${t(`CS_ACTION_FILEUPLOADED`)}` : t(`ES_NO_FILE_SELECTED_LABEL`)} - error={error} - /> -
- ); -} - -export default WSDocumentDetails; +import React, { useEffect, useState } from "react"; +import { CardLabel, Dropdown, UploadFile, Toast, Loader, FormStep } from "@egovernments/digit-ui-react-components"; +import Timeline from "../components/Timeline"; + +const WSDocumentDetails = ({ t, config, onSelect, userType, formData, setError: setFormError, clearErrors: clearFormErrors, formState }) => { + const tenantId = Digit.ULBService.getStateId(); + const [documents, setDocuments] = useState(formData?.documents?.documents || []); + const [error, setError] = useState(null); + const [enableSubmit, setEnableSubmit] = useState(true); + const [checkRequiredFields, setCheckRequiredFields] = useState(false); + + const { isLoading: wsDocsLoading, data: wsDocs } = Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesMasters(tenantId); + + const handleSubmit = () => { + let document = formData.documents; + let documentStep; + documentStep = { ...document, documents: documents }; + onSelect(config.key, documentStep); + }; + const onSkip = () => onSelect(); + function onAdd() {} + + useEffect(() => { + let count = 0; + wsDocs?.Documents.map((doc) => { + let isRequired = false; + documents.map((data) => { + if (doc.required && data?.documentType.includes(doc.code)) isRequired = true; + }); + if (!isRequired && doc.required) count = count + 1; + }); + if ((count == "0" || count == 0) && documents.length > 0) setEnableSubmit(false); + else setEnableSubmit(true); + }, [documents, checkRequiredFields]); + + return ( +
+ {userType === "citizen" && } + {!wsDocsLoading ? ( + + {wsDocs?.Documents?.map((document, index) => { + return ( + + ); + })} + {error && setError(null)} error />} + + ) : ( + + )} +
+ ); +}; + +function SelectDocument({ t, key, document: doc, setDocuments, error, setError, documents, setCheckRequiredFields }) { + const filteredDocument = documents?.filter((item) => item?.documentType?.includes(doc?.code))[0]; + const tenantId = Digit.ULBService.getCurrentTenantId(); + const [selectedDocument, setSelectedDocument] = useState( + filteredDocument + ? { ...filteredDocument, active: true, code: filteredDocument?.documentType, i18nKey: filteredDocument?.documentType } + : doc?.dropdownData?.length === 1 + ? doc?.dropdownData[0] + : {} + ); + const [file, setFile] = useState(null); + const [uploadedFile, setUploadedFile] = useState(() => filteredDocument?.fileStoreId || null); + + const handleSelectDocument = (value) => setSelectedDocument(value); + + function selectfile(e) { + setFile(e.target.files[0]); + } + + useEffect(() => { + if (selectedDocument?.code) { + setDocuments((prev) => { + const filteredDocumentsByDocumentType = prev?.filter((item) => item?.documentType !== selectedDocument?.code); + if (uploadedFile?.length === 0 || uploadedFile === null) return filteredDocumentsByDocumentType; + const filteredDocumentsByFileStoreId = filteredDocumentsByDocumentType?.filter((item) => item?.fileStoreId !== uploadedFile); + return [ + ...filteredDocumentsByFileStoreId, + { + documentType: selectedDocument?.code, + fileStoreId: uploadedFile, + documentUid: selectedDocument?.documentUid || null, + id: selectedDocument?.id || null, + fileName: file?.name || "", + status: "ACTIVE", + }, + ]; + }); + } + }, [uploadedFile, selectedDocument]); + + useEffect(() => { + (async () => { + setError(null); + if (file) { + if (file.size >= 5242880) { + setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")); + } else { + try { + setUploadedFile(null); + const response = await Digit.UploadServices.Filestorage("WS", file, tenantId?.split(".")[0]); + if (response?.data?.files?.length > 0) { + setUploadedFile(response?.data?.files[0]?.fileStoreId); + } else { + setError(t("CS_FILE_UPLOAD_ERROR")); + } + } catch (err) { + // console.error("Modal -> err ", err); + setError(t("CS_FILE_UPLOAD_ERROR")); + } + } + } + })(); + }, [file]); + + return ( +
+ {doc?.required ? `${t(doc?.i18nKey)} *` : `${t(doc?.i18nKey)}`} + + { + setUploadedFile(null); + setCheckRequiredFields(true); + }} + message={uploadedFile ? `1 ${t(`CS_ACTION_FILEUPLOADED`)}` : t(`ES_NO_FILE_SELECTED_LABEL`)} + error={error} + /> +
+ ); +} + +export default WSDocumentDetails; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocumentsRequired.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocumentsRequired.js old mode 100755 new mode 100644 index 4fb2dfcec71..df68e1ee7cf --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocumentsRequired.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSDocumentsRequired.js @@ -1,9 +1,9 @@ -import React from 'react' - -const WSDocumentsRequired = () => { - return ( -
WSDocumentsRequired
- ) -} - +import React from 'react' + +const WSDocumentsRequired = () => { + return ( +
WSDocumentsRequired
+ ) +} + export default WSDocumentsRequired \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSInfoLabel.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSInfoLabel.js old mode 100755 new mode 100644 index 4ae3da189fe..7bd94d40418 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSInfoLabel.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSInfoLabel.js @@ -1,34 +1,34 @@ -import React, { useState } from "react"; -import { TypeSelectCard } from "@egovernments/digit-ui-react-components"; -import { FormStep, RadioOrSelect, RadioButtons, CitizenInfoLabel, InfoBannerIcon } from "@egovernments/digit-ui-react-components"; - -const EyeSvgINdex = ({ style }) => { - return - - - - - -} -const WSInfoLabel = ({ t, config, onSelect, userType, formData }) => { - userType = userType || Digit.SessionStorage.get("userType"); - const isMobile = window.Digit.Utils.browser.isMobile(); - let isPrivacyEnabled = sessionStorage.getItem("isPrivacyEnabled") - return ( - - { isPrivacyEnabled === "true" &&
-
-
- -

{t("CS_FILE_APPLICATION_INFO_LABEL")}

-
- {`${t("WS_CLICK_ON_LABEL")} `} - - {` ${t("WS_CLICK_ON_INFO_LABEL")}`} -
-
} -
- ); -}; - -export default WSInfoLabel; +import React, { useState } from "react"; +import { TypeSelectCard } from "@egovernments/digit-ui-react-components"; +import { FormStep, RadioOrSelect, RadioButtons, CitizenInfoLabel, InfoBannerIcon } from "@egovernments/digit-ui-react-components"; + +const EyeSvgINdex = ({ style }) => { + return + + + + + +} +const WSInfoLabel = ({ t, config, onSelect, userType, formData }) => { + userType = userType || Digit.SessionStorage.get("userType"); + const isMobile = window.Digit.Utils.browser.isMobile(); + let isPrivacyEnabled = sessionStorage.getItem("isPrivacyEnabled") + return ( + + { isPrivacyEnabled === "true" &&
+
+
+ +

{t("CS_FILE_APPLICATION_INFO_LABEL")}

+
+ {`${t("WS_CLICK_ON_LABEL")} `} + + {` ${t("WS_CLICK_ON_INFO_LABEL")}`} +
+
} +
+ ); +}; + +export default WSInfoLabel; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPlumberDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPlumberDetails.js old mode 100755 new mode 100644 index be81c007615..72503a17145 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPlumberDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPlumberDetails.js @@ -1,72 +1,72 @@ -import { CardLabel, Dropdown, LabelFieldPair, TextInput } from "@egovernments/digit-ui-react-components"; -import React from "react"; - -const WSPlumberDetails = ({ t, config, userType, formData }) => { - const [plumberDetails, setPlumberDetails] = React.useState({ - plumberName: "", - plumberMobileNo: "", - plumberLicenseNo: "", - plumberProvideBy: { code: "", value: "", i18nKey: "" }, - }); - - React.useEffect(() => { - if (formData && formData.PlumberDetails) { - } - }); - - return ( - - - {t("WS_PLUMBER_PROVIDED_BY")} -
- { - setPlumberDetails({ ...plumberDetails, plumberProvideBy: value }); - }} - > -
-
- - {t("WS_PLUMBER_LICENSE_NUMBER")} -
- { - setPlumberDetails({ ...plumberDetails, plumberLicenseNo: ev.target.value }); - }} - > -
-
- - {t("WS_PLUMBER_NAME")} -
- { - setPlumberDetails({ ...plumberDetails, plumberName: ev.target.value }); - }} - > -
-
- - {t("WS_PLUMBER_MOB_NUMBER")} -
- { - setPlumberDetails({ ...plumberDetails, plumberMobileNo: ev.target.value }); - }} - > -
-
-
- ); -}; - -export default WSPlumberDetails; +import { CardLabel, Dropdown, LabelFieldPair, TextInput } from "@egovernments/digit-ui-react-components"; +import React from "react"; + +const WSPlumberDetails = ({ t, config, userType, formData }) => { + const [plumberDetails, setPlumberDetails] = React.useState({ + plumberName: "", + plumberMobileNo: "", + plumberLicenseNo: "", + plumberProvideBy: { code: "", value: "", i18nKey: "" }, + }); + + React.useEffect(() => { + if (formData && formData.PlumberDetails) { + } + }); + + return ( + + + {t("WS_PLUMBER_PROVIDED_BY")} +
+ { + setPlumberDetails({ ...plumberDetails, plumberProvideBy: value }); + }} + > +
+
+ + {t("WS_PLUMBER_LICENSE_NUMBER")} +
+ { + setPlumberDetails({ ...plumberDetails, plumberLicenseNo: ev.target.value }); + }} + > +
+
+ + {t("WS_PLUMBER_NAME")} +
+ { + setPlumberDetails({ ...plumberDetails, plumberName: ev.target.value }); + }} + > +
+
+ + {t("WS_PLUMBER_MOB_NUMBER")} +
+ { + setPlumberDetails({ ...plumberDetails, plumberMobileNo: ev.target.value }); + }} + > +
+
+
+ ); +}; + +export default WSPlumberDetails; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPlumberPreference.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPlumberPreference.js old mode 100755 new mode 100644 index 66369fbec8d..1de9ce22dbf --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPlumberPreference.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPlumberPreference.js @@ -1,73 +1,73 @@ -import React, { useState } from "react"; -import { - FormStep, - RadioOrSelect, - CardLabel, - TextInput, - MobileNumber, -} from "@egovernments/digit-ui-react-components"; -import Timeline from "../components/Timeline"; - -const WSPlumberPreference = ({ t, config, onSelect, userType, formData }) => { - - const [plumberPreference, setPlumberPreference] = useState(formData?.plumberPreference?.plumberPreference || { - i18nKey: "WS_I_WOULD_PREFER_FROM_MUNICIPAL_OFFICE", - code: "ULB" - }); - let validation = {} - - const plumberPreferenceList = [ - { - i18nKey: "WS_I_WOULD_PREFER_FROM_MUNICIPAL_OFFICE", - code: "ULB" - }, - { - i18nKey: "WS_I_WILL_ARRAGE_THE_PLUMBER_MYSELF", - code: "Self" - } - ]; - - function onAdd() { } - - function onPlumberPreferenceSelect(value) { - setPlumberPreference(value); - } - - - const onSkip = () => onSelect(); - - const handleSubmit = () => { - let plumberDetails = { - plumberPreference : plumberPreference, - - } - onSelect(config.key, plumberDetails); - }; - - return ( -
- {userType === "citizen" && ()} - - - -
- ); -} - +import React, { useState } from "react"; +import { + FormStep, + RadioOrSelect, + CardLabel, + TextInput, + MobileNumber, +} from "@egovernments/digit-ui-react-components"; +import Timeline from "../components/Timeline"; + +const WSPlumberPreference = ({ t, config, onSelect, userType, formData }) => { + + const [plumberPreference, setPlumberPreference] = useState(formData?.plumberPreference?.plumberPreference || { + i18nKey: "WS_I_WOULD_PREFER_FROM_MUNICIPAL_OFFICE", + code: "ULB" + }); + let validation = {} + + const plumberPreferenceList = [ + { + i18nKey: "WS_I_WOULD_PREFER_FROM_MUNICIPAL_OFFICE", + code: "ULB" + }, + { + i18nKey: "WS_I_WILL_ARRAGE_THE_PLUMBER_MYSELF", + code: "Self" + } + ]; + + function onAdd() { } + + function onPlumberPreferenceSelect(value) { + setPlumberPreference(value); + } + + + const onSkip = () => onSelect(); + + const handleSubmit = () => { + let plumberDetails = { + plumberPreference : plumberPreference, + + } + onSelect(config.key, plumberDetails); + }; + + return ( +
+ {userType === "citizen" && ()} + + + +
+ ); +} + export default WSPlumberPreference; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPropertyDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPropertyDetails.js old mode 100755 new mode 100644 index c52a0ba1950..1baa1a75a1f --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPropertyDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSPropertyDetails.js @@ -1,93 +1,93 @@ -import { CardLabel, LabelFieldPair, LinkButton, Loader, TextInput } from "@egovernments/digit-ui-react-components"; -import React from "react"; -import { Link } from "react-router-dom"; - -const WSPropertyDetails = ({ t, config, onSelect, userType, formData, setError, formState, clearErrors }) => { - const redirectBackUrl = `/digit-ui/${userType}/ws/new-application`; - const [propertyId, setPropertyId] = React.useState(""); - const tenantId = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; - const { isLoading: loading, data: propertyDetails } = Digit.Hooks.pt.usePropertySearch( - { filters: { propertyIds: formData?.cptId?.id }, tenantId: tenantId }, - { filters: { propertyIds: formData?.cptId?.id }, tenantId: tenantId } - ); - - const getPropertyAddress = () => { - const property = propertyDetails?.Properties?.at(0); - const doorNo = property?.doorNo; - const street = property?.address?.street; - const landMark = property?.address?.landmark; - const locality = property?.address?.locality?.name; - const city = property?.address?.city; - const pinCode = property?.address?.pincode; - - return `${doorNo ? doorNo + ", " : ""} - ${street ? street + ", " : ""} - ${landMark ? landMark + ", " : ""} - ${locality ? locality + ", " : ""} - ${city ? city : ""} - ${pinCode ? ", " + pinCode : ""}`; - }; - - if (loading) { - return ; - } - - return ( - - - {`${t(`PROPERTY_ID`)}`} -
- { - setPropertyId(e.target.value); - onSelect(config.key, { id: e.target.value }); - }} - style={{ width: "65%", float: "left", marginRight: "20px" }} - /> - -
-
- - - -   |   - - - - {propertyDetails && propertyDetails?.Properties.length && ( - -
- {t("PT_DETAILS")} -
- - {`${t(`PROPERTY_ID`)}`} -
-

{propertyDetails?.Properties[0]?.propertyId}

-
-
- - {`${t(`OWNER_NAME`)}`} -
-

{propertyDetails?.Properties[0]?.owners[0]?.name}

-
-
- - {`${t(`PROPERTY_ADDRESS`)}`} -
-

{getPropertyAddress()}

-
-
- - - -
- )} -
- ); -}; - -export default WSPropertyDetails; +import { CardLabel, LabelFieldPair, LinkButton, Loader, TextInput } from "@egovernments/digit-ui-react-components"; +import React from "react"; +import { Link } from "react-router-dom"; + +const WSPropertyDetails = ({ t, config, onSelect, userType, formData, setError, formState, clearErrors }) => { + const redirectBackUrl = `/digit-ui/${userType}/ws/new-application`; + const [propertyId, setPropertyId] = React.useState(""); + const tenantId = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; + const { isLoading: loading, data: propertyDetails } = Digit.Hooks.pt.usePropertySearch( + { filters: { propertyIds: formData?.cptId?.id }, tenantId: tenantId }, + { filters: { propertyIds: formData?.cptId?.id }, tenantId: tenantId } + ); + + const getPropertyAddress = () => { + const property = propertyDetails?.Properties?.at(0); + const doorNo = property?.doorNo; + const street = property?.address?.street; + const landMark = property?.address?.landmark; + const locality = property?.address?.locality?.name; + const city = property?.address?.city; + const pinCode = property?.address?.pincode; + + return `${doorNo ? doorNo + ", " : ""} + ${street ? street + ", " : ""} + ${landMark ? landMark + ", " : ""} + ${locality ? locality + ", " : ""} + ${city ? city : ""} + ${pinCode ? ", " + pinCode : ""}`; + }; + + if (loading) { + return ; + } + + return ( + + + {`${t(`PROPERTY_ID`)}`} +
+ { + setPropertyId(e.target.value); + onSelect(config.key, { id: e.target.value }); + }} + style={{ width: "65%", float: "left", marginRight: "20px" }} + /> + +
+
+ + + +   |   + + + + {propertyDetails && propertyDetails?.Properties.length && ( + +
+ {t("PT_DETAILS")} +
+ + {`${t(`PROPERTY_ID`)}`} +
+

{propertyDetails?.Properties[0]?.propertyId}

+
+
+ + {`${t(`OWNER_NAME`)}`} +
+

{propertyDetails?.Properties[0]?.owners[0]?.name}

+
+
+ + {`${t(`PROPERTY_ADDRESS`)}`} +
+

{getPropertyAddress()}

+
+
+ + + +
+ )} +
+ ); +}; + +export default WSPropertyDetails; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSRoadCuttingDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSRoadCuttingDetails.js old mode 100755 new mode 100644 index 467ab598959..6a11d83ecb5 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSRoadCuttingDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSRoadCuttingDetails.js @@ -1,218 +1,218 @@ -import { CardLabel, Dropdown, LabelFieldPair, LinkButton, TextInput, CardLabelError, DeleteIcon } from "@egovernments/digit-ui-react-components"; -import _ from "lodash"; -import React, { useState, useEffect, useMemo } from "react"; -import { useForm, Controller } from "react-hook-form"; -import { stringReplaceAll } from "../utils"; -import { useTranslation } from "react-i18next"; -import { useLocation } from "react-router-dom"; - -const createRoadCuttingDetails = () => ({ - roadType: { code: "", value: "", i18nKey: "" }, - area: "", - status: "", - id: null, - key: Date.now(), -}); - -const WSRoadCuttingDetails = ({ config, onSelect, userType, formData, setError, formState, clearErrors }) => { - const { t } = useTranslation(); - const { pathname } = useLocation(); - - const isEditScreen = pathname.includes("/modify-application/" ) - - const stateCode = Digit.ULBService.getStateId(); - const { isMdmsLoading, data: mdmsData } = Digit.Hooks.ws.useMDMS(stateCode, "sw-services-calculation", ["RoadType"]); - - const [roadCuttingDetails, setRoadCuttingDetails] = useState(formData?.roadCuttingDetails || [createRoadCuttingDetails()]); - const [focusIndex, setFocusIndex] = useState({ index: -1, type: "" }); - - const addroadCutt = () => { - const newRoadCutting = createRoadCuttingDetails(); - setRoadCuttingDetails((prev) => [...prev, newRoadCutting]); - }; - - const removeroadCutt = (roadCutt) => { - roadCutt?.id !== null ? - setRoadCuttingDetails((prev) => prev.map((e) => (e.key == roadCutt.key && e.id !== null) - ? { ...roadCutt, id : e.id, status: "INACTIVE"} : {...e})) - : setRoadCuttingDetails((prev) => prev.filter((o) => o.key != roadCutt.key)); - }; - - useEffect(() => { - onSelect(config?.key, roadCuttingDetails); - }, [roadCuttingDetails]); - - const commonProps = { - focusIndex, - allRoadCuttingDetails: roadCuttingDetails, - setFocusIndex, - removeroadCutt, - formData, - formState, - setRoadCuttingDetails, - mdmsData, - t, - setError, - clearErrors, - config, - isEditScreen, - }; - - if (isMdmsLoading) return - - return ( - - {roadCuttingDetails.filter((o) => o.status !== "INACTIVE").map((roadCutt, index) => ( - - ))} - - - ); -}; - -const RoadCuttForm = (_props) => { - const { - roadCutt, - index, - focusIndex, - allRoadCuttingDetails, - setFocusIndex, - removeroadCutt, - formData, - formState, - setRoadCuttingDetails, - mdmsData, - t, - setError, - clearErrors, - config, - isEditScreen, - } = _props; - - const { control, formState: localFormState, watch, setError: setLocalError, clearErrors: clearLocalErrors, setValue, trigger, getValues } = useForm(); - const formValue = watch(); - const { errors } = localFormState; - - const roadCuttingTypeMenu = useMemo(() => { - const RoadTypes = mdmsData?.["sw-services-calculation"]?.RoadType || []; - RoadTypes?.forEach(data => data.i18nKey = `WS_ROADTYPE_${stringReplaceAll(data?.code?.toUpperCase(), " ", "_")}`); - return RoadTypes; - }, [mdmsData]); - - useEffect(() => { - trigger(); - }, []); - - useEffect(() => { - trigger(); - }, [allRoadCuttingDetails, formData?.connectionDetails, formData?.plumberDetails]); - - const [part, setPart] = React.useState({}); - - useEffect(() => { - if (!_.isEqual(part, formValue)) { - setPart({...formValue}); - setRoadCuttingDetails((prev) => prev.map((o) => (o.key && o.key === roadCutt.key ? { ...o, ...formValue } : { ...o }))); - trigger(); - } - }, [formValue]); - - useEffect(() => { - if (Object.keys(errors).length && !_.isEqual(formState.errors[config.key]?.type || {}, errors)) { - setError(config.key, { type: errors }); - } - else if (!Object.keys(errors).length && formState.errors[config.key]) { - clearErrors(config.key); - } -}, [errors]); - - const errorStyle = { width: "70%", marginLeft: "30%", fontSize: "12px", marginTop: "-21px" }; - - return ( - -
-
-

- {t("WS_COMMON_ROAD_CUTTING_DETAILS")} {allRoadCuttingDetails?.filter((o) => o.status !== "INACTIVE").length > 1 ? index + 1 : null} -

-
-
- {allRoadCuttingDetails?.filter((o) => o.status !== "INACTIVE").length > 1 ? ( - } - style={{ width: "100px", display: "inline", background: "black" }} - onClick={(e) => removeroadCutt(roadCutt)} - /> - ) : null} - -
o.status !== "INACTIVE").length == 1 ? {} : {marginTop: "40px"}}> - - {t("WS_ROAD_TYPE") + " *"} - ( - { - props.onChange(e); - }} - option={roadCuttingTypeMenu} - onBlur={props.onBlur} - optionKey="i18nKey" - disable={false} - t={t} - /> - )} - /> - - - {localFormState.touched?.roadType ? errors?.roadType?.message : ""} - - - {t("WS_AREA_SQ_FT") + " *"} -
- (/^[0-9]{1,10}$/i.test(e) ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), - }, - }} - render={(props) => ( - { - props.onChange(e.target.value); - setFocusIndex({ index: roadCutt.key, type: "area"}); - }} - onBlur={(e) => { - setFocusIndex({ index: -1 }); - props.onBlur(e); - }} - /> - )} - /> -
-
- - {localFormState.touched?.area ? errors?.area?.message : ""} - -
-
-
-
- ); -}; - -export default WSRoadCuttingDetails; +import { CardLabel, Dropdown, LabelFieldPair, LinkButton, TextInput, CardLabelError, DeleteIcon } from "@egovernments/digit-ui-react-components"; +import _ from "lodash"; +import React, { useState, useEffect, useMemo } from "react"; +import { useForm, Controller } from "react-hook-form"; +import { stringReplaceAll } from "../utils"; +import { useTranslation } from "react-i18next"; +import { useLocation } from "react-router-dom"; + +const createRoadCuttingDetails = () => ({ + roadType: { code: "", value: "", i18nKey: "" }, + area: "", + status: "", + id: null, + key: Date.now(), +}); + +const WSRoadCuttingDetails = ({ config, onSelect, userType, formData, setError, formState, clearErrors }) => { + const { t } = useTranslation(); + const { pathname } = useLocation(); + + const isEditScreen = pathname.includes("/modify-application/" ) + + const stateCode = Digit.ULBService.getStateId(); + const { isMdmsLoading, data: mdmsData } = Digit.Hooks.ws.useMDMS(stateCode, "sw-services-calculation", ["RoadType"]); + + const [roadCuttingDetails, setRoadCuttingDetails] = useState(formData?.roadCuttingDetails || [createRoadCuttingDetails()]); + const [focusIndex, setFocusIndex] = useState({ index: -1, type: "" }); + + const addroadCutt = () => { + const newRoadCutting = createRoadCuttingDetails(); + setRoadCuttingDetails((prev) => [...prev, newRoadCutting]); + }; + + const removeroadCutt = (roadCutt) => { + roadCutt?.id !== null ? + setRoadCuttingDetails((prev) => prev.map((e) => (e.key == roadCutt.key && e.id !== null) + ? { ...roadCutt, id : e.id, status: "INACTIVE"} : {...e})) + : setRoadCuttingDetails((prev) => prev.filter((o) => o.key != roadCutt.key)); + }; + + useEffect(() => { + onSelect(config?.key, roadCuttingDetails); + }, [roadCuttingDetails]); + + const commonProps = { + focusIndex, + allRoadCuttingDetails: roadCuttingDetails, + setFocusIndex, + removeroadCutt, + formData, + formState, + setRoadCuttingDetails, + mdmsData, + t, + setError, + clearErrors, + config, + isEditScreen, + }; + + if (isMdmsLoading) return + + return ( + + {roadCuttingDetails.filter((o) => o.status !== "INACTIVE").map((roadCutt, index) => ( + + ))} + + + ); +}; + +const RoadCuttForm = (_props) => { + const { + roadCutt, + index, + focusIndex, + allRoadCuttingDetails, + setFocusIndex, + removeroadCutt, + formData, + formState, + setRoadCuttingDetails, + mdmsData, + t, + setError, + clearErrors, + config, + isEditScreen, + } = _props; + + const { control, formState: localFormState, watch, setError: setLocalError, clearErrors: clearLocalErrors, setValue, trigger, getValues } = useForm(); + const formValue = watch(); + const { errors } = localFormState; + + const roadCuttingTypeMenu = useMemo(() => { + const RoadTypes = mdmsData?.["sw-services-calculation"]?.RoadType || []; + RoadTypes?.forEach(data => data.i18nKey = `WS_ROADTYPE_${stringReplaceAll(data?.code?.toUpperCase(), " ", "_")}`); + return RoadTypes; + }, [mdmsData]); + + useEffect(() => { + trigger(); + }, []); + + useEffect(() => { + trigger(); + }, [allRoadCuttingDetails, formData?.connectionDetails, formData?.plumberDetails]); + + const [part, setPart] = React.useState({}); + + useEffect(() => { + if (!_.isEqual(part, formValue)) { + setPart({...formValue}); + setRoadCuttingDetails((prev) => prev.map((o) => (o.key && o.key === roadCutt.key ? { ...o, ...formValue } : { ...o }))); + trigger(); + } + }, [formValue]); + + useEffect(() => { + if (Object.keys(errors).length && !_.isEqual(formState.errors[config.key]?.type || {}, errors)) { + setError(config.key, { type: errors }); + } + else if (!Object.keys(errors).length && formState.errors[config.key]) { + clearErrors(config.key); + } +}, [errors]); + + const errorStyle = { width: "70%", marginLeft: "30%", fontSize: "12px", marginTop: "-21px" }; + + return ( + +
+
+

+ {t("WS_COMMON_ROAD_CUTTING_DETAILS")} {allRoadCuttingDetails?.filter((o) => o.status !== "INACTIVE").length > 1 ? index + 1 : null} +

+
+
+ {allRoadCuttingDetails?.filter((o) => o.status !== "INACTIVE").length > 1 ? ( + } + style={{ width: "100px", display: "inline", background: "black" }} + onClick={(e) => removeroadCutt(roadCutt)} + /> + ) : null} + +
o.status !== "INACTIVE").length == 1 ? {} : {marginTop: "40px"}}> + + {t("WS_ROAD_TYPE") + " *"} + ( + { + props.onChange(e); + }} + option={roadCuttingTypeMenu} + onBlur={props.onBlur} + optionKey="i18nKey" + disable={false} + t={t} + /> + )} + /> + + + {localFormState.touched?.roadType ? errors?.roadType?.message : ""} + + + {t("WS_AREA_SQ_FT") + " *"} +
+ (/^[0-9]{1,10}$/i.test(e) ? true : t("ERR_DEFAULT_INPUT_FIELD_MSG")), + }, + }} + render={(props) => ( + { + props.onChange(e.target.value); + setFocusIndex({ index: roadCutt.key, type: "area"}); + }} + onBlur={(e) => { + setFocusIndex({ index: -1 }); + props.onBlur(e); + }} + /> + )} + /> +
+
+ + {localFormState.touched?.area ? errors?.area?.message : ""} + +
+
+
+
+ ); +}; + +export default WSRoadCuttingDetails; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSServiceName.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSServiceName.js old mode 100755 new mode 100644 index 4df6f695b72..073f1ee07d4 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSServiceName.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSServiceName.js @@ -1,79 +1,79 @@ -import React, { useState } from "react"; -import { - FormStep, - RadioOrSelect, - CardLabel -} from "@egovernments/digit-ui-react-components"; -import Timeline from "../components/Timeline"; - -const WSServiceName = ({ t, config, onSelect, userType, formData }) => { - const [serviceName, setServiceName] = useState(formData?.serviceName || ""); - const [formDetails, setFormDetails] = useState(formData || {}); - const isEdit = window.location.href.includes("/ws/edit-application/"); - - const serviceNameList = [ - { - i18nKey: "WS_WATER_CONNECTION_ONLY", - code: "WATER" - }, - { - i18nKey: "WS_SEWERAGE_CONNECTION_ONLY", - code: "SEWERAGE" - }, - { - i18nKey: "WS_BOTH_WATER_AND_SEWERAGE", - code: "BOTH" - } - ]; - - function onAdd() { } - - function onServiceNameSelect(value) { - setServiceName(value); - } - - const onSkip = () => onSelect(); - - const handleSubmit = () => { - if (serviceName?.code == "WATER") sessionStorage.setItem("serviceName", "WATER"); - else if (serviceName?.code == "SEWERAGE") sessionStorage.setItem("serviceName", "SEWERAGE"); - else sessionStorage.setItem("serviceName", ""); - - if (serviceName?.code != "BOTH" && formDetails?.serviceName?.code != serviceName?.code) { - let data = formDetails; - data.waterConectionDetails = {}; - data.sewerageConnectionDetails = {}; - data.serviceName = serviceName; - onSelect("", data); - } else { - onSelect(config.key, serviceName); - } - }; - - return ( -
- {userType === "citizen" && ()} - - {t("WS_SELECT_SERVICE_TYPE_WANT_TO_APPLY")} - - -
- ); -} - +import React, { useState } from "react"; +import { + FormStep, + RadioOrSelect, + CardLabel +} from "@egovernments/digit-ui-react-components"; +import Timeline from "../components/Timeline"; + +const WSServiceName = ({ t, config, onSelect, userType, formData }) => { + const [serviceName, setServiceName] = useState(formData?.serviceName || ""); + const [formDetails, setFormDetails] = useState(formData || {}); + const isEdit = window.location.href.includes("/ws/edit-application/"); + + const serviceNameList = [ + { + i18nKey: "WS_WATER_CONNECTION_ONLY", + code: "WATER" + }, + { + i18nKey: "WS_SEWERAGE_CONNECTION_ONLY", + code: "SEWERAGE" + }, + { + i18nKey: "WS_BOTH_WATER_AND_SEWERAGE", + code: "BOTH" + } + ]; + + function onAdd() { } + + function onServiceNameSelect(value) { + setServiceName(value); + } + + const onSkip = () => onSelect(); + + const handleSubmit = () => { + if (serviceName?.code == "WATER") sessionStorage.setItem("serviceName", "WATER"); + else if (serviceName?.code == "SEWERAGE") sessionStorage.setItem("serviceName", "SEWERAGE"); + else sessionStorage.setItem("serviceName", ""); + + if (serviceName?.code != "BOTH" && formDetails?.serviceName?.code != serviceName?.code) { + let data = formDetails; + data.waterConectionDetails = {}; + data.sewerageConnectionDetails = {}; + data.serviceName = serviceName; + onSelect("", data); + } else { + onSelect(config.key, serviceName); + } + }; + + return ( +
+ {userType === "citizen" && ()} + + {t("WS_SELECT_SERVICE_TYPE_WANT_TO_APPLY")} + + +
+ ); +} + export default WSServiceName; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSSewerageConnectionDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSSewerageConnectionDetails.js old mode 100755 new mode 100644 index 852216e499b..6821f1dae9c --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSSewerageConnectionDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSSewerageConnectionDetails.js @@ -1,289 +1,289 @@ -import React, { useState } from "react"; -import { - FormStep, - TextInput, - CardLabel, - Toast -} from "@egovernments/digit-ui-react-components"; -import Timeline from "../components/Timeline"; - -const WSSewerageConnectionDetails = ({ t, config, userType, onSelect, formData }) => { - const [proposedWaterClosets, setProposedWaterClosets] = useState(formData?.sewerageConnectionDetails?.proposedWaterClosets || ""); - const [proposedToilets, setProposedToilets] = useState(formData?.sewerageConnectionDetails?.proposedToilets || ""); - const [isDisableForNext, setIsDisableForNext] = useState(false); - const [showToast, setShowToast] = useState(null); - const [error, setError] = useState(null); - let validation = {}; - - function onAdd() { } - - function setNumberOfProposedWaterClosets(e) { - setProposedWaterClosets(e.target.value); - } - - function setNumberOfProposedToilets(e) { - setProposedToilets(e.target.value); - } - - const onSkip = () => onSelect(); - - const handleSubmit = () => { - - if ((!(formData?.SewerageConnectionResult && formData?.SewerageConnectionResult?.SewerageConnections?.[0]?.id) || formData?.isModifyConnection) && formData?.serviceName?.code === "SEWERAGE") { - setIsDisableForNext(true); - let payload = {}; - if(formData?.isModifyConnection) - { - payload = { - "SewerageConnection":{...formData?.SewerageConnectionResult?.SewerageConnections?.[0], - "processInstance": { - "action": "INITIATE" - }, - "channel": "CITIZEN" - }, - reconnectRequest:false, disconnectRequest:false - } - } - else{ - payload = { - "SewerageConnection": { - "water": false, - "sewerage": true, - "property": {...formData?.cpt?.details}, - "proposedTaps": null, - "proposedPipeSize": null, - "proposedWaterClosets": parseInt(proposedWaterClosets), - "proposedToilets": parseInt(proposedToilets), - "connectionHolders": formData?.ConnectionHolderDetails?.isOwnerSame ? null : [{ - correspondenceAddress: formData?.ConnectionHolderDetails?.address, - fatherOrHusbandName: formData?.ConnectionHolderDetails?.guardian, - gender: formData?.ConnectionHolderDetails?.gender?.code, - mobileNumber: formData?.ConnectionHolderDetails?.mobileNumber, - name: formData?.ConnectionHolderDetails?.name, - ownerType: formData?.ConnectionHolderDetails?.specialCategoryType?.code || "NONE", - relationship: formData?.ConnectionHolderDetails?.relationship?.code, - sameAsPropertyAddress: false, - }], - "service": "Sewerage", - "roadCuttingArea": null, - "noOfTaps": null, - "noOfWaterClosets": null, - "noOfToilets": null, - "propertyId": formData?.cptId?.id || formData?.cpt?.details?.propertyId, - "additionalDetails": { - "initialMeterReading": null, - "detailsProvidedBy": "", - "locality": formData?.cpt?.details?.address?.locality?.code, - }, - "tenantId": formData?.cpt?.details?.tenantId, - "processInstance": { - "action": "INITIATE" - }, - "channel": "CITIZEN" - }, - reconnectRequest:false, disconnectRequest:false - } - } - - Digit.WSService.create(payload, "SEWERAGE") - .then((result, err) => { - setIsDisableForNext(false); - let data = {...formData, SewerageConnectionResult: result, sewerageConnectionDetails : {proposedWaterClosets : proposedWaterClosets, proposedToilets : proposedToilets} } - //1, units - onSelect("", data, "", true); - - }) - .catch((e) => { - setIsDisableForNext(false); - setShowToast({ key: "error" }); - setError(e?.response?.data?.Errors[0]?.message || null); - }); - } - else if ((!(formData?.SewerageConnectionResult && formData?.SewerageConnectionResult?.SewerageConnection?.id) && !(formData?.WaterConnectionResult && formData?.WaterConnectionResult?.WaterConnection?.id) || formData?.isModifyConnection) && formData?.serviceName?.code === "BOTH"){ - setIsDisableForNext(true); - let payload1 = {}; - if(formData?.isModifyConnection) - { - payload = { - "WaterConnection":{...formData?.WaterConnectionResult?.WaterConnection?.[0], - "processInstance": { - "action": "INITIATE" - }, - "channel": "CITIZEN" - }, - reconnectRequest:false, disconnectRequest:false - } - } - else{ - payload1 = { - "WaterConnection": { - "water": true, - "sewerage": true, - "property": {...formData?.cpt?.details}, - "proposedTaps": formData?.waterConectionDetails?.proposedTaps, - "proposedPipeSize": formData?.waterConectionDetails?.proposedPipeSize?.code, - "proposedWaterClosets": parseInt(proposedWaterClosets), - "proposedToilets": parseInt(proposedToilets), - "connectionHolders": formData?.ConnectionHolderDetails?.isOwnerSame ? null : [{ - correspondenceAddress: formData?.ConnectionHolderDetails?.address, - fatherOrHusbandName: formData?.ConnectionHolderDetails?.guardian, - gender: formData?.ConnectionHolderDetails?.gender?.code, - mobileNumber: formData?.ConnectionHolderDetails?.mobileNumber, - name: formData?.ConnectionHolderDetails?.name, - ownerType: formData?.ConnectionHolderDetails?.specialCategoryType?.code || "NONE", - relationship: formData?.ConnectionHolderDetails?.relationship?.code, - sameAsPropertyAddress: false, - }], - "service": "Water and Sewerage", - "roadCuttingArea": null, - "noOfTaps": null, - "noOfWaterClosets": null, - "noOfToilets": null, - "propertyId": formData?.cptId?.id || formData?.cpt?.details?.propertyId, - "additionalDetails": { - "initialMeterReading": null, - "detailsProvidedBy": "", - "locality": formData?.cpt?.details?.address?.locality?.code, - }, - "tenantId": formData?.cpt?.details?.tenantId, - "processInstance": { - "action": "INITIATE" - }, - "channel": "CITIZEN" - }, - reconnectRequest:false, disconnectRequest:false - } - } - - let payload2 = {}; - if(formData?.isModifyConnection) - { - payload2 = { - "SewerageConnection":{...formData?.SewerageConnectionResult?.SewerageConnections?.[0], - "processInstance": { - "action": "INITIATE" - }, - "channel": "CITIZEN" - }, - reconnectRequest:false, disconnectRequest:false - } - } - else{ - payload2 = { - "SewerageConnection": { - "water": true, - "sewerage": true, - "property": {...formData?.cpt?.details}, - "proposedTaps": formData?.waterConectionDetails?.proposedTaps, - "proposedPipeSize": formData?.waterConectionDetails?.proposedPipeSize?.code, - "proposedWaterClosets": parseInt(proposedWaterClosets), - "proposedToilets": parseInt(proposedToilets), - "connectionHolders": formData?.ConnectionHolderDetails?.isOwnerSame ? null : [{ - correspondenceAddress: formData?.ConnectionHolderDetails?.address, - fatherOrHusbandName: formData?.ConnectionHolderDetails?.guardian, - gender: formData?.ConnectionHolderDetails?.gender?.code, - mobileNumber: formData?.ConnectionHolderDetails?.mobileNumber, - name: formData?.ConnectionHolderDetails?.name, - ownerType: formData?.ConnectionHolderDetails?.specialCategoryType?.code || "NONE", - relationship: formData?.ConnectionHolderDetails?.relationship?.code, - sameAsPropertyAddress: false, - }], - "service": "Water and Sewerage", - "roadCuttingArea": null, - "noOfTaps": null, - "noOfWaterClosets": null, - "noOfToilets": null, - "propertyId": formData?.cptId?.id || formData?.cpt?.details?.propertyId, - "additionalDetails": { - "initialMeterReading": null, - "detailsProvidedBy": "", - "locality": formData?.cpt?.details?.address?.locality?.code, - }, - "tenantId": formData?.cpt?.details?.tenantId, - "processInstance": { - "action": "INITIATE" - }, - "channel": "CITIZEN" - }, - reconnectRequest:false, disconnectRequest:false - } - } - - Digit.WSService.create(payload1, "WATER") - .then((result1, err) => { - Digit.WSService.create(payload2, "SEWERAGE") - .then((result2, err) => { - setIsDisableForNext(false); - let data = {...formData,WaterConnectionResult: result1, SewerageConnectionResult: result2, sewerageConnectionDetails : {proposedWaterClosets : proposedWaterClosets, proposedToilets : proposedToilets} } - //1, units - onSelect("", data, "", true); - - }) - .catch((e) => { - setIsDisableForNext(false); - setShowToast({ key: "error" }); - setError(e?.response?.data?.Errors[0]?.message || null); - }); - }) - .catch((e) => { - setIsDisableForNext(false); - setShowToast({ key: "error" }); - setError(e?.response?.data?.Errors[0]?.message || null); - }); - } - else { - let details = {}; - details.proposedWaterClosets = proposedWaterClosets; - details.proposedToilets = proposedToilets; - onSelect(config.key, details); - } - }; - - return ( -
- {userType === "citizen" && ()} - - {t("WS_NO_OF_WATER_CLOSETS")}* - - {t("WS_SERV_DETAIL_NO_OF_TOILETS")}* - - - {showToast && { setShowToast(null); setError(null); }} />} -
- ); -} - +import React, { useState } from "react"; +import { + FormStep, + TextInput, + CardLabel, + Toast +} from "@egovernments/digit-ui-react-components"; +import Timeline from "../components/Timeline"; + +const WSSewerageConnectionDetails = ({ t, config, userType, onSelect, formData }) => { + const [proposedWaterClosets, setProposedWaterClosets] = useState(formData?.sewerageConnectionDetails?.proposedWaterClosets || ""); + const [proposedToilets, setProposedToilets] = useState(formData?.sewerageConnectionDetails?.proposedToilets || ""); + const [isDisableForNext, setIsDisableForNext] = useState(false); + const [showToast, setShowToast] = useState(null); + const [error, setError] = useState(null); + let validation = {}; + + function onAdd() { } + + function setNumberOfProposedWaterClosets(e) { + setProposedWaterClosets(e.target.value); + } + + function setNumberOfProposedToilets(e) { + setProposedToilets(e.target.value); + } + + const onSkip = () => onSelect(); + + const handleSubmit = () => { + + if ((!(formData?.SewerageConnectionResult && formData?.SewerageConnectionResult?.SewerageConnections?.[0]?.id) || formData?.isModifyConnection) && formData?.serviceName?.code === "SEWERAGE") { + setIsDisableForNext(true); + let payload = {}; + if(formData?.isModifyConnection) + { + payload = { + "SewerageConnection":{...formData?.SewerageConnectionResult?.SewerageConnections?.[0], + "processInstance": { + "action": "INITIATE" + }, + "channel": "CITIZEN" + }, + reconnectRequest:false, disconnectRequest:false + } + } + else{ + payload = { + "SewerageConnection": { + "water": false, + "sewerage": true, + "property": {...formData?.cpt?.details}, + "proposedTaps": null, + "proposedPipeSize": null, + "proposedWaterClosets": parseInt(proposedWaterClosets), + "proposedToilets": parseInt(proposedToilets), + "connectionHolders": formData?.ConnectionHolderDetails?.isOwnerSame ? null : [{ + correspondenceAddress: formData?.ConnectionHolderDetails?.address, + fatherOrHusbandName: formData?.ConnectionHolderDetails?.guardian, + gender: formData?.ConnectionHolderDetails?.gender?.code, + mobileNumber: formData?.ConnectionHolderDetails?.mobileNumber, + name: formData?.ConnectionHolderDetails?.name, + ownerType: formData?.ConnectionHolderDetails?.specialCategoryType?.code || "NONE", + relationship: formData?.ConnectionHolderDetails?.relationship?.code, + sameAsPropertyAddress: false, + }], + "service": "Sewerage", + "roadCuttingArea": null, + "noOfTaps": null, + "noOfWaterClosets": null, + "noOfToilets": null, + "propertyId": formData?.cptId?.id || formData?.cpt?.details?.propertyId, + "additionalDetails": { + "initialMeterReading": null, + "detailsProvidedBy": "", + "locality": formData?.cpt?.details?.address?.locality?.code, + }, + "tenantId": formData?.cpt?.details?.tenantId, + "processInstance": { + "action": "INITIATE" + }, + "channel": "CITIZEN" + }, + reconnectRequest:false, disconnectRequest:false + } + } + + Digit.WSService.create(payload, "SEWERAGE") + .then((result, err) => { + setIsDisableForNext(false); + let data = {...formData, SewerageConnectionResult: result, sewerageConnectionDetails : {proposedWaterClosets : proposedWaterClosets, proposedToilets : proposedToilets} } + //1, units + onSelect("", data, "", true); + + }) + .catch((e) => { + setIsDisableForNext(false); + setShowToast({ key: "error" }); + setError(e?.response?.data?.Errors[0]?.message || null); + }); + } + else if ((!(formData?.SewerageConnectionResult && formData?.SewerageConnectionResult?.SewerageConnection?.id) && !(formData?.WaterConnectionResult && formData?.WaterConnectionResult?.WaterConnection?.id) || formData?.isModifyConnection) && formData?.serviceName?.code === "BOTH"){ + setIsDisableForNext(true); + let payload1 = {}; + if(formData?.isModifyConnection) + { + payload = { + "WaterConnection":{...formData?.WaterConnectionResult?.WaterConnection?.[0], + "processInstance": { + "action": "INITIATE" + }, + "channel": "CITIZEN" + }, + reconnectRequest:false, disconnectRequest:false + } + } + else{ + payload1 = { + "WaterConnection": { + "water": true, + "sewerage": true, + "property": {...formData?.cpt?.details}, + "proposedTaps": formData?.waterConectionDetails?.proposedTaps, + "proposedPipeSize": formData?.waterConectionDetails?.proposedPipeSize?.code, + "proposedWaterClosets": parseInt(proposedWaterClosets), + "proposedToilets": parseInt(proposedToilets), + "connectionHolders": formData?.ConnectionHolderDetails?.isOwnerSame ? null : [{ + correspondenceAddress: formData?.ConnectionHolderDetails?.address, + fatherOrHusbandName: formData?.ConnectionHolderDetails?.guardian, + gender: formData?.ConnectionHolderDetails?.gender?.code, + mobileNumber: formData?.ConnectionHolderDetails?.mobileNumber, + name: formData?.ConnectionHolderDetails?.name, + ownerType: formData?.ConnectionHolderDetails?.specialCategoryType?.code || "NONE", + relationship: formData?.ConnectionHolderDetails?.relationship?.code, + sameAsPropertyAddress: false, + }], + "service": "Water and Sewerage", + "roadCuttingArea": null, + "noOfTaps": null, + "noOfWaterClosets": null, + "noOfToilets": null, + "propertyId": formData?.cptId?.id || formData?.cpt?.details?.propertyId, + "additionalDetails": { + "initialMeterReading": null, + "detailsProvidedBy": "", + "locality": formData?.cpt?.details?.address?.locality?.code, + }, + "tenantId": formData?.cpt?.details?.tenantId, + "processInstance": { + "action": "INITIATE" + }, + "channel": "CITIZEN" + }, + reconnectRequest:false, disconnectRequest:false + } + } + + let payload2 = {}; + if(formData?.isModifyConnection) + { + payload2 = { + "SewerageConnection":{...formData?.SewerageConnectionResult?.SewerageConnections?.[0], + "processInstance": { + "action": "INITIATE" + }, + "channel": "CITIZEN" + }, + reconnectRequest:false, disconnectRequest:false + } + } + else{ + payload2 = { + "SewerageConnection": { + "water": true, + "sewerage": true, + "property": {...formData?.cpt?.details}, + "proposedTaps": formData?.waterConectionDetails?.proposedTaps, + "proposedPipeSize": formData?.waterConectionDetails?.proposedPipeSize?.code, + "proposedWaterClosets": parseInt(proposedWaterClosets), + "proposedToilets": parseInt(proposedToilets), + "connectionHolders": formData?.ConnectionHolderDetails?.isOwnerSame ? null : [{ + correspondenceAddress: formData?.ConnectionHolderDetails?.address, + fatherOrHusbandName: formData?.ConnectionHolderDetails?.guardian, + gender: formData?.ConnectionHolderDetails?.gender?.code, + mobileNumber: formData?.ConnectionHolderDetails?.mobileNumber, + name: formData?.ConnectionHolderDetails?.name, + ownerType: formData?.ConnectionHolderDetails?.specialCategoryType?.code || "NONE", + relationship: formData?.ConnectionHolderDetails?.relationship?.code, + sameAsPropertyAddress: false, + }], + "service": "Water and Sewerage", + "roadCuttingArea": null, + "noOfTaps": null, + "noOfWaterClosets": null, + "noOfToilets": null, + "propertyId": formData?.cptId?.id || formData?.cpt?.details?.propertyId, + "additionalDetails": { + "initialMeterReading": null, + "detailsProvidedBy": "", + "locality": formData?.cpt?.details?.address?.locality?.code, + }, + "tenantId": formData?.cpt?.details?.tenantId, + "processInstance": { + "action": "INITIATE" + }, + "channel": "CITIZEN" + }, + reconnectRequest:false, disconnectRequest:false + } + } + + Digit.WSService.create(payload1, "WATER") + .then((result1, err) => { + Digit.WSService.create(payload2, "SEWERAGE") + .then((result2, err) => { + setIsDisableForNext(false); + let data = {...formData,WaterConnectionResult: result1, SewerageConnectionResult: result2, sewerageConnectionDetails : {proposedWaterClosets : proposedWaterClosets, proposedToilets : proposedToilets} } + //1, units + onSelect("", data, "", true); + + }) + .catch((e) => { + setIsDisableForNext(false); + setShowToast({ key: "error" }); + setError(e?.response?.data?.Errors[0]?.message || null); + }); + }) + .catch((e) => { + setIsDisableForNext(false); + setShowToast({ key: "error" }); + setError(e?.response?.data?.Errors[0]?.message || null); + }); + } + else { + let details = {}; + details.proposedWaterClosets = proposedWaterClosets; + details.proposedToilets = proposedToilets; + onSelect(config.key, details); + } + }; + + return ( +
+ {userType === "citizen" && ()} + + {t("WS_NO_OF_WATER_CLOSETS")}* + + {t("WS_SERV_DETAIL_NO_OF_TOILETS")}* + + + {showToast && { setShowToast(null); setError(null); }} />} +
+ ); +} + export default WSSewerageConnectionDetails; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSWaterConnectionDetails.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSWaterConnectionDetails.js old mode 100755 new mode 100644 index 3c9ecda57bf..d331e089d18 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSWaterConnectionDetails.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pageComponents/WSWaterConnectionDetails.js @@ -1,167 +1,167 @@ -import { CardLabel, Dropdown, FormStep, Loader, RadioOrSelect, TextInput, Toast } from "@egovernments/digit-ui-react-components"; -import React, { useEffect, useState } from "react"; -import Timeline from "../components/Timeline"; - -const WSWaterConnectionDetails = ({ t, config, userType, onSelect, formData }) => { - const tenantId = Digit.ULBService.getStateId(); - const [proposedTaps, setProposedTaps] = useState(formData?.waterConectionDetails?.proposedTaps || ""); - const [proposedPipeSize, setProposedPipeSize] = useState(formData?.waterConectionDetails?.proposedPipeSize || ""); - const [isDisableForNext, setIsDisableForNext] = useState(false); - const [showToast, setShowToast] = useState(null); - const [error, setError] = useState(null); - const [proposedPipeSizeList, setProposedPipeSizeList] = useState([]); - let validation = {}; - const { isLoading: wsServiceCalculationLoading, data: wsServiceCalculation } = Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesCalculation(tenantId); - - useEffect(() => { - if (wsServiceCalculation?.PipeSize?.length > 0) { - let pipeLists = []; - wsServiceCalculation?.PipeSize?.forEach((type) => { - pipeLists.push({ - i18nKey: `${type.size} ${t("WS_INCHES_LABEL")}`, - code: type.size, - id: type.id, - size: type.size, - }); - }); - setProposedPipeSizeList(pipeLists); - } - }, [wsServiceCalculation]); - - function onAdd() {} - - function setNumberOfProposedTaps(e) { - setProposedTaps(e.target.value); - } - - function setProposedPipeSizeSelect(value) { - setProposedPipeSize(value); - } - - const onSkip = () => onSelect(); - - const handleSubmit = () => { - - if (!(formData?.WaterConnectionResult && formData?.WaterConnectionResult?.WaterConnection?.[0]?.id) && formData?.serviceName?.code === "WATER" || formData?.isModifyConnection) { - setIsDisableForNext(true); - let payload = {}; - if(formData?.isModifyConnection) - { - payload = { - "WaterConnection":{...formData?.WaterConnectionResult?.WaterConnection?.[0], - "processInstance": { - "action": "INITIATE" - }, - "channel": "CITIZEN" - }, - reconnectRequest:false, disconnectRequest:false - } - } - else{ - payload = { - "WaterConnection": { - "water": true, - "sewerage": false, - "property": {...formData?.cpt?.details}, - "proposedTaps": proposedTaps, - "proposedPipeSize": proposedPipeSize?.code, - "proposedWaterClosets": null, - "proposedToilets": null, - "connectionHolders": formData?.ConnectionHolderDetails?.isOwnerSame ? null : [{ - correspondenceAddress: formData?.ConnectionHolderDetails?.address, - fatherOrHusbandName: formData?.ConnectionHolderDetails?.guardian, - gender: formData?.ConnectionHolderDetails?.gender?.code, - mobileNumber: formData?.ConnectionHolderDetails?.mobileNumber, - name: formData?.ConnectionHolderDetails?.name, - ownerType: formData?.ConnectionHolderDetails?.specialCategoryType?.code || "NONE", - relationship: formData?.ConnectionHolderDetails?.relationship?.code, - sameAsPropertyAddress: false, - }], - "service": "Water", - "roadCuttingArea": null, - "noOfTaps": null, - "noOfWaterClosets": null, - "noOfToilets": null, - "propertyId": formData?.cptId?.id || formData?.cpt?.details?.propertyId, - "additionalDetails": { - "initialMeterReading": null, - "detailsProvidedBy": "", - "locality": formData?.cpt?.details?.address?.locality?.code - }, - "tenantId": formData?.cpt?.details?.tenantId, - "processInstance": { - "action": "INITIATE" - }, - "channel": "CITIZEN" - }, - reconnectRequest:false, disconnectRequest:false - } - } - - Digit.WSService.create(payload, "WATER") - .then((result, err) => { - setIsDisableForNext(false); - let data = {...formData, WaterConnectionResult: result, waterConectionDetails : {proposedTaps : proposedTaps, proposedPipeSize : proposedPipeSize} } - //1, units - onSelect("", data, "", true); - - }) - .catch((e) => { - setIsDisableForNext(false); - setShowToast({ key: "error" }); - setError(e?.response?.data?.Errors[0]?.message || null); - }); - } - else { - - let details = {}; - details.proposedTaps = proposedTaps; - details.proposedPipeSize = proposedPipeSize; - onSelect(config.key, details); - - } - }; - - return ( -
- {userType === "citizen" && } - {!wsServiceCalculationLoading ? ( - - {t("WS_NO_OF_TAPS_PROPOSED")}* - - {t("WS_PROPOSED_PIPE_SIZE")}* - - {/* {t("WS_NO_OF_PROPOSED_WATER_CLOSETS")}: - - - {t("WS_NO_OF_PROPOSED_TOILETS")}: */} - - ) : ( - - )} - {showToast && { setShowToast(null); setError(null); }} />} -
- ); -}; - -export default WSWaterConnectionDetails; +import { CardLabel, Dropdown, FormStep, Loader, RadioOrSelect, TextInput, Toast } from "@egovernments/digit-ui-react-components"; +import React, { useEffect, useState } from "react"; +import Timeline from "../components/Timeline"; + +const WSWaterConnectionDetails = ({ t, config, userType, onSelect, formData }) => { + const tenantId = Digit.ULBService.getStateId(); + const [proposedTaps, setProposedTaps] = useState(formData?.waterConectionDetails?.proposedTaps || ""); + const [proposedPipeSize, setProposedPipeSize] = useState(formData?.waterConectionDetails?.proposedPipeSize || ""); + const [isDisableForNext, setIsDisableForNext] = useState(false); + const [showToast, setShowToast] = useState(null); + const [error, setError] = useState(null); + const [proposedPipeSizeList, setProposedPipeSizeList] = useState([]); + let validation = {}; + const { isLoading: wsServiceCalculationLoading, data: wsServiceCalculation } = Digit.Hooks.ws.WSSearchMdmsTypes.useWSServicesCalculation(tenantId); + + useEffect(() => { + if (wsServiceCalculation?.PipeSize?.length > 0) { + let pipeLists = []; + wsServiceCalculation?.PipeSize?.forEach((type) => { + pipeLists.push({ + i18nKey: `${type.size} ${t("WS_INCHES_LABEL")}`, + code: type.size, + id: type.id, + size: type.size, + }); + }); + setProposedPipeSizeList(pipeLists); + } + }, [wsServiceCalculation]); + + function onAdd() {} + + function setNumberOfProposedTaps(e) { + setProposedTaps(e.target.value); + } + + function setProposedPipeSizeSelect(value) { + setProposedPipeSize(value); + } + + const onSkip = () => onSelect(); + + const handleSubmit = () => { + + if (!(formData?.WaterConnectionResult && formData?.WaterConnectionResult?.WaterConnection?.[0]?.id) && formData?.serviceName?.code === "WATER" || formData?.isModifyConnection) { + setIsDisableForNext(true); + let payload = {}; + if(formData?.isModifyConnection) + { + payload = { + "WaterConnection":{...formData?.WaterConnectionResult?.WaterConnection?.[0], + "processInstance": { + "action": "INITIATE" + }, + "channel": "CITIZEN" + }, + reconnectRequest:false, disconnectRequest:false + } + } + else{ + payload = { + "WaterConnection": { + "water": true, + "sewerage": false, + "property": {...formData?.cpt?.details}, + "proposedTaps": proposedTaps, + "proposedPipeSize": proposedPipeSize?.code, + "proposedWaterClosets": null, + "proposedToilets": null, + "connectionHolders": formData?.ConnectionHolderDetails?.isOwnerSame ? null : [{ + correspondenceAddress: formData?.ConnectionHolderDetails?.address, + fatherOrHusbandName: formData?.ConnectionHolderDetails?.guardian, + gender: formData?.ConnectionHolderDetails?.gender?.code, + mobileNumber: formData?.ConnectionHolderDetails?.mobileNumber, + name: formData?.ConnectionHolderDetails?.name, + ownerType: formData?.ConnectionHolderDetails?.specialCategoryType?.code || "NONE", + relationship: formData?.ConnectionHolderDetails?.relationship?.code, + sameAsPropertyAddress: false, + }], + "service": "Water", + "roadCuttingArea": null, + "noOfTaps": null, + "noOfWaterClosets": null, + "noOfToilets": null, + "propertyId": formData?.cptId?.id || formData?.cpt?.details?.propertyId, + "additionalDetails": { + "initialMeterReading": null, + "detailsProvidedBy": "", + "locality": formData?.cpt?.details?.address?.locality?.code + }, + "tenantId": formData?.cpt?.details?.tenantId, + "processInstance": { + "action": "INITIATE" + }, + "channel": "CITIZEN" + }, + reconnectRequest:false, disconnectRequest:false + } + } + + Digit.WSService.create(payload, "WATER") + .then((result, err) => { + setIsDisableForNext(false); + let data = {...formData, WaterConnectionResult: result, waterConectionDetails : {proposedTaps : proposedTaps, proposedPipeSize : proposedPipeSize} } + //1, units + onSelect("", data, "", true); + + }) + .catch((e) => { + setIsDisableForNext(false); + setShowToast({ key: "error" }); + setError(e?.response?.data?.Errors[0]?.message || null); + }); + } + else { + + let details = {}; + details.proposedTaps = proposedTaps; + details.proposedPipeSize = proposedPipeSize; + onSelect(config.key, details); + + } + }; + + return ( +
+ {userType === "citizen" && } + {!wsServiceCalculationLoading ? ( + + {t("WS_NO_OF_TAPS_PROPOSED")}* + + {t("WS_PROPOSED_PIPE_SIZE")}* + + {/* {t("WS_NO_OF_PROPOSED_WATER_CLOSETS")}: + + + {t("WS_NO_OF_PROPOSED_TOILETS")}: */} + + ) : ( + + )} + {showToast && { setShowToast(null); setError(null); }} />} +
+ ); +}; + +export default WSWaterConnectionDetails; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditApplication/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditApplication/index.js old mode 100755 new mode 100644 index 2473f4e582e..a7a717890fc --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditApplication/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditApplication/index.js @@ -1,173 +1,173 @@ -import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; -import React, { useState, useEffect } from "react"; -import { useTranslation } from "react-i18next"; -import { useLocation, useHistory } from "react-router-dom"; -import * as func from "../../../utils"; -import _ from "lodash"; -import { newConfig as newConfigLocal } from "../../../config/wsCreateConfig"; -import { convertApplicationData, convertEditApplicationDetails } from "../../../utils"; -import cloneDeep from "lodash/cloneDeep"; - -const EditApplication = () => { - const { t } = useTranslation(); - let { state } = useLocation(); - state = state ? (typeof(state) === "string" ? JSON.parse(state) : state) : {}; - const history = useHistory(); - let filters = func.getQueryStringParams(location.search); - const [canSubmit, setSubmitValve] = useState(false); - const [showToast, setShowToast] = useState(null); - const [appData, setAppData] = useState({}); - const [config, setConfig] = useState({ head: "", body: [] }); - const [enabledLoader, setEnabledLoader] = useState(true); - const [isAppDetailsPage, setIsAppDetailsPage] = useState(false); - - let tenantId = Digit.ULBService.getCurrentTenantId(); - tenantId ? tenantId : Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; - - const applicationNumber = filters?.applicationNumber; - const editApplicationDetails = JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")); - const serviceType = filters?.service || editApplicationDetails?.applicationData?.serviceType; - - let details = cloneDeep(state?.data?.applicationDetails); - const actionData = cloneDeep(state?.data?.action); - - const stateId = Digit.ULBService.getStateId(); - let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}); - - let { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.ws.useWSDetailsPage(t, tenantId, details?.applicationNo, details?.applicationData?.serviceType,{privacy : Digit.Utils.getPrivacyObject() }); - details = applicationDetails; - const [propertyId, setPropertyId] = useState(new URLSearchParams(useLocation().search).get("propertyId")); - - const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); - - const { data: propertyDetails } = Digit.Hooks.pt.usePropertySearch( - { filters: { propertyIds: propertyId }, tenantId: tenantId }, - { filters: { propertyIds: propertyId }, tenantId: tenantId, enabled: propertyId && propertyId != "" ? true : false, privacy : Digit.Utils.getPrivacyObject() } - ); - - useEffect(() => { - if (!isConfigLoading) { - // const config = newConfigLocal.find((conf) => conf.hideInCitizen && conf.isEdit); - const config = newConfig.find((conf) => conf.hideInCitizen && conf.isEdit); - config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL"; - let bodyDetails = []; - config?.body?.forEach(data => { if (data?.isEditConnection) bodyDetails.push(data); }) - config.body = bodyDetails; - setConfig(config); - } - }, [newConfig]); - - useEffect(() => { - !propertyId && sessionFormData?.cpt?.details?.propertyId && setPropertyId(sessionFormData?.cpt?.details?.propertyId); - }, [sessionFormData?.cpt]); - - useEffect(async () => { - const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false - if (details?.applicationData?.id && !IsDetailsExists) { - sessionStorage.setItem("appData",JSON.stringify(appData)); - const convertAppData = await convertApplicationData(details, serviceType, false, false, t); - setSessionFormData({ ...sessionFormData, ...convertAppData }); - setAppData({ ...convertAppData }) - sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); - } - }, [details,applicationDetails,sessionFormData?.cpt, sessionFormData, propertyDetails]); - - useEffect(() => { - setSessionFormData({ ...sessionFormData, cpt: { details: propertyDetails?.Properties?.[0] } }); - }, [propertyDetails]); - - useEffect(() => { - if (sessionFormData?.DocumentsRequired?.documents?.length > 0 || sessionFormData?.ConnectionDetails?.[0]?.water || sessionFormData?.ConnectionDetails?.[0]?.sewerage || sessionFormData?.cpt?.details && !isLoading) { - setEnabledLoader(false); - } - }, [propertyDetails, sessionFormData, sessionFormData?.cpt]); - - useEffect(() => { - const timer = setTimeout(() => { - if (isAppDetailsPage) window.location.href = `${window.location.origin}/digit-ui/employee/ws/application-details?applicationNumber=${sessionFormData?.ConnectionDetails?.[0]?.applicationNo}&service=${sessionFormData?.ConnectionDetails?.[0]?.serviceName?.toUpperCase()}` - }, 5000); - return () => clearTimeout(timer); - }, [isAppDetailsPage]); - - const { - isLoading: updatingApplication, - isError: updateApplicationError, - data: updateResponse, - error: updateError, - mutate, - } = Digit.Hooks.ws.useWSApplicationActions(serviceType); - - const onFormValueChange = (setValue, formData, formState) => { - if (!_.isEqual(sessionFormData, formData)) { - setSessionFormData({ ...sessionFormData, ...formData }); - } - if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); - else setSubmitValve(!(Object.keys(formState.errors).length)); - }; - - const onSubmit = async (data) => { - if(!canSubmit){ - setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); - setTimeout(() => { - setShowToast(false); - }, 3000); - } - else{ - const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; - let convertAppData = await convertEditApplicationDetails(data, details, actionData); - const reqDetails = data?.ConnectionDetails?.[0]?.serviceName == "WATER" ? { WaterConnection: convertAppData } : { SewerageConnection: convertAppData } - setSubmitValve(false); - - if (details?.processInstancesDetails?.[0]?.state?.applicationStatus?.includes("CITIZEN_ACTION")) { - if (mutate) { - mutate(reqDetails, { - onError: (error, variables) => { - setShowToast({ key: "error", message: error?.message ? error.message : error }); - setTimeout(closeToastOfError, 5000); - setSubmitValve(true); - }, - onSuccess: (data, variables) => { - setShowToast({ key: false, message: "WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL" }); - setIsAppDetailsPage(true); - // setTimeout(closeToast(), 5000); - }, - }); - } - } else { - sessionStorage.setItem("redirectedfromEDIT", true); - sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS", JSON.stringify(convertAppData)); - window.location.assign(`${window.location.origin}${state?.url}`); - } - } - }; - - - const closeToast = () => { - setShowToast(null); - }; - - if (enabledLoader || isConfigLoading) { - return ; - } - - return ( - -
-
{t(config.head)}
-
- - {showToast && } -
- ); -}; - -export default EditApplication; +import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; +import React, { useState, useEffect } from "react"; +import { useTranslation } from "react-i18next"; +import { useLocation, useHistory } from "react-router-dom"; +import * as func from "../../../utils"; +import _ from "lodash"; +import { newConfig as newConfigLocal } from "../../../config/wsCreateConfig"; +import { convertApplicationData, convertEditApplicationDetails } from "../../../utils"; +import cloneDeep from "lodash/cloneDeep"; + +const EditApplication = () => { + const { t } = useTranslation(); + let { state } = useLocation(); + state = state ? (typeof(state) === "string" ? JSON.parse(state) : state) : {}; + const history = useHistory(); + let filters = func.getQueryStringParams(location.search); + const [canSubmit, setSubmitValve] = useState(false); + const [showToast, setShowToast] = useState(null); + const [appData, setAppData] = useState({}); + const [config, setConfig] = useState({ head: "", body: [] }); + const [enabledLoader, setEnabledLoader] = useState(true); + const [isAppDetailsPage, setIsAppDetailsPage] = useState(false); + + let tenantId = Digit.ULBService.getCurrentTenantId(); + tenantId ? tenantId : Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; + + const applicationNumber = filters?.applicationNumber; + const editApplicationDetails = JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")); + const serviceType = filters?.service || editApplicationDetails?.applicationData?.serviceType; + + let details = cloneDeep(state?.data?.applicationDetails); + const actionData = cloneDeep(state?.data?.action); + + const stateId = Digit.ULBService.getStateId(); + let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}); + + let { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.ws.useWSDetailsPage(t, tenantId, details?.applicationNo, details?.applicationData?.serviceType,{privacy : Digit.Utils.getPrivacyObject() }); + details = applicationDetails; + const [propertyId, setPropertyId] = useState(new URLSearchParams(useLocation().search).get("propertyId")); + + const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); + + const { data: propertyDetails } = Digit.Hooks.pt.usePropertySearch( + { filters: { propertyIds: propertyId }, tenantId: tenantId }, + { filters: { propertyIds: propertyId }, tenantId: tenantId, enabled: propertyId && propertyId != "" ? true : false, privacy : Digit.Utils.getPrivacyObject() } + ); + + useEffect(() => { + if (!isConfigLoading) { + // const config = newConfigLocal.find((conf) => conf.hideInCitizen && conf.isEdit); + const config = newConfig.find((conf) => conf.hideInCitizen && conf.isEdit); + config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL"; + let bodyDetails = []; + config?.body?.forEach(data => { if (data?.isEditConnection) bodyDetails.push(data); }) + config.body = bodyDetails; + setConfig(config); + } + }, [newConfig]); + + useEffect(() => { + !propertyId && sessionFormData?.cpt?.details?.propertyId && setPropertyId(sessionFormData?.cpt?.details?.propertyId); + }, [sessionFormData?.cpt]); + + useEffect(async () => { + const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false + if (details?.applicationData?.id && !IsDetailsExists) { + sessionStorage.setItem("appData",JSON.stringify(appData)); + const convertAppData = await convertApplicationData(details, serviceType, false, false, t); + setSessionFormData({ ...sessionFormData, ...convertAppData }); + setAppData({ ...convertAppData }) + sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); + } + }, [details,applicationDetails,sessionFormData?.cpt, sessionFormData, propertyDetails]); + + useEffect(() => { + setSessionFormData({ ...sessionFormData, cpt: { details: propertyDetails?.Properties?.[0] } }); + }, [propertyDetails]); + + useEffect(() => { + if (sessionFormData?.DocumentsRequired?.documents?.length > 0 || sessionFormData?.ConnectionDetails?.[0]?.water || sessionFormData?.ConnectionDetails?.[0]?.sewerage || sessionFormData?.cpt?.details && !isLoading) { + setEnabledLoader(false); + } + }, [propertyDetails, sessionFormData, sessionFormData?.cpt]); + + useEffect(() => { + const timer = setTimeout(() => { + if (isAppDetailsPage) window.location.href = `${window.location.origin}/digit-ui/employee/ws/application-details?applicationNumber=${sessionFormData?.ConnectionDetails?.[0]?.applicationNo}&service=${sessionFormData?.ConnectionDetails?.[0]?.serviceName?.toUpperCase()}` + }, 5000); + return () => clearTimeout(timer); + }, [isAppDetailsPage]); + + const { + isLoading: updatingApplication, + isError: updateApplicationError, + data: updateResponse, + error: updateError, + mutate, + } = Digit.Hooks.ws.useWSApplicationActions(serviceType); + + const onFormValueChange = (setValue, formData, formState) => { + if (!_.isEqual(sessionFormData, formData)) { + setSessionFormData({ ...sessionFormData, ...formData }); + } + if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); + else setSubmitValve(!(Object.keys(formState.errors).length)); + }; + + const onSubmit = async (data) => { + if(!canSubmit){ + setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); + setTimeout(() => { + setShowToast(false); + }, 3000); + } + else{ + const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; + let convertAppData = await convertEditApplicationDetails(data, details, actionData); + const reqDetails = data?.ConnectionDetails?.[0]?.serviceName == "WATER" ? { WaterConnection: convertAppData } : { SewerageConnection: convertAppData } + setSubmitValve(false); + + if (details?.processInstancesDetails?.[0]?.state?.applicationStatus?.includes("CITIZEN_ACTION")) { + if (mutate) { + mutate(reqDetails, { + onError: (error, variables) => { + setShowToast({ key: "error", message: error?.message ? error.message : error }); + setTimeout(closeToastOfError, 5000); + setSubmitValve(true); + }, + onSuccess: (data, variables) => { + setShowToast({ key: false, message: "WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL" }); + setIsAppDetailsPage(true); + // setTimeout(closeToast(), 5000); + }, + }); + } + } else { + sessionStorage.setItem("redirectedfromEDIT", true); + sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS", JSON.stringify(convertAppData)); + window.location.assign(`${window.location.origin}${state?.url}`); + } + } + }; + + + const closeToast = () => { + setShowToast(null); + }; + + if (enabledLoader || isConfigLoading) { + return ; + } + + return ( + +
+
{t(config.head)}
+
+ + {showToast && } +
+ ); +}; + +export default EditApplication; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/EditDisconnectionByConfig.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/EditDisconnectionByConfig.js old mode 100755 new mode 100644 index f315914b316..447584a9377 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/EditDisconnectionByConfig.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/EditDisconnectionByConfig.js @@ -1,117 +1,117 @@ -import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; -import React, { useState, useEffect } from "react"; -import { useTranslation } from "react-i18next"; -import { useLocation } from "react-router-dom"; -import * as func from "../../../utils"; -import _ from "lodash"; -import { newConfig as newConfigLocal } from "../../../config/wsDisconnectionConfig"; -import { convertDisonnectEditApplicationDetails, convertDisonnectApplicationData } from "../../../utils"; -import cloneDeep from "lodash/cloneDeep"; - -const EditDisconnectionByConfig = () => { - const { t } = useTranslation(); - let { state } = useLocation(); - state = state ? (typeof (state) === "string" ? JSON.parse(state) : state) : {}; - let filters = func.getQueryStringParams(location.search); - const [canSubmit, setSubmitValve] = useState(false); - const [showToast, setShowToast] = useState(null); - const [appData, setAppData] = useState({}); - const [config, setConfig] = useState({ head: "", body: [] }); - - let tenantId = Digit.ULBService.getCurrentTenantId(); - tenantId ? tenantId : Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; - - const editApplicationDetails = JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")); - const serviceType = filters?.service || editApplicationDetails?.applicationData?.serviceType; - - const stateId = Digit.ULBService.getStateId(); - let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSDisconnectionConfig(stateId, {}); - - let details = cloneDeep(state?.data?.applicationDetails); - const actionData = cloneDeep(state?.data?.action); - let { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.ws.useDisConnectionDetails(t, tenantId, details?.applicationNo, details?.applicationData?.serviceType, { privacy: Digit.Utils.getPrivacyObject() }); - - details = applicationDetails; - - const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); - - useEffect(() => { - if (!isLoading && !isConfigLoading) { - // const config = newConfigLocal.find((conf) => conf.isDisonnectionEdit); - const config = newConfig.find((conf) => conf.isDisonnectionEdit); - config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL"; - let bodyDetails = []; - config?.body?.forEach(data => { if (data?.isDisonnectionEditByConfig) bodyDetails.push(data); }) - config.body = bodyDetails; - setConfig(config); - } - }, [applicationDetails, isLoading, newConfig]); - - useEffect(async () => { - const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false - if (details?.applicationData?.id && !IsDetailsExists) { - const convertAppData = await convertDisonnectApplicationData(details, serviceType, true, t); - setSessionFormData({ ...sessionFormData, ...convertAppData }); - setAppData({ ...convertAppData }) - sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); - } - }, [details, applicationDetails, sessionFormData]); - - const onFormValueChange = (setValue, formData, formState) => { - if (!_.isEqual(sessionFormData, formData)) { - setSessionFormData({ ...sessionFormData, ...formData }); - } - if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); - else setSubmitValve(!(Object.keys(formState.errors).length)); - }; - - const onSubmit = async (data) => { - if(!canSubmit){ - setShowToast({ warning: true, message: "Please fill mandatory details" }); - setTimeout(() => { - setShowToast(false); - }, 3000); - } - else{ - const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; - let convertAppData = await convertDisonnectEditApplicationDetails(data, details, actionData); - setSubmitValve(false); - sessionStorage.setItem("redirectedfromEDIT", true); - sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS", JSON.stringify(convertAppData)); - window.location.assign(`${window.location.origin}${state?.url}`); - } - }; - - - const closeToast = () => { - setShowToast(null); - }; - - const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false - if (isLoading || !IsDetailsExists || isConfigLoading) { - return ; - } - - return ( - -
-
{t(config.head)}
-
- - {showToast && } -
- ); -}; - -export default EditDisconnectionByConfig; - +import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; +import React, { useState, useEffect } from "react"; +import { useTranslation } from "react-i18next"; +import { useLocation } from "react-router-dom"; +import * as func from "../../../utils"; +import _ from "lodash"; +import { newConfig as newConfigLocal } from "../../../config/wsDisconnectionConfig"; +import { convertDisonnectEditApplicationDetails, convertDisonnectApplicationData } from "../../../utils"; +import cloneDeep from "lodash/cloneDeep"; + +const EditDisconnectionByConfig = () => { + const { t } = useTranslation(); + let { state } = useLocation(); + state = state ? (typeof (state) === "string" ? JSON.parse(state) : state) : {}; + let filters = func.getQueryStringParams(location.search); + const [canSubmit, setSubmitValve] = useState(false); + const [showToast, setShowToast] = useState(null); + const [appData, setAppData] = useState({}); + const [config, setConfig] = useState({ head: "", body: [] }); + + let tenantId = Digit.ULBService.getCurrentTenantId(); + tenantId ? tenantId : Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; + + const editApplicationDetails = JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")); + const serviceType = filters?.service || editApplicationDetails?.applicationData?.serviceType; + + const stateId = Digit.ULBService.getStateId(); + let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSDisconnectionConfig(stateId, {}); + + let details = cloneDeep(state?.data?.applicationDetails); + const actionData = cloneDeep(state?.data?.action); + let { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.ws.useDisConnectionDetails(t, tenantId, details?.applicationNo, details?.applicationData?.serviceType, { privacy: Digit.Utils.getPrivacyObject() }); + + details = applicationDetails; + + const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); + + useEffect(() => { + if (!isLoading && !isConfigLoading) { + // const config = newConfigLocal.find((conf) => conf.isDisonnectionEdit); + const config = newConfig.find((conf) => conf.isDisonnectionEdit); + config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL"; + let bodyDetails = []; + config?.body?.forEach(data => { if (data?.isDisonnectionEditByConfig) bodyDetails.push(data); }) + config.body = bodyDetails; + setConfig(config); + } + }, [applicationDetails, isLoading, newConfig]); + + useEffect(async () => { + const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false + if (details?.applicationData?.id && !IsDetailsExists) { + const convertAppData = await convertDisonnectApplicationData(details, serviceType, true, t); + setSessionFormData({ ...sessionFormData, ...convertAppData }); + setAppData({ ...convertAppData }) + sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); + } + }, [details, applicationDetails, sessionFormData]); + + const onFormValueChange = (setValue, formData, formState) => { + if (!_.isEqual(sessionFormData, formData)) { + setSessionFormData({ ...sessionFormData, ...formData }); + } + if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); + else setSubmitValve(!(Object.keys(formState.errors).length)); + }; + + const onSubmit = async (data) => { + if(!canSubmit){ + setShowToast({ warning: true, message: "Please fill mandatory details" }); + setTimeout(() => { + setShowToast(false); + }, 3000); + } + else{ + const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; + let convertAppData = await convertDisonnectEditApplicationDetails(data, details, actionData); + setSubmitValve(false); + sessionStorage.setItem("redirectedfromEDIT", true); + sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS", JSON.stringify(convertAppData)); + window.location.assign(`${window.location.origin}${state?.url}`); + } + }; + + + const closeToast = () => { + setShowToast(null); + }; + + const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false + if (isLoading || !IsDetailsExists || isConfigLoading) { + return ; + } + + return ( + +
+
{t(config.head)}
+
+ + {showToast && } +
+ ); +}; + +export default EditDisconnectionByConfig; + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/ResubmitDisconnection.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/ResubmitDisconnection.js old mode 100755 new mode 100644 index 99b169ced38..b717ec6a534 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/ResubmitDisconnection.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/ResubmitDisconnection.js @@ -1,150 +1,150 @@ -import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; -import React, { useState, useEffect } from "react"; -import { useTranslation } from "react-i18next"; -import { useLocation } from "react-router-dom"; -import * as func from "../../../utils"; -import _ from "lodash"; -import { newConfig as newConfigLocal } from "../../../config/wsDisconnectionConfig"; -import { convertDisonnectEditApplicationDetails, convertDisonnectApplicationData } from "../../../utils"; -import cloneDeep from "lodash/cloneDeep"; - -const ResubmitDisconnection = () => { - const { t } = useTranslation(); - let { state } = useLocation(); - state = state ? (typeof (state) === "string" ? JSON.parse(state) : state) : {}; - let filters = func.getQueryStringParams(location.search); - const [canSubmit, setSubmitValve] = useState(false); - const [showToast, setShowToast] = useState(null); - const [appData, setAppData] = useState({}); - const [config, setConfig] = useState({ head: "", body: [] }); - const [isAppDetailsPage, setIsAppDetailsPage] = useState(false); - - let tenantId = Digit.ULBService.getCurrentTenantId(); - tenantId ? tenantId : Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; - - const stateId = Digit.ULBService.getStateId(); - let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSDisconnectionConfig(stateId, {}); - - const editApplicationDetails = JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")); - const serviceType = filters?.service || editApplicationDetails?.applicationData?.serviceType; - - let details = cloneDeep(state?.data?.applicationDetails); - const actionData = cloneDeep(state?.data?.action); - let { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.ws.useDisConnectionDetails(t, tenantId, details?.applicationNo, details?.applicationData?.serviceType, { privacy: Digit.Utils.getPrivacyObject() }); - - details = applicationDetails; - - const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); - - const { - isLoading: updatingApplication, - isError: updateApplicationError, - data: updateResponse, - error: updateError, - mutate, - } = Digit.Hooks.ws.useWSApplicationActions(serviceType); - - useEffect(() => { - if (!isLoading && !isConfigLoading) { - // const config = newConfigLocal.find((conf) => conf.isDisonnectionEdit); - const config = newConfig.find((conf) => conf.isDisonnectionEdit); - config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL"; - let bodyDetails = []; - config?.body?.forEach(data => { if (data?.isDisonnectionEdit) bodyDetails.push(data); }) - config.body = bodyDetails; - setConfig(config); - } - }, [applicationDetails, isLoading, newConfig]); - - useEffect(async () => { - const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false - if (details?.applicationData?.id && !IsDetailsExists) { - const convertAppData = await convertDisonnectApplicationData(details, serviceType, false, t); - setSessionFormData({ ...sessionFormData, ...convertAppData }); - setAppData({ ...convertAppData }) - sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); - } - }, [details, applicationDetails, sessionFormData]); - - useEffect(() => { - const timer = setTimeout(() => { - const dataDetails = sessionStorage.getItem("disconnectionURL"); - const details = dataDetails ? JSON.parse(dataDetails) : {}; - if (isAppDetailsPage) window.location.assign(`${window.location.origin}${details?.url}`); - }, 5000); - return () => clearTimeout(timer); - }, [isAppDetailsPage]); - - const onFormValueChange = (setValue, formData, formState) => { - if (!_.isEqual(sessionFormData, formData)) { - setSessionFormData({ ...sessionFormData, ...formData }); - } - if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); - else setSubmitValve(!(Object.keys(formState.errors).length)); - }; - - const onSubmit = async (data) => { - if(!canSubmit){ - setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); - setTimeout(() => { - setShowToast(false); - }, 3000); - } - else{ - const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; - let convertAppData = await convertDisonnectEditApplicationDetails(data, details, actionData); - setSubmitValve(false); - sessionStorage.setItem("redirectedfromEDIT", true); - sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS", JSON.stringify(convertAppData)); - convertAppData.processInstance.action = "RESUBMIT_APPLICATION"; - let reqDetails = convertAppData.serviceType == "WATER" ? { WaterConnection: convertAppData } : { SewerageConnection: convertAppData } - reqDetails.disconnectRequest = true; - - if (mutate) { - mutate(reqDetails, { - onError: (error, variables) => { - setShowToast({ key: "error", message: error?.message ? error.message : error }); - setSubmitValve(true); - }, - onSuccess: (data, variables) => { - setShowToast({ key: false, message: "WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL" }); - setIsAppDetailsPage(true); - }, - }); - } - } - }; - - - const closeToast = () => { - setShowToast(null); - }; - - const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false - if (isLoading || !IsDetailsExists || isConfigLoading) { - return ; - } - - return ( - -
-
{t(config.head)}
-
- - {showToast && } -
- ); -}; - -export default ResubmitDisconnection; - +import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; +import React, { useState, useEffect } from "react"; +import { useTranslation } from "react-i18next"; +import { useLocation } from "react-router-dom"; +import * as func from "../../../utils"; +import _ from "lodash"; +import { newConfig as newConfigLocal } from "../../../config/wsDisconnectionConfig"; +import { convertDisonnectEditApplicationDetails, convertDisonnectApplicationData } from "../../../utils"; +import cloneDeep from "lodash/cloneDeep"; + +const ResubmitDisconnection = () => { + const { t } = useTranslation(); + let { state } = useLocation(); + state = state ? (typeof (state) === "string" ? JSON.parse(state) : state) : {}; + let filters = func.getQueryStringParams(location.search); + const [canSubmit, setSubmitValve] = useState(false); + const [showToast, setShowToast] = useState(null); + const [appData, setAppData] = useState({}); + const [config, setConfig] = useState({ head: "", body: [] }); + const [isAppDetailsPage, setIsAppDetailsPage] = useState(false); + + let tenantId = Digit.ULBService.getCurrentTenantId(); + tenantId ? tenantId : Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; + + const stateId = Digit.ULBService.getStateId(); + let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSDisconnectionConfig(stateId, {}); + + const editApplicationDetails = JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")); + const serviceType = filters?.service || editApplicationDetails?.applicationData?.serviceType; + + let details = cloneDeep(state?.data?.applicationDetails); + const actionData = cloneDeep(state?.data?.action); + let { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.ws.useDisConnectionDetails(t, tenantId, details?.applicationNo, details?.applicationData?.serviceType, { privacy: Digit.Utils.getPrivacyObject() }); + + details = applicationDetails; + + const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); + + const { + isLoading: updatingApplication, + isError: updateApplicationError, + data: updateResponse, + error: updateError, + mutate, + } = Digit.Hooks.ws.useWSApplicationActions(serviceType); + + useEffect(() => { + if (!isLoading && !isConfigLoading) { + // const config = newConfigLocal.find((conf) => conf.isDisonnectionEdit); + const config = newConfig.find((conf) => conf.isDisonnectionEdit); + config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL"; + let bodyDetails = []; + config?.body?.forEach(data => { if (data?.isDisonnectionEdit) bodyDetails.push(data); }) + config.body = bodyDetails; + setConfig(config); + } + }, [applicationDetails, isLoading, newConfig]); + + useEffect(async () => { + const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false + if (details?.applicationData?.id && !IsDetailsExists) { + const convertAppData = await convertDisonnectApplicationData(details, serviceType, false, t); + setSessionFormData({ ...sessionFormData, ...convertAppData }); + setAppData({ ...convertAppData }) + sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); + } + }, [details, applicationDetails, sessionFormData]); + + useEffect(() => { + const timer = setTimeout(() => { + const dataDetails = sessionStorage.getItem("disconnectionURL"); + const details = dataDetails ? JSON.parse(dataDetails) : {}; + if (isAppDetailsPage) window.location.assign(`${window.location.origin}${details?.url}`); + }, 5000); + return () => clearTimeout(timer); + }, [isAppDetailsPage]); + + const onFormValueChange = (setValue, formData, formState) => { + if (!_.isEqual(sessionFormData, formData)) { + setSessionFormData({ ...sessionFormData, ...formData }); + } + if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); + else setSubmitValve(!(Object.keys(formState.errors).length)); + }; + + const onSubmit = async (data) => { + if(!canSubmit){ + setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); + setTimeout(() => { + setShowToast(false); + }, 3000); + } + else{ + const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; + let convertAppData = await convertDisonnectEditApplicationDetails(data, details, actionData); + setSubmitValve(false); + sessionStorage.setItem("redirectedfromEDIT", true); + sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS", JSON.stringify(convertAppData)); + convertAppData.processInstance.action = "RESUBMIT_APPLICATION"; + let reqDetails = convertAppData.serviceType == "WATER" ? { WaterConnection: convertAppData } : { SewerageConnection: convertAppData } + reqDetails.disconnectRequest = true; + + if (mutate) { + mutate(reqDetails, { + onError: (error, variables) => { + setShowToast({ key: "error", message: error?.message ? error.message : error }); + setSubmitValve(true); + }, + onSuccess: (data, variables) => { + setShowToast({ key: false, message: "WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL" }); + setIsAppDetailsPage(true); + }, + }); + } + } + }; + + + const closeToast = () => { + setShowToast(null); + }; + + const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false + if (isLoading || !IsDetailsExists || isConfigLoading) { + return ; + } + + return ( + +
+
{t(config.head)}
+
+ + {showToast && } +
+ ); +}; + +export default ResubmitDisconnection; + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/index.js old mode 100755 new mode 100644 index f933bb5f3fb..5991b803acf --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditDisconnectionApplication/index.js @@ -1,117 +1,117 @@ -import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; -import React, { useState, useEffect } from "react"; -import { useTranslation } from "react-i18next"; -import { useLocation } from "react-router-dom"; -import * as func from "../../../utils"; -import _ from "lodash"; -import { newConfig as newConfigLocal } from "../../../config/wsDisconnectionConfig"; -import { convertDisonnectEditApplicationDetails, convertDisonnectApplicationData } from "../../../utils"; -import cloneDeep from "lodash/cloneDeep"; - -const EditDisconnectionByConfig = () => { - const { t } = useTranslation(); - let { state } = useLocation(); - state = state ? (typeof (state) === "string" ? JSON.parse(state) : state) : {}; - let filters = func.getQueryStringParams(location.search); - const [canSubmit, setSubmitValve] = useState(false); - const [showToast, setShowToast] = useState(null); - const [appData, setAppData] = useState({}); - const [config, setConfig] = useState({ head: "", body: [] }); - - let tenantId = Digit.ULBService.getCurrentTenantId(); - tenantId ? tenantId : Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; - - const editApplicationDetails = JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")); - const serviceType = filters?.service || editApplicationDetails?.applicationData?.serviceType; - - const stateId = Digit.ULBService.getStateId(); - let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSDisconnectionConfig(stateId, {}); - - let details = cloneDeep(state?.data?.applicationDetails); - const actionData = cloneDeep(state?.data?.action); - let { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.ws.useDisConnectionDetails(t, tenantId, details?.applicationNo, details?.applicationData?.serviceType, { privacy: Digit.Utils.getPrivacyObject() }); - - details = applicationDetails; - - const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); - - useEffect(() => { - if (!isLoading && !isConfigLoading) { - // const config = newConfigLocal.find((conf) => conf.isDisonnectionEdit); - const config = newConfig.find((conf) => conf.isDisonnectionEdit); - config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL"; - let bodyDetails = []; - config?.body?.forEach(data => { if (data?.isDisonnectionEdit) bodyDetails.push(data); }) - config.body = bodyDetails; - setConfig(config); - } - }, [applicationDetails, isLoading, newConfig]); - - useEffect(async () => { - const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false - if (details?.applicationData?.id && !IsDetailsExists) { - const convertAppData = await convertDisonnectApplicationData(details, serviceType, false, t); - setSessionFormData({ ...sessionFormData, ...convertAppData }); - setAppData({ ...convertAppData }) - sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); - } - }, [details, applicationDetails, sessionFormData]); - - const onFormValueChange = (setValue, formData, formState) => { - if (!_.isEqual(sessionFormData, formData)) { - setSessionFormData({ ...sessionFormData, ...formData }); - } - if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); - else setSubmitValve(!(Object.keys(formState.errors).length)); - }; - - const onSubmit = async (data) => { - if(!canSubmit){ - setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); - setTimeout(() => { - setShowToast(false); - }, 3000); - } - else{ - const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; - let convertAppData = await convertDisonnectEditApplicationDetails(data, details, actionData); - setSubmitValve(false); - sessionStorage.setItem("redirectedfromEDIT", true); - sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS", JSON.stringify(convertAppData)); - window.location.assign(`${window.location.origin}${state?.url}`); - } - }; - - - const closeToast = () => { - setShowToast(null); - }; - - const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false - if (isLoading || !IsDetailsExists || isConfigLoading) { - return ; - } - - return ( - -
-
{t(config.head)}
-
- - {showToast && } -
- ); -}; - -export default EditDisconnectionByConfig; - +import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; +import React, { useState, useEffect } from "react"; +import { useTranslation } from "react-i18next"; +import { useLocation } from "react-router-dom"; +import * as func from "../../../utils"; +import _ from "lodash"; +import { newConfig as newConfigLocal } from "../../../config/wsDisconnectionConfig"; +import { convertDisonnectEditApplicationDetails, convertDisonnectApplicationData } from "../../../utils"; +import cloneDeep from "lodash/cloneDeep"; + +const EditDisconnectionByConfig = () => { + const { t } = useTranslation(); + let { state } = useLocation(); + state = state ? (typeof (state) === "string" ? JSON.parse(state) : state) : {}; + let filters = func.getQueryStringParams(location.search); + const [canSubmit, setSubmitValve] = useState(false); + const [showToast, setShowToast] = useState(null); + const [appData, setAppData] = useState({}); + const [config, setConfig] = useState({ head: "", body: [] }); + + let tenantId = Digit.ULBService.getCurrentTenantId(); + tenantId ? tenantId : Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; + + const editApplicationDetails = JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")); + const serviceType = filters?.service || editApplicationDetails?.applicationData?.serviceType; + + const stateId = Digit.ULBService.getStateId(); + let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSDisconnectionConfig(stateId, {}); + + let details = cloneDeep(state?.data?.applicationDetails); + const actionData = cloneDeep(state?.data?.action); + let { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.ws.useDisConnectionDetails(t, tenantId, details?.applicationNo, details?.applicationData?.serviceType, { privacy: Digit.Utils.getPrivacyObject() }); + + details = applicationDetails; + + const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); + + useEffect(() => { + if (!isLoading && !isConfigLoading) { + // const config = newConfigLocal.find((conf) => conf.isDisonnectionEdit); + const config = newConfig.find((conf) => conf.isDisonnectionEdit); + config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL"; + let bodyDetails = []; + config?.body?.forEach(data => { if (data?.isDisonnectionEdit) bodyDetails.push(data); }) + config.body = bodyDetails; + setConfig(config); + } + }, [applicationDetails, isLoading, newConfig]); + + useEffect(async () => { + const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false + if (details?.applicationData?.id && !IsDetailsExists) { + const convertAppData = await convertDisonnectApplicationData(details, serviceType, false, t); + setSessionFormData({ ...sessionFormData, ...convertAppData }); + setAppData({ ...convertAppData }) + sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); + } + }, [details, applicationDetails, sessionFormData]); + + const onFormValueChange = (setValue, formData, formState) => { + if (!_.isEqual(sessionFormData, formData)) { + setSessionFormData({ ...sessionFormData, ...formData }); + } + if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); + else setSubmitValve(!(Object.keys(formState.errors).length)); + }; + + const onSubmit = async (data) => { + if(!canSubmit){ + setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); + setTimeout(() => { + setShowToast(false); + }, 3000); + } + else{ + const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; + let convertAppData = await convertDisonnectEditApplicationDetails(data, details, actionData); + setSubmitValve(false); + sessionStorage.setItem("redirectedfromEDIT", true); + sessionStorage.setItem("WS_SESSION_APPLICATION_DETAILS", JSON.stringify(convertAppData)); + window.location.assign(`${window.location.origin}${state?.url}`); + } + }; + + + const closeToast = () => { + setShowToast(null); + }; + + const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false + if (isLoading || !IsDetailsExists || isConfigLoading) { + return ; + } + + return ( + +
+
{t(config.head)}
+
+ + {showToast && } +
+ ); +}; + +export default EditDisconnectionByConfig; + diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditModifyApplication/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditModifyApplication/index.js old mode 100755 new mode 100644 index 7f244cd9a89..ef3f234a8a1 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditModifyApplication/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/EditModifyApplication/index.js @@ -1,161 +1,161 @@ -import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; -import React, { useState, useEffect } from "react"; -import { useTranslation } from "react-i18next"; -import { useLocation, useHistory } from "react-router-dom"; -import * as func from "../../../utils"; -import _ from "lodash"; -import { newConfig as newConfigLocal } from "../../../config/wsCreateConfig"; -import { convertApplicationData, convertModifyApplicationDetails } from "../../../utils"; -import cloneDeep from "lodash/cloneDeep"; - -const EditModifyApplication = () => { - const { t } = useTranslation(); - let { state } = useLocation(); - state = state ? (typeof(state) === "string" ? JSON.parse(state) : state) : {}; - const history = useHistory(); - let filters = func.getQueryStringParams(location.search); - const [canSubmit, setSubmitValve] = useState(false); - const [showToast, setShowToast] = useState(null); - const [appData, setAppData] = useState({}); - const [config, setConfig] = useState({ head: "", body: [] }); - const [enabledLoader, setEnabledLoader] = useState(true); - const [isAppDetailsPage, setIsAppDetailsPage] = useState(false); - const tenantId = Digit.ULBService.getCurrentTenantId(); - const applicationNumber = filters?.applicationNumber; - const serviceType = filters?.service; - const details = cloneDeep(state?.data); - const stateId = Digit.ULBService.getStateId(); - let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}); - - const [propertyId, setPropertyId] = useState(new URLSearchParams(useLocation().search).get("propertyId")); - - const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); - - const { data: propertyDetails } = Digit.Hooks.pt.usePropertySearch( - { filters: { propertyIds: propertyId }, tenantId: tenantId }, - { filters: { propertyIds: propertyId }, tenantId: tenantId, enabled: propertyId && propertyId != "" ? true : false } - ); - - useEffect(() => { - if (!isConfigLoading) { - // const config = newConfigLocal.find((conf) => conf.hideInCitizen && conf.isModify); - const config = newConfig.find((conf) => conf.hideInCitizen && conf.isModify); - config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL"; - let bodyDetails = []; - config?.body?.forEach(data => { if (data?.isModifyConnection) bodyDetails.push(data); }); - bodyDetails.forEach(bdyData => { if (bdyData?.head == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = ""; }) - config.body = bodyDetails; - setConfig(config); - } - }, [newConfig]); - - useEffect(() => { - !propertyId && sessionFormData?.cpt?.details?.propertyId && setPropertyId(sessionFormData?.cpt?.details?.propertyId); - }, [sessionFormData?.cpt]); - - useEffect(async () => { - const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false - if (details?.applicationData?.id && !IsDetailsExists) { - const convertAppData = await convertApplicationData(details, serviceType, true, false, t); - setSessionFormData({ ...sessionFormData, ...convertAppData }); - setAppData({ ...convertAppData }) - sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); - } - }, [propertyDetails, sessionFormData, sessionFormData?.cpt]); - - useEffect(() => { - setSessionFormData({ ...sessionFormData, cpt: { details: propertyDetails?.Properties?.[0] } }); - }, [propertyDetails]); - - useEffect(() => { - if (sessionFormData?.ConnectionDetails?.[0]?.applicationNo) { - setEnabledLoader(false); - } - }, [propertyDetails, sessionFormData, sessionFormData?.cpt]); - - useEffect(() => { - const timer = setTimeout(() => { - if (isAppDetailsPage) window.location.href = `${window.location.origin}/digit-ui/employee/ws/application-details?applicationNumber=${sessionFormData?.ConnectionDetails?.[0]?.applicationNo}&service=${sessionFormData?.ConnectionDetails?.[0]?.serviceName?.toUpperCase()}&mode=MODIFY` - }, 3000); - return () => clearTimeout(timer); - }, [isAppDetailsPage]); - - const { - isLoading: updatingApplication, - isError: updateApplicationError, - data: updateResponse, - error: updateError, - mutate, - } = Digit.Hooks.ws.useWSApplicationActions(filters?.service); - - const onFormValueChange = (setValue, formData, formState) => { - if (!_.isEqual(sessionFormData, formData)) { - setSessionFormData({ ...sessionFormData, ...formData }); - } - if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); - else setSubmitValve(!(Object.keys(formState.errors).length)); - }; - - const onSubmit = async (data) => { - if(!canSubmit){ - setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); - setTimeout(() => { - setShowToast(false); - }, 3000); - } - else{ - const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; - let convertAppData = await convertModifyApplicationDetails(data, details, "SUBMIT_APPLICATION"); - const reqDetails = data?.ConnectionDetails?.[0]?.serviceName == "WATER" ? { WaterConnection: convertAppData } : { SewerageConnection: convertAppData } - - if (mutate) { - mutate(reqDetails, { - onError: (error, variables) => { - setShowToast({ key: "error", message: error?.message ? error.message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: (data, variables) => { - setShowToast({ key: false, message: "WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL" }); - setIsAppDetailsPage(true); - }, - }); - } - } - }; - - - const closeToast = () => { - setShowToast(null); - }; - - if (enabledLoader || isConfigLoading) { - return ; - } - - return ( - -
-
{t(config.head)}
-
- - {showToast && - } -
- ); -}; - -export default EditModifyApplication; +import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; +import React, { useState, useEffect } from "react"; +import { useTranslation } from "react-i18next"; +import { useLocation, useHistory } from "react-router-dom"; +import * as func from "../../../utils"; +import _ from "lodash"; +import { newConfig as newConfigLocal } from "../../../config/wsCreateConfig"; +import { convertApplicationData, convertModifyApplicationDetails } from "../../../utils"; +import cloneDeep from "lodash/cloneDeep"; + +const EditModifyApplication = () => { + const { t } = useTranslation(); + let { state } = useLocation(); + state = state ? (typeof(state) === "string" ? JSON.parse(state) : state) : {}; + const history = useHistory(); + let filters = func.getQueryStringParams(location.search); + const [canSubmit, setSubmitValve] = useState(false); + const [showToast, setShowToast] = useState(null); + const [appData, setAppData] = useState({}); + const [config, setConfig] = useState({ head: "", body: [] }); + const [enabledLoader, setEnabledLoader] = useState(true); + const [isAppDetailsPage, setIsAppDetailsPage] = useState(false); + const tenantId = Digit.ULBService.getCurrentTenantId(); + const applicationNumber = filters?.applicationNumber; + const serviceType = filters?.service; + const details = cloneDeep(state?.data); + const stateId = Digit.ULBService.getStateId(); + let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}); + + const [propertyId, setPropertyId] = useState(new URLSearchParams(useLocation().search).get("propertyId")); + + const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); + + const { data: propertyDetails } = Digit.Hooks.pt.usePropertySearch( + { filters: { propertyIds: propertyId }, tenantId: tenantId }, + { filters: { propertyIds: propertyId }, tenantId: tenantId, enabled: propertyId && propertyId != "" ? true : false } + ); + + useEffect(() => { + if (!isConfigLoading) { + // const config = newConfigLocal.find((conf) => conf.hideInCitizen && conf.isModify); + const config = newConfig.find((conf) => conf.hideInCitizen && conf.isModify); + config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL"; + let bodyDetails = []; + config?.body?.forEach(data => { if (data?.isModifyConnection) bodyDetails.push(data); }); + bodyDetails.forEach(bdyData => { if (bdyData?.head == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = ""; }) + config.body = bodyDetails; + setConfig(config); + } + }, [newConfig]); + + useEffect(() => { + !propertyId && sessionFormData?.cpt?.details?.propertyId && setPropertyId(sessionFormData?.cpt?.details?.propertyId); + }, [sessionFormData?.cpt]); + + useEffect(async () => { + const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false + if (details?.applicationData?.id && !IsDetailsExists) { + const convertAppData = await convertApplicationData(details, serviceType, true, false, t); + setSessionFormData({ ...sessionFormData, ...convertAppData }); + setAppData({ ...convertAppData }) + sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); + } + }, [propertyDetails, sessionFormData, sessionFormData?.cpt]); + + useEffect(() => { + setSessionFormData({ ...sessionFormData, cpt: { details: propertyDetails?.Properties?.[0] } }); + }, [propertyDetails]); + + useEffect(() => { + if (sessionFormData?.ConnectionDetails?.[0]?.applicationNo) { + setEnabledLoader(false); + } + }, [propertyDetails, sessionFormData, sessionFormData?.cpt]); + + useEffect(() => { + const timer = setTimeout(() => { + if (isAppDetailsPage) window.location.href = `${window.location.origin}/digit-ui/employee/ws/application-details?applicationNumber=${sessionFormData?.ConnectionDetails?.[0]?.applicationNo}&service=${sessionFormData?.ConnectionDetails?.[0]?.serviceName?.toUpperCase()}&mode=MODIFY` + }, 3000); + return () => clearTimeout(timer); + }, [isAppDetailsPage]); + + const { + isLoading: updatingApplication, + isError: updateApplicationError, + data: updateResponse, + error: updateError, + mutate, + } = Digit.Hooks.ws.useWSApplicationActions(filters?.service); + + const onFormValueChange = (setValue, formData, formState) => { + if (!_.isEqual(sessionFormData, formData)) { + setSessionFormData({ ...sessionFormData, ...formData }); + } + if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); + else setSubmitValve(!(Object.keys(formState.errors).length)); + }; + + const onSubmit = async (data) => { + if(!canSubmit){ + setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); + setTimeout(() => { + setShowToast(false); + }, 3000); + } + else{ + const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; + let convertAppData = await convertModifyApplicationDetails(data, details, "SUBMIT_APPLICATION"); + const reqDetails = data?.ConnectionDetails?.[0]?.serviceName == "WATER" ? { WaterConnection: convertAppData } : { SewerageConnection: convertAppData } + + if (mutate) { + mutate(reqDetails, { + onError: (error, variables) => { + setShowToast({ key: "error", message: error?.message ? error.message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: (data, variables) => { + setShowToast({ key: false, message: "WS_APPLICATION_SUBMITTED_SUCCESSFULLY_LABEL" }); + setIsAppDetailsPage(true); + }, + }); + } + } + }; + + + const closeToast = () => { + setShowToast(null); + }; + + if (enabledLoader || isConfigLoading) { + return ; + } + + return ( + +
+
{t(config.head)}
+
+ + {showToast && + } +
+ ); +}; + +export default EditModifyApplication; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/ModifyApplication/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/ModifyApplication/index.js old mode 100755 new mode 100644 index d2565ae0b8e..f5d6a654090 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/ModifyApplication/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/ModifyApplication/index.js @@ -1,244 +1,244 @@ -import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; -import React, { useState, useEffect } from "react"; -import { useTranslation } from "react-i18next"; -import { useLocation, useHistory } from "react-router-dom"; -import * as func from "../../../utils"; -import _ from "lodash"; -import { newConfig as newConfigLocal } from "../../../config/wsCreateConfig"; -import { convertApplicationData, convertModifyApplicationDetails, updatePayloadOfWS } from "../../../utils"; -import cloneDeep from "lodash/cloneDeep"; - -const ModifyApplication = () => { - const { t } = useTranslation(); - let { state } = useLocation(); - state = state ? (typeof(state) === "string" ? JSON.parse(state) : state) : {}; - const history = useHistory(); - let filters = func.getQueryStringParams(location.search); - const [canSubmit, setSubmitValve] = useState(false); - const [showToast, setShowToast] = useState(null); - const [appData, setAppData] = useState({}); - const [config, setConfig] = useState({ head: "", body: [] }); - const [enabledLoader, setEnabledLoader] = useState(true); - const [isAppDetailsPage, setIsAppDetailsPage] = useState(false); - const [isEnableLoader, setIsEnableLoader] = useState(false); - - let tenantId = Digit.ULBService.getCurrentTenantId(); - const applicationNumber = filters?.applicationNumber; - const serviceType = filters?.service; - - const stateId = Digit.ULBService.getStateId(); - let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}); - - let details = cloneDeep(state?.data); - let { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.ws.useWSDetailsPage(t, tenantId, details?.applicationNo, details?.applicationData?.serviceType,{privacy : Digit.Utils.getPrivacyObject() }); - details = applicationDetails; - const [propertyId, setPropertyId] = useState(new URLSearchParams(useLocation().search).get("propertyId")); - - const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); - - const { data: propertyDetails } = Digit.Hooks.pt.usePropertySearch( - { filters: { propertyIds: propertyId }, tenantId: tenantId }, - { filters: { propertyIds: propertyId }, tenantId: tenantId, enabled: propertyId && propertyId != "" ? true : false, privacy : Digit.Utils.getPrivacyObject() } - ); - - useEffect(() => { - if (!isConfigLoading) { - // const config = newConfigLocal.find((conf) => conf.hideInCitizen && conf.isModify); - const config = newConfig.find((conf) => conf.hideInCitizen && conf.isModify); - config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL"; - let bodyDetails = []; - config?.body?.forEach(data => { if (data?.isModifyConnection) bodyDetails.push(data); }); - bodyDetails.forEach(bdyData => { if (bdyData?.head == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = ""; }) - config.body = bodyDetails; - setConfig(config); - } - }, [newConfig]); - - useEffect(() => { - !propertyId && sessionFormData?.cpt?.details?.propertyId && setPropertyId(sessionFormData?.cpt?.details?.propertyId); - }, [sessionFormData?.cpt]); - - useEffect(async () => { - const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false - if (details?.applicationData?.id /* && !IsDetailsExists */) { - const convertAppData = await convertApplicationData(details, serviceType, true, undefined,t); - setSessionFormData({ ...sessionFormData, ...convertAppData }); - setAppData({ ...convertAppData }) - sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); - } - }, [details,applicationDetails]); - - useEffect(() => { - setSessionFormData({ ...sessionFormData, cpt: { details: propertyDetails?.Properties?.[0] } }); - }, [propertyDetails]); - - useEffect(() => { - if (sessionFormData?.ConnectionDetails?.[0]?.applicationNo) { - setEnabledLoader(false); - } - }, [propertyDetails, sessionFormData, sessionFormData?.cpt]); - - useEffect(() => { - const timer = setTimeout(() => { - if (isAppDetailsPage) window.location.href = `${window.location.origin}/digit-ui/employee/ws/application-details?applicationNumber=${sessionFormData?.ConnectionDetails?.[0]?.applicationNo}&service=${sessionFormData?.ConnectionDetails?.[0]?.serviceName?.toUpperCase()}` - }, 3000); - return () => clearTimeout(timer); - }, [isAppDetailsPage]); - - const { - isLoading: creatingWaterApplicationLoading, - isError: createWaterApplicationError, - data: createWaterResponse, - error: createWaterError, - mutate: waterMutation, - } = Digit.Hooks.ws.useWaterCreateAPI("WATER"); - - const { - isLoading: updatingWaterApplicationLoading, - isError: updateWaterApplicationError, - data: updateWaterResponse, - error: updateWaterError, - mutate: waterUpdateMutation, - } = Digit.Hooks.ws.useWSApplicationActions("WATER"); - - const { - isLoading: creatingSewerageApplicationLoading, - isError: createSewerageApplicationError, - data: createSewerageResponse, - error: createSewerageError, - mutate: sewerageMutation, - } = Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"); - - const { - isLoading: updatingSewerageApplicationLoading, - isError: updateSewerageApplicationError, - data: updateSewerageResponse, - error: updateSewerageError, - mutate: sewerageUpdateMutation, - } = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"); - - const onFormValueChange = (setValue, formData, formState) => { - if (!_.isEqual(sessionFormData, formData)) { - setSessionFormData({ ...sessionFormData, ...formData }); - } - if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); - else setSubmitValve(!(Object.keys(formState.errors).length)); - }; - - const onSubmit = async (data) => { - if(!data?.cpt?.id && !propertyDetails?.Properties?.[0]){ - if (!data?.cpt?.details || !propertyDetails) { - setShowToast({ key: "error", message: "ERR_INVALID_PROPERTY_ID" }); - return; - } - } - if(!canSubmit){ - setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); - setTimeout(() => { - setShowToast(false); - }, 3000); - } - else{ - - if (!data?.cpt?.details) { - data.cpt = { - details: propertyDetails?.Properties?.[0] - }; - } - - const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; - let convertAppData = await convertModifyApplicationDetails(data, details); - //const reqDetails = data?.ConnectionDetails?.[0]?.serviceName == "WATER" ? { WaterConnection: convertAppData } : { SewerageConnection: convertAppData } - const reqDetails = data?.ConnectionDetails?.[0]?.serviceName == "WATER"? data?.ConnectionDetails?.[0]?.applicationType === "WATER_RECONNECTION" ? { WaterConnection: convertAppData, reconnectRequest:true, disconnectRequest:false } :{ WaterConnection: convertAppData,reconnectRequest:false, disconnectRequest:false }: formData?.applicationType === "SEWERAGE_RECONNECTION" ? { SewerageConnection: convertAppData ,reconnectRequest:true, disconnectRequest:false}:{ SewerageConnection: convertAppData ,reconnectRequest:false, disconnectRequest:false } - if (serviceType == "WATER") { - if (waterMutation) { - setIsEnableLoader(true); - await waterMutation(reqDetails, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: async (data, variables) => { - let response = await updatePayloadOfWS(data?.WaterConnection?.[0], "WATER"); - let waterConnectionUpdate = { WaterConnection: response, reconnectRequest:false, disconnectRequest:false }; - waterUpdateMutation(waterConnectionUpdate, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: (data, variables) => { - clearSessionFormData(); - history.push(`/digit-ui/employee/ws/ws-response?applicationNumber=${data?.WaterConnection?.[0]?.applicationNo}`); - // window.location.href = `${window.location.origin}/digit-ui/employee/ws/ws-response?applicationNumber=${data?.WaterConnection?.[0]?.applicationNo}`; - }, - }) - }, - }); - } - } - - if (serviceType !== "WATER") { - if (sewerageMutation) { - setIsEnableLoader(true); - await sewerageMutation(reqDetails, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0]?.message ? error?.response?.data?.Errors?.[0]?.message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: async (data, variables) => { - let response = await updatePayloadOfWS(data?.SewerageConnections?.[0], "SEWERAGE"); - let sewerageConnectionUpdate = { SewerageConnection: response,reconnectRequest:false, disconnectRequest:false }; - await sewerageUpdateMutation(sewerageConnectionUpdate, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.message ? error.message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: (data, variables) => { - clearSessionFormData(); - history.push(`/digit-ui/employee/ws/ws-response?applicationNumber1=${data?.SewerageConnections?.[0]?.applicationNo}`); - // window.location.href = `${window.location.origin}/digit-ui/employee/ws/ws-response?applicationNumber1=${data?.SewerageConnections?.[0]?.applicationNo}`; - } - }); - }, - }); - } - } - } - }; - - - const closeToast = () => { - setShowToast(null); - }; - - if (enabledLoader || isEnableLoader || isConfigLoading) { - return ; - } - - return ( - -
-
{t(config.head)}
-
- - {showToast && } - {/* {showToast && } */} -
- ); -}; - -export default ModifyApplication; +import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; +import React, { useState, useEffect } from "react"; +import { useTranslation } from "react-i18next"; +import { useLocation, useHistory } from "react-router-dom"; +import * as func from "../../../utils"; +import _ from "lodash"; +import { newConfig as newConfigLocal } from "../../../config/wsCreateConfig"; +import { convertApplicationData, convertModifyApplicationDetails, updatePayloadOfWS } from "../../../utils"; +import cloneDeep from "lodash/cloneDeep"; + +const ModifyApplication = () => { + const { t } = useTranslation(); + let { state } = useLocation(); + state = state ? (typeof(state) === "string" ? JSON.parse(state) : state) : {}; + const history = useHistory(); + let filters = func.getQueryStringParams(location.search); + const [canSubmit, setSubmitValve] = useState(false); + const [showToast, setShowToast] = useState(null); + const [appData, setAppData] = useState({}); + const [config, setConfig] = useState({ head: "", body: [] }); + const [enabledLoader, setEnabledLoader] = useState(true); + const [isAppDetailsPage, setIsAppDetailsPage] = useState(false); + const [isEnableLoader, setIsEnableLoader] = useState(false); + + let tenantId = Digit.ULBService.getCurrentTenantId(); + const applicationNumber = filters?.applicationNumber; + const serviceType = filters?.service; + + const stateId = Digit.ULBService.getStateId(); + let { data: newConfig, isLoading: isConfigLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}); + + let details = cloneDeep(state?.data); + let { isLoading, isError, data: applicationDetails, error } = Digit.Hooks.ws.useWSDetailsPage(t, tenantId, details?.applicationNo, details?.applicationData?.serviceType,{privacy : Digit.Utils.getPrivacyObject() }); + details = applicationDetails; + const [propertyId, setPropertyId] = useState(new URLSearchParams(useLocation().search).get("propertyId")); + + const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); + + const { data: propertyDetails } = Digit.Hooks.pt.usePropertySearch( + { filters: { propertyIds: propertyId }, tenantId: tenantId }, + { filters: { propertyIds: propertyId }, tenantId: tenantId, enabled: propertyId && propertyId != "" ? true : false, privacy : Digit.Utils.getPrivacyObject() } + ); + + useEffect(() => { + if (!isConfigLoading) { + // const config = newConfigLocal.find((conf) => conf.hideInCitizen && conf.isModify); + const config = newConfig.find((conf) => conf.hideInCitizen && conf.isModify); + config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL"; + let bodyDetails = []; + config?.body?.forEach(data => { if (data?.isModifyConnection) bodyDetails.push(data); }); + bodyDetails.forEach(bdyData => { if (bdyData?.head == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = ""; }) + config.body = bodyDetails; + setConfig(config); + } + }, [newConfig]); + + useEffect(() => { + !propertyId && sessionFormData?.cpt?.details?.propertyId && setPropertyId(sessionFormData?.cpt?.details?.propertyId); + }, [sessionFormData?.cpt]); + + useEffect(async () => { + const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false + if (details?.applicationData?.id /* && !IsDetailsExists */) { + const convertAppData = await convertApplicationData(details, serviceType, true, undefined,t); + setSessionFormData({ ...sessionFormData, ...convertAppData }); + setAppData({ ...convertAppData }) + sessionStorage.setItem("IsDetailsExists", JSON.stringify(true)); + } + }, [details,applicationDetails]); + + useEffect(() => { + setSessionFormData({ ...sessionFormData, cpt: { details: propertyDetails?.Properties?.[0] } }); + }, [propertyDetails]); + + useEffect(() => { + if (sessionFormData?.ConnectionDetails?.[0]?.applicationNo) { + setEnabledLoader(false); + } + }, [propertyDetails, sessionFormData, sessionFormData?.cpt]); + + useEffect(() => { + const timer = setTimeout(() => { + if (isAppDetailsPage) window.location.href = `${window.location.origin}/digit-ui/employee/ws/application-details?applicationNumber=${sessionFormData?.ConnectionDetails?.[0]?.applicationNo}&service=${sessionFormData?.ConnectionDetails?.[0]?.serviceName?.toUpperCase()}` + }, 3000); + return () => clearTimeout(timer); + }, [isAppDetailsPage]); + + const { + isLoading: creatingWaterApplicationLoading, + isError: createWaterApplicationError, + data: createWaterResponse, + error: createWaterError, + mutate: waterMutation, + } = Digit.Hooks.ws.useWaterCreateAPI("WATER"); + + const { + isLoading: updatingWaterApplicationLoading, + isError: updateWaterApplicationError, + data: updateWaterResponse, + error: updateWaterError, + mutate: waterUpdateMutation, + } = Digit.Hooks.ws.useWSApplicationActions("WATER"); + + const { + isLoading: creatingSewerageApplicationLoading, + isError: createSewerageApplicationError, + data: createSewerageResponse, + error: createSewerageError, + mutate: sewerageMutation, + } = Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"); + + const { + isLoading: updatingSewerageApplicationLoading, + isError: updateSewerageApplicationError, + data: updateSewerageResponse, + error: updateSewerageError, + mutate: sewerageUpdateMutation, + } = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"); + + const onFormValueChange = (setValue, formData, formState) => { + if (!_.isEqual(sessionFormData, formData)) { + setSessionFormData({ ...sessionFormData, ...formData }); + } + if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter((ob) => ob.type === "required").length == 0 && !formData?.cpt?.details?.propertyId) setSubmitValve(true); + else setSubmitValve(!(Object.keys(formState.errors).length)); + }; + + const onSubmit = async (data) => { + if(!data?.cpt?.id && !propertyDetails?.Properties?.[0]){ + if (!data?.cpt?.details || !propertyDetails) { + setShowToast({ key: "error", message: "ERR_INVALID_PROPERTY_ID" }); + return; + } + } + if(!canSubmit){ + setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); + setTimeout(() => { + setShowToast(false); + }, 3000); + } + else{ + + if (!data?.cpt?.details) { + data.cpt = { + details: propertyDetails?.Properties?.[0] + }; + } + + const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {}; + let convertAppData = await convertModifyApplicationDetails(data, details); + //const reqDetails = data?.ConnectionDetails?.[0]?.serviceName == "WATER" ? { WaterConnection: convertAppData } : { SewerageConnection: convertAppData } + const reqDetails = data?.ConnectionDetails?.[0]?.serviceName == "WATER"? data?.ConnectionDetails?.[0]?.applicationType === "WATER_RECONNECTION" ? { WaterConnection: convertAppData, reconnectRequest:true, disconnectRequest:false } :{ WaterConnection: convertAppData,reconnectRequest:false, disconnectRequest:false }: formData?.applicationType === "SEWERAGE_RECONNECTION" ? { SewerageConnection: convertAppData ,reconnectRequest:true, disconnectRequest:false}:{ SewerageConnection: convertAppData ,reconnectRequest:false, disconnectRequest:false } + if (serviceType == "WATER") { + if (waterMutation) { + setIsEnableLoader(true); + await waterMutation(reqDetails, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: async (data, variables) => { + let response = await updatePayloadOfWS(data?.WaterConnection?.[0], "WATER"); + let waterConnectionUpdate = { WaterConnection: response, reconnectRequest:false, disconnectRequest:false }; + waterUpdateMutation(waterConnectionUpdate, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: (data, variables) => { + clearSessionFormData(); + history.push(`/digit-ui/employee/ws/ws-response?applicationNumber=${data?.WaterConnection?.[0]?.applicationNo}`); + // window.location.href = `${window.location.origin}/digit-ui/employee/ws/ws-response?applicationNumber=${data?.WaterConnection?.[0]?.applicationNo}`; + }, + }) + }, + }); + } + } + + if (serviceType !== "WATER") { + if (sewerageMutation) { + setIsEnableLoader(true); + await sewerageMutation(reqDetails, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0]?.message ? error?.response?.data?.Errors?.[0]?.message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: async (data, variables) => { + let response = await updatePayloadOfWS(data?.SewerageConnections?.[0], "SEWERAGE"); + let sewerageConnectionUpdate = { SewerageConnection: response,reconnectRequest:false, disconnectRequest:false }; + await sewerageUpdateMutation(sewerageConnectionUpdate, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.message ? error.message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: (data, variables) => { + clearSessionFormData(); + history.push(`/digit-ui/employee/ws/ws-response?applicationNumber1=${data?.SewerageConnections?.[0]?.applicationNo}`); + // window.location.href = `${window.location.origin}/digit-ui/employee/ws/ws-response?applicationNumber1=${data?.SewerageConnections?.[0]?.applicationNo}`; + } + }); + }, + }); + } + } + } + }; + + + const closeToast = () => { + setShowToast(null); + }; + + if (enabledLoader || isEnableLoader || isConfigLoading) { + return ; + } + + return ( + +
+
{t(config.head)}
+
+ + {showToast && } + {/* {showToast && } */} +
+ ); +}; + +export default ModifyApplication; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/NewApplication/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/NewApplication/index.js old mode 100755 new mode 100644 index 9d59ff0ce5d..7e6afea6138 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/NewApplication/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/NewApplication/index.js @@ -1,281 +1,281 @@ -import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; -import cloneDeep from "lodash/cloneDeep"; -import React, { useState, useEffect } from "react"; -import { useTranslation } from "react-i18next"; -import { useLocation, useHistory } from "react-router-dom"; -import * as func from "../../../utils"; -import _ from "lodash"; -import { newConfig as newConfigLocal } from "../../../config/wsCreateConfig"; -import { - createPayloadOfWS, - updatePayloadOfWS -} from "../../../utils"; - -const NewApplication = () => { - const { t } = useTranslation(); - const { state } = useLocation(); - const history = useHistory(); - let filters = func.getQueryStringParams(location.search); - const [canSubmit, setSubmitValve] = useState(false); - const [isEnableLoader, setIsEnableLoader] = useState(false); - const [showToast, setShowToast] = useState(null); - const [appDetails, setAppDetails] = useState({}); - const [waterAndSewerageBoth, setWaterAndSewerageBoth] = useState(null); - const [config, setConfig] = useState({ head: "", body: [] }); - let tenantId = Digit.ULBService.getCurrentTenantId(); - tenantId ? tenantId : Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; - - const stateId = Digit.ULBService.getStateId(); - let { data: newConfig, isLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}); - - const [propertyId, setPropertyId] = useState(new URLSearchParams(useLocation().search).get("propertyId")); - - const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); - - const { data: propertyDetails } = Digit.Hooks.pt.usePropertySearch( - { filters: { propertyIds: propertyId }, tenantId: tenantId }, - { filters: { propertyIds: propertyId }, tenantId: tenantId, enabled: propertyId && propertyId != "" ? true : false } - ); - - useEffect(() => { - if (!isLoading) { - // const config = newConfigLocal.find((conf) => conf.hideInCitizen && conf.isCreate); - const config = newConfig.find((conf) => conf.hideInCitizen && conf.isCreate); - config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_LABEL"; - let bodyDetails = []; - config?.body?.forEach(data => { if (data?.isCreateConnection) bodyDetails.push(data); }) - config.body = bodyDetails; - setConfig(config); - } - }, [newConfig]); - - useEffect(() => { - !propertyId && sessionFormData?.cpt?.details?.propertyId && setPropertyId(sessionFormData?.cpt?.details?.propertyId); - }, [sessionFormData?.cpt]); - - useEffect(() => { - setSessionFormData({ ...sessionFormData, cpt: {details: propertyDetails?.Properties?.[0]} }); - }, [propertyDetails]) - - const { - isLoading: creatingWaterApplicationLoading, - isError: createWaterApplicationError, - data: createWaterResponse, - error: createWaterError, - mutate: waterMutation, - } = Digit.Hooks.ws.useWaterCreateAPI("WATER"); - - const { - isLoading: updatingWaterApplicationLoading, - isError: updateWaterApplicationError, - data: updateWaterResponse, - error: updateWaterError, - mutate: waterUpdateMutation, - } = Digit.Hooks.ws.useWSApplicationActions("WATER"); - - const { - isLoading: creatingSewerageApplicationLoading, - isError: createSewerageApplicationError, - data: createSewerageResponse, - error: createSewerageError, - mutate: sewerageMutation, - } = Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"); - - const { - isLoading: updatingSewerageApplicationLoading, - isError: updateSewerageApplicationError, - data: updateSewerageResponse, - error: updateSewerageError, - mutate: sewerageUpdateMutation, - } = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"); - - const onFormValueChange = (setValue, formData, formState) => { - if (!_.isEqual(sessionFormData, formData)) { - setSessionFormData({ ...sessionFormData, ...formData }); - sessionStorage.setItem("FORMSTATE_ERRORS", JSON.stringify(formState?.errors)); - } - - if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState?.errors?.["ConnectionHolderDetails"]?.type && Object.keys(formState?.errors?.["ConnectionHolderDetails"]?.type)?.length == 1 && formState.errors["ConnectionHolderDetails"] && Object.values(formState.errors["ConnectionHolderDetails"].type).filter((ob) => ob.type === "required" && (ob?.ref?.value !== "")).length > 0 /*&& !formData?.cpt?.details?.propertyId*/) setSubmitValve(true); - else setSubmitValve(!(Object.keys(formState.errors).length)); - // if(!formData?.cpt?.details?.propertyId) setSubmitValve(false); - }; - - const closeToastOfError = () => { setShowToast(null); }; - - - const onSubmit = async (data) => { - if(!data?.cpt?.id && !propertyDetails?.Properties?.[0]){ - if (!data?.cpt?.details || !propertyDetails) { - setShowToast({ key: "error", message: "ERR_INVALID_PROPERTY_ID" }); - return; - } - } - - const errors = sessionStorage.getItem("FORMSTATE_ERRORS"); - const formStateErros = typeof(errors) == "string" ? JSON.parse(errors) : {}; - - if(Object.keys(formStateErros).length > 0 && !(Object.keys(formStateErros).length == 1 && formStateErros?.["ConnectionHolderDetails"]?.type && Object.keys(formStateErros?.["ConnectionHolderDetails"]?.type)?.length == 1 && formStateErros["ConnectionHolderDetails"] && Object.values(formStateErros["ConnectionHolderDetails"].type).filter((ob) => ob.type === "required" && (ob?.ref?.value !== "")).length > 0) ){ - setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); - return; - } - else{ - - if (!data?.cpt?.details) { - data.cpt = { - details: propertyDetails?.Properties?.[0] - }; - } - const allDetails = cloneDeep(data); - const payload = await createPayloadOfWS(data); - let waterAndSewerageLoader = false, waterLoader = false, sewerageLoader = false; - if (payload?.water && payload?.sewerage) waterAndSewerageLoader = true; - if (payload?.water && !payload?.sewerage) waterLoader = true; - if (!payload?.water && payload?.sewerage) sewerageLoader = true; - let waterConnection = { WaterConnection: payload ,disconnectRequest: false, reconnectRequest: false}; - let sewerageConnection = { SewerageConnection: payload ,disconnectRequest: false, reconnectRequest: false}; - - if (waterAndSewerageLoader) { - setWaterAndSewerageBoth(true); - sessionStorage.setItem("setWaterAndSewerageBoth", JSON.stringify(true)); - } else { - sessionStorage.setItem("setWaterAndSewerageBoth", JSON.stringify(false)); - } - - if (payload?.water && payload?.sewerage) { - if (waterMutation && sewerageMutation) { - setIsEnableLoader(true); - await waterMutation(waterConnection, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: async (waterData, variables) => { - let response = await updatePayloadOfWS(waterData?.WaterConnection?.[0], "WATER"); - let waterConnectionUpdate = { WaterConnection: response,disconnectRequest:false, reconnectRequest:false }; - waterUpdateMutation(waterConnectionUpdate, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: async (waterUpdateData, variables) => { - setAppDetails({ ...appDetails, waterConnection: waterUpdateData?.WaterConnection?.[0] }); - await sewerageMutation(sewerageConnection, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: async (sewerageData, variables) => { - let response = await updatePayloadOfWS(sewerageData?.SewerageConnections?.[0], "SEWERAGE"); - let sewerageConnectionUpdate = { SewerageConnection: response, disconnectRequest:false, reconnectRequest:false }; - await sewerageUpdateMutation(sewerageConnectionUpdate, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: async (sewerageUpdateData, variables) => { - setAppDetails({ ...appDetails, sewerageConnection: sewerageUpdateData?.SewerageConnections?.[0] }); - clearSessionFormData(); - history.push(`/digit-ui/employee/ws/ws-response?applicationNumber=${waterUpdateData?.WaterConnection?.[0]?.applicationNo}&applicationNumber1=${sewerageUpdateData?.SewerageConnections?.[0]?.applicationNo}`); - // window.location.href = `${window.location.origin}/digit-ui/employee/ws/ws-response?applicationNumber=${waterUpdateData?.WaterConnection?.[0]?.applicationNo}&applicationNumber1=${sewerageUpdateData?.SewerageConnections?.[0]?.applicationNo}` - }, - }); - }, - }); - }, - }) - }, - }); - } - } else if (payload?.water && !payload?.sewerage) { - if (waterMutation) { - setIsEnableLoader(true); - await waterMutation(waterConnection, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: async (data, variables) => { - let response = await updatePayloadOfWS(data?.WaterConnection?.[0], "WATER"); - let waterConnectionUpdate = { WaterConnection: response }; - waterUpdateMutation(waterConnectionUpdate, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: (data, variables) => { - setAppDetails({ ...appDetails, waterConnection: data?.WaterConnection?.[0] }); - clearSessionFormData(); - history.push(`/digit-ui/employee/ws/ws-response?applicationNumber=${data?.WaterConnection?.[0]?.applicationNo}`); - // window.location.href = `${window.location.origin}/digit-ui/employee/ws/ws-response?applicationNumber=${data?.WaterConnection?.[0]?.applicationNo}`; - }, - }) - }, - }); - } - } else if (payload?.sewerage && !payload?.water) { - if (sewerageMutation) { - setIsEnableLoader(true); - await sewerageMutation(sewerageConnection, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: async (data, variables) => { - let response = await updatePayloadOfWS(data?.SewerageConnections?.[0], "SEWERAGE"); - let sewerageConnectionUpdate = { SewerageConnection: response }; - await sewerageUpdateMutation(sewerageConnectionUpdate, { - onError: (error, variables) => { - setIsEnableLoader(false); - setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); - setTimeout(closeToastOfError, 5000); - }, - onSuccess: (data, variables) => { - setAppDetails({ ...appDetails, sewerageConnection: data?.SewerageConnections?.[0] }); - clearSessionFormData(); - history.push(`/digit-ui/employee/ws/ws-response?applicationNumber1=${data?.SewerageConnections?.[0]?.applicationNo}`); - // window.location.href = `${window.location.origin}/digit-ui/employee/ws/ws-response?applicationNumber1=${data?.SewerageConnections?.[0]?.applicationNo}`; - }, - }); - }, - }); - } - } - } - }; - - const closeToast = () => { - setShowToast(null); - }; - - if (isEnableLoader || isLoading) { - return ; - } - - return ( - -
-
{t(config.head)}
-
- - {showToast && } - {/* {showToast && } */} -
- ); -}; - -export default NewApplication; +import { FormComposer, Header, Loader, Toast } from "@egovernments/digit-ui-react-components"; +import cloneDeep from "lodash/cloneDeep"; +import React, { useState, useEffect } from "react"; +import { useTranslation } from "react-i18next"; +import { useLocation, useHistory } from "react-router-dom"; +import * as func from "../../../utils"; +import _ from "lodash"; +import { newConfig as newConfigLocal } from "../../../config/wsCreateConfig"; +import { + createPayloadOfWS, + updatePayloadOfWS +} from "../../../utils"; + +const NewApplication = () => { + const { t } = useTranslation(); + const { state } = useLocation(); + const history = useHistory(); + let filters = func.getQueryStringParams(location.search); + const [canSubmit, setSubmitValve] = useState(false); + const [isEnableLoader, setIsEnableLoader] = useState(false); + const [showToast, setShowToast] = useState(null); + const [appDetails, setAppDetails] = useState({}); + const [waterAndSewerageBoth, setWaterAndSewerageBoth] = useState(null); + const [config, setConfig] = useState({ head: "", body: [] }); + let tenantId = Digit.ULBService.getCurrentTenantId(); + tenantId ? tenantId : Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; + + const stateId = Digit.ULBService.getStateId(); + let { data: newConfig, isLoading } = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}); + + const [propertyId, setPropertyId] = useState(new URLSearchParams(useLocation().search).get("propertyId")); + + const [sessionFormData, setSessionFormData, clearSessionFormData] = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}); + + const { data: propertyDetails } = Digit.Hooks.pt.usePropertySearch( + { filters: { propertyIds: propertyId }, tenantId: tenantId }, + { filters: { propertyIds: propertyId }, tenantId: tenantId, enabled: propertyId && propertyId != "" ? true : false } + ); + + useEffect(() => { + if (!isLoading) { + // const config = newConfigLocal.find((conf) => conf.hideInCitizen && conf.isCreate); + const config = newConfig.find((conf) => conf.hideInCitizen && conf.isCreate); + config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_LABEL"; + let bodyDetails = []; + config?.body?.forEach(data => { if (data?.isCreateConnection) bodyDetails.push(data); }) + config.body = bodyDetails; + setConfig(config); + } + }, [newConfig]); + + useEffect(() => { + !propertyId && sessionFormData?.cpt?.details?.propertyId && setPropertyId(sessionFormData?.cpt?.details?.propertyId); + }, [sessionFormData?.cpt]); + + useEffect(() => { + setSessionFormData({ ...sessionFormData, cpt: {details: propertyDetails?.Properties?.[0]} }); + }, [propertyDetails]) + + const { + isLoading: creatingWaterApplicationLoading, + isError: createWaterApplicationError, + data: createWaterResponse, + error: createWaterError, + mutate: waterMutation, + } = Digit.Hooks.ws.useWaterCreateAPI("WATER"); + + const { + isLoading: updatingWaterApplicationLoading, + isError: updateWaterApplicationError, + data: updateWaterResponse, + error: updateWaterError, + mutate: waterUpdateMutation, + } = Digit.Hooks.ws.useWSApplicationActions("WATER"); + + const { + isLoading: creatingSewerageApplicationLoading, + isError: createSewerageApplicationError, + data: createSewerageResponse, + error: createSewerageError, + mutate: sewerageMutation, + } = Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"); + + const { + isLoading: updatingSewerageApplicationLoading, + isError: updateSewerageApplicationError, + data: updateSewerageResponse, + error: updateSewerageError, + mutate: sewerageUpdateMutation, + } = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE"); + + const onFormValueChange = (setValue, formData, formState) => { + if (!_.isEqual(sessionFormData, formData)) { + setSessionFormData({ ...sessionFormData, ...formData }); + sessionStorage.setItem("FORMSTATE_ERRORS", JSON.stringify(formState?.errors)); + } + + if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState?.errors?.["ConnectionHolderDetails"]?.type && Object.keys(formState?.errors?.["ConnectionHolderDetails"]?.type)?.length == 1 && formState.errors["ConnectionHolderDetails"] && Object.values(formState.errors["ConnectionHolderDetails"].type).filter((ob) => ob.type === "required" && (ob?.ref?.value !== "")).length > 0 /*&& !formData?.cpt?.details?.propertyId*/) setSubmitValve(true); + else setSubmitValve(!(Object.keys(formState.errors).length)); + // if(!formData?.cpt?.details?.propertyId) setSubmitValve(false); + }; + + const closeToastOfError = () => { setShowToast(null); }; + + + const onSubmit = async (data) => { + if(!data?.cpt?.id && !propertyDetails?.Properties?.[0]){ + if (!data?.cpt?.details || !propertyDetails) { + setShowToast({ key: "error", message: "ERR_INVALID_PROPERTY_ID" }); + return; + } + } + + const errors = sessionStorage.getItem("FORMSTATE_ERRORS"); + const formStateErros = typeof(errors) == "string" ? JSON.parse(errors) : {}; + + if(Object.keys(formStateErros).length > 0 && !(Object.keys(formStateErros).length == 1 && formStateErros?.["ConnectionHolderDetails"]?.type && Object.keys(formStateErros?.["ConnectionHolderDetails"]?.type)?.length == 1 && formStateErros["ConnectionHolderDetails"] && Object.values(formStateErros["ConnectionHolderDetails"].type).filter((ob) => ob.type === "required" && (ob?.ref?.value !== "")).length > 0) ){ + setShowToast({ warning: true, message: "PLEASE_FILL_MANDATORY_DETAILS" }); + return; + } + else{ + + if (!data?.cpt?.details) { + data.cpt = { + details: propertyDetails?.Properties?.[0] + }; + } + const allDetails = cloneDeep(data); + const payload = await createPayloadOfWS(data); + let waterAndSewerageLoader = false, waterLoader = false, sewerageLoader = false; + if (payload?.water && payload?.sewerage) waterAndSewerageLoader = true; + if (payload?.water && !payload?.sewerage) waterLoader = true; + if (!payload?.water && payload?.sewerage) sewerageLoader = true; + let waterConnection = { WaterConnection: payload ,disconnectRequest: false, reconnectRequest: false}; + let sewerageConnection = { SewerageConnection: payload ,disconnectRequest: false, reconnectRequest: false}; + + if (waterAndSewerageLoader) { + setWaterAndSewerageBoth(true); + sessionStorage.setItem("setWaterAndSewerageBoth", JSON.stringify(true)); + } else { + sessionStorage.setItem("setWaterAndSewerageBoth", JSON.stringify(false)); + } + + if (payload?.water && payload?.sewerage) { + if (waterMutation && sewerageMutation) { + setIsEnableLoader(true); + await waterMutation(waterConnection, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: async (waterData, variables) => { + let response = await updatePayloadOfWS(waterData?.WaterConnection?.[0], "WATER"); + let waterConnectionUpdate = { WaterConnection: response,disconnectRequest:false, reconnectRequest:false }; + waterUpdateMutation(waterConnectionUpdate, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: async (waterUpdateData, variables) => { + setAppDetails({ ...appDetails, waterConnection: waterUpdateData?.WaterConnection?.[0] }); + await sewerageMutation(sewerageConnection, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: async (sewerageData, variables) => { + let response = await updatePayloadOfWS(sewerageData?.SewerageConnections?.[0], "SEWERAGE"); + let sewerageConnectionUpdate = { SewerageConnection: response, disconnectRequest:false, reconnectRequest:false }; + await sewerageUpdateMutation(sewerageConnectionUpdate, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: async (sewerageUpdateData, variables) => { + setAppDetails({ ...appDetails, sewerageConnection: sewerageUpdateData?.SewerageConnections?.[0] }); + clearSessionFormData(); + history.push(`/digit-ui/employee/ws/ws-response?applicationNumber=${waterUpdateData?.WaterConnection?.[0]?.applicationNo}&applicationNumber1=${sewerageUpdateData?.SewerageConnections?.[0]?.applicationNo}`); + // window.location.href = `${window.location.origin}/digit-ui/employee/ws/ws-response?applicationNumber=${waterUpdateData?.WaterConnection?.[0]?.applicationNo}&applicationNumber1=${sewerageUpdateData?.SewerageConnections?.[0]?.applicationNo}` + }, + }); + }, + }); + }, + }) + }, + }); + } + } else if (payload?.water && !payload?.sewerage) { + if (waterMutation) { + setIsEnableLoader(true); + await waterMutation(waterConnection, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: async (data, variables) => { + let response = await updatePayloadOfWS(data?.WaterConnection?.[0], "WATER"); + let waterConnectionUpdate = { WaterConnection: response }; + waterUpdateMutation(waterConnectionUpdate, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: (data, variables) => { + setAppDetails({ ...appDetails, waterConnection: data?.WaterConnection?.[0] }); + clearSessionFormData(); + history.push(`/digit-ui/employee/ws/ws-response?applicationNumber=${data?.WaterConnection?.[0]?.applicationNo}`); + // window.location.href = `${window.location.origin}/digit-ui/employee/ws/ws-response?applicationNumber=${data?.WaterConnection?.[0]?.applicationNo}`; + }, + }) + }, + }); + } + } else if (payload?.sewerage && !payload?.water) { + if (sewerageMutation) { + setIsEnableLoader(true); + await sewerageMutation(sewerageConnection, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: async (data, variables) => { + let response = await updatePayloadOfWS(data?.SewerageConnections?.[0], "SEWERAGE"); + let sewerageConnectionUpdate = { SewerageConnection: response }; + await sewerageUpdateMutation(sewerageConnectionUpdate, { + onError: (error, variables) => { + setIsEnableLoader(false); + setShowToast({ key: "error", message: error?.response?.data?.Errors?.[0].message ? error?.response?.data?.Errors?.[0].message : error }); + setTimeout(closeToastOfError, 5000); + }, + onSuccess: (data, variables) => { + setAppDetails({ ...appDetails, sewerageConnection: data?.SewerageConnections?.[0] }); + clearSessionFormData(); + history.push(`/digit-ui/employee/ws/ws-response?applicationNumber1=${data?.SewerageConnections?.[0]?.applicationNo}`); + // window.location.href = `${window.location.origin}/digit-ui/employee/ws/ws-response?applicationNumber1=${data?.SewerageConnections?.[0]?.applicationNo}`; + }, + }); + }, + }); + } + } + } + }; + + const closeToast = () => { + setShowToast(null); + }; + + if (isEnableLoader || isLoading) { + return ; + } + + return ( + +
+
{t(config.head)}
+
+ + {showToast && } + {/* {showToast && } */} +
+ ); +}; + +export default NewApplication; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/index.js index 4123d561f08..a83f3c4504e 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/ws/src/pages/employee/index.js @@ -1,337 +1,337 @@ -import React from "react"; -import { useTranslation } from "react-i18next"; -import { Switch, useLocation } from "react-router-dom"; -import { PrivateRoute, BreadCrumb } from "@egovernments/digit-ui-react-components"; - - -import WSResponse from "./WSResponse"; -import Response from "./Response"; -import ResponseBillAmend from "./ResponseBillAmend"; -import WSDisconnectionResponse from "./DisconnectionApplication/WSDisconnectionResponse"; -import WSRestorationResponse from "./RestorationApplication/WSRestorationResponse"; - -const BILLSBreadCrumbs = ({ location }) => { - const { t } = useTranslation(); - - const search = useLocation().search; - const fromScreen = new URLSearchParams(search).get("from") || null; - const IsEdit = new URLSearchParams(search).get("isEdit") || null; - const applicationNumbercheck = new URLSearchParams(search).get("applicationNumber") || null; - let isMobile = window.Digit.Utils.browser.isMobile(); - let requestParam = window.location.href.split("?")[1]; - - function findLastIndex(array, searchKey, searchValue) { - var index = array.slice().reverse().findIndex(x => x[searchKey] === searchValue); - var count = array.length - 1 - var finalIndex = index >= 0 ? count - index : index; - return finalIndex; - } - - let crumbs = [ - { - path: "/digit-ui/employee", - content: t("ES_COMMON_HOME"), - show: true, - style: isMobile ? {width:"20%"} : {}, - }, - { - path: "/digit-ui/employee/ws/create-application", - content: t("ES_COMMON_WS_DOCUMENTS_REQUIRED"), - show: location.pathname.includes("/create-application") ? true : false, - }, - { - path: "/digit-ui/employee/water/inbox", - content: t("ES_COMMON_BILLS_WATER_INBOX_LABEL"), - show: location.pathname.includes("/water/inbox") ? true : false, - }, - { - path: "/digit-ui/employee/ws/water/bill-amendment/inbox", - content: t("ES_COMMON_BILL_AMEND_WATER_INBOX_LABEL"), - show: location.pathname.includes("/water/bill-amendment/inbox") ? true : false, - }, - { - path: "/digit-ui/employee/ws/sewerage/bill-amendment/inbox", - content: t("ES_COMMON_BILL_AMEND_SEWERAGE_INBOX_LABEL"), - show: location.pathname.includes("/sewerage/bill-amendment/inbox") ? true : false, - }, - { - path: "/digit-ui/employee/ws/water/search-application", - content: fromScreen ? `${t(fromScreen)} / ${t("WS_SEARCH_APPLICATIONS")}` : t("WS_SEARCH_APPLICATIONS"), - show: location.pathname.includes("/water/search-application") ? true : false, - isBack: fromScreen && true, - }, - { - path: "/digit-ui/employee/ws/water/search-connection", - content: fromScreen ? `${t(fromScreen)} / ${t("WS_SEARCH_CONNECTION")}` : t("WS_SEARCH_CONNECTION"), - show: location.pathname.includes("/water/search-connection") ? true : false, - isBack: fromScreen && true, - }, - { - path: "/digit-ui/employee/ws/water/wns-search", - content: fromScreen ? `${t(fromScreen)} / ${t("WS_SEARCH_INTEGRATED_BILL")}` : t("WS_SEARCH_INTEGRATED_BILL"), - show: location.pathname.includes("/water/wns-search") ? true : false, - isBack: fromScreen && true, - }, - { - path: "/digit-ui/employee/ws/sewerage/search-application", - content: fromScreen ? `${t(fromScreen)} / ${t("WS_SEARCH_APPLICATIONS")}` : t("WS_SEARCH_APPLICATIONS"), - show: location.pathname.includes("/sewerage/search-application") ? true : false, - isBack: fromScreen && true, - }, - { - path: "/digit-ui/employee/ws/sewerage/search-connection", - content: fromScreen ? `${t(fromScreen)} / ${t("WS_SEARCH_CONNECTION")}` : t("WS_SEARCH_CONNECTION"), - show: location.pathname.includes("/sewerage/search-connection") ? true : false, - isBack: fromScreen && true, - }, - { - path: "/digit-ui/employee/sewerage/inbox", - content: t("ES_COMMON_BILLS_SEWERAGE_INBOX_LABEL"), - show: location.pathname.includes("/sewerage/inbox") ? true : false, - }, - { - path: "/digit-ui/employee/ws/new-application", - content: t("ES_COMMON_WS_NEW_CONNECTION"), - show: location.pathname.includes("/new-application") ? true : false, - }, - { - path: `${location?.pathname}${location.search}`, - content: t("ACTION_TEST_RESPONSE"), - show: location.pathname.includes("/ws-response") ? true : false, - }, - { - path: "/digit-ui/employee/ws/consumption-details", - content: fromScreen ? `${t(fromScreen)} / ${t("WS_VIEW_CONSUMPTION_DETAIL")}` : t("WS_VIEW_CONSUMPTION_DETAIL"), - show: location.pathname.includes("/consumption-details") ? true : false, - isBack: fromScreen && true, - }, - // { - // path: sessionStorage.getItem("redirectedfromEDIT") === "true"? (applicationNumbercheck?.includes("SW_AP")? "/digit-ui/employee/ws/sewerage/search-application" : "/digit-ui/employee/ws/water/search-application") : "/digit-ui/employee/ws/application-details", - // content: fromScreen ? `${t(fromScreen)} / ${t("WS_APPLICATION_DETAILS_HEADER")}` : t("WS_APPLICATION_DETAILS_HEADER"), - // show: location.pathname.includes("/generate-note") ? true : false, - // isBack: sessionStorage.getItem("redirectedfromEDIT") !== "true" && fromScreen && true, - // }, - { - path: sessionStorage.getItem("redirectedfromEDIT") === "true"? (applicationNumbercheck?.includes("SW_AP")? "/digit-ui/employee/ws/sewerage/search-application" : "/digit-ui/employee/ws/water/search-application") : "/digit-ui/employee/ws/application-details", - content: fromScreen ? `${t(fromScreen)} / ${t("WS_APPLICATION_DETAILS_HEADER")}` : t("WS_APPLICATION_DETAILS_HEADER"), - show: location.pathname.includes("/application-details") ? true : false, - isBack: sessionStorage.getItem("redirectedfromEDIT") !== "true" && fromScreen && true, - }, - { - path: sessionStorage.getItem("redirectedfromEDIT") === "true"? (applicationNumbercheck?.includes("SW_AP")? "/digit-ui/employee/ws/sewerage/search-application" : "/digit-ui/employee/ws/water/search-application") : "/digit-ui/employee/ws/modify-details", - content: fromScreen ? `${t(fromScreen)} / ${t("WS_APPLICATION_DETAILS_HEADER")}` : t("WS_APPLICATION_DETAILS_HEADER"), - show: location.pathname.includes("/modify-details") ? true : false, - isBack: sessionStorage.getItem("redirectedfromEDIT") !== "true" && fromScreen && true, - }, - { - path: "/digit-ui/employee/ws/disconnection-details", - content: fromScreen ? `${t(fromScreen)} / ${t("WS_APPLICATION_DETAILS_HEADER")}` : t("WS_APPLICATION_DETAILS_HEADER"), - show: location.pathname.includes("/disconnection-details") ? true : false, - isBack: fromScreen && true, - }, - { - path: "/digit-ui/employee/ws/connection-details", - content: fromScreen ? `${t(fromScreen)} / ${t("WS_COMMON_CONNECTION_DETAIL")}` : t("WS_COMMON_CONNECTION_DETAIL"), - show: location.pathname.includes("/connection-details") ? true : false, - isBack: fromScreen && true, - }, - { - path: "/digit-ui/employee/ws/edit-application", - content: `${t("WS_APPLICATION_DETAILS_HEADER")} / ${t("WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL")}`, - show: location.pathname.includes("/edit-application") ? true : false, - isBack: true, - }, - { - path: `${location?.pathname}${location.search}`, - content: `${t("WS_APPLICATION_DETAILS_HEADER")} / ${t("WF_EMPLOYEE_NEWSW1_ACTIVATE_CONNECTION")}`, - show: location.pathname.includes("/activate-connection") ? true : false, - isBack: true, - }, - { - path: `${location?.pathname}${location.search}`, - content: `${t("WS_APPLICATION_DETAILS_HEADER")} / ${t("WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL")}`, - show: location.pathname.includes("edit-disconnection-application") ? true : false, - isBack: true, - }, - { - path: `${location?.pathname}${location.search}`, - content: `${t("WS_APPLICATION_DETAILS_HEADER")} / ${t("WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL")}`, - show: location.pathname.includes("config-by-disconnection-application") ? true : false, - isBack: true, - }, - { - path: `${location?.pathname}${location.search}`, - content: `${t("WS_APPLICATION_DETAILS_HEADER")} / ${t("WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL")}`, - show: location.pathname.includes("resubmit-disconnection-application") ? true : false, - isBack: true, - }, - { - path: `/digit-ui/employee/ws/new-disconnection/docsrequired`, - content: t("WS_NEW_DISCONNECTION_DOCS_REQUIRED"), - show: location.pathname.includes("/new-disconnection/docsrequired") ? true : false, - }, - { - path: `/digit-ui/employee/ws/new-disconnection/application-form`, - content: isMobile ? `${t("WS_NEW_DISCONNECTION_DOCS_REQUIRED")} / ${t("WS_NEW_DISCONNECTION_APPLICATION")}` : `${t("WS_NEW_DISCONNECTION_DOCS_REQUIRED")} / ${t("WS_NEW_DISCONNECTION_APPLICATION")}`, - show: location.pathname.includes("/new-disconnection/application-form") ? true : false, - isBack: true - }, - { - path: `${location?.pathname}${location.search}`, - content: `${t("WS_NEW_DISCONNECTION_RESPONSE")}`, - show: location.pathname.includes("/ws-disconnection-response") ? true : false, - isBack: true - }, - // { - // path: "/digit-ui/employee/sewerage/bill-amendment/inbox", - // content: t("ES_COMMON_BILLS_SEWERAGE_INBOX_LABEL"), - // show: location.pathname.includes("/sewerage/bill-amendment/inbox") ? true : false, - // }, - { - path: `${location?.pathname}${location.search}`, - content: fromScreen ? `${t(fromScreen)} / ${t("WS_MODIFY_CONNECTION_BUTTON")}`:t("WS_MODIFY_CONNECTION_BUTTON"), - show: location.pathname.includes("ws/modify-application") ? true : false, - isBack:true, - }, - { - path: "/digit-ui/employee/ws/required-documents", - content: t("ES_COMMON_WS_DOCUMENTS_REQUIRED"), - show: location.pathname.includes("/required-documents") ? true : false, - }, - { - path: requestParam ? `/digit-ui/employee/ws/bill-amendment?${requestParam}` : "/digit-ui/employee/ws/bill-amendment", - content: t("WS_BILL_AMEND_APP"), - show: location.pathname.includes("ws/bill-amendment") && !IsEdit ? true : false, - }, - { - path: "/digit-ui/employee/ws/bill-amendment", - content: t("WS_BILL_AMEND_EDIT_APP"), - show: location.pathname.includes("ws/bill-amendment") && IsEdit ? true : false, - }, - { - path: "/digit-ui/employee/ws/response", - content: t("WS_ACK_SCREEN"), - show: location.pathname.includes("/employee/ws/response") ? true : false, - isclickable : false, - }, - { - path: "/digit-ui/employee/ws/generate-note-bill-amendment", - content: t("CS_TITLE_GENERATE_NOTE"), - show: location.pathname.includes("/generate-note-bill-amendment") ? true : false, - //isclickable : false, - } - ]; - - let lastCrumbIndex = findLastIndex(crumbs,"show",true) - crumbs[lastCrumbIndex] = {...crumbs[lastCrumbIndex],isclickable: false} - - return
; -}; -const App = ({ path }) => { - console.log("ffffff",path) - const location = useLocation(); - - const WSDocsRequired = Digit?.ComponentRegistryService?.getComponent("WSDocsRequired"); - const WSInbox = Digit?.ComponentRegistryService?.getComponent("WSInbox"); - const WSDisconnectionDocsRequired = Digit?.ComponentRegistryService?.getComponent('WSDisconnectionDocsRequired'); - const WSApplicationBillAmendment = Digit?.ComponentRegistryService?.getComponent("WSApplicationBillAmendment"); - const WSRequiredDocuments = Digit?.ComponentRegistryService?.getComponent("WSRequiredDocuments"); - const WSNewApplication = Digit?.ComponentRegistryService?.getComponent("WSNewApplication"); - const WSApplicationDetails = Digit?.ComponentRegistryService?.getComponent("WSApplicationDetails"); - const WSGetConnectionDetails = Digit?.ComponentRegistryService?.getComponent("WSGetConnectionDetails"); - const WSActivateConnection = Digit?.ComponentRegistryService?.getComponent("WSActivateConnection"); - const WSApplicationDetailsBillAmendment = Digit?.ComponentRegistryService?.getComponent("WSApplicationDetailsBillAmendment"); - const WSSearch = Digit?.ComponentRegistryService?.getComponent("WSSearch"); - const WSSearchWater = Digit?.ComponentRegistryService?.getComponent("WSSearchWater"); - const WSEditApplication = Digit?.ComponentRegistryService?.getComponent("WSEditApplication"); - const WSConsumptionDetails = Digit?.ComponentRegistryService?.getComponent("WSConsumptionDetails"); - const WSModifyApplication = Digit?.ComponentRegistryService?.getComponent("WSModifyApplication"); - const WSEditModifyApplication = Digit?.ComponentRegistryService?.getComponent("WSEditModifyApplication"); - const WSDisconnectionApplication = Digit?.ComponentRegistryService?.getComponent("WSDisconnectionApplication"); - const WSRestorationApplication = Digit?.ComponentRegistryService?.getComponent("WSRestorationApplication"); - const WSEditApplicationByConfig = Digit?.ComponentRegistryService?.getComponent("WSEditApplicationByConfig"); - const WSBillIAmendMentInbox = Digit?.ComponentRegistryService?.getComponent("WSBillIAmendMentInbox"); - const WSGetDisconnectionDetails = Digit?.ComponentRegistryService?.getComponent("WSGetDisconnectionDetails"); - const WSModifyApplicationDetails = Digit?.ComponentRegistryService?.getComponent("WSModifyApplicationDetails"); - const WSEditDisconnectionApplication = Digit?.ComponentRegistryService?.getComponent("WSEditDisconnectionApplication"); - const WSEditDisconnectionByConfig = Digit?.ComponentRegistryService?.getComponent("WSEditDisconnectionByConfig"); - const WSResubmitDisconnection = Digit?.ComponentRegistryService?.getComponent("WSResubmitDisconnection"); - const WSSearchIntegrated = Digit?.ComponentRegistryService?.getComponent("WSSearchIntegrated"); - - const locationCheck = - window.location.href.includes("/employee/ws/new-application") || - window.location.href.includes("/employee/ws/modify-application") || - window.location.href.includes("/employee/ws/edit-application") || - window.location.href.includes("/employee/ws/activate-connection") || - window.location.href.includes("/employee/ws/application-details") || - window.location.href.includes("/employee/ws/modify-details") || - window.location.href.includes("/employee/ws/ws-response") || - window.location.href.includes("/employee/ws/new-disconnection/application-form") || - window.location.href.includes("/employee/ws/ws-disconnection-response") || - window.location.href.includes("/employee/ws/consumption-details") || - window.location.href.includes("/employee/ws/edit-disconnection-application") || - window.location.href.includes("/employee/ws/config-by-disconnection-application")|| - - window.location.href.includes("/employee/ws/resubmit-disconnection-application"); - - - - - const locationCheckReqDocs = window.location.href.includes("/employee/ws/create-application") || window.location.href.includes("/employee/ws/new-disconnection/docsrequired"); - - return ( - - -
-
- -
- - - - - - - - - - - } /> - } /> - } /> - } /> - } /> - - } /> - } /> - - - - } /> - } /> - } /> - } /> - - - - - - - } /> - } /> - } /> - - - } /> - } /> - } /> - - {/* - */} -
-
-
- ); -}; - +import React from "react"; +import { useTranslation } from "react-i18next"; +import { Switch, useLocation } from "react-router-dom"; +import { PrivateRoute, BreadCrumb } from "@egovernments/digit-ui-react-components"; + + +import WSResponse from "./WSResponse"; +import Response from "./Response"; +import ResponseBillAmend from "./ResponseBillAmend"; +import WSDisconnectionResponse from "./DisconnectionApplication/WSDisconnectionResponse"; +import WSRestorationResponse from "./RestorationApplication/WSRestorationResponse"; + +const BILLSBreadCrumbs = ({ location }) => { + const { t } = useTranslation(); + + const search = useLocation().search; + const fromScreen = new URLSearchParams(search).get("from") || null; + const IsEdit = new URLSearchParams(search).get("isEdit") || null; + const applicationNumbercheck = new URLSearchParams(search).get("applicationNumber") || null; + let isMobile = window.Digit.Utils.browser.isMobile(); + let requestParam = window.location.href.split("?")[1]; + + function findLastIndex(array, searchKey, searchValue) { + var index = array.slice().reverse().findIndex(x => x[searchKey] === searchValue); + var count = array.length - 1 + var finalIndex = index >= 0 ? count - index : index; + return finalIndex; + } + + let crumbs = [ + { + path: "/digit-ui/employee", + content: t("ES_COMMON_HOME"), + show: true, + style: isMobile ? {width:"20%"} : {}, + }, + { + path: "/digit-ui/employee/ws/create-application", + content: t("ES_COMMON_WS_DOCUMENTS_REQUIRED"), + show: location.pathname.includes("/create-application") ? true : false, + }, + { + path: "/digit-ui/employee/water/inbox", + content: t("ES_COMMON_BILLS_WATER_INBOX_LABEL"), + show: location.pathname.includes("/water/inbox") ? true : false, + }, + { + path: "/digit-ui/employee/ws/water/bill-amendment/inbox", + content: t("ES_COMMON_BILL_AMEND_WATER_INBOX_LABEL"), + show: location.pathname.includes("/water/bill-amendment/inbox") ? true : false, + }, + { + path: "/digit-ui/employee/ws/sewerage/bill-amendment/inbox", + content: t("ES_COMMON_BILL_AMEND_SEWERAGE_INBOX_LABEL"), + show: location.pathname.includes("/sewerage/bill-amendment/inbox") ? true : false, + }, + { + path: "/digit-ui/employee/ws/water/search-application", + content: fromScreen ? `${t(fromScreen)} / ${t("WS_SEARCH_APPLICATIONS")}` : t("WS_SEARCH_APPLICATIONS"), + show: location.pathname.includes("/water/search-application") ? true : false, + isBack: fromScreen && true, + }, + { + path: "/digit-ui/employee/ws/water/search-connection", + content: fromScreen ? `${t(fromScreen)} / ${t("WS_SEARCH_CONNECTION")}` : t("WS_SEARCH_CONNECTION"), + show: location.pathname.includes("/water/search-connection") ? true : false, + isBack: fromScreen && true, + }, + { + path: "/digit-ui/employee/ws/water/wns-search", + content: fromScreen ? `${t(fromScreen)} / ${t("WS_SEARCH_INTEGRATED_BILL")}` : t("WS_SEARCH_INTEGRATED_BILL"), + show: location.pathname.includes("/water/wns-search") ? true : false, + isBack: fromScreen && true, + }, + { + path: "/digit-ui/employee/ws/sewerage/search-application", + content: fromScreen ? `${t(fromScreen)} / ${t("WS_SEARCH_APPLICATIONS")}` : t("WS_SEARCH_APPLICATIONS"), + show: location.pathname.includes("/sewerage/search-application") ? true : false, + isBack: fromScreen && true, + }, + { + path: "/digit-ui/employee/ws/sewerage/search-connection", + content: fromScreen ? `${t(fromScreen)} / ${t("WS_SEARCH_CONNECTION")}` : t("WS_SEARCH_CONNECTION"), + show: location.pathname.includes("/sewerage/search-connection") ? true : false, + isBack: fromScreen && true, + }, + { + path: "/digit-ui/employee/sewerage/inbox", + content: t("ES_COMMON_BILLS_SEWERAGE_INBOX_LABEL"), + show: location.pathname.includes("/sewerage/inbox") ? true : false, + }, + { + path: "/digit-ui/employee/ws/new-application", + content: t("ES_COMMON_WS_NEW_CONNECTION"), + show: location.pathname.includes("/new-application") ? true : false, + }, + { + path: `${location?.pathname}${location.search}`, + content: t("ACTION_TEST_RESPONSE"), + show: location.pathname.includes("/ws-response") ? true : false, + }, + { + path: "/digit-ui/employee/ws/consumption-details", + content: fromScreen ? `${t(fromScreen)} / ${t("WS_VIEW_CONSUMPTION_DETAIL")}` : t("WS_VIEW_CONSUMPTION_DETAIL"), + show: location.pathname.includes("/consumption-details") ? true : false, + isBack: fromScreen && true, + }, + // { + // path: sessionStorage.getItem("redirectedfromEDIT") === "true"? (applicationNumbercheck?.includes("SW_AP")? "/digit-ui/employee/ws/sewerage/search-application" : "/digit-ui/employee/ws/water/search-application") : "/digit-ui/employee/ws/application-details", + // content: fromScreen ? `${t(fromScreen)} / ${t("WS_APPLICATION_DETAILS_HEADER")}` : t("WS_APPLICATION_DETAILS_HEADER"), + // show: location.pathname.includes("/generate-note") ? true : false, + // isBack: sessionStorage.getItem("redirectedfromEDIT") !== "true" && fromScreen && true, + // }, + { + path: sessionStorage.getItem("redirectedfromEDIT") === "true"? (applicationNumbercheck?.includes("SW_AP")? "/digit-ui/employee/ws/sewerage/search-application" : "/digit-ui/employee/ws/water/search-application") : "/digit-ui/employee/ws/application-details", + content: fromScreen ? `${t(fromScreen)} / ${t("WS_APPLICATION_DETAILS_HEADER")}` : t("WS_APPLICATION_DETAILS_HEADER"), + show: location.pathname.includes("/application-details") ? true : false, + isBack: sessionStorage.getItem("redirectedfromEDIT") !== "true" && fromScreen && true, + }, + { + path: sessionStorage.getItem("redirectedfromEDIT") === "true"? (applicationNumbercheck?.includes("SW_AP")? "/digit-ui/employee/ws/sewerage/search-application" : "/digit-ui/employee/ws/water/search-application") : "/digit-ui/employee/ws/modify-details", + content: fromScreen ? `${t(fromScreen)} / ${t("WS_APPLICATION_DETAILS_HEADER")}` : t("WS_APPLICATION_DETAILS_HEADER"), + show: location.pathname.includes("/modify-details") ? true : false, + isBack: sessionStorage.getItem("redirectedfromEDIT") !== "true" && fromScreen && true, + }, + { + path: "/digit-ui/employee/ws/disconnection-details", + content: fromScreen ? `${t(fromScreen)} / ${t("WS_APPLICATION_DETAILS_HEADER")}` : t("WS_APPLICATION_DETAILS_HEADER"), + show: location.pathname.includes("/disconnection-details") ? true : false, + isBack: fromScreen && true, + }, + { + path: "/digit-ui/employee/ws/connection-details", + content: fromScreen ? `${t(fromScreen)} / ${t("WS_COMMON_CONNECTION_DETAIL")}` : t("WS_COMMON_CONNECTION_DETAIL"), + show: location.pathname.includes("/connection-details") ? true : false, + isBack: fromScreen && true, + }, + { + path: "/digit-ui/employee/ws/edit-application", + content: `${t("WS_APPLICATION_DETAILS_HEADER")} / ${t("WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL")}`, + show: location.pathname.includes("/edit-application") ? true : false, + isBack: true, + }, + { + path: `${location?.pathname}${location.search}`, + content: `${t("WS_APPLICATION_DETAILS_HEADER")} / ${t("WF_EMPLOYEE_NEWSW1_ACTIVATE_CONNECTION")}`, + show: location.pathname.includes("/activate-connection") ? true : false, + isBack: true, + }, + { + path: `${location?.pathname}${location.search}`, + content: `${t("WS_APPLICATION_DETAILS_HEADER")} / ${t("WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL")}`, + show: location.pathname.includes("edit-disconnection-application") ? true : false, + isBack: true, + }, + { + path: `${location?.pathname}${location.search}`, + content: `${t("WS_APPLICATION_DETAILS_HEADER")} / ${t("WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL")}`, + show: location.pathname.includes("config-by-disconnection-application") ? true : false, + isBack: true, + }, + { + path: `${location?.pathname}${location.search}`, + content: `${t("WS_APPLICATION_DETAILS_HEADER")} / ${t("WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL")}`, + show: location.pathname.includes("resubmit-disconnection-application") ? true : false, + isBack: true, + }, + { + path: `/digit-ui/employee/ws/new-disconnection/docsrequired`, + content: t("WS_NEW_DISCONNECTION_DOCS_REQUIRED"), + show: location.pathname.includes("/new-disconnection/docsrequired") ? true : false, + }, + { + path: `/digit-ui/employee/ws/new-disconnection/application-form`, + content: isMobile ? `${t("WS_NEW_DISCONNECTION_DOCS_REQUIRED")} / ${t("WS_NEW_DISCONNECTION_APPLICATION")}` : `${t("WS_NEW_DISCONNECTION_DOCS_REQUIRED")} / ${t("WS_NEW_DISCONNECTION_APPLICATION")}`, + show: location.pathname.includes("/new-disconnection/application-form") ? true : false, + isBack: true + }, + { + path: `${location?.pathname}${location.search}`, + content: `${t("WS_NEW_DISCONNECTION_RESPONSE")}`, + show: location.pathname.includes("/ws-disconnection-response") ? true : false, + isBack: true + }, + // { + // path: "/digit-ui/employee/sewerage/bill-amendment/inbox", + // content: t("ES_COMMON_BILLS_SEWERAGE_INBOX_LABEL"), + // show: location.pathname.includes("/sewerage/bill-amendment/inbox") ? true : false, + // }, + { + path: `${location?.pathname}${location.search}`, + content: fromScreen ? `${t(fromScreen)} / ${t("WS_MODIFY_CONNECTION_BUTTON")}`:t("WS_MODIFY_CONNECTION_BUTTON"), + show: location.pathname.includes("ws/modify-application") ? true : false, + isBack:true, + }, + { + path: "/digit-ui/employee/ws/required-documents", + content: t("ES_COMMON_WS_DOCUMENTS_REQUIRED"), + show: location.pathname.includes("/required-documents") ? true : false, + }, + { + path: requestParam ? `/digit-ui/employee/ws/bill-amendment?${requestParam}` : "/digit-ui/employee/ws/bill-amendment", + content: t("WS_BILL_AMEND_APP"), + show: location.pathname.includes("ws/bill-amendment") && !IsEdit ? true : false, + }, + { + path: "/digit-ui/employee/ws/bill-amendment", + content: t("WS_BILL_AMEND_EDIT_APP"), + show: location.pathname.includes("ws/bill-amendment") && IsEdit ? true : false, + }, + { + path: "/digit-ui/employee/ws/response", + content: t("WS_ACK_SCREEN"), + show: location.pathname.includes("/employee/ws/response") ? true : false, + isclickable : false, + }, + { + path: "/digit-ui/employee/ws/generate-note-bill-amendment", + content: t("CS_TITLE_GENERATE_NOTE"), + show: location.pathname.includes("/generate-note-bill-amendment") ? true : false, + //isclickable : false, + } + ]; + + let lastCrumbIndex = findLastIndex(crumbs,"show",true) + crumbs[lastCrumbIndex] = {...crumbs[lastCrumbIndex],isclickable: false} + + return
; +}; +const App = ({ path }) => { + console.log("ffffff",path) + const location = useLocation(); + + const WSDocsRequired = Digit?.ComponentRegistryService?.getComponent("WSDocsRequired"); + const WSInbox = Digit?.ComponentRegistryService?.getComponent("WSInbox"); + const WSDisconnectionDocsRequired = Digit?.ComponentRegistryService?.getComponent('WSDisconnectionDocsRequired'); + const WSApplicationBillAmendment = Digit?.ComponentRegistryService?.getComponent("WSApplicationBillAmendment"); + const WSRequiredDocuments = Digit?.ComponentRegistryService?.getComponent("WSRequiredDocuments"); + const WSNewApplication = Digit?.ComponentRegistryService?.getComponent("WSNewApplication"); + const WSApplicationDetails = Digit?.ComponentRegistryService?.getComponent("WSApplicationDetails"); + const WSGetConnectionDetails = Digit?.ComponentRegistryService?.getComponent("WSGetConnectionDetails"); + const WSActivateConnection = Digit?.ComponentRegistryService?.getComponent("WSActivateConnection"); + const WSApplicationDetailsBillAmendment = Digit?.ComponentRegistryService?.getComponent("WSApplicationDetailsBillAmendment"); + const WSSearch = Digit?.ComponentRegistryService?.getComponent("WSSearch"); + const WSSearchWater = Digit?.ComponentRegistryService?.getComponent("WSSearchWater"); + const WSEditApplication = Digit?.ComponentRegistryService?.getComponent("WSEditApplication"); + const WSConsumptionDetails = Digit?.ComponentRegistryService?.getComponent("WSConsumptionDetails"); + const WSModifyApplication = Digit?.ComponentRegistryService?.getComponent("WSModifyApplication"); + const WSEditModifyApplication = Digit?.ComponentRegistryService?.getComponent("WSEditModifyApplication"); + const WSDisconnectionApplication = Digit?.ComponentRegistryService?.getComponent("WSDisconnectionApplication"); + const WSRestorationApplication = Digit?.ComponentRegistryService?.getComponent("WSRestorationApplication"); + const WSEditApplicationByConfig = Digit?.ComponentRegistryService?.getComponent("WSEditApplicationByConfig"); + const WSBillIAmendMentInbox = Digit?.ComponentRegistryService?.getComponent("WSBillIAmendMentInbox"); + const WSGetDisconnectionDetails = Digit?.ComponentRegistryService?.getComponent("WSGetDisconnectionDetails"); + const WSModifyApplicationDetails = Digit?.ComponentRegistryService?.getComponent("WSModifyApplicationDetails"); + const WSEditDisconnectionApplication = Digit?.ComponentRegistryService?.getComponent("WSEditDisconnectionApplication"); + const WSEditDisconnectionByConfig = Digit?.ComponentRegistryService?.getComponent("WSEditDisconnectionByConfig"); + const WSResubmitDisconnection = Digit?.ComponentRegistryService?.getComponent("WSResubmitDisconnection"); + const WSSearchIntegrated = Digit?.ComponentRegistryService?.getComponent("WSSearchIntegrated"); + + const locationCheck = + window.location.href.includes("/employee/ws/new-application") || + window.location.href.includes("/employee/ws/modify-application") || + window.location.href.includes("/employee/ws/edit-application") || + window.location.href.includes("/employee/ws/activate-connection") || + window.location.href.includes("/employee/ws/application-details") || + window.location.href.includes("/employee/ws/modify-details") || + window.location.href.includes("/employee/ws/ws-response") || + window.location.href.includes("/employee/ws/new-disconnection/application-form") || + window.location.href.includes("/employee/ws/ws-disconnection-response") || + window.location.href.includes("/employee/ws/consumption-details") || + window.location.href.includes("/employee/ws/edit-disconnection-application") || + window.location.href.includes("/employee/ws/config-by-disconnection-application")|| + + window.location.href.includes("/employee/ws/resubmit-disconnection-application"); + + + + + const locationCheckReqDocs = window.location.href.includes("/employee/ws/create-application") || window.location.href.includes("/employee/ws/new-disconnection/docsrequired"); + + return ( + + +
+
+ +
+ + + + + + + + + + + } /> + } /> + } /> + } /> + } /> + + } /> + } /> + + + + } /> + } /> + } /> + } /> + + + + + + + } /> + } /> + } /> + + + } /> + } /> + } /> + + {/* + */} +
+
+
+ ); +}; + export default App; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/BackButton.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/BackButton.js index 995f9ec6c11..5546f26ce96 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/BackButton.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/BackButton.js @@ -3,13 +3,33 @@ import { ArrowLeft, ArrowLeftWhite } from "./svgindex"; import { withRouter } from "react-router-dom"; import { useTranslation } from "react-i18next"; -const BackButton = ({ history, style, isSuccessScreen, isCommonPTPropertyScreen, getBackPageNumber, className="" ,variant="black"}) => { +const BackButton = ({ history, style, isSuccessScreen, isCommonPTPropertyScreen, getBackPageNumber, className = "", variant = "black" }) => { const { t } = useTranslation(); - return ( -
{!isSuccessScreen ?( !isCommonPTPropertyScreen ? (history.goBack(), window.location.href.includes("/citizen/pt/property/new-application/property-type") ? sessionStorage.setItem("docReqScreenByBack",true) : null) : history.go(getBackPageNumber()) ): null}}> - {variant=="black"?( -

{t("CS_COMMON_BACK")}

):} +
{ + !isSuccessScreen + ? !isCommonPTPropertyScreen + ? window.location.href.includes("/citizen/fsm/new-application/street") + ? window.history.go(getBackPageNumber()) + : (history.goBack(), + window.location.href.includes("/citizen/pt/property/new-application/property-type") + ? sessionStorage.setItem("docReqScreenByBack", true) + : null) + : null + : null; + }} + > + {variant == "black" ? ( + + +

{t("CS_COMMON_BACK")}

+
+ ) : ( + + )}
); }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardBasedOptions.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardBasedOptions.js index 6e0ac9e213b..c1b7b96ecc2 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardBasedOptions.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/CardBasedOptions.js @@ -12,23 +12,15 @@ const Option = ({ name, Icon, onClick, className }) => { const CardBasedOptions = ({ header, sideOption, options, styles = {}, style={} }) => { return (
-
-

{header}

- {/*

*/} - -
-
-
- {options.map( (props, index) => -
-
- -
-
+
+

{header}

+

{sideOption.name}

+
+
+ {options.map((props, index) => ( +
); }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.js index 3ac3da8929a..d1d49cd9f16 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.js @@ -147,9 +147,9 @@ const Dropdown = (props) => { function selectOption(ind) { onSelect(filteredOption[ind]); } - if (props?.option?.[0]?.label == "PropertyType") { - filteredOption = props.option - } + // if (props?.option?.[0]?.label == "PropertyType") { + // filteredOption = props.option + // } if(props.isBPAREG && selectedOption) { let isSelectedSameAsOptions = props.option?.filter((ob) => ob?.code === selectedOption?.code)?.length > 0; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeModuleCard.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeModuleCard.js index 09117f70964..bef8a622aa5 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeModuleCard.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeModuleCard.js @@ -139,4 +139,4 @@ const ModuleCardFullWidth = ({ moduleName, links = [], isCitizen = false, class ); }; -export { EmployeeModuleCard, ModuleCardFullWidth }; +export { EmployeeModuleCard, ModuleCardFullWidth }; \ No newline at end of file diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.js index 8771253cdb0..5c15f101c9b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.js @@ -7,7 +7,7 @@ const Rating = (props) => { var stars = []; const star = useRef(null); - const calculatingPercentage = (percentage) => { + /* const calculatingPercentage = (percentage) => { if (percentage >= 85 && percentage < 90) { return percentage - 8 } else if (percentage >= 90 && percentage < 95) { @@ -17,12 +17,12 @@ const Rating = (props) => { } else { return percentage } - } + } */ for (var i = 1; i <= props.maxRating; i++) { if (i - props.currentRating <= 0) { const index = i; // stars.push(star filledprops.onFeedback(e,ref)}/>) - stars.push( props.onFeedback(e, star, index)} />); + stars.push( props.onFeedback(e, star, index)} percentage={Math.round(((props.currentRating - parseInt(props.currentRating)) * 100))} />) } else if (i - props.currentRating > 0 && i - props.currentRating < 1) { const index = i; stars.push( props.onFeedback(e, star, index)} percentage={calculatingPercentage(Math.round(((props.currentRating - parseInt(props.currentRating)) * 100)))} />) @@ -34,21 +34,8 @@ const Rating = (props) => { } return ( -
- {props?.toolTipText ? -
-
-
-

{props.text ? props.text : ""} {stars}

- - {`${props.currentRating}`} - -
-
-
: -
- {props.text ? props.text : ""} {stars} -
} +
+ {props.text ? props.text : ""} {stars}
); diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/StatusTable.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/StatusTable.js index 80f6171b936..da2f9e6edd8 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/StatusTable.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/StatusTable.js @@ -106,7 +106,7 @@ export const MediaRow = (props) => { return (

{props.label}

- {props.children} + {/* {props.children} */}
); }; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/FormComposer.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/FormComposer.js index 96b6fbd7d92..f69ce8af66c 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/FormComposer.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/hoc/FormComposer.js @@ -98,7 +98,9 @@ export const FormComposer = (props) => { case "mobileNumber": return ( } + render={(props) => ( + + )} defaultValue={populators.defaultValue} name={populators?.name} control={control} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/index.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/index.js index 3fb04f03aba..0665791626f 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/index.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/index.js @@ -199,6 +199,7 @@ import DashboardBox from "./molecules/DashboardBox"; import DetailsCard from "./molecules/DetailsCard"; import FilterAction from "./molecules/FilterAction"; import FormStep from "./molecules/FormStep"; +import CustomDropdown from "./molecules/CustomDropdown"; import InputCard from "./molecules/InputCard"; import Localities from "./molecules/Localities"; import LocationSearchCard from "./molecules/LocationSearchCard"; @@ -349,6 +350,7 @@ export { // Molecule InputCard, FormStep, + CustomDropdown, RatingCard, SearchAction, FilterAction, diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/CustomDropdown.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/CustomDropdown.js new file mode 100644 index 00000000000..17b6f383708 --- /dev/null +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/CustomDropdown.js @@ -0,0 +1,144 @@ +import _ from "lodash"; +import React from "react"; +import { Loader } from "../atoms/Loader"; +import RadioButtons from "../atoms/RadioButtons"; +import Dropdown from "../atoms/Dropdown"; + +/** + * Custom Dropdown / Radio Button component can be used mostly via formcomposer + * + * @author jagankumar-egov + * + * @example + * + * + * { + * component: "CustomDropdown", + isMandatory: false, + key: "gender", + type: "radio", + label: "Enter Gender", + disable: false, + populators: { + name: "gender", + optionsKey: "name", + error: "sample required message", + required: false, + options: [ + { + code: "MALE", + name: "MALE", + }, + { + code: "FEMALE", + name: "FEMALE", + }, + { + code: "TRANSGENDER", + name: "TRANSGENDER", + }, + ], + }, + } +or + { + component: "CustomDropdown", + isMandatory: true, + key: "genders", + type: "radioordropdown", + label: "Enter Gender", + disable: false, + populators: { + name: "genders", + optionsKey: "name", + error: "sample required message", + required: true, + mdmsConfig: { + masterName: "GenderType", + moduleName: "common-masters", + localePrefix: "COMMON_GENDER", + }, + }, + }, + * + */ +const CustomDropdown = ({ t, config, inputRef, label, onChange, value, errorStyle, disable, type, additionalWrapperClass = "" }) => { + const master = { name: config?.mdmsConfig?.masterName }; + if (config?.mdmsConfig?.filter) { + master["filter"] = config?.mdmsConfig?.filter; + } + const { isLoading, data } = Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(), config?.mdmsConfig?.moduleName, [master], { + select: config?.mdmsConfig?.select + ? Digit.Utils.createFunction(config?.mdmsConfig?.select) + : (data) => { + const optionsData = _.get(data, `${config?.mdmsConfig?.moduleName}.${config?.mdmsConfig?.masterName}`, []); + return optionsData + .filter((opt) => (opt?.hasOwnProperty("active") ? opt.active : true)) + .map((opt) => ({ ...opt, name: `${config?.mdmsConfig?.localePrefix}_${Digit.Utils.locale.getTransformedLocale(opt.code)}` })); + }, + enabled: config?.mdmsConfig ? true : false, + }); + if (isLoading) { + return ; + } + + // const getValue = () => { + // let selectedValue = "" + // if(data?.length === 1 || config?.options?.length === 1) { + // selectedValue = data?.[0] || config?.options?.[0] + // } else { + // selectedValue = value + // } + // return selectedValue + // } + return ( + + {/* + + {t(label)} + {config.required ? " * " : null} + */} + {type === "radio" ? ( + { + onChange(e, config.name); + }} + disable={disable} + selectedOption={value} + defaultValue={value} + t={t} + errorStyle={errorStyle} + additionalWrapperClass={additionalWrapperClass} + innerStyles={config?.innerStyles} + /> + ) : ( + { + onChange(e, config.name); + }} + disable={disable} + selected={value || config.defaultValue} + defaultValue={value || config.defaultValue} + t={t} + errorStyle={errorStyle} + optionCardStyles={config?.optionsCustomStyle} + /> + )} + {/* */} + + ); +}; + +export default CustomDropdown; diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/FormStep.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/FormStep.js index 851b9ea4c70..a0972c08930 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/FormStep.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/FormStep.js @@ -40,7 +40,7 @@ const FormStep = ({ if (input.type === "text") { return ( - {t(input.label)} {input.labelChildren && input.labelChildren} + {t(input.label)} {errors[input.name] && {t(input.error)}}
{componentInFront ? {componentInFront} : null} diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.js b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.js index da17d180366..40602478ea8 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.js @@ -3,7 +3,7 @@ import { useForm } from "react-hook-form"; import PropTypes from "prop-types"; import TextArea from "../atoms/TextArea"; -import TextInput from "../atoms/TextInput"; +// import TextInput from "../atoms/TextInput"; import CardLabel from "../atoms/CardLabel"; import Rating from "../atoms/Rating"; import CheckBox from "../atoms/CheckBox"; @@ -17,7 +17,7 @@ const RatingCard = ({ config, onSelect, t }) => { const { register, watch, handleSubmit } = useForm(); const [comments, setComments] = useState(""); const [rating, setRating] = useState(0); - const [textInput, setTextInput] = useState(0); + // const [textInput, setTextInput] = useState(0); const onSubmit = (data) => { data.rating = rating; @@ -85,7 +85,7 @@ const RatingCard = ({ config, onSelect, t }) => { ); } - if (input.type === "text") { + /*if (input.type === "text") { return ( {t(input.label)} @@ -93,7 +93,7 @@ const RatingCard = ({ config, onSelect, t }) => { ); - } + } */ }); return ( diff --git a/frontend/micro-ui/web/micro-ui-internals/scripts/create.sh b/frontend/micro-ui/web/micro-ui-internals/scripts/create.sh old mode 100755 new mode 100644 diff --git a/frontend/micro-ui/web/micro-ui-internals/scripts/deploy.sh b/frontend/micro-ui/web/micro-ui-internals/scripts/deploy.sh old mode 100755 new mode 100644 diff --git a/frontend/micro-ui/web/micro-ui-internals/scripts/jenkins.sh b/frontend/micro-ui/web/micro-ui-internals/scripts/jenkins.sh old mode 100755 new mode 100644 diff --git a/frontend/micro-ui/web/micro-ui-internals/scripts/run.sh b/frontend/micro-ui/web/micro-ui-internals/scripts/run.sh old mode 100755 new mode 100644 diff --git a/frontend/micro-ui/web/package.json b/frontend/micro-ui/web/package.json index c4542c2ddc2..ecb1b25ab92 100644 --- a/frontend/micro-ui/web/package.json +++ b/frontend/micro-ui/web/package.json @@ -11,11 +11,11 @@ "micro-ui-internals/packages/modules/dss", "micro-ui-internals/packages/modules/pgr", "micro-ui-internals/packages/modules/pt", + "micro-ui-internals/packages/modules/ws", + "micro-ui-internals/packages/modules/fsm", "micro-ui-internals/packages/modules/commonPt", "micro-ui-internals/packages/modules/mCollect", "micro-ui-internals/packages/modules/obps" - - ], "engines": { "node": ">=14" diff --git a/frontend/micro-ui/web/src/App.js b/frontend/micro-ui/web/src/App.js index 1452f146071..c471fbe0cfa 100644 --- a/frontend/micro-ui/web/src/App.js +++ b/frontend/micro-ui/web/src/App.js @@ -38,6 +38,8 @@ import { initCommonPTComponents } from "@egovernments/digit-ui-module-commonpt"; import { initBillsComponents } from "@egovernments/digit-ui-module-bills"; // import { initReportsComponents } from "@egovernments/digit-ui-module-reports"; +window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH"); + initLibraries(); const enabledModules = [ @@ -101,6 +103,7 @@ const moduleReducers = (initData) => ({ }); function App() { + window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH"); const stateCode = window.globalConfigs?.getConfig("STATE_LEVEL_TENANT_ID") || process.env.REACT_APP_STATE_LEVEL_TENANT_ID; diff --git a/frontend/micro-ui/yarn.lock b/frontend/micro-ui/yarn.lock deleted file mode 100644 index fb57ccd13af..00000000000 --- a/frontend/micro-ui/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/frontend/mono-ui/.gitignore b/frontend/mono-ui/.gitignore index c2d722c2906..ea4f50a5208 100644 --- a/frontend/mono-ui/.gitignore +++ b/frontend/mono-ui/.gitignore @@ -5,7 +5,6 @@ node_modules/ keystore/ web/rainmaker/yarn.lock -*.css + *.lock web/rainmaker/yarn.lock -index.lock diff --git a/frontend/mono-ui/LICENSE b/frontend/mono-ui/LICENSE index 43771c89fb0..335fd5f8652 100644 --- a/frontend/mono-ui/LICENSE +++ b/frontend/mono-ui/LICENSE @@ -1,91 +1,21 @@ -# UPYOG CODE, COPYRIGHT AND CONTRIBUTION LICENSE TERMS - -THIS OPEN SOURCE LICENSE ("LICENSE") DEFINES THE RIGHTS OF USE, COPY, REPRODUCTION, DISPLAY, PUBLICATION, DISTRIBUTION, REDISTRIBUTION AND MODIFICATION OF UPYOG, ORIGINALLY RELEASED BY THE NATIONAL INSTITUTE OF URBAN AFFAIRS (“NIUA”) ACTING ON BEHALF OF THE MINISTRY OF HOUSING AND URBAN AFFAIRS, GOVERNMENT OF INDIA. ANYONE WHO USES, COPIES, REPRODUCES, DISPLAYS, PUBLISHES, DISTRIBUTES, REDISTRIBUTES OR MODIFIES ‘UPYOG’ OR ANY PART THEREOF, IS BY THAT ACTION, ACCEPTING IN FULL THE RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS LICENSE. - -PLEASE READ THIS LICENSE CAREFULLY. - - -## 1. DEFINITION - -1.1. “Contributor” means any person or entity that creates or contributes to the creation of Modifications. - -1.2. “Covered Code” means the combination of the Original Code and any Modifications, and/or any portion thereof. - -1.3. “Larger Work” means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. - -1.4. “Modification” means any improvement, bug fix, error correction, embedded commenting enhancement, extension, rewrite, edit, addition to, deletion from, derivative work and/ or change to, the substance and/or structure of the Original Code and any previous Modifications, and/or any respective portions thereof, which is conceived and/or developed pursuant to this License, including by You and/or Your Representatives. - -1.5. “Original Code” means (a) the source code of UPYOG originally made available by the NIUA under this License as well as the source code of any updates or upgrades to UPYOG made available by the NIUA under this License; and (b) the object code compiled from such source code and originally made available by NIUA under this License. - -1.6. “Public money” means money, funds, or accounts, regardless of the source from which they are derived, that are owned, owed to, held, or administered by the Central Government any State Government(s), the local Government(s) or any ministry, department, agency, or any other person for or on behalf of any Local, State, or Central Government or any ministry, department or agency (collectively "Public Functionary"), including but not limited to those funded or controlled, directly or indirectly, by a State as defined in Article 12 of the Constitution of India. - -1.7. “Representative” means with respect to You, any and all of Your employees, directors, officers, consultants, advisors, agents, other lawful representatives and third party agencies such as implementation partner, engaged by You. - -1.8. “UPYOG” means an open-source, shared digital platform to enable the rollout of urban e-Governance services as part of the offerings under National Urban Digital Mission aimed to support States and Union Territories in their efforts to roll out the online delivery of municipal services in all their Urban Local Bodies ("ULBs"). This includes the common platform components and the reference applications, and additional applications which may be required by the ULBs, developed under the National Urban Digital Mission. - -1.9. “You” or “Your” means any legal person (individual, entity, organisation, company, trust, public sector undertaking, government departments and bodies, constitutional authorities etc.) exercising the rights granted under this License. - - -## 2. GRANT OF LICENSE - -2.1. Subject to the terms and conditions of this License, NIUA hereby grants You, a perpetual, non-exclusive, worldwide, open, no-charge, royalty-free, irrevocable copyright license, to the extent of NIUA’s copyrights covering the Original Code, to deal in the Original Code without restriction, including without limitation, the rights to use, copy, display, publish, reproduce, distribute, modify, redistribute, download or onboard the Original Code or any part thereof, for commercial or non-commercial purposes, and permit persons to whom the Original Code or Modification is furnished to do the same. Provided, however: (i) You shall retain and reproduce in all copies of the Original Code, the copyright notice, trademark, attribution notices, disclaimers of warranty, or limitations of liability as they appear in the Original Code and keep intact all notices in the Original Code that refer to this License; and (ii) You shall provide a copy of this License with every copy of the Original Code or Modification you distribute, redistribute, sell etc. - -2.2. You may modify the Original Code and use, copy, display, publish, reproduce, distribute, redistribute Your Modifications and the Covered Code for commercial or non-commercial purposes, provided that in each instance you shall: - -2.2.1. Satisfy all the conditions of the Proviso to Clause 2.1 with respect to the Original Code; - -2.2.2. You must identify yourself as the originator of Your Modification in a manner that reasonably allows subsequent recipients to identify and contact You as the originator of the Modification and cause the modified files to carry prominent notices stating that You modified the files. In fulfilment of these requirements, You must include a file (e.g., a change log file) that describes the alterations made to the Original Code, the date of the alterations, and include an express statement that the Modification is derived, directly or indirectly, from the Original Code provided by NIUA and give due acknowledgment and credit to Upyog by indicating that the Modification developed using the Original Code is ‘Powered by Upyog’; and - -2.2.3. In case Your Modification is sponsored by or done from Public Moneys, Your Modification and the Covered Code must be released under the same terms, applicable on a reciprocal basis, as set forth in this License and You shall furnish to NIUA, the source code and object code of such Modification and the Covered Code. Therefore, as a condition to the rights granted to You under this License and in consideration of the Public Moneys utilised by You for developing the Modification and the Covered Code, you hereby grant a perpetual, non-exclusive, worldwide, open, no-charge, royalty-free, irrevocable license to NIUA, to the extent of Your copyrights and other intellectual property rights owned or controlled by You in such Modification and Covered Code, to deal in Your Modification and/or the Covered Code without restriction, including but not limited to, use, copy, display, publish, reproduce, distribute, modify, redistribute, download or onboard Your Modification, the Covered Code or any part thereof, for commercial or non-commercial purposes, in source code and object form and permit persons to whom Your Modification, the Covered Code or any part thereof is furnished to do the same. - -2.3. You expressly agree and acknowledge that no assurances are provided by NIUA that the Original Code does not infringe intellectual property rights of any other entity. NIUA disclaims any liability to You for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, You hereby assume sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow You to distribute Your Modification and/ or Covered Code and/ or Larger Work, it is your responsibility to acquire the license before distributing such work. In each such instance, You must make sure the requirements of this License are fulfilled for the Original Code and/or the Covered Code, or any portion thereof, as applicable. - -2.4. You may not make any representation in the Original Code or in any promotional, advertising or other material that may be construed as an endorsement by NIUA of any product or service provided by You, or seek to obtain any commercial advantage by the fact of NIUA's participation in this License. - - -## 3. DISCLAIMER OF WARRANTIES AND LIABILITIES; WAIVER AND INDEMNIFICATION - -3.1. THE ORIGINAL CODE MAY CONTAIN ERRORS THAT COULD CAUSE FAILURES OR LOSS OF DATA, AND MAY BE INCOMPLETE OR CONTAIN INACCURACIES. YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT USE OF THE ORIGINAL CODE, OR ANY PORTION THEREOF, IS AT YOUR SOLE AND ENTIRE RISK. THE ORIGINAL CODE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE ORIGINAL CODE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT. THE GOVERNMENT OF INDIA AND NIUA DO NOT WARRANT AGAINST INTERFERNCE OF YOUR ENJOYMENT OF THE ORIGINAL CODE, THAT THE OPERATION OF THE ORIGINAL CODE WILL BE UNITERRUPTED OR ERROR FREE, OR THAT DEFECTS IN THE ORIGINAL CODE WILL BE CORRECTED. SHOULD THE ORIGINAL CODE PROVE DEFECTIVE IN ANY RESPECT, YOU ASSUME THE COST OF ANY NECESSARRY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF THE ORIGINAL CODE IS AUTHORISED UNDER THIS LICENSE EXCEPT UNDER THIS DISCLAIMER. - -3.2. YOU AGREE TO WAIVE ANY AND ALL CLAIMS AGAINST THE GOVERNMENT OF INDIA AND NIUA. IF YOUR USE OF THE ORIGINAL CODE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, YOU SHALL INDEMNIFY AND HOLD HARMLESS THE GOVERNMENT OF INDIA AND NIUA, TO THE EXTENT PERMITTED BY LAW. - -3.3. YOU HEREBY AGREE TO DEFEND AND INDEMNIFY THE GOVERNMENT OF INDIA AND NIUA AGAINST ANY LOSSES, DAMAGES AND COSTS (COLLECTIVELY “LOSSES”) ARISING FROM CLAIMS, LAWSUITS AND OTHER LEGAL ACTIONS BROUGHT BY A THIRD PARTY AGAINST THE GOVERNMENT OF INDIA AND NIUA CAUSED BY YOUR BREACH OF ANY OF THE TERMS OF THIS LICENSE AND/OR YOUR REPRESENTATIONS, COVENANTS AND/ OR OBLIGATIONS. - -3.4. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE GOVERNMENT OF INDIA AND NIUA, BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES WHETHER COMMERCIAL OR OTHERWISE, ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE ORIGINAL CODE, OR ANY PORTION THEREOF. - -3.5. YOU SHALL NOTIFY THE GOVERNMENT OF INDIA AND NIUA IN WRITING OF (I) ANY ACTUAL, SUSPECTED OR APPARENT MISUSE OR MISAPPROPRIATION OF THE ORIGINAL CODE BY ANY THIRD PARTY; (II) ANY ALLEGATION OR CLAIM BY A THIRD PARTY THAT THE USE OF ORIGINAL CODE INFRINGES SUCH THIRD PARTY’S INTELLECTUAL PROPERTY RIGHTS; OR (III) ANY OTHER CIRCUMSTANCE WHICH MAY ADVERSLY AFFECT THE RIGHTS OF THE GOVERNMENT OF INDIA AND NIUA. - -3.6. UNDER THIS LICENSE; WHICH COMES TO YOUR ATTENTION OR YOU MAY BECOME AWARE OF, IMMEDIATELY ON SUCH INFORMATION OR KNOWLEDGE BEING RECEIVED BY YOU, GIVING FULL PARTICULARS THEREOF. - - -## 4. COMMERCIAL DISTRIBUTION - -4.1. In the event You include the Original Code in a commercial product offering, you should do so in a manner that does not create potential liability for the Government of India and NIUA. Therefore, you hereby agree to defend and indemnify the Government of India and NIUA against any Losses arising from claims, lawsuits and other legal actions brought by a third party against the Government of India and NIUA caused by Your acts or omissions in connection with Your distribution of the Original Code in the commercial product offering. - -4.2. In case You choose to offer, and to charge a fee for, warranty, support, indemnity and/or liability obligations to one or more recipients of the Original Code, you do so only on Your own behalf and as Your sole responsibility, and not on behalf of the Government of India, NIUA or any other Contributor. You must make it absolutely clear that any such warranty, support, indemnity and/or liability obligation is offered by You alone. Further, you agree to indemnify, defend and hold harmless the Government of India, NIUA and every other Contributor for any liability incurred by or claim asserted against the Government of India, NIUA or such Contributor as a result of such warranty, support, indemnity and/or liability offered by You. - - -## 5. TRADEMARK - -5.1. This License does not grant any rights to use the trademarks, service marks, logos or trade names or symbols belonging to or associated with NIUA, CDG, UPYOG or any government or other agencies associated with UPYOG (“collectively Marks”). You agree not to use any Marks in or as part of the name of products derived from the Original Code or to endorse or promote products derived from the Original Code. - - -## 6. OWNERSHIP -6.1. NIUA retains all rights title and interest in and to the Original Code and any Modifications made by or on behalf of NIUA. Subject to and save and except as set out in the terms of this License, each Contributor retains all rights, title and interest in and to any Modification made by such Contributor. - - -## 7. GENERAL TERMS -7.1. This License will not be construed as creating an agency, partnership, joint venture, association of persons or any other form of association, legal or otherwise, between or among You and NIUA, and You will not represent to the contrary, whether expressly, by implication, appearance or otherwise. Nothing contained in this License shall be construed to (i) constitute any form of a fiduciary relationship between You and NIUA; or (ii) give You the authority to bind, to contract in the name of, or to create a liability for NIUA, in any manner. - -7.2. Nothing in this License will impair NIUA’s rights to acquire, license, develop, have others develop for it, technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Larger Works, technology, or products You may develop, produce, market or distribute. - -7.3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License. - -7.4. This License shall be governed by and construed in accordance with the laws of India. - -7.5. Any litigation relating to this License may be brought only in the courts of New Delhi and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict of law provisions. - - -## 8. END OF UPYOG code, copyright, and contribution license terms. - - +MIT License + +Copyright (c) 2019 eGovernments Foundation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/frontend/mono-ui/README.md b/frontend/mono-ui/README.md index 7c7e84ab72b..4276881e2c3 100644 --- a/frontend/mono-ui/README.md +++ b/frontend/mono-ui/README.md @@ -1,111 +1,8 @@ -# UPYOG MONO UI +# DIGIT CityOS refernce web apps -UPYOG (Urban Platform for deliverY of Online Governance) is India's largest platform for governance services. Visit [UPYOG documentation portal](https://upyog-docs.gitbook.io/upyog-v-1.0/) for more details. +DIGIT (Digital Infrastructure for Governance, Impact & Transformation) is India's largest platform for governance services. Visit https://www.digit.org for more details. This repository contains the reference responsive web app implementations of core modules for Citizens and Government employees/officers. #### License -UPYOG Source Code is open sources under License [UPYOG CODE, COPYRIGHT AND CONTRIBUTION LICENSE TERMS](https://upyog.niua.org/employee/Upyog%20Code%20and%20Copyright%20License_v1.pdf) - -## Rainmaker - ---- - -Below are the steps to run project in dev and production, first time user should install lerna as global dependency, below is the command. - -Note : Node should be above version 8. - -First switch to this working directory frontend/web/rainmaker -and do - -``` -$ yarn install -$ yarn install --global lerna - -``` - -### Steps for development - -- Step 1 - go command will transpile all the dependent modules from /dev-packages to /packages and link them to the respective packages in the repo. It will also take care of installing all the required npm packages inside each module including citizen and employee. - -``` -$ yarn run go - -``` - -- Step 2 - if you want to run citizen - -``` -$ yarn run dev:citizen - -``` - -or - -- Step 2 - if you want to run employee - -``` -$ yarn run dev:employee - -``` - -### Steps for production - -- Step 1 - lerna bootstrap will link dependencies in the repo together - -``` -$ lerna bootstrap - -``` - -- Step 2 - if you want to build citizen - -``` -$ yarn run prod:citizen - -``` - -or - -- Step 2 - if you want to build employee - -``` -$ yarn run prod:employee - -``` - -Tech stack used in Rainmaker App:- - -- React JS - https://reactjs.org/ -- Redux - https://redux.js.org/ -- Material UI - https://material-ui.com/ -- Javascript -- CSS/SASS - -Dev tools:- - -- Lerna - https://lernajs.io/ -- Babel - https://babeljs.io/ -- Webpack - https://webpack.js.org/ - -Links for tutorial related to get familiar with tech stack ( For new joinees/ contributors who wish to work on project):- - -1) JavaScript ES6 Tutorial - https://www.youtube.com/playlist?list=PL4cUxeGkcC9gKfw25slm4CUDUcM_sXdml&fbclid=IwAR0XIm0bvO9mUG71kP-rTK8rTJAcCRlz2VlnaKzfjbCCGyNDOa4AwmHL6Ls -This tutorial give idea about some of the new features available to us with ES6 - generators, constants, the let keyword, template strings and more. - -2) How to Learn React — A roadmap from beginner to advanced - https://medium.freecodecamp.org/learning-react-roadmap-from-scratch-to-advanced-bff7735531b6 -This guide gives consise idea about react and provides roadmap to excel in react. This provide curated links to one of best material along with prerequisites for react. - -3) Getting Started With Material-UI For React (Material Design For React) - https://medium.com/codingthesmartway-com-blog/getting-started-with-material-ui-for-react-material-design-for-react-364b2688b555 -This 8 min read article gives idea about setting up material ui in your react application with deploying sample application. - -4) Understanding Redux: The World’s Easiest Guide to Beginning Redux - https://medium.freecodecamp.org/understanding-redux-the-worlds-easiest-guide-to-beginning-redux-c695f45546f6 -One of the best and comprehensive guide for redux beginners. - -### Created by - - -### Updated by - ---- - +These reference apps are released under GPL V3.0 diff --git a/frontend/mono-ui/build/build-config.yml b/frontend/mono-ui/build/build-config.yml index 423d17edb58..65d2dafd78f 100644 --- a/frontend/mono-ui/build/build-config.yml +++ b/frontend/mono-ui/build/build-config.yml @@ -1,52 +1,48 @@ -# # config: -# - name: < Name of the job, foo/bar would create job named bar inside folder foo > +# - name: < Name of the job, foo/bar would create job named bar inside folder foo > # build: -# - work-dir: < Working directory of the app to be built > -# dockerfile: < Path to the dockerfile, optional, assumes dockerfile in working directory if not provided > -# image-name: < Docker image name > -# - -# - +# - work-dir: < Working directory of the app to be built > +# dockerfile: < Path to the dockerfile, optional, assumes dockerfile in working directory if not provided > +# image-name: < Docker image name > config: -- name: builds/digit-impel-builds/frontend/citizen + - name: builds/frontend/citizen build: - - work-dir: web/rainmaker/ - dockerfile: web/rainmaker/docker/citizen/Dockerfile - image-name: citizen + - work-dir: web/rainmaker/ + dockerfile: web/rainmaker/docker/citizen/Dockerfile + image-name: citizen -- name: builds/digit-impel-builds/frontend/employee + - name: builds/frontend/employee build: - - work-dir: web/rainmaker/ - dockerfile: web/rainmaker/docker/employee/Dockerfile - image-name: employee + - work-dir: web/rainmaker/ + dockerfile: web/rainmaker/docker/employee/Dockerfile + image-name: employee -- name: builds/digit-impel-builds/frontend/employee-mcs + - name: builds/frontend/employee-mcs build: - - work-dir: web/rainmaker/ - dockerfile: web/rainmaker/docker/employee-mcs/Dockerfile - image-name: employee-mcs + - work-dir: web/rainmaker/ + dockerfile: web/rainmaker/docker/employee-mcs/Dockerfile + image-name: employee-mcs -- name: builds/digit-impel-builds/frontend/localization + - name: builds/frontend/localization build: - - work-dir: web/rainmaker/ - dockerfile: web/rainmaker/docker/localization/Dockerfile - image-name: ui-localisation - -- name: builds/digit-impel-builds/frontend/ui-uploader + - work-dir: web/rainmaker/ + dockerfile: web/rainmaker/docker/localization/Dockerfile + image-name: ui-localisation + - name: builds/frontend/ui-uploader build: - - work-dir: web/ui-uploader/ - image-name: ui-uploader + - work-dir: web/ui-uploader/ + image-name: ui-uploader -- name: builds/digit-impel-builds/frontend/dss-dashboard + - name: builds/frontend/dss-dashboard build: - - work-dir: web/dss-dashboard/ - dockerfile: web/dss-dashboard/docker/Dockerfile - image-name: dss-dashboard - -- name: builds/digit-impel-builds/frontend/common-screen + - work-dir: web/dss-dashboard/ + dockerfile: web/dss-dashboard/docker/Dockerfile + image-name: dss-dashboard + + - name: builds/frontend/common-screen build: - - work-dir: web/egov-common-screen/ - dockerfile: web/egov-common-screen/docker/Dockerfile - image-name: common-screen + - work-dir: web/egov-common-screen/ + dockerfile: web/egov-common-screen/docker/Dockerfile + image-name: common-screen diff --git a/frontend/mono-ui/web/dss-dashboard/docker/nginx.conf b/frontend/mono-ui/web/dss-dashboard/docker/nginx.conf index 0c8200c26fd..84c3eb0cdb8 100644 --- a/frontend/mono-ui/web/dss-dashboard/docker/nginx.conf +++ b/frontend/mono-ui/web/dss-dashboard/docker/nginx.conf @@ -2,8 +2,7 @@ server { listen 80; underscores_in_headers on; - server_tokens off; - + location /dashboard { root /var/web; diff --git a/frontend/mono-ui/web/dss-dashboard/package.json b/frontend/mono-ui/web/dss-dashboard/package.json index d3b340e99b8..4a4607ccf3c 100644 --- a/frontend/mono-ui/web/dss-dashboard/package.json +++ b/frontend/mono-ui/web/dss-dashboard/package.json @@ -1,9 +1,9 @@ { "name": "e-governance", - "version": "1.10.0-beta", + "version": "1.3.0", "private": true, "homepage": "/dashboard/", - "proxy": "https://qa.digit.org", + "proxy": "https://egov-micro-qa.egovernments.org", "dependencies": { "@date-io/date-fns": "^1.3.11", "@material-ui/core": "^4.5.1", @@ -49,10 +49,7 @@ "redux-thunk": "^2.3.0", "typeface-roboto": "^0.0.75", "typescript": "^3.6.3", - "xlsx": "^0.15.1", - "d3-scale": "^3.2.1", - "react-simple-maps": "^2.0.0", - "react-tooltip": "^4.1.2" + "xlsx": "^0.15.1" }, "scripts": { "start": "react-scripts start", diff --git a/frontend/mono-ui/web/dss-dashboard/public/browser-icon.png b/frontend/mono-ui/web/dss-dashboard/public/browser-icon.png new file mode 100644 index 00000000000..32e2488b00e Binary files /dev/null and b/frontend/mono-ui/web/dss-dashboard/public/browser-icon.png differ diff --git a/frontend/mono-ui/web/dss-dashboard/public/index.html b/frontend/mono-ui/web/dss-dashboard/public/index.html index 7c1f86450a9..c1a69c34238 100644 --- a/frontend/mono-ui/web/dss-dashboard/public/index.html +++ b/frontend/mono-ui/web/dss-dashboard/public/index.html @@ -4,7 +4,8 @@ - + + diff --git a/frontend/mono-ui/web/dss-dashboard/src/App.css b/frontend/mono-ui/web/dss-dashboard/src/App.css index 1ce3c3d767e..42fd2497140 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/App.css +++ b/frontend/mono-ui/web/dss-dashboard/src/App.css @@ -1,34 +1,18 @@ body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, "Roboto" !important; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - background-color: rgb(238, 238, 238); -} -.tab-header { - font-weight: bold; - font-size: 16px; - line-height: 19px; - border-bottom: 1px solid #b1b4b6; - color: #2a3340; -} -.tab-rows { - display: flex; - justify-content: space-between; - height: 30px; - align-items: center; - width: 60%; - margin-left: 13%; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Roboto" !important; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } + code { - font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", - monospace; + font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; } header { - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } .col-lg-1, @@ -44,254 +28,243 @@ header { .col-lg-8, .col-lg-9, .col-lg-auto { - padding-right: 10px !important; - padding-left: 10px !important; + padding-right: 10px !important; + padding-left: 10px !important; } .App { - text-align: center; + text-align: center; } .App-logo { - height: 40vmin; + height: 40vmin; } .App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; } .App-link { - color: #09d3ac; + color: #09d3ac; } i { - padding: 5px !important; + padding: 5px !important; } a { - color: black !important; + color: black !important; } li { - font-family: Roboto; - font-size: 14px; - font-weight: normal; - font-stretch: normal; - font-style: normal; - line-height: normal; - letter-spacing: normal; - color: var(--black); + font-family: Roboto; + font-size: 14px; + font-weight: normal; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; + color: var(--black); } .heading { - width: 262px; - height: 21px; - font-family: Roboto !important; - font-size: 16px; - font-weight: normal; - font-stretch: normal; - font-style: normal; - line-height: normal; - letter-spacing: normal; - color: var(--black); - padding-left: 12px; + width: 262px; + height: 21px; + font-family: Roboto !important; + font-size: 16px; + font-weight: normal; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; + color: var(--black); + padding-left: 12px; } .help { - width: 35px; - height: 18px; - font-family: Roboto; - font-size: 14px; - font-weight: normal; - font-stretch: normal; - font-style: normal; - line-height: normal; - letter-spacing: normal; - color: var(--black); + width: 35px; + height: 18px; + font-family: Roboto; + font-size: 14px; + font-weight: normal; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; + color: var(--black); } h6 span { - font-family: Roboto; - font-size: 10px; - font-weight: normal; - font-stretch: normal; - font-style: normal; - line-height: normal; - letter-spacing: normal; - color: var(--bluey-grey); + font-family: Roboto; + font-size: 10px; + font-weight: normal; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; + color: var(--bluey-grey); } .navbar-nav { - flex-direction: row; + flex-direction: row; } .nav-link { - padding-right: 0.5rem !important; - padding-left: 0.5rem !important; + padding-right: .5rem !important; + padding-left: .5rem !important; } + /* Fixes dropdown menus placed on the right side */ .ml-auto .dropdown-menu { - left: auto !important; - right: 0px; + left: auto !important; + right: 0px; } .card-body { - padding: 20px !important; + padding: 20px !important; } .collectionChart .tt-label, .collectionChart .tt-value { - float: left; - color: black; - font-family: Roboto; - font-size: 14px; - font-stretch: normal; - font-style: normal; - line-height: normal; - letter-spacing: normal; - height: 20px; + float: left; + color: black; + font-family: Roboto; + font-size: 14px; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; + height: 20px; } .collectionChart .tt-value { - font-size: 24px; - font-weight: 500; - height: 32px; + font-size: 24px; + font-weight: 500; + height: 32px; } .collectionChart .colRow { - padding: 30px 0px; - border-bottom: 1px solid #ccc; + padding: 30px 0px; + border-bottom: 1px solid #ccc; } .colText { - font-family: Roboto; - font-size: 24px; - font-weight: 500; + font-family: Roboto; + font-size: 24px; + font-weight: 500; } .defaultButton { - font-family: Roboto; - font-size: 12px; - font-weight: 500; - font-stretch: normal; - font-style: normal; - line-height: normal; - letter-spacing: normal; - color: #5b5b5b; - width: 137px; - height: 32px; - border-radius: 2px !important; - border: solid 1px #5b5b5b; - background-color: rgba(255, 255, 255, 0); - margin: 4px; + font-family: Roboto; + font-size: 12px; + font-weight: 500; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; + color: #5b5b5b; + width: 137px; + height: 32px; + border-radius: 2px !important; + border: solid 1px #5b5b5b; + background-color: rgba(255, 255, 255, 0); + margin: 4px; } .navbar-nav li { - padding: 15px; + padding: 15px; } .badge-primary { - background-color: #fe7a51 !important; + background-color: #fe7a51 !important; } .badge { - margin: 8px; - font-size: 12px; - font-weight: 500; - border-radius: 0px !important; + margin: 8px; + font-size: 12px; + font-weight: 500; + border-radius: 0px !important; } .card { - border-radius: 2px; - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.24), 0 0 2px 0 rgba(0, 0, 0, 0.12); - border-style: solid; - border-width: 0.5px; - border-image-source: linear-gradient( - to bottom, - rgba(0, 0, 0, 0), - rgba(0, 0, 0, 0) 80%, - rgba(0, 0, 0, 0.02) 95%, - rgba(0, 0, 0, 0.04) - ); - border-image-slice: 1; - background-image: linear-gradient(to bottom, white, white), - linear-gradient( - to bottom, - rgba(0, 0, 0, 0), - rgba(0, 0, 0, 0) 80%, - rgba(0, 0, 0, 0.02) 95%, - rgba(0, 0, 0, 0.04) - ); - background-origin: border-box; - background-clip: content-box, border-box; -} - -.sidebar > div > ul > li > a.active { - background-color: #ffefeb !important; - margin: 15px -15px -0px -15px; - border-left: 3px solid #fe7a51; + border-radius: 2px; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.24), 0 0 2px 0 rgba(0, 0, 0, 0.12); + border-style: solid; + border-width: 0.5px; + border-image-source: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0.02) 95%, rgba(0, 0, 0, 0.04)); + border-image-slice: 1; + background-image: linear-gradient(to bottom, white, white), linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0.02) 95%, rgba(0, 0, 0, 0.04)); + background-origin: border-box; + background-clip: content-box, border-box; +} + +.sidebar>div>ul>li>a.active { + background-color: #ffefeb !important; + margin: 15px -15px -0px -15px; + border-left: 3px solid #fe7a51; } .fa-menu { - color: #656565 !important; - padding-right: 30px !important; + color: #656565 !important; + padding-right: 30px !important; } .icons { - width: 10.9px; - height: 16px; + width: 10.9px; + height: 16px; } .tableHeading { - height: 50px; - font-family: Roboto; - font-size: 14px; - font-weight: normal; - font-stretch: normal; - font-style: normal; - line-height: normal; - letter-spacing: normal; - color: #000000; - position: absolute; - margin-top: 15px; + height: 50px; + font-family: Roboto; + font-size: 14px; + font-weight: normal; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; + color: #000000; + position: absolute; + margin-top: 15px; } .tableHeading { - display: flex; - /* flex-direction: row-reverse; */ - flex: 1 1; - margin-top: -25px; + display: flex; + /* flex-direction: row-reverse; */ + flex: 1 1; + margin-top: -25px; } .fwh { - flex: 1; + flex: 1; } .tableHeading .MuiToggleButtonGroup-root { - font-family: Roboto; - font-size: 12px; - font-weight: 500; - color: black; + font-family: Roboto; + font-size: 12px; + font-weight: 500; + color: black; } .tableHeading .MuiGrid-spacing-xs-2, .tableHeading .MuiGrid-container { - width: auto !important; + width: auto !important; } .tableHeading .MuiToggleButton-root { - height: 30px; + height: 30px; } + /* .MuiTable-root th, .MuiTable-root tr, .MuiTable-root td { @@ -299,326 +272,312 @@ h6 span { } */ .MuiTableBody-root { - font-family: Roboto; - font-size: 12px; - color: black !important; - font-weight: normal; - font-stretch: normal; - font-style: normal; - line-height: normal; - letter-spacing: normal; + font-family: Roboto; + font-size: 12px; + color: black !important; + font-weight: normal; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; } .MuiTableRow-head th { - color: #656565 !important; - font-family: Roboto; - font-size: 10px; - background-color: #fafafa; + color: #656565 !important; + font-family: Roboto; + font-size: 10px; + background-color: #fafafa; } .GlobalFilter-mainFilter-1 { - /* height: 100px; */ + /* height: 100px; */ } .tableWrapper { - margin: 20px 0px; + margin: 20px 0px; } .MuiTableCell-root { - padding: 10px !important; + padding: 10px !important; } .MuiCardContent-root { - padding: 20px 20px !important; + padding: 20px 20px !important; } .tableWrapper .MuiCardContent-root { - padding: 20px !important; + padding: 20px !important; } .MuiCardContent-root .MuiPaper-rounded { - box-shadow: initial !important; + box-shadow: initial !important; } .colRow:last-child { - border-bottom: none; + border-bottom: none; } .MuiToggleButtonGroup-grouped { - font-family: Roboto; - font-size: 12px; - font-weight: 500; - font-stretch: normal; - font-style: normal; - line-height: normal; - letter-spacing: normal; - border-radius: 4px; - border: solid 1px #d9d9d9; - color: #96989a; - background-color: #ffffff; + font-family: Roboto; + font-size: 12px; + font-weight: 500; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; + border-radius: 4px; + border: solid 1px #d9d9d9; + color: #96989a; + background-color: #ffffff; } .MuiToggleButtonGroup-grouped.Mui-selected { - color: #000000; - border-radius: 4px; - border: solid 1px #d9d9d9; - background-color: #eeeeee; + color: #000000; + border-radius: 4px; + border: solid 1px #d9d9d9; + background-color: #eeeeee; } .MuiChip-outlined { - height: 32px !important; - width: 120px; - background-color: #eeeeee !important; + height: 32px !important; + width: 120px; + background-color: #eeeeee !important; } .MuiAvatar-root { - width: 60px !important; - height: 32px !important; - border-radius: 15px !important; - background-color: #fe7a51 !important; - /* #17c1f4; */ - color: white !important; - margin-left: -3px !important; - margin-top: -1px; + width: 60px !important; + height: 32px !important; + border-radius: 15px !important; + background-color: #fe7a51 !important; + /* #17c1f4; */ + color: white !important; + margin-left: -3px !important; + margin-top: -1px; } .MuiChip-label { - font-family: Roboto; - font-size: 13px; - font-weight: normal; - font-stretch: normal; - font-style: normal; - line-height: normal; - letter-spacing: normal; - color: rgba(0, 0, 0, 0.87); - width: 70px; + font-family: Roboto; + font-size: 13px; + font-weight: normal; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; + color: rgba(0, 0, 0, 0.87); + width: 70px; } .tableFilterChipWrap { - /* margin-bottom: 20px; */ - text-align: left; - flex-direction: row; - display: flex; - margin-left: -8px; - padding-top: 15px; + /* margin-bottom: 20px; */ + text-align: left; + flex-direction: row; + display: flex; + margin-left: -8px; + padding-top: 15px; } .pieFilterChipWrap { - margin-bottom: 10px; - text-align: left; - display: flex; + margin-bottom: 10px; + text-align: left; + display: flex; } .pieFilterChipWrap .chipWrap { - margin: -5px 10px 0px 15px; - display: flex; + margin: -5px 10px 0px 15px; + display: flex; } .tableFilterChipWrap .chipWrap { - margin: 0px 20px; - display: flex; -} -.india-map-comp { - width: 450px; -} -.map-status { - position: absolute; - bottom: 14%; - width: 33%; - right: 1%; + margin: 0px 20px; + display: flex; + } .tableFilterChipWrap .filLabel { - margin-left: 10px; - padding-top: 5px; + margin-left: 10px; + padding-top: 5px; } .table-filters { - display: flex; - flex-direction: row; + display: flex; + flex-direction: row; } .GF_Denomination { - max-width: 100px; + max-width: 100px; } .fa-info-circle { - color: grey !important; - font-size: 20px; + color: grey !important; + font-size: 20px; } .progress { - border-radius: 10px; - height: 5px; + border-radius: 10px; + height: 5px; } .revenueRow { - margin-top: 20px; + margin-top: 20px; } .MuiToggleButton-root.Mui-selected { - color: #fe7a51 !important; - background-color: #f0f0f0 !important; - border-bottom: 1px solid #fe7a51 !important; - border-radius: 0; + color: #fe7a51 !important; + background-color: #f0f0f0 !important; + border-bottom: 1px solid #fe7a51 !important; + border-radius: 0; } canvas { - height: 100%; + height: 100%; } .MuiPaper-root { - /* margin: 0px 8px !important; */ + /* margin: 0px 8px !important; */ } .pb-2, .py-2 { - /* padding: 0px 5px !important; */ + /* padding: 0px 5px !important; */ } -#customCalander > div { - background-color: transparent; +#customCalander>div { + background-color: transparent } button:focus { - outline-color: initial !important; + outline-color: initial !important; } .tableChart .MuiPaper-elevation1 { - box-shadow: none !important; -} - -@media (min-width: 320px) { - /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ - .col-lg-1, - .col-lg-10, - .col-lg-11, - .col-lg-12, - .col-lg-2, - .col-lg-3, - .col-lg-4, - .col-lg-5, - .col-lg-6, - .col-lg-7, - .col-lg-8, - .col-lg-9, - .col-lg-auto { - margin-bottom: 20px; - } - - .navbar-nav { - display: none; - } - - .rowList { - padding-top: 0px; - } - .rdrDateDisplay{ - justify-content:unset!important; - margin: 0px !important; - } - -} - -@media (min-width: 480px) { - /* smartphones, Android phones, landscape iPhone */ - .col-lg-1, - .col-lg-10, - .col-lg-11, - .col-lg-12, - .col-lg-2, - .col-lg-3, - .col-lg-4, - .col-lg-5, - .col-lg-6, - .col-lg-7, - .col-lg-8, - .col-lg-9, - .col-lg-auto { - margin-bottom: 20px; - } - - .navbar-nav { - display: none; - } - - .rowList { - padding-top: 0px; - } + box-shadow: none !important; +} + +@media (min-width:320px) { + + /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ + .col-lg-1, + .col-lg-10, + .col-lg-11, + .col-lg-12, + .col-lg-2, + .col-lg-3, + .col-lg-4, + .col-lg-5, + .col-lg-6, + .col-lg-7, + .col-lg-8, + .col-lg-9, + .col-lg-auto { + margin-bottom: 20px; + } + + .navbar-nav { + display: none; + } + + .rowList { + padding-top: 0px; + } +} + +@media (min-width:480px) { + + /* smartphones, Android phones, landscape iPhone */ + .col-lg-1, + .col-lg-10, + .col-lg-11, + .col-lg-12, + .col-lg-2, + .col-lg-3, + .col-lg-4, + .col-lg-5, + .col-lg-6, + .col-lg-7, + .col-lg-8, + .col-lg-9, + .col-lg-auto { + margin-bottom: 20px; + } + + .navbar-nav { + display: none; + } + + .rowList { + padding-top: 0px; + } } @media (max-width: 1293px) { - .tableHeading { - display: flex; - /* flex-direction: row-reverse; */ - flex: 1; - } + .tableHeading { + display: flex; + /* flex-direction: row-reverse; */ + flex: 1 + } } @media (max-width: 1024px) { - .tableHeading { - display: flex; - /* flex-direction: row-reverse; */ - flex: 1; - } + .tableHeading { + display: flex; + /* flex-direction: row-reverse; */ + flex: 1 + } } @media (max-width: 768px) { - .india-map-comp { - width: 350px; - } - .MuiCardContent-root { - padding: 20px 8px !important; - } - .map-status { - width: 45%; - } - .tableHeading { - display: flex; - flex-direction: column; - flex: 1; - position: unset; - margin-top: -28px; - } + .MuiCardContent-root { + padding: 20px 8px !important; + } - .tableFilterChipWrap { - margin-top: 0px; - margin-left: 0px; - flex-direction: column; - position: unset; - } + .tableHeading { + display: flex; + flex-direction: column; + flex: 1; + position: unset; + margin-top: -28px; + } - .table-filters { - flex-direction: column; - } + .tableFilterChipWrap { + margin-top: 0px; + margin-left: 0px; + flex-direction: column; + position: unset; + } + + .table-filters { + flex-direction: column; + } + + .pieFilterChipWrap { + margin-bottom: 0px; + } - .pieFilterChipWrap { - margin-bottom: 0px; - } + .tableFilterChipWrap .chipWrap { + padding: 3px 0px; - .tableFilterChipWrap .chipWrap { - padding: 3px 0px; - } + } } @media (max-width: 375px) { - .tableHeading { - display: flex; - flex-direction: column; - flex: 1; - position: unset; - } + .tableHeading { + display: flex; + flex-direction: column; + flex: 1; + position: unset; + } - .tableFilterChipWrap { - margin-top: 0px; - margin-left: 0px; - } + .tableFilterChipWrap { + margin-top: 0px; + margin-left: 0px; + } - .table-filters { - flex-direction: column; - } + .table-filters { + flex-direction: column; + } } + /* .MuiInput-underline-337:before { border-bottom: none !important; } @@ -632,51 +591,32 @@ button:focus { } */ .CheckboxesTags-root-220 div { - color: #000000; - margin: 0px 3px 2px 0 !important; + color: #000000; + margin: 0px 3px 2px 0 !important; } .jss222 div { - color: #000000; - margin: 0 3px 2px 0 !important; + color: #000000; + margin: 0 3px 2px 0 !important; } -.dss-date-range div div button i { - padding: 0px !important; +.dss-date-range div div button i{ +padding: 0px !important; } @media only screen and (max-width: 1000px) { - .dss-date-range { - display: flex !important; - flex-direction: column; - overflow: hidden; - align-items: center; - justify-items: center; - } - .dss-date-range div { - width: 20em !important; - } - .dss-date-time-filter { - padding: 10px 5px !important; - } -} -.map-row { - display: flex; - align-items: center; - margin-top: 5px; -} -.map-box { - display: inline-block; - height: 10px; - width: 10px; -} - -.map-text { - margin-left: 5px; - color: #636363; - font-size: 14px; -} - -@media screen { -} + .dss-date-range{ + display: flex!important; + flex-direction: column; + overflow: hidden; + align-items: center; + justify-items: center; + } + .dss-date-range div{ + width: 20em!important; + } + .dss-date-time-filter{ + padding: 10px 5px !important + } + } \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/App.js b/frontend/mono-ui/web/dss-dashboard/src/App.js index c36dadd4786..9f200cbcdb1 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/App.js +++ b/frontend/mono-ui/web/dss-dashboard/src/App.js @@ -1,180 +1,198 @@ -import React from 'react'; -import { createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles'; -import axios from 'axios'; -import _ from 'lodash'; -import { connect } from 'react-redux'; -import { bindActionCreators } from 'redux'; -import { changeTheName } from '../src/actions/firstAction'; -import { updateLanguage } from './actions/languageChange'; -import './App.css'; -import variables from './styles/variables'; -import { fetchLocalisationRequest, getLocaleLabels, getTenantId } from './utils/commons'; -import Layout from './utils/Layout'; -import { loadUlbLogo } from './utils/block'; +import React from "react"; +import { createMuiTheme, MuiThemeProvider } from "@material-ui/core/styles"; +import axios from "axios"; +import _ from "lodash"; +import { connect } from "react-redux"; +import { bindActionCreators } from "redux"; +import { changeTheName } from "../src/actions/firstAction"; +import { updateLanguage } from "./actions/languageChange"; +import "./App.css"; +import variables from "./styles/variables"; +import { fetchLocalisationRequest } from "./utils/commons"; +import Layout from "./utils/Layout"; +import { loadUlbLogo } from "./utils/block"; const theme = createMuiTheme({ overrides: { typography: { useNextVariants: true, - fontFamily: variables.primaryFont + fontFamily: variables.primaryFont, }, MuiMenu: { paper: { - backgroundColor: 'white', + backgroundColor: "white", fontFamily: variables.primaryFont, - height: 'auto', - color: variables.black - } - } - } + height: "auto", + color: variables.black, + }, + }, + }, }); - let dataL = { - "en": { - "DSS_OVERVIEW": "Overview", - "DSS_TOTAL_COLLECTION": "Total Collection", - "DSS_TARGET_COLLECTION": "Target Collection", - "DSS_TARGET_ACHIEVED": "Target Achievement", - "DSS_TOTAL_CUMULATIVE_COLLECTION": "Total Cumulative Collection", - "DSS_TOP_PERFORMING_ULBS": "Top 3 Performing ULBs", - "DSS_BOTTOM_PERFORMING_ULBS": "Bottom 3 Performing ULBs", - "DSS_TOTAL_CUMULATIVE_COLLECTION:_DEPARTMENT_WISE": "Total Cumulative Collection: Service Wise", - "DSS_TOTAL_APPLICATION": "Total Applications", - "DSS_CLOSED_APPLICATION": "Closed Applications", - "DSS_SLA_ACHIEVED": "SLA Achievement", - "DSS_CITIZEN_REGISTERED": "Citizen Registered", - "DSS_TOTAL_APPLICATION_&_CLOSED_APPLICATION": "Total Applications & Closed Applications", - "DSS_TOTAL_APPLICATIONS:_DEPARTMENT_WISE": "Total Applications: Service Wise", - "DSS_PT_TOP_3_PERFORMING_ULBS": "Top 3 Performing ULBs", - "DSS_PT_BOTTOM_3_PERFORMING_ULBS": "Bottom 3 Performing ULBs", - "DSS_PT_COLLECTION_BY_USAGE_TYPE": "Collection by Usage type", + en: { + DSS_OVERVIEW: "Overview", + DSS_TOTAL_COLLECTION: "Total Collection", + DSS_TARGET_COLLECTION: "Target Collection", + DSS_TARGET_ACHIEVED: "Target Achievement", + DSS_TOTAL_CUMULATIVE_COLLECTION: "Total Cumulative Collection", + DSS_TOP_PERFORMING_ULBS: "Top 3 Performing ULBs", + DSS_BOTTOM_PERFORMING_ULBS: "Bottom 3 Performing ULBs", + "DSS_TOTAL_CUMULATIVE_COLLECTION:_DEPARTMENT_WISE": + "Total Cumulative Collection: Service Wise", + DSS_TOTAL_APPLICATION: "Total Applications", + DSS_CLOSED_APPLICATION: "Closed Applications", + DSS_SLA_ACHIEVED: "SLA Achievement", + DSS_CITIZEN_REGISTERED: "Citizen Registered", + "DSS_TOTAL_APPLICATION_&_CLOSED_APPLICATION": + "Total Applications & Closed Applications", + "DSS_TOTAL_APPLICATIONS:_DEPARTMENT_WISE": + "Total Applications: Service Wise", + DSS_PT_TOP_3_PERFORMING_ULBS: "Top 3 Performing ULBs", + DSS_PT_BOTTOM_3_PERFORMING_ULBS: "Bottom 3 Performing ULBs", + DSS_PT_COLLECTION_BY_USAGE_TYPE: "Collection by Usage type", "DSS_PT_DEMAND_&_COLLECTION_INDEX": "Key Performance Indicator", - "DSS_PT_TOTAL_PROPERTIES_ASSESSED": "Total Properties Assessed", - "DSS_PT_TOTAL_ASSESSMENTS": "Total Assessments", - "DSS_PT_TOTAL_ACTIVE_ULBS": "Total Active ULBs", - "DSS_PT_PROPERTIES_BY_USAGE_TYPE": "Properties by Usage Type", - "DSS_PT_CUMULATIVE_PROPERTIES_ASSESSED": "Total Cumulative Properties Assessed", - "DSS_PT_DEMAND_COLLECTION_BOUNDARY": "Boundary", - "DSS_PT_DEMAND_COLLECTION_USAGETYPE": "Usage Type", - "DSS_PT_DEMAND_COLLECTION": "Key Performance Indicator", - "DSS_PT_TAX_HEAD_BREAKUP_REVENUE": "Tax Heads Breakups", - "DSS_TL_LICENSE_ISSUED": "Total License Issued", - "DSS_TL_CUMULATIVE_LICENSE_ISSUED": "Total Cumulative License Issued", - "DSS_TL_LICENSE_BY_TYPE": "License by Type", - "DSS_TL_LICENSE_BY_STATUS": "Trade License by Status", - "DSS_COMPLETION_RATE": "Completion Rate", - "DSS_REVENUE": "Revenue", - "DSS_SERVICE": "Service", - "DSS_PGR_TOTAL_COMPLAINTS": "Total Complaints", - "DSS_PGR_CLOSED_COMPLAINTS": "Closed Complaints", - "DSS_TOTAL_CUMULATIVE_CLOSED_COMPLAINTS": "Cumulative Closed Complaints", - "DSS_PGR_COMPLAINTS_BY_STATUS": "Complaint By Status", - "DSS_PGR_COMPLAINTS_BY_CHANNEL": "Complaint By Channel", - "DSS_PGR_COMPLAINTS_BY_CATEGORY": "Complaint By Category", - "DSS_PGR_COMPLAINTS_BY_TENANT": "Complaint By Tenant", - "DSS_PGR_COMPLAINTS_BY_DISTRICT": "Complaint By District", - "DSS_PGR_COMPLAINTS_BY_DEPARTMENT": "Complaint By Department", - "DSS_DOWNLOAD": 'DOWNLOAD', - "DSS_SHARE": 'SHARE', - "DSS_MOBILE_DOWNLOAD": 'Download', - "DSS_MOBILE_SHARE": 'Share', - "DSS_APPLY": "APPLY", - "DSS_CLEAR_ALL": "CLEAR", - "DSS_DATE_RANGE": "Date Range", - "DSS_DDRS": "DDRs", - "DSS_ULBS": "ULBS", - "DSS_SERVICES": "Services", - "DSS_DENOMINATION": "Denomination", - "DSS_PDF": "PDF", - "DSS_IMAGE": "Image", - "DSS_MORE_ACTIONS": "DSS_MORE_ACTIONS", - "DSS_VIEW_ALL": "VIEW_ALL", - "DSS_BACK_TO_MY_DASHBOARD": "Back to MyDashboard", - "DSS_ROWS": "Rows", - "DSS_SELECT": "SELECT", - "DSS_CANCEL": "CANCEL", - "DSS_TODAY": "Today", - "DSS_THIS_WEEK": "This Week", - "DSS_THIS_MONTH": "This Month", - "DSS_THIS_QUARTER": "This Quarter", - "DSS_CUSTOM": "Custom", - "DSS_FY": "FY", - "DSS_RANK": "Rank", - "DSS_NO_DATA_AVAILABLE": "No Data Available", - "DSS_TOTAL_COLLECTION_TODAY": "Today's Collection", - "DSS_PT_TAX_HEAD": "Tax Heads", - "DSS_TL_TAX_HEAD_BREAKUP": "Tax Heads Breakups", - "DSS_TOTAL_COMPLAINTS_BY_SOURCE": "Total Complaints by Source", - "DSS_TOTAL_COMPLAINTS_STATUS": "Total Complaints by Status", - "DSS_PGR_COMPLETION_RATE": "Completion Rate", - "DSS_PROPERTY_TAX": "Property Tax", - "DSS_TRADE_LICENCE": "Trade License", - "DSS_COMPLAINS": 'Complaints', - "DSS_OVERVIEW_DASHBOARD": "Overview", - "DSS_HOME_DASHBOARD": "State Urban Real-Time Executive (SURE) Dashboard", - "DSS_PROPERTY_TAX_DASHBOARD": "Property Tax (SURE) Dashboard", - "DSS_TRADE_LICENSE_DASHBOARD": "Trade License (SURE) Dashboard", - "DSS_PGR_DASHBOARD": "PGR (SURE) Dashboard" - } -} + DSS_PT_TOTAL_PROPERTIES_ASSESSED: "Total Properties Assessed", + DSS_PT_TOTAL_ASSESSMENTS: "Total Assessments", + DSS_PT_TOTAL_ACTIVE_ULBS: "Total Active ULBs", + DSS_PT_PROPERTIES_BY_USAGE_TYPE: "Properties by Usage Type", + DSS_PT_CUMULATIVE_PROPERTIES_ASSESSED: + "Total Cumulative Properties Assessed", + DSS_PT_DEMAND_COLLECTION_BOUNDARY: "Boundary", + DSS_PT_DEMAND_COLLECTION_USAGETYPE: "Usage Type", + DSS_PT_DEMAND_COLLECTION: "Key Performance Indicator", + DSS_PT_TAX_HEAD_BREAKUP_REVENUE: "Tax Heads Breakups", + DSS_TL_LICENSE_ISSUED: "Total License Issued", + DSS_TL_CUMULATIVE_LICENSE_ISSUED: "Total Cumulative License Issued", + DSS_TL_LICENSE_BY_TYPE: "License by Type", + DSS_TL_LICENSE_BY_STATUS: "Trade License by Status", + DSS_COMPLETION_RATE: "Completion Rate", + DSS_REVENUE: "Revenue", + DSS_SERVICE: "Service", + DSS_PGR_TOTAL_COMPLAINTS: "Total Complaints", + DSS_PGR_CLOSED_COMPLAINTS: "Closed Complaints", + DSS_TOTAL_CUMULATIVE_CLOSED_COMPLAINTS: "Cumulative Closed Complaints", + DSS_PGR_COMPLAINTS_BY_STATUS: "Complaint By Status", + DSS_PGR_COMPLAINTS_BY_CHANNEL: "Complaint By Channel", + DSS_PGR_COMPLAINTS_BY_CATEGORY: "Complaint By Category", + DSS_PGR_COMPLAINTS_BY_TENANT: "Complaint By Tenant", + DSS_PGR_COMPLAINTS_BY_DISTRICT: "Complaint By District", + DSS_PGR_COMPLAINTS_BY_DEPARTMENT: "Complaint By Department", + DSS_DOWNLOAD: "DOWNLOAD", + DSS_SHARE: "SHARE", + DSS_MOBILE_DOWNLOAD: "Download", + DSS_MOBILE_SHARE: "Share", + DSS_APPLY: "APPLY", + DSS_CLEAR_ALL: "CLEAR", + DSS_DATE_RANGE: "Date Range", + DSS_DDRS: "DDRs", + DSS_ULBS: "ULBS", + DSS_SERVICES: "Services", + DSS_DENOMINATION: "Denomination", + DSS_PDF: "PDF", + DSS_IMAGE: "Image", + DSS_MORE_ACTIONS: "More Actions", + DSS_VIEW_ALL: "VIEW_ALL", + DSS_BACK_TO_MY_DASHBOARD: "Back to MyDashboard", + DSS_ROWS: "Rows", + DSS_SELECT: "SELECT", + DSS_CANCEL: "CANCEL", + DSS_TODAY: "Today", + DSS_THIS_WEEK: "This Week", + DSS_THIS_MONTH: "This Month", + DSS_THIS_QUARTER: "This Quarter", + DSS_CUSTOM: "Custom", + DSS_FY: "FY", + DSS_RANK: "Rank", + DSS_NO_DATA_AVAILABLE: "No Data Available", + DSS_TOTAL_COLLECTION_TODAY: "Today's Collection", + DSS_PT_TAX_HEAD: "Tax Heads", + DSS_TL_TAX_HEAD_BREAKUP: "Tax Heads Breakups", + DSS_TOTAL_COMPLAINTS_BY_SOURCE: "Total Complaints by Source", + DSS_TOTAL_COMPLAINTS_STATUS: "Total Complaints by Status", + DSS_PGR_COMPLETION_RATE: "Completion Rate", + DSS_PROPERTY_TAX: "Property Tax", + DSS_TRADE_LICENCE: "Trade License", + DSS_COMPLAINS: "Complaints", + DSS_OVERVIEW_DASHBOARD: "Overview", + DSS_HOME_DASHBOARD: "State Urban Real-Time Executive (SURE) Dashboard", + DSS_PROPERTY_TAX_DASHBOARD: "Property Tax (SURE) Dashboard", + DSS_TRADE_LICENSE_DASHBOARD: "Trade License (SURE) Dashboard", + DSS_PGR_DASHBOARD: "PGR (SURE) Dashboard", + DSS_MCOLLECT:"MCollect", + DSS_FIRENOC_OVERVIEW: "Fire NOC", + + }, +}; class App extends React.Component { constructor(props) { super(props); localStorage.setItem("lang", JSON.stringify(dataL)); + localStorage.setItem("tenant-id", "pb.punjab"); this.changeTheName = this.changeTheName.bind(this); this.state = { - language: 'en' - } + language: "en", + }; } - + loadLocalisation = () => { - let language = localStorage.getItem("Employee.locale")||'en_IN'; - let localisationLabels = JSON.parse(localStorage.getItem(`localization_${language}`)) || []; - if (localisationLabels.length == 0 || localisationLabels.filter(localisation => localisation.module == "rainmaker-dss").length == 0) { - let localisationRequest = fetchLocalisationRequest(language); - axios.post(localisationRequest.reqUrl, localisationRequest.reqBody, localisationRequest.reqHeaders) - .then(response => { - localStorage.setItem(`localization_${language}`,JSON.stringify(response.data.messages)); + let language = localStorage.getItem("Employee.locale") + ? localStorage.getItem("Employee.locale") + : "en_IN"; + let tenent = localStorage.getItem("tenant-id") + ? `${localStorage.getItem("tenant-id")}`.split(".")[0] + : "pb"; + let localisationLabels = + JSON.parse(localStorage.getItem(`localization_${language}`)) || []; + if ( + localisationLabels.length == 0 || + localisationLabels.filter( + (localisation) => localisation.module == "rainmaker-dss" + ).length == 0 + ) { + let localisationRequest = fetchLocalisationRequest(language, tenent); + axios + .post( + localisationRequest.reqUrl, + localisationRequest.reqBody, + localisationRequest.reqHeaders + ) + .then((response) => { this.setLocalisation(response.data.messages); }) - .catch(error => { + .catch((error) => { + console.log(error.response); }); } else { this.setLocalisation(localisationLabels); } - } + }; setLocalisation = (localisationLabels = []) => { let data = _.chain(localisationLabels) - .map(i => { return { key: i.code, value: i.message } }) - .flatten().value(); - let newIndex = _.chain(data) - .keyBy('key') - .mapValues('value') + .map((i) => { + return { key: i.code, value: i.message }; + }) + .flatten() .value(); + let newIndex = _.chain(data).keyBy("key").mapValues("value").value(); let dataL = { - 'en': newIndex, - 'hi': {} - } - getLocaleLabels("check",dataL?.en); + en: newIndex, + hi: {}, + }; this.props.updateLanguage(dataL); - } + }; componentDidMount() { document.title = "DSS Dashboard"; this.loadLocalisation(); - loadUlbLogo(getTenantId()); - // if(process.env.NODE_ENV==="development"){ - // localStorage.setItem("Employee.token","25f8252c-683c-4bda-a065-7180dea56a6b") - // localStorage.setItem("tenant-id","pg.citya") - // } + loadUlbLogo(localStorage.getItem("tenant-id")); } changeTheName = (e) => { this.props.changeTheName(); - } + }; render() { return ( @@ -188,15 +206,16 @@ class App extends React.Component { const mapStateToProps = (state) => ({ isLoaded: state.firstReducer.isLoaded, apistatus: state.apistatus, - strings: state.lang - + strings: state.lang, }); - -const mapDispatchToProps = dispatch => { - return bindActionCreators({ - changeTheName: changeTheName, - updateLanguage: updateLanguage - }, dispatch) -} +const mapDispatchToProps = (dispatch) => { + return bindActionCreators( + { + changeTheName: changeTheName, + updateLanguage: updateLanguage, + }, + dispatch + ); +}; export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/frontend/mono-ui/web/dss-dashboard/src/Breadcrumbs.js b/frontend/mono-ui/web/dss-dashboard/src/Breadcrumbs.js index 60cd7bcb0b0..67a6a153e7b 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/Breadcrumbs.js +++ b/frontend/mono-ui/web/dss-dashboard/src/Breadcrumbs.js @@ -5,7 +5,6 @@ import { Typography } from "@material-ui/core"; import { withRouter } from "react-router-dom"; -import { isNurtDashboard } from "./utils/commons"; const Breadcrumb = props => { @@ -16,12 +15,9 @@ const Breadcrumb = props => { const pathnames = pathname.split("/").filter(x => x); return ( - {isNurtDashboard()? {'Home'}:pathnames.map((name, index) => { - let displayname=getDisplayName(name); - let routeTo = `/${pathnames.slice(0, index + 1).join("/")}`; - if(window.location.pathname.toLowerCase().includes("national")==true){ - routeTo = 'NURT_DASHBOARD'; - } + {pathnames.map((name, index) => { + let displayname=getDisplayName(name); + const routeTo = `/${pathnames.slice(0, index + 1).join("/")}`; const isLast = index === pathnames.length - 1; return isLast ? ( {displayname} @@ -49,9 +45,13 @@ const getDisplayName = (name) => { case "pgr": return "Complaints"; case "ws": - return "Water & Sewerage"; - case "fsm": - return "FSM"; + return "Water & Sewerage"; + case "mCollect": + return "mCollect"; + case "noc": + return "Fire NOC"; + case "finance": + return "Finance"; default: return name; } diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/apitransport/apitransport.js b/frontend/mono-ui/web/dss-dashboard/src/actions/apitransport/apitransport.js index 89446051057..4da4622a429 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/apitransport/apitransport.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/apitransport/apitransport.js @@ -37,6 +37,7 @@ export default function dispatchAPI(api, page) { }) } } else if (api.status === 401) { + console.log('====================== logout ==========================') } else { return dispatch => { dispatch(apiStatusAsync(true, false, '')) diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/charts/allChartsAPI.js b/frontend/mono-ui/web/dss-dashboard/src/actions/charts/allChartsAPI.js index 9565c26665d..557e1aa54ce 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/charts/allChartsAPI.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/charts/allChartsAPI.js @@ -1,7 +1,6 @@ /** * Dashboard API */ -import { getToken } from '../../utils/commons'; import API from '../apis/api'; import C from '../constants'; @@ -48,7 +47,7 @@ export default class AllChartsAPI extends API { headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', - 'auth-token': `${getToken()}` + 'auth-token': `${localStorage.getItem('Employee.token')}` } } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/charts/chartsAPI.js b/frontend/mono-ui/web/dss-dashboard/src/actions/charts/chartsAPI.js index 5f36e40eb77..2b0755c8ca2 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/charts/chartsAPI.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/charts/chartsAPI.js @@ -1,7 +1,6 @@ /** * Dashboard API */ -import { getToken } from '../../utils/commons'; import API from '../apis/api'; import C from '../constants'; @@ -48,7 +47,7 @@ export default class ChartsAPI extends API { headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', - 'auth-token': `${getToken()}` + 'auth-token': `${localStorage.getItem('Employee.token')}` } } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/dashboardAPI.js b/frontend/mono-ui/web/dss-dashboard/src/actions/dashboardAPI.js index e922ab85148..6f4412bc03f 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/dashboardAPI.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/dashboardAPI.js @@ -1,7 +1,6 @@ /** * Dashboard API */ -import { getToken } from '../utils/commons'; import API from './apis/api'; import C from './constants'; @@ -43,7 +42,7 @@ export default class DashboardAPI extends API { return { headers: { 'Content-Type': 'application/json', - 'auth-token': `${getToken()}` + 'auth-token': `${localStorage.getItem('Employee.token')}` } } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/demandAndC/demandAndCAPI.js b/frontend/mono-ui/web/dss-dashboard/src/actions/demandAndC/demandAndCAPI.js index 3a825ef9685..4f905417c5b 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/demandAndC/demandAndCAPI.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/demandAndC/demandAndCAPI.js @@ -1,7 +1,6 @@ /** * Dashboard API */ -import { getToken } from '../../utils/commons'; import API from '../apis/api'; import C from '../constants'; @@ -43,7 +42,7 @@ export default class DashboardAPI extends API { return { headers: { 'Content-Type': 'application/json', - 'auth-token': `${getToken()}` + 'auth-token': `${localStorage.getItem('Employee.token')}` } } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/fileUpload/fileUpload.js b/frontend/mono-ui/web/dss-dashboard/src/actions/fileUpload/fileUpload.js index 7c8c33524cb..6bc530225c9 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/fileUpload/fileUpload.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/fileUpload/fileUpload.js @@ -1,6 +1,5 @@ import API from '../apis/api'; import CONFIGS from '../../config/configs' -import { getTenantId, getToken } from '../../utils/commons'; export default class FileUploadAPI extends API { constructor(timeout = 2000, path, reqType, reqBody, queryParams = null) { @@ -29,7 +28,7 @@ export default class FileUploadAPI extends API { getFormData() { var data = new FormData(); data.append("file", this.body); - data.append("tenantId", `${getTenantId()}`); + data.append("tenantId", `${localStorage.getItem('tenant-id')}`); data.append("module", 'dashboard'); data.append("tag", '123452'); return data; @@ -47,8 +46,7 @@ export default class FileUploadAPI extends API { headers: { "Content-Type": "multipart/form-data", "type": "formData", - "Cache-Control":"no-cache", - 'auth-token': `${getToken()}` + "Cache-Control":"no-cache" } } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/filterData/filterData.js b/frontend/mono-ui/web/dss-dashboard/src/actions/filterData/filterData.js index f1739d16e1b..a9cc12ca893 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/filterData/filterData.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/filterData/filterData.js @@ -1,7 +1,6 @@ /** * Dashboard API */ -import { stateTenant } from '../../utils/commons'; import API from './apis/api'; import C from './constants'; @@ -36,7 +35,8 @@ export default class FIlterAPI extends API { } apiEndPoint(page) { - let tenent = stateTenant() || ''; + let tenent = `${localStorage.getItem('tenant-id')}` ? (`${localStorage.getItem('tenant-id')}`).split('.')[0] : '' + return `${super.apiEndPoint()}/v1/_get?masterName=tenants&moduleName=tenant&tenantId=` + tenent } diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/firstAction.js b/frontend/mono-ui/web/dss-dashboard/src/actions/firstAction.js index d14319cdb84..d5459cf5c8b 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/firstAction.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/firstAction.js @@ -23,6 +23,7 @@ export const loadDashboardConfigData = () => dispatch => { }).then(data => { dispatch(receiveDashBoardConfigData(data["responseData"])) }).catch(err => { + console.log("Error Reading data " + err); }); } \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/getChartOptions.js b/frontend/mono-ui/web/dss-dashboard/src/actions/getChartOptions.js index 3f8ea1aa299..16ceca96a3a 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/getChartOptions.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/getChartOptions.js @@ -1,5 +1,4 @@ import CONFIGS from '../config/configs'; -import { getTenantId, getToken } from '../utils/commons'; export default function getChartOptions(code, filters) { let url = code ? CONFIGS.BASE_URL + "/dashboard/getChartV2" : ""; @@ -13,15 +12,15 @@ export default function getChartOptions(code, filters) { headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', - 'auth-token': `${getToken()}` + 'auth-token': `${localStorage.getItem('Employee.token')}` } }; let dataoption = { "RequestInfo":{ - "authToken": `${getToken()}` + "authToken": `${localStorage.getItem('Employee.token')}` }, "headers": { - "tenantId": `${getTenantId()}` + "tenantId": `${localStorage.getItem('tenant-id')}` }, "aggregationRequestDto": { diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/getFilterObj.js b/frontend/mono-ui/web/dss-dashboard/src/actions/getFilterObj.js index d37114cb68b..f58b70e91ff 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/getFilterObj.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/getFilterObj.js @@ -1,7 +1,5 @@ import _ from 'lodash'; import CONFIG from '../config/configs'; -import { stateTenant } from '../utils/commons'; - export default function getFilterObj(GFilterData, mdmsData, page) { let newGFilterData = _.cloneDeep(GFilterData); let MODULE_LEVEL=JSON.parse(sessionStorage.getItem('MODULE_LEVEL')) @@ -28,8 +26,8 @@ let MODULE_LEVEL=JSON.parse(sessionStorage.getItem('MODULE_LEVEL')) if (newGFilterData && newGFilterData['ULBS'] && newGFilterData['ULBS'].length > 0) { for (var i = 0; i < newGFilterData['ULBS'].length; i++) { - let tenent = stateTenant() || ""; - tempValue.push( newGFilterData['ULBS'][i].toLowerCase()); + let tenent = `${localStorage.getItem('tenant-id')}` ? (`${localStorage.getItem('tenant-id')}`).split('.')[0] : '' + tempValue.push(tenent + '.' + newGFilterData['ULBS'][i].toLowerCase()); } filters['tenantId'] = tempValue; } diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/getFinancialYearObj.js b/frontend/mono-ui/web/dss-dashboard/src/actions/getFinancialYearObj.js index 0bf1d04fc8f..9d79ec80cb2 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/getFinancialYearObj.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/getFinancialYearObj.js @@ -23,7 +23,6 @@ export default function getFinancialYearObj(onlyText,yearObj) { value: { startDate: moment(moment().subtract(2,'year')).month(3).startOf('month').unix(), endDate: moment(moment().subtract(1,'year')).month(2).endOf('month').unix(), - // endDate: moment().endOf('day').unix(), interval: 'month' } }) @@ -31,8 +30,7 @@ export default function getFinancialYearObj(onlyText,yearObj) { title: `FY ${moment(moment().subtract(1,'year')).month(3).startOf('month').format("YY")}-${moment().month(2).endOf('month').format("YY")}`, value: { startDate: moment(moment().subtract(1,'year')).month(3).startOf('month').unix(), - // endDate: moment().month(2).endOf('month').unix(), - endDate: moment().endOf('day').unix(), + endDate: moment().month(2).endOf('month').unix(), interval: 'month' } }) @@ -41,9 +39,7 @@ export default function getFinancialYearObj(onlyText,yearObj) { title: `FY ${moment(moment().subtract(1,'year')).month(3).startOf('month').format("YY")}-${moment().month(2).endOf('month').format("YY")}`, value: { startDate: moment(moment().subtract(1,'year')).month(3).startOf('month').unix(), - // endDate: moment().month(2).endOf('month').unix(), - endDate: moment().endOf('day').unix(), - + endDate: moment().month(2).endOf('month').unix(), interval: 'month' } } @@ -57,8 +53,6 @@ export default function getFinancialYearObj(onlyText,yearObj) { value: { startDate: moment(moment().subtract(1,'year')).month(3).startOf('month').unix(), endDate: moment().month(2).endOf('month').unix(), - // endDate: moment().endOf('day').unix(), - interval: 'month' } }) @@ -66,8 +60,7 @@ export default function getFinancialYearObj(onlyText,yearObj) { title: `FY ${moment().month(3).startOf('month').format("YY")}-${moment().month(2).endOf('month').add(1, 'years').format("YY")}`, value: { startDate: moment().month(3).startOf('month').unix(), - // endDate: moment().month(2).endOf('month').add(1, 'years').unix(), - endDate: moment().endOf('day').unix(), + endDate: moment().month(2).endOf('month').add(1, 'years').unix(), interval: 'month' } }) @@ -76,13 +69,13 @@ export default function getFinancialYearObj(onlyText,yearObj) { title: `FY ${moment().month(3).startOf('month').format("YY")}-${moment().month(2).endOf('month').add(1, 'years').format("YY")}`, value: { startDate: moment().month(3).startOf('month').unix(), - // endDate: moment().month(2).endOf('month').add(1, 'years').unix(), - endDate: moment().endOf('day').unix(), + endDate: moment().month(2).endOf('month').add(1, 'years').unix(), interval: 'month' } } } } } + return FYobj; } diff --git a/frontend/mono-ui/web/dss-dashboard/src/actions/getMDMSData.js b/frontend/mono-ui/web/dss-dashboard/src/actions/getMDMSData.js index 06a93299646..f2aa3ee85a7 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/actions/getMDMSData.js +++ b/frontend/mono-ui/web/dss-dashboard/src/actions/getMDMSData.js @@ -1,48 +1,50 @@ import _ from 'lodash'; -import { getTenantId } from '../utils/commons'; -export default function getMDMSData(tenants){ -let tempDRRsObj = {},tempDDRs=[],tempULBS=[],tenantId = "",tenantLogo ={},tenantName='',corpName = ''; -_.each(tenants,(v,k) => { +export default function getMDMSData(tenants) { + let tempDRRsObj = {}, tempDDRs = [], tempULBS = [], tenantId = "", tenantLogo = {}, tenantName = '', corpName = ''; + _.each(tenants, (v, k) => { - if(v.code){ - tenantLogo[v.code] = v.logoId; - tempULBS.push(v.code); - } - if(v.code === getTenantId()) - tenantName = v.code; - if(v.city.ddrName){ - tenantId = v.code; - if(!_.isEmpty(tempDRRsObj,true) && typeof tempDRRsObj[v.city.districtTenantCode] != 'undefined'){ - tempDRRsObj[v.city.districtTenantCode].push(tenantId); - }else{ - tempDRRsObj[v.city.districtTenantCode] = [tenantId] - tempDDRs.push(v.city.districtTenantCode); + if (v.code) { + tenantLogo[v.code] = v.logoId; + tempULBS.push(v.name); } - } -}) + if (v.code === localStorage.getItem('tenant-id')) + tenantName = v.name; + if (v.city.ddrName) { + tenantId = v.code; + if (!_.isEmpty(tempDRRsObj, true) && typeof tempDRRsObj[v.city.ddrName] != 'undefined') { + tempDRRsObj[v.city.ddrName].push(tenantId); + } else { + tempDRRsObj[v.city.ddrName] = [tenantId] + tempDDRs.push(v.city.ddrName); + } + } + }) + if(localStorage.getItem("localization_" + localStorage.getItem("locale"))){ + let localVal = JSON.parse(localStorage.getItem("localization_" + localStorage.getItem("locale"))); + for (var i = 0; i < localVal.length; i++) { + if (localVal[i].code === "ULBGRADE_MC1") { + corpName = localVal[i]['message']; + break; + } + } + } -let localVal = JSON.parse(localStorage.getItem("localization_"+localStorage.getItem("locale") ) ); -for(var i=0; i { + console.log( error ); callback(error,""); } ); } \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/CollectionChart.js b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/CollectionChart.js index b9711085086..789aaa33b90 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/CollectionChart.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/CollectionChart.js @@ -6,7 +6,6 @@ import CollectionChartRow from './CollectionChartRow'; import { Grid } from '@material-ui/core' import { withStyles } from '@material-ui/core/styles'; import style from './styles'; -import { Typography, Tooltip } from '@material-ui/core'; class CollectionChart extends React.Component { constructor(props) { @@ -30,15 +29,13 @@ class CollectionChart extends React.Component { data.map((d, i) => { let precision = 100; // 2 decimals let randomnum = Math.floor(Math.random() * (10 * precision - 1 * precision) + 1 * precision) / (1 * precision); - const tool = `TIP_DSS_${d.label}`; + return
- - {strings[d.label] || d.label} - + {strings[d.label] || d.label}
diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/CollectionChartRow.js b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/CollectionChartRow.js index 76f105097ba..8206e967ee7 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/CollectionChartRow.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/CollectionChartRow.js @@ -11,7 +11,7 @@ import style from './styles'; import Arrow_Downward from '../../images/arrows/Arrow_Downward.svg' import Arrow_Upward from '../../images/arrows/Arrow_Upward.svg' import moment from 'moment'; -import { getTenantId, removeSignFromInsightData } from '../../utils/commons'; +import { removeSignFromInsightData } from '../../utils/commons'; import { isMobile } from 'react-device-detect'; class CollectionChartRow extends React.Component { @@ -25,10 +25,11 @@ class CollectionChartRow extends React.Component { } callAPI() { + console.log(this.props.chartData,"this.props.chartData") let code = this.props.chartData['id'] ? this.props.chartData['id'] : ""; if (code) { let filters = _.cloneDeep(this.props.filters) - if(code == 'todaysCollection' || code == 'wstodaysCollection'){ + if(code == 'todaysCollection' || code == 'wstodaysCollection' || code == 'mcTodaysCollection'|| code == 'nocTodaysCollection' ){ filters['duration'] = { title: "TODAY", startDate: (moment().startOf('day').unix()) * 1000, @@ -42,7 +43,7 @@ class CollectionChartRow extends React.Component { if (this.props.page.includes('ulb')) { if (!filters['tenantId']) { let tenentFilter = [] - tenentFilter.push(`${getTenantId()}`) + tenentFilter.push(`${localStorage.getItem('tenant-id')}`) filters['tenantId'] = tenentFilter } diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/DonutChart.js b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/DonutChart.js index 34a198e9e55..e9a8eda53b2 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/DonutChart.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/DonutChart.js @@ -104,6 +104,7 @@ class DonutChart extends React.Component { }) }) .catch(error => { + console.log(error.response) }); } diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/HorBarChart.js b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/HorBarChart.js deleted file mode 100644 index 87f03bc83d2..00000000000 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/HorBarChart.js +++ /dev/null @@ -1,149 +0,0 @@ -import { withStyles } from "@material-ui/core/styles"; -import _ from "lodash"; -import React from "react"; -import { connect } from "react-redux"; -import { - Bar, - BarChart, - CartesianGrid, - Legend, - Tooltip, - XAxis, - YAxis -} from "recharts"; -import { bindActionCreators } from "redux"; -import APITransport from "../../actions/apitransport/apitransport"; -import ChartsAPI from "../../actions/charts/chartsAPI"; -import getChartOptions from "../../actions/getChartOptions"; -import { getLocaleLabels, getTenantId } from "../../utils/commons"; -import style from "./styles"; - -const COLORS = ["#298CFF", "#54D140"]; - -class HorBarChart extends React.Component { - constructor(props) { - super(props); - this.state = { - tooltipContent: "", - drillDown: false, - }; - } - - callAPI(filterkey="") { - let code = this.props.chartData["id"] ? this.props.chartData["id"] : ""; - let filters = this.props.filters; - if (this.props.page.includes("ulb")) { - if (!filters["tenantId"]) { - let tenentFilter = []; - tenentFilter.push(`${getTenantId()}`); - filters["tenantId"] = tenentFilter; - } - } - if(filterkey!=""){ - filters["state"] = this.props.selectedState; - } - let requestBody = getChartOptions(code, filters); - let chartsAPI = new ChartsAPI( - 2000, - "dashboard", - code + this.props.moduleLevel, - requestBody.dataoption - ); - this.props.APITransport(chartsAPI); - } - - componentDidMount() { - this.callAPI(); - } - componentDidUpdate() { - if (this.props.selectedState !== "" && !this.state.drillDown) { - this.callAPI(this.props.selectedState); - this.setState({ drillDown: true }); - }else if(this.props.selectedState == "" && this.state.drillDown){ - this.callAPI(); - this.setState({ drillDown: false }); - } - } - - render() { - let { strings } = this.props; - - let codekey = _.chain(this.props).get("chartData").get("id").value(); - codekey = codekey + this.props.moduleLevel; - let data1 = - _.chain(this.props) - .get("chartsGData") - .get(codekey) - .get("data") - .filter(data=>data) - .map((dat) => { - return { ...dat }; - }) - .value() || null; - let keys = {}; - - const mergeObj = data1?.[0]?.plots.map((x, index) => { - let newObj = {}; - data1.map((ob) => { - keys[getLocaleLabels(`DSS_${ob.headerName}`, strings)] = getLocaleLabels(`DSS_${ob.headerName}`, strings); - newObj[getLocaleLabels(`DSS_${ob.headerName}`, strings)] =Number(ob?.plots[index].value).toFixed(); - }); - return { - label: null, - name: data1?.[0]?.plots[index].name, - strValue: null, - symbol: data1?.[0]?.plots[index].symbol, - ...newObj, - }; - }); - if (!data1) { - return
Loading...
; - } - return ( -
-
- - - - - - - {Object.values(keys).map((key, ind) => { - return ; - })} - -
-
- ); - } -} - -// export default App; -const mapStateToProps = (state) => { - return { - GFilterData: state.GFilterData, - chartsGData: state.chartsData, - strings: state.lang, - }; -}; -const mapDispatchToProps = (dispatch) => { - return bindActionCreators( - { - APITransport: APITransport, - }, - dispatch - ); -}; -export default withStyles(style)( - connect(mapStateToProps, mapDispatchToProps)(HorBarChart) -); diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/LineChart.js b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/LineChart.js index 225f27c1275..1da465ea1f9 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/LineChart.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/LineChart.js @@ -1,25 +1,25 @@ -import { withStyles } from '@material-ui/core/styles'; import React from 'react'; import { Line } from 'react-chartjs-2'; -import { isMobile } from 'react-device-detect'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; -import { getLocaleLabels } from '../../utils/commons'; import NFormatterFun from '../common/numberFormaterFun'; +import { withStyles } from '@material-ui/core/styles'; import style from './styles'; +import { isMobile } from 'react-device-detect'; +import CONFIG from '../../config/configs'; const options = { scales: { xAxes: [{ - gridLines: { - color: "rgba(0, 0, 0, 0)", - } + gridLines: { + color: "rgba(0, 0, 0, 0)", + } }] - }, +}, responsive: true, options: { responsive: true, - + maintainAspectRatio: true, scales: { yAxes: [{ @@ -43,16 +43,16 @@ class LineChart extends React.Component { constructor(props) { super(props); } - + callforNewData(elems) { } - - manupulateData(strings, chartData) { + + manupulateData(strings,chartData) { var tempdata = { labels: [], datasets: [] }; - let color = JSON.parse(sessionStorage.getItem('CHART_COLOR_CODE')); + let color = JSON.parse(sessionStorage.getItem('CHART_COLOR_CODE')) ; chartData.map((d, i) => { let tempObj = { label: "", @@ -61,11 +61,11 @@ class LineChart extends React.Component { fill: false } let tempdataArr = []; - let tempdatalabel = [], tempVal = ''; - tempObj.label = getLocaleLabels(`DSS_${d.headerName}`, strings) || `DSS_${d.headerName}`; + let tempdatalabel = [],tempVal=''; + tempObj.label = strings[d.headerName] || d.headerName; d.plots.map((d1, i) => { tempVal = NFormatterFun(d1.value, d1.symbol, this.props.GFilterData['Denomination']); - tempVal = (typeof tempVal == 'string') ? parseFloat(tempVal.replace(/,/g, '')) : tempVal; + tempVal = (typeof tempVal == 'string')?parseFloat(tempVal.replace(/,/g, '')):tempVal; tempdataArr.push(tempVal); tempdatalabel.push(strings[d1.name] || d1.name); }) @@ -76,35 +76,35 @@ class LineChart extends React.Component { return tempdata; } - render() { - let { chartData, classes, strings } = this.props; - let data = this.manupulateData(strings, chartData); + render() { + let { chartData,classes,strings } = this.props; + let data = this.manupulateData(strings,chartData); if (data) { - if (isMobile) { - return ( -
- - -
- ) - } else { - return ( -
- - -
- ) + if (isMobile){ + return ( +
+ + +
+ ) + }else{ + return ( +
+ + +
+ ) } } return
Loading...
@@ -122,4 +122,4 @@ const mapDispatchToProps = dispatch => { return bindActionCreators({ }, dispatch) } -export default withStyles(style)(connect(mapStateToProps, mapDispatchToProps)(LineChart)); +export default withStyles(style)(connect(mapStateToProps, mapDispatchToProps)(LineChart)); diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/MapChart.js b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/MapChart.js deleted file mode 100644 index df0995a49ca..00000000000 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/MapChart.js +++ /dev/null @@ -1,346 +0,0 @@ -import { withStyles } from "@material-ui/core/styles"; -import _ from "lodash"; -import React from "react"; -import { connect } from "react-redux"; -import { ComposableMap, Geographies, Geography } from "react-simple-maps"; -import ReactTooltip from "react-tooltip"; -import { bindActionCreators } from "redux"; -import APITransport from "../../actions/apitransport/apitransport"; -import ChartsAPI from "../../actions/charts/chartsAPI"; -import getChartOptions from "../../actions/getChartOptions"; -import { getLocaleLabels, getTenantId } from "../../utils/commons"; -import style from "./styles"; -import { get } from "lodash"; -import { Typography, Tooltip } from '@material-ui/core'; - - -const PROJECTION_CONFIG = { scale: 350, center: [78.9629, 22.5937] }; - -// Red Variants -const COLOR_RANGE = ["#54D140", "#298CFF", "#F47738", "#D1D1D1"]; - -const STATUS = ["Live","OnBoarded", "None"]; -const DEFAULT_COLOR = "#D1D1D1"; - -const getColor = (current) => { - const status = current && current.status; - if (current) { - switch (status) { - case "Live": - return COLOR_RANGE[0]; - case "OnBoarded": - return COLOR_RANGE[1]; - case "UnderImplementation": - return COLOR_RANGE[2]; - case "None": - return DEFAULT_COLOR; - default: - return DEFAULT_COLOR; - } - } - return DEFAULT_COLOR; -}; - -const Backsvg = ({ onClick }) => ( - - - -); - -const geographyStyle = { - default: { - outline: "none", - stroke: "white", - strokeWidth: "0.5", - strokeOpacity: "0.9", - }, - hover: { - outline: "none", - stroke: "white", - strokeWidth: "0.5", - strokeOpacity: "0.9", - }, - pressed: { - outline: "none", - stroke: "white", - strokeWidth: "0.5", - strokeOpacity: "0.9", - }, -}; - -class MapChart extends React.Component { - constructor(props) { - super(props); - this.state = { - tooltipContent: "", - drillDown: false, - }; - } - - onMouseEnter(geo, current = { value: "0" }, event) { - this.setState({ - tooltipContent: `${getLocaleLabels(`DSS_TB_${geo.properties.name}`)}: ${ - current.value ? Number(current.value).toFixed() + " ULBs" : "NA" - } `, - }); - } - back() { - this.props.updateSelectedState({ state: "", totalCount: 0, liveCount: 0 }); - } - onMouseClick(geo, current = { value: "NA" }, event) { - /* to make the map clickable only on the live states */ - if (current && current.value > 0 && current.status === "Live") this.props.updateSelectedState(current); - } - onMouseLeave(geo, current = { value: "NA" }, event) { - this.setState({ tooltipContent: `` }); - } - callAPI() { - let code = this.props.chartData["id"] ? this.props.chartData["id"] : ""; - let filters = this.props.filters; - if (this.props.page.includes("ulb")) { - if (!filters["tenantId"]) { - let tenentFilter = []; - tenentFilter.push(`${getTenantId()}`); - filters["tenantId"] = tenentFilter; - } - } - let requestBody = getChartOptions(code, filters); - let chartsAPI = new ChartsAPI( - 2000, - "dashboard", - code + this.props.moduleLevel, - requestBody.dataoption - ); - this.props.APITransport(chartsAPI); - } - callAPI2() { - let code = this.props.chartData["id"] ? this.props.chartData["id"] : ""; - let filters = this.props.filters; - if (this.props.page.includes("ulb")) { - if (!filters["tenantId"]) { - let tenentFilter = []; - tenentFilter.push(`${getTenantId()}`); - filters["tenantId"] = tenentFilter; - } - } - filters["state"] = this.props.selectedState; - let drillDownCode = this.props.chartsGData[code] - ? this.props.chartsGData[code].drillDownChartId - : ""; - let requestBody = getChartOptions(drillDownCode, filters); - let chartsAPI = new ChartsAPI( - 2000, - "dashboard", - drillDownCode + this.props.moduleLevel, - requestBody.dataoption - ); - this.props.APITransport(chartsAPI); - } - componentDidMount() { - this.callAPI(); - } - componentDidUpdate() { - if (this.props.selectedState !== "" && !this.state.drillDown) { - this.callAPI2(); - this.setState({ drillDown: true }); - } else if (this.props.selectedState == "" && this.state.drillDown) { - this.callAPI(); - this.setState({ drillDown: false }); - } - } - render() { - const {classes}=this.props; - const INDIA_TOPO_JSON = - JSON.parse(sessionStorage.getItem("MAP_CONFIG")) || {}; - const data = get(INDIA_TOPO_JSON, "objects.india.geometries", [])?.map( - (ee) => { - return { state: ee.properties.name, value: 0, id: ee.id }; - } - ); - let DataObj = - data?.reduce((acc, curr) => { - acc[curr.state] = { ...curr }; - return { ...acc }; - }, {}) || {}; - - /* - const colorScale = scaleQuantile() - .domain(data.map(d => d.value)) - .range(COLOR_RANGE); - const gradientData = { - fromColor: COLOR_RANGE[0], - toColor: COLOR_RANGE[COLOR_RANGE.length - 1], - min: 0, - max: data.reduce((max, item) => (item.value > max ? item.value : max), 0) - }; - */ - let codekey = _.chain(this.props).get("chartData").get("id").value(); - codekey = codekey + this.props.moduleLevel; - let data1 = - _.chain(this.props) - .get("chartsGData") - .get(codekey) - .get("data") - .filter((data) => data) - .map((dat) => { - let totalCount = dat.plots[3].value; - let liveCount = dat.plots[4].value; - let live = dat.plots[4].strValue > 0 ? true : false; - DataObj[dat.headerName] = { - ...DataObj?.[dat.headerName], - status: dat.plots[2].strValue, - value: live ? liveCount : totalCount, - live, - totalCount, - liveCount, - }; - }) - .value() || null; - let drillDownCodes = _.chain(this.props) - .get("chartsGData") - .get(codekey) - .get("drillDownChartId") - .value(); - if (!data1) { - return
Loading...
; - } - const { selectedState, liveCount, totalCount } = this.props; - if (selectedState !== "") { - let data2 = - _.chain(this.props) - .get("chartsGData") - .get(drillDownCodes) - .get("data") - .map((dat) => ({ ...dat })) - .value() || null; - if (!data2) { - return
Loading...
; - } - return ( -
- {" "} - {/* {selectedState} - {totalCount} - {liveCount} */} -
- this.back()} /> -
- {data2 && data2.length == 0 && ( -
- {getLocaleLabels("DSS_NO_DATA")} -
- )} - {data2 && data2[0] && ( - - {getLocaleLabels(`DSS_${data2[0].plots[1].name}`)} - {getLocaleLabels(`DSS_${data2[0].plots[2].name}`)} - - )} - {data2.map((dat, i) => { - return ( - - {getLocaleLabels(`DSS_${dat.plots[1].label}`)} - {dat.plots[2].value} - - ); - })} -
- ); - } - - return ( -
- {this.state.tooltipContent} -
- - - {({ geographies }) => - geographies.map((geo) => { - const current = Object.values(DataObj).find( - (s) => s.id === geo.id - ); - return ( - - this.onMouseEnter(geo, current, event) - } - onClick={(event) => - this.onMouseClick(geo, current, event) - } - onMouseLeave={(event) => - this.onMouseLeave(geo, current, event) - } - /> - ); - }) - } - - -
- - {STATUS.map((sta) => { - return ( - - - - - {getLocaleLabels(`DSS_${sta}`)} - - - - ); - })} - -
- ); - } -} - -// export default App; -const mapStateToProps = (state) => { - return { - GFilterData: state.GFilterData, - chartsGData: state.chartsData, - strings: state.lang, - }; -}; -const mapDispatchToProps = (dispatch) => { - return bindActionCreators( - { - APITransport: APITransport, - }, - dispatch - ); -}; -export default withStyles(style)( - connect(mapStateToProps, mapDispatchToProps)(MapChart) -); diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/PerformanceChart.js b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/PerformanceChart.js index 2f2891f096d..e44b467d874 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/PerformanceChart.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/PerformanceChart.js @@ -13,7 +13,6 @@ import ActionButtons from '../common/inputs/ActionButtons'; import Cards from '../common/Cards/Cards'; import UiTable from '../common/UiTable/UiTable'; import variables from '../../styles/variables'; -import { getLocaleLabels } from '../../utils/commons'; class PerformanceChart extends React.Component { constructor(props) { @@ -111,7 +110,7 @@ class PerformanceChart extends React.Component { return { "fortable": (strings["TENANT_TENANTS_" + label] || label), "order": d.headerValue, - "label": getLocaleLabels(`DSS_${d.headerName}`,strings) + " " + d.headerValue + " : " + (strings["TENANT_TENANTS_" + label] || label), + "label": d.headerName + " " + d.headerValue + " : " + (strings["TENANT_TENANTS_" + label] || label), "value": plot.value, "label2": (strings[plot.label] || plot.label) + ": ", "color": (plot.value > 50) ? "#259b24" : "#e54d42" diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/TableChart.js b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/TableChart.js index b8eb41caf8d..82c03c1677e 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/TableChart.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/TableChart.js @@ -1,6 +1,6 @@ import { withStyles } from '@material-ui/styles'; import axios from 'axios'; -import _, { get } from 'lodash'; +import _ from 'lodash'; import moment from 'moment'; import React, { Component } from 'react'; import { isMobile } from 'react-device-detect'; @@ -10,7 +10,6 @@ import { bindActionCreators } from 'redux'; import APITransport from '../../actions/apitransport/apitransport'; import getChartOptions from '../../actions/getChartOptions'; import getPrevFinancialYearObj from '../../actions/getPrevFinancialYearObj'; -import { getLocaleLabels, getTenantId } from '../../utils/commons'; import Chips from '../common/Chips/Chips'; import NFormatterFun from '../common/numberFormaterFun'; import SwitchButton from '../common/tableswitchs/switchButtons'; @@ -152,10 +151,10 @@ class TableChart extends Component { this.setState(tmpState); }) .catch(error => { + console.log(error.response) }); } } - getRequest(calledFrom, visualcode, active, filterList) { @@ -169,7 +168,7 @@ class TableChart extends Component { if (filterList[v] && filterList[v].length > 0) { tempFL = filterList[v][filterList[v].length - 1]; if (tempFL[2]['column'] == 'DDRs') { - let tempDDR = this.props.tenantObj[tempFL[4]]; + let tempDDR = this.props.mdmsData['master'][tempFL[4]]; for (var j = 0; j < tempDDR.length; j++) { ttest.push(tempDDR[j]); } @@ -214,8 +213,9 @@ class TableChart extends Component { if (this.props.page && this.props.page.includes('ulb')) { if (!globalFilters['tenantId']) { + console.log('=======tenet Id not there TableChart comp========') let tenentFilter = [] - tenentFilter.push(`${getTenantId()}`) + tenentFilter.push(`${localStorage.getItem('tenant-id')}`) globalFilters['tenantId'] = tenentFilter } } @@ -245,6 +245,7 @@ class TableChart extends Component { this.setState(tempState); }) .catch(error => { + console.log(error.response) }); } } @@ -481,7 +482,7 @@ class TableChart extends Component { {(this.state.data && !_.isEmpty(this.state.filterList, true)) &&
- {getLocaleLabels('Filters Applied')} + Filters Applied
{ isMobile ? @@ -518,25 +519,12 @@ class TableChart extends Component { } } const mapStateToProps = (state) => { - let tenants=get(state,'tenents.MdmsRes.tenant.tenants',[]); - const tenantObj=tenants.reduce((prev,curr)=>{ - let ddrname=curr.city.ddrName; - if(prev[ddrname]) - { - prev[ddrname].push(curr.code) - }else{ - prev[ddrname]=[curr.code] - } - return prev; - - },{}) return { dncData: state.DemandAndCollectionData, GFilterData: state.GFilterData, chartsData: state.chartsData, mdmsData: state.mdmsData, - strings: state.lang, - tenantObj + strings: state.lang } } const mapDispatchToProps = dispatch => { diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/chartrow.js b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/chartrow.js index dae0d48b617..badd40dfc16 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/chartrow.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/chartrow.js @@ -18,7 +18,7 @@ class ChartRow extends Component { let { classes, rowData, displayName, filters, page,Gfilter,row } = this.props; if(isMobile){ return ( -
+
{ displayName &&
{strings[rowData.name]}
@@ -28,7 +28,7 @@ class ChartRow extends Component { ); }else{ return ( -
+
{ displayName &&
{strings[rowData.name]}
diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/charttype.js b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/charttype.js index e3a1c3a2a4d..3ae444c4435 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Charts/charttype.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Charts/charttype.js @@ -11,7 +11,6 @@ import { connect } from 'react-redux'; import APITransport from '../../actions/apitransport/apitransport'; import DonutChart from './DonutChart'; import HorizontalBarChart from './HorizontalBarChart' -import { getTenantId } from '../../utils/commons'; class ChartType extends React.Component { constructor(props) { @@ -36,7 +35,7 @@ class ChartType extends React.Component { if(this.props.page && this.props.page.includes('ulb')) { if(!filters['tenantId']) { let tenentFilter = [] - tenentFilter.push(`${getTenantId()}`) + tenentFilter.push(`${localStorage.getItem('tenant-id')}`) filters['tenantId'] = tenentFilter } } @@ -49,6 +48,7 @@ class ChartType extends React.Component { let chartKey = _.chain(this.props).get('chartData').first().get('id').value(); let chartType = _.chain(this.props).get('chartData').first().get('chartType').toUpper().value(); let data = _.chain(this.props).get('chartsGData').get(chartKey).get('data').value(); + if (data) { switch (chartType) { case 'PIE': diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/dashboard.js b/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/dashboard.js index 617158f857a..c743c50c6ee 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/dashboard.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/dashboard.js @@ -28,7 +28,6 @@ import UiTable from '../common/UiTable/UiTable'; import getFinancialYearObj from '../../actions/getFinancialYearObj'; import mdmsAPI from '../../actions/mdms/mdms'; import moment from 'moment'; -import { getTenantId } from '../../utils/commons'; class Dashboard extends Component { @@ -94,7 +93,7 @@ class Dashboard extends Component { if(this.state.page.includes('ulb')) { if(!filters['tenantId']) { let tenentFilter = [] - tenentFilter.push(`${getTenantId()}`) + tenentFilter.push(`${localStorage.getItem('tenant-id')}`) filters['tenantId'] = tenentFilter } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/download/filterTable.js b/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/download/filterTable.js index 800a18f94e0..95079e3b20f 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/download/filterTable.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/download/filterTable.js @@ -1,6 +1,5 @@ import React, { useState } from "react" import _ from 'lodash'; -import { getLocaleLabels } from "../../../utils/commons"; export default function FilterTable(props) { let initState = props.data; @@ -10,7 +9,7 @@ export default function FilterTable(props) { // let header = Object.keys(state.filter) return ["Filters Applied", "Filter Values"].map((key, index) => { - return {getLocaleLabels(key.toUpperCase())} + return {key.toUpperCase()} }) } diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/download/index.js b/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/download/index.js index e88d6847bfa..51d9bae7033 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/download/index.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/download/index.js @@ -78,6 +78,7 @@ export function CustomizedMenus(props) { props.APITrans(false); setAnchorEl(null); }.bind(this)).catch(function (err) { + console.log(err); setAnchorEl(null); }.bind(this)) @@ -104,6 +105,7 @@ export function CustomizedMenus(props) { } catch{ } }.bind(this)).catch(function (error) { + console.log(error); setAnchorEl(null); }.bind(this)) @@ -135,13 +137,13 @@ export function CustomizedMenus(props) { - + - +
diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/share/index.js b/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/share/index.js index 924db2eb293..dd30f89fa4a 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/share/index.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Dashboard/share/index.js @@ -120,6 +120,7 @@ class CustomizedShare extends Component { APITransport(fileUploadAPI) } catch{ } }).catch(function (error) { + console.log(error); this.setState({ anchorEl: null }) @@ -162,6 +163,7 @@ class CustomizedShare extends Component { APITransport(fileUploadAPI) } catch{ } }).catch(function (error) { + console.log(error); this.setState({ anchorEl: null }) @@ -231,8 +233,9 @@ class CustomizedShare extends Component { fakeLink.click(); } if (image && type === 'email') { - window.open(`mailto:?body=${encodeURIComponent(image)}`, "_blank"); - + fakeLink.setAttribute('href', 'mailto:?body=' + encodeURIComponent(image)); + fakeLink.setAttribute('target', '_top'); + fakeLink.click(); } }) } @@ -265,26 +268,26 @@ class CustomizedShare extends Component { - + - {/* + - - */} + + - + - {/* + - - */} + +
) diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Home/Home.js b/frontend/mono-ui/web/dss-dashboard/src/components/Home/Home.js index 193b89e235c..ca6c3b1f58c 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Home/Home.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Home/Home.js @@ -1,541 +1,234 @@ -import { Typography } from "@material-ui/core"; -import Grid from "@material-ui/core/Grid"; -import { withStyles } from "@material-ui/core/styles"; -import _ from "lodash"; -import moment from "moment"; import React from "react"; -import { isMobile } from "react-device-detect"; -import { connect } from "react-redux"; +import Grid from '@material-ui/core/Grid'; import { bindActionCreators } from "redux"; -import APITransport from "../../actions/apitransport/apitransport"; -import dashboardAPI from "../../actions/dashboardAPI"; -import getFilterObj from "../../actions/getFilterObj"; -import getFinancialYearObj from "../../actions/getFinancialYearObj"; -import mdmsAPI from "../../actions/mdms/mdms"; -import Variables from "../../styles/variables"; -import { getLocaleLabels, isNurtDashboard } from "../../utils/commons"; -import history from "../../utils/web.history"; -import HorBarChart from "../Charts/HorBarChart"; -import MapChart from "../Charts/MapChart"; +import { connect } from "react-redux"; +import APITransport from '../../actions/apitransport/apitransport'; +import { Typography } from '@material-ui/core'; +import style from './styles'; +import { withStyles } from '@material-ui/core/styles'; import Card from "../common/Card/Card"; import CardBody from "../common/Card/CardBody.js"; import CardHeader from "../common/Card/CardHeader.js"; import CardIcon from "../common/Card/CardIcon.js"; -import CustomCard from "../common/CustomCard/CustomCard"; -import Icons from "../common/Icon/Icon"; -import CustomizedMenus from "../Dashboard/download"; -import CustomizedShare from "../Dashboard/share"; -import style from "./styles"; -import Arrow_Right from "../../images/arrows/Arrow_Right.svg"; +import CustomCard from '../common/CustomCard/CustomCard' +import Paper from '@material-ui/core/Paper'; +import Variables from '../../styles/variables' +import Icons from '../common/Icon/Icon' +import getFilterObj from '../../actions/getFilterObj'; +import history from '../../utils/web.history'; +import _ from 'lodash'; +import dashboardAPI from '../../actions/dashboardAPI'; +import { isMobile } from 'react-device-detect'; +import CustomizedMenus from '../Dashboard/download'; +import CustomizedShare from '../Dashboard/share'; +import FilterIcon from '@material-ui/icons/FilterList'; +import Button from '@material-ui/core/Button'; +import Menu from '../common/CustomMenu' +import getFinancialYearObj from '../../actions/getFinancialYearObj'; +import mdmsAPI from '../../actions/mdms/mdms'; +import moment from 'moment'; class Home extends React.Component { - constructor(props) { - super(props); - - this.state = { - filter: this.props.GFilterData, - page: _.get(this.props, "match.params.pageId"), - dontShowHeader: true, - getFYobj: getFinancialYearObj(), - dashboardConfigData: [], - selectedState: "", - totalCount: 0, - liveCount: 0, - }; - } - - updateSelectedState = (obj = {}) => { - this.setState({ - selectedState: obj.state, - totalCount: obj.totalCount, - liveCount: obj.liveCount, - }); - }; - async componentDidMount() { - await this.workingOnLabelText(); - } - - lightenDarkenColor(col, amt) { - var usePound = false; - - if (col[0] == "#") { - col = col.slice(1); - usePound = true; + constructor(props) { + super(props); + + this.state = { + filter: this.props.GFilterData, + page: _.get(this.props, 'match.params.pageId'), + dontShowHeader: true, + getFYobj:getFinancialYearObj(), + dashboardConfigData: [] + }; + } + + async componentDidMount() { + await this.workingOnLabelText() } - var num = parseInt(col, 16); - var r = (num >> 16) + amt; + lightenDarkenColor(col, amt) { + var usePound = false; - if (r > 255) r = 255; - else if (r < 0) r = 0; + if (col[0] == "#") { + col = col.slice(1); + usePound = true; + } - var b = ((num >> 8) & 0x00ff) + amt; + var num = parseInt(col, 16); + var r = (num >> 16) + amt; - if (b > 255) b = 255; - else if (b < 0) b = 0; + if (r > 255) r = 255; + else if (r < 0) r = 0; - var g = (num & 0x0000ff) + amt; + var b = ((num >> 8) & 0x00FF) + amt; - if (g > 255) g = 255; - else if (g < 0) g = 0; - let color = (usePound ? "#" : "") + (g | (b << 8) | (r << 16)).toString(16); - return color; - } + if (b > 255) b = 255; + else if (b < 0) b = 0; - handleOnClick(path) { - history.push(`${process.env.PUBLIC_URL}/` + path); - } + var g = (num & 0x0000FF) + amt; - componentDidUpdate(prevProps) { - if (prevProps.dashboardConfigData !== this.props.dashboardConfigData) { - this.setState({ - dashboardConfigData: this.props.dashboardConfigData, - }); + if (g > 255) g = 255; + else if (g < 0) g = 0; + let color = (usePound ? "#" : "") + (g | (b << 8) | (r << 16)).toString(16); + return color } - } - - renderChart(data, index, vizArray) { - let { chartLabelName, selectedState, liveCount, totalCount } = this.state; - let { classes, strings } = this.props; - let filters = getFilterObj( - this.props.GFilterData, - this.props.mdmsData, - this.state.page - ); - let bgColor = Variables.colors[index].light; - let iconColor = Variables.iconColors[index].light; - let pageId = ""; - let moduleLevel = ""; - - if (data) { - if (data.ref && data.ref.url) { - pageId = data.ref.url; - } - if (data.moduleLevel) { - moduleLevel = data.moduleLevel; - if (!filters["modulelevel"]) { - filters.modulelevel = data.moduleLevel; + + handleOnClick(path) { + history.push(`${process.env.PUBLIC_URL}/` + path) + } + + componentDidUpdate(prevProps) { + if (prevProps.dashboardConfigData !== this.props.dashboardConfigData) { + this.setState({ + dashboardConfigData: this.props.dashboardConfigData + }) } - } } - if (data.vizType.toUpperCase() === "COLLECTION") { - if (data.charts[0].chartType == "map") { - let newData = vizArray[1]; - return ( - - -
-
- - - - -
- - {selectedState - ? getLocaleLabels(`DSS_TB_${selectedState}`) - : strings[data.name] || data.name} - {selectedState && ( - - {strings[`DSS_TOTAL_ULBS`] || "DSS_TOTAL_ULBS"}{" "} - {Number(totalCount).toFixed()} |{" "} - {strings[`DSS_LIVE_ULBS`] || "DSS_LIVE_ULBS"}{" "} - {Number(liveCount).toFixed()} - - )} - -
-
- - - - - - - -
-
- - - - -
- - {getLocaleLabels( - selectedState - ? `${selectedState.toUpperCase()}_${newData.name}` - : newData.name - )} - -
-
- - - - - - - -
-
-
-
- ); - } else if (data.charts[0].chartType == "bar") { - return data.charts[0].chartType == "bar" ? null : ( - - - - - - -
- - {selectedState - ? strings[`${selectedState.toUpperCase()}_${data.name}`] - ? strings[`${selectedState.toUpperCase()}_${data.name}`] - : `${selectedState.toUpperCase()}_${data.name}` - : strings[data.name] || data.name} - -
-
- - - - - - - -
-
- ); - } else { - return ( - - - - - - - {isNurtDashboard() && pageId === "national-overview" ? ( -
- - {strings["DSS_OVERVIEW"] || "DSS_OVERVIEW"} - - - {" "} - - -
- ) : ( -
- )} -
- - {strings[data.name] || data.name} - -
-
- - - {data && - data.charts && - Array.isArray(data.charts) && - data.charts.length > 0 && - data.charts.map((d, i) => { - return ( - - - - ); - })} + + renderChart(data, index) { + let { chartLabelName } = this.state; + let { classes, strings } = this.props; + let filters = getFilterObj(this.props.GFilterData, this.props.mdmsData, this.state.page); + let bgColor = Variables.colors[index].light + let iconColor = Variables.colors[index].dark + let pageId = '' + let moduleLevel = '' + + if (data) { + if (data.ref && data.ref.url) { + pageId = data.ref.url + } + if (data.moduleLevel) { + moduleLevel = data.moduleLevel + if (!filters['modulelevel']) { + filters.modulelevel = data.moduleLevel + } + } + } + if (data.vizType.toUpperCase() === 'COLLECTION') { + return ( + + + + + + +
+ {strings[data.name] || data.name} +
+ +
+ + + { + data && data.charts && Array.isArray(data.charts) && data.charts.length > 0 && data.charts.map((d, i) => { + return ( + + + + ) + }) + } + + +
+
+ + + ) + } + else { + return ( + + + + + + + +
+ {strings[data.name] || data.name} +
+ +
+ + + { + data && data.charts && Array.isArray(data.charts) && data.charts.length > 0 && data.charts.map((d, i) => { + return + + }) + } + + +
-
-
-
- ); - } - } else { - return ( - - - - - - -
- - {strings[data.name] || data.name} - -
-
- - - {data && - data.charts && - Array.isArray(data.charts) && - data.charts.length > 0 && - data.charts.map((d, i) => { - return ( - - - - ); - })} - - -
-
- ); - } - } - - callDashboardAPI() { - let dashboardApi = new dashboardAPI(20000); - let overview = false; - if ( - _.toLower(this.state.page) === "dashboard" || - typeof this.state.page == "undefined" - ) { - overview = true; - } else { - this.setState({ - dontShowHeader: false, - }); + ) + } + } - let path = ""; - if (window.location.pathname && window.location.pathname.includes("ulb-")) { - path = "ulb-home"; - } else if (window.location.pathname && isNurtDashboard()) { - path = "NURT_DASHBOARD"; - } else { - path = "home"; + callDashboardAPI() { + let dashboardApi = new dashboardAPI(20000); + let overview = false + if (_.toLower(this.state.page) === 'dashboard' || typeof this.state.page == 'undefined') { + overview = true + } else { + this.setState({ + dontShowHeader: false + }) + } + + let path = '' + if (window.location.pathname && window.location.pathname.includes('ulb-')) { + path = 'ulb-home' + } else { + path = 'home' + + } + this.props.APITransport(dashboardApi, path || 'home'); + } - this.props.APITransport(dashboardApi, path || "home"); - } - componentDidMount() { - let newFilterData = this.state.filter; - newFilterData.duration.value.startDate = - this.state.getFYobj.value.startDate; - newFilterData.duration.value.endDate = this.state.getFYobj.value.endDate; + componentDidMount() { + let newFilterData = this.state.filter + newFilterData.duration.value.startDate = this.state.getFYobj.value.startDate + newFilterData.duration.value.endDate = this.state.getFYobj.value.endDate - this.setState({ - filter: newFilterData, - }); + this.setState({ + filter: newFilterData + }) - let mdmsApi = new mdmsAPI(20000); - this.props.APITransport(mdmsApi); + let mdmsApi = new mdmsAPI(20000); + this.props.APITransport(mdmsApi); - this.callDashboardAPI(); - } + this.callDashboardAPI(); + } - getTitleText(strings) { - let title, fromTxt, toTxt; + getTitleText(strings){ + let title,fromTxt,toTxt; - fromTxt = strings["DSS_FROM"] ? strings["DSS_FROM"] : "DSS_FROM"; - toTxt = strings["DSS_TO"] ? strings["DSS_TO"] : "DSS_TO"; + fromTxt = (strings["DSS_FROM"])? strings["DSS_FROM"] : "DSS_FROM"; + toTxt = (strings["DSS_TO"])? strings["DSS_TO"] : "DSS_TO"; - title = - fromTxt + - " " + - moment.unix(this.state.getFYobj.value.startDate).format("MMM DD, YYYY") + - " " + - toTxt + - " " + - moment().format("MMM DD, YYYY"); + title = fromTxt + " " + moment.unix(this.state.getFYobj.value.startDate).format("MMM, DD YYYY") + " " +toTxt +" " + moment().format("MMM, DD YYYY") return title; - } - - render() { - let { classes, strings } = this.props; - let { dashboardConfigData } = this.state; - let tabsInitData = - dashboardConfigData && - Array.isArray(dashboardConfigData) && - dashboardConfigData.length > 0 && - dashboardConfigData[0] - ? dashboardConfigData[0] - : ""; - let dashboardName = - dashboardConfigData && - Array.isArray(dashboardConfigData) && - dashboardConfigData.length >= 0 && - dashboardConfigData[0] && - dashboardConfigData[0].name && - dashboardConfigData[0].name; - return ( - - - - {this.props.strings[dashboardName] || dashboardName} - - - {/* {isMobile &&
+ } + + render() { + let { classes, strings } = this.props; + let { dashboardConfigData } = this.state; + let tabsInitData = dashboardConfigData && Array.isArray(dashboardConfigData) && dashboardConfigData.length > 0 && dashboardConfigData[0] ? dashboardConfigData[0] : '' + let dashboardName = dashboardConfigData && Array.isArray(dashboardConfigData) && dashboardConfigData.length >= 0 && dashboardConfigData[0] && dashboardConfigData[0].name && dashboardConfigData[0].name + return ( + + + + + {this.props.strings[dashboardName] || dashboardName} + + + {/* {isMobile &&
{!this.state.dontShowHeader && @@ -549,82 +242,53 @@ class Home extends React.Component {
} */} - {!isMobile && ( -
- - -
- )} -
-
- - - {this.getTitleText(strings)} - - - {isMobile && ( -
- - -
- )} - - {/* {tabsInitData.visualizations && Array.isArray(tabsInitData.visualizations) && tabsInitData.visualizations.length > 0 && this.gettingData(tabsInitData.visualizations)} */} - {tabsInitData.visualizations && - Array.isArray(tabsInitData.visualizations) && - tabsInitData.visualizations.length > 0 && - tabsInitData.visualizations.map((k, v) => { - return ( - k.vizArray && - Array.isArray(k.vizArray) && - k.vizArray.length > 0 && - k.vizArray.map((data, index) => { - // if (data.vizType.toUpperCase() !== 'COLLECTION') { this.gettingData(data) } - return this.renderChart(data, index, k.vizArray); - }) - ); - })} -
- ); - } + {!isMobile &&
+ + +
} + + + + + {this.getTitleText(strings)} + + {isMobile &&
+ + +
} + + {/* {tabsInitData.visualizations && Array.isArray(tabsInitData.visualizations) && tabsInitData.visualizations.length > 0 && this.gettingData(tabsInitData.visualizations)} */} + {tabsInitData.visualizations && Array.isArray(tabsInitData.visualizations) && tabsInitData.visualizations.length > 0 && tabsInitData.visualizations.map((k, v) => { + return ( + k.vizArray && Array.isArray(k.vizArray) && k.vizArray.length > 0 && k.vizArray.map((data, index) => { + // if (data.vizType.toUpperCase() !== 'COLLECTION') { this.gettingData(data) } + return (this.renderChart(data, index)) + + }) + ) + })} + + + ) + } } -const mapStateToProps = (state) => ({ - strings: state.lang, - dashboardConfigData: state.firstReducer.dashboardConfigData, - mdmsData: state.mdmsData, - GFilterData: state.GFilterData, +const mapStateToProps = state => ({ + strings: state.lang, + dashboardConfigData: state.firstReducer.dashboardConfigData, + mdmsData: state.mdmsData, + GFilterData: state.GFilterData }); -const mapDispatchToProps = (dispatch) => - bindActionCreators( - { - APITransport: APITransport, - }, - dispatch - ); - -export default withStyles(style)( - connect(mapStateToProps, mapDispatchToProps)(Home) -); +const mapDispatchToProps = dispatch => + bindActionCreators( + { + APITransport: APITransport, + }, + dispatch + ); + +export default withStyles(style)(connect( + mapStateToProps, + mapDispatchToProps +)(Home)); \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/Home/styles.js b/frontend/mono-ui/web/dss-dashboard/src/components/Home/styles.js index 33513e9d2e3..186b51c9cb6 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/Home/styles.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/Home/styles.js @@ -10,8 +10,8 @@ const styles = theme => ({ }, pageHeader: { fontFamily: 'Roboto', - fontSize: '36px', - fontWeight: '700', + fontSize: '24px', + fontWeight: '500', flex: 1, textAlign: 'left', wordBreak: "break-word" @@ -55,8 +55,8 @@ const styles = theme => ({ }, cardTitle: { fontFamily: 'Roboto', - fontSize: '22px', - fontWeight: '600', + fontSize: '20px', + fontWeight: '500', margin: '10px 18px 0px 18px', textOverflow: 'ellipsis', whiteSpace: 'nowrap', @@ -122,7 +122,7 @@ const styles = theme => ({ padding: '0px 12px 0px 12px !important', }, paper: { - padding: '2px 12px 0px 12px !important', + padding: '18px 12px 30px 12px !important', }, customCard: { diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/Box.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/Box.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/BoxStyles.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/BoxStyles.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/ColorBox.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/ColorBox.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/ColorBoxStyle.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/ColorBoxStyle.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/KPIBox.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/KPIBox.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/KPIBoxStyles.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/KPIBoxStyles.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/ResourceBox.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/ResourceBox.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/ResourceBoxStyles.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/ResourceBoxStyles.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/StatusBox.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/StatusBox.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/StatusBoxStyles.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Box/StatusBoxStyles.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/Card.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/Card.js index b5912319a86..c447650cdde 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/Card.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/Card.js @@ -3,26 +3,12 @@ import classNames from "classnames"; import PropTypes from "prop-types"; import { makeStyles } from "@material-ui/core/styles"; import styles from "./styles/Card"; -import history from '../../../utils/web.history'; - - -/* Enabled modules will get redirected to new digit - ui , will revisit this constant to move into some mdms config */ -const enabledModulesInDigitUI = ["fsm","mCollect","ws","noc","obps","national-firenoc","national-mcollect","national-ws","nss-obps","national-overview","national-propertytax","national-tradelicense","national-pgr","national-overview","nss-birth-death","birth-death","finance"]; +import history from '../../../utils/web.history' const useStyles = makeStyles(styles); function handleNavigation(page) { - if (page && page.includes && page.includes('digit-ui')) { - window.location.href = page.startsWith('/digit') ? page : `/${page}`; - return; - } else if (page && page.includes && enabledModulesInDigitUI.includes(page)) { - let homeWindow=window.parent; - homeWindow.open(`/digit-ui/employee/dss/dashboard/${page}`, '_self') - return; - } else { - history.push(`${process.env.PUBLIC_URL}/` + page); - } - + history.push(`${process.env.PUBLIC_URL}/`+ page) } export default function Card(props) { @@ -37,10 +23,10 @@ export default function Card(props) { [className]: className !== undefined }); return ( -
handleNavigation(page)} style={{ cursor: 'pointer' }}> -
- {children} -
+
handleNavigation(page)} style={{ cursor: 'pointer' }}> +
+ {children} +
); } @@ -51,4 +37,4 @@ Card.propTypes = { profile: PropTypes.bool, chart: PropTypes.bool, children: PropTypes.node -}; +}; \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/CardHeader.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/CardHeader.js index c94f7f12bd0..abb06edd5e8 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/CardHeader.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/CardHeader.js @@ -18,7 +18,7 @@ export default function CardHeader(props) { [className]: className !== undefined }); return ( -
+
{children}
); diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/CardIcon.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/CardIcon.js index 7843e130158..c29260fad35 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/CardIcon.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/CardIcon.js @@ -15,7 +15,7 @@ export default function CardIcon(props) { [className]: className !== undefined }); return ( -
+
{children}
); diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/styles/CardIconStyles.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/styles/CardIconStyles.js index 11ab9a48648..73b9034fc12 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/styles/CardIconStyles.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/Card/styles/CardIconStyles.js @@ -13,9 +13,9 @@ const cardIconStyle = { "&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader": { borderRadius: "3px", backgroundColor: grayColor[0], - padding: "2px", - marginTop: "-10px", - marginRight: "10px", + padding: "15px", + marginTop: "-20px", + marginRight: "15px", float: "left" } }, diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Cards/Cards.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Cards/Cards.js index b6ceb44adb4..4311e798c75 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/Cards/Cards.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/Cards/Cards.js @@ -36,7 +36,7 @@ class Cards extends Component { {title && - +
diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomCard/CustomCard.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomCard/CustomCard.js index 0535255a6e9..7e95b21926f 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomCard/CustomCard.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomCard/CustomCard.js @@ -1,174 +1,123 @@ import React from "react"; -import Grid from "@material-ui/core/Grid"; +import Grid from '@material-ui/core/Grid'; import { bindActionCreators } from "redux"; import { connect } from "react-redux"; -import APITransport from "../../../actions/apitransport/apitransport"; -import { Typography, Tooltip } from "@material-ui/core"; -import style from "./Style"; -import { withStyles } from "@material-ui/core/styles"; -import _ from "lodash"; -import getChartOptions from "../../../actions/getChartOptions"; -import ChartsAPI from "../../../actions/charts/chartsAPI"; +import APITransport from '../../../actions/apitransport/apitransport'; +import { Typography, Tooltip } from '@material-ui/core'; +import style from './Style'; +import { withStyles } from '@material-ui/core/styles'; +import _ from 'lodash'; +import getChartOptions from '../../../actions/getChartOptions'; +import ChartsAPI from '../../../actions/charts/chartsAPI'; import Arrow_Downward from "../../../images/arrows/Arrow_Downward.svg"; -import Arrow_Upward from "../../../images/arrows/Arrow_Upward.svg"; -import NFormatter from "../numberFormater"; -import { getTenantId, removeSignFromInsightData } from "../../../utils/commons"; +import Arrow_Upward from '../../../images/arrows/Arrow_Upward.svg'; +import NFormatter from '../numberFormater'; +import { removeSignFromInsightData } from "../../../utils/commons"; class CustomCard extends React.Component { - constructor(props) { - super(props); - } + constructor(props) { + super(props); + } - callAPI() { - let code = this.props.chartData["id"] ? this.props.chartData["id"] : ""; - let filters = this.props.filters; + callAPI() { + let code = this.props.chartData['id'] ? this.props.chartData['id'] : ""; + let filters = this.props.filters + + if(this.props.page.includes('ulb')) { + if(!filters['tenantId']) { + let tenentFilter = [] + tenentFilter.push(`${localStorage.getItem('tenant-id')}`) + filters['tenantId'] = tenentFilter + } + } - if (this.props.page.includes("ulb")) { - if (!filters["tenantId"]) { - let tenentFilter = []; - tenentFilter.push(`${getTenantId()}`); - filters["tenantId"] = tenentFilter; - } + let requestBody = getChartOptions(code, filters); + let chartsAPI = new ChartsAPI(2000, 'dashboard', code+this.props.moduleLevel, requestBody.dataoption); + this.props.APITransport(chartsAPI); + } + + componentDidMount() { + this.callAPI(); } - let requestBody = getChartOptions(code, filters); - let chartsAPI = new ChartsAPI( - 2000, - "dashboard", - code + this.props.moduleLevel, - requestBody.dataoption - ); - this.props.APITransport(chartsAPI); - } + render() { + const { classes, strings } = this.props; - componentDidMount() { - this.callAPI(); - } + let codekey = _.chain(this.props).get('chartData').get("id").value(); + codekey=codekey+ this.props.moduleLevel; + let data = _.chain(this.props).get("chartsGData").get(codekey).get("data").map((d, i) => { + return { + "label": _.chain(this.props).get('chartData').get("name").value(), + "valueSymbol": d.headerSymbol, + "value": d.headerValue, + "plots": d.plots, + "insight_data": d.insight ? d.insight : '' + } + }).first().value() || null; - render() { - const { classes, strings, isHome } = this.props; + if (data) { + let insightColor = data.insight_data ? data.insight_data.colorCode === "lower_red" ? "#e54d42" : "#259b24" : ''; + let insightIcon = data.insight_data ? data.insight_data.colorCode === "lower_red" ? Arrow_Downward : Arrow_Upward : ''; + let value = ""; + if(data.insight_data.value){ + if(data.insight_data.value.includes("last year")){ + value = data.insight_data.value.replace("last year" , "LY"); + }else if(data.insight_data.value.includes("last month")){ + value = data.insight_data.value.replace("last month" , "LM"); + } + value=removeSignFromInsightData(value); + } + + let label = data.label ? (strings[data.label] ? strings[data.label] : data.label) : ''; + return ( + + +
+ + {label} + +
- let codekey = _.chain(this.props).get("chartData").get("id").value(); - codekey = codekey + this.props.moduleLevel; - let data = - _.chain(this.props) - .get("chartsGData") - .get(codekey) - .get("data") - .map((d, i) => { - return { - label: _.chain(this.props).get("chartData").get("name").value(), - valueSymbol: d.headerSymbol, - value: d.headerValue, - plots: d.plots, - insight_data: d.insight ? d.insight : "", - }; - }) - .first() - .value() || null; +
+ + + + + + + { + + + + + {value} + + } + - if (data) { - let insightColor = data.insight_data - ? data.insight_data.colorCode === "lower_red" - ? "#e54d42" - : "#00703c" - : ""; - let insightIcon = data.insight_data - ? data.insight_data.colorCode === "lower_red" - ? Arrow_Downward - : Arrow_Upward - : ""; - let value = ""; - if (data.insight_data.value) { - if (data.insight_data.value.includes("last year")) { - value = data.insight_data.value.replace("last year", "LY"); - } else if (data.insight_data.value.includes("last month")) { - value = data.insight_data.value.replace("last month", "LM"); - } - value = removeSignFromInsightData(value); - } - let label = data.label - ? strings[data.label] - ? strings[data.label] - : data.label - : ""; - let tool = data.label - ? strings[`TIP_${data.label}`] - ? strings[`TIP_${data.label}`] - : `TIP_${data.label}` - : ""; - return ( - - -
- - {label} - -
-
- - - - - - {value && ( - - { - - - - - - {value} - - - } - - )} -
- ); +
+ ) + } + return
Loading...
} - return
Loading...
; - } } -const mapStateToProps = (state) => ({ - strings: state.lang, - dashboardConfigData: state.firstReducer.dashboardConfigData, - chartsGData: state.chartsData, +const mapStateToProps = state => ({ + strings: state.lang, + dashboardConfigData: state.firstReducer.dashboardConfigData, + chartsGData: state.chartsData }); -const mapDispatchToProps = (dispatch) => - bindActionCreators( - { - APITransport: APITransport, - }, - dispatch - ); +const mapDispatchToProps = dispatch => + bindActionCreators( + { + APITransport: APITransport, + }, + dispatch + ); -export default withStyles(style)( - connect(mapStateToProps, mapDispatchToProps)(CustomCard) -); +export default withStyles(style)(connect( + mapStateToProps, + mapDispatchToProps +)(CustomCard)); \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomCard/Style.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomCard/Style.js index c70784d7dbb..4fd263eec6c 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomCard/Style.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomCard/Style.js @@ -17,7 +17,7 @@ const styles = theme => ({ subTitle: { textAlign: 'left', fontFamily: 'Roboto', - fontSize: '16px', + fontSize: '14px', fontWeight: '400', color: 'rgba(0, 0, 0, 0.87)', textOverflow: 'ellipsis', @@ -27,11 +27,10 @@ const styles = theme => ({ value: { textAlign: 'left', fontFamily: 'Roboto', - fontSize: '24px', - fontWeight: '700', + fontSize: '20px', + fontWeight: '500', color: 'rgba(0, 0, 0, 0.87)', - marginTop: '1px', - lineHeight:"32px", + marginTop: '5px', textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden', diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomInfo/index.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomInfo/index.js index a899833fa8e..010a4411c3d 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomInfo/index.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomInfo/index.js @@ -1,41 +1,41 @@ -import Collapse from '@material-ui/core/Collapse'; -import Divider from '@material-ui/core/Divider'; -import List from '@material-ui/core/List'; -import ListItemIcon from '@material-ui/core/ListItemIcon'; -import ListItemText from '@material-ui/core/ListItemText'; -import Menu from '@material-ui/core/Menu'; -import MenuItem from '@material-ui/core/MenuItem'; +import React from "react"; +import PropTypes from "prop-types"; import { withStyles } from "@material-ui/core/styles"; import CloudDownloadSharp from '@material-ui/icons/CloudDownloadSharp'; -import DraftsIcon from '@material-ui/icons/Drafts'; -import IconExpandLess from '@material-ui/icons/ExpandLess'; -import IconExpandMore from '@material-ui/icons/ExpandMore'; -import WhatsappIcon from '@material-ui/icons/WhatsApp'; + +import Menu from '@material-ui/core/Menu'; +import MenuItem from '@material-ui/core/MenuItem'; +import ListItemIcon from '@material-ui/core/ListItemIcon'; +import ListItemText from '@material-ui/core/ListItemText'; +import ActionButtons from '../inputs/ActionButtons'; import domtoimage from 'dom-to-image'; -import PropTypes from "prop-types"; -import React from "react"; -import SVG from 'react-inlinesvg'; import { connect } from 'react-redux'; -import { withRouter } from 'react-router-dom'; import { bindActionCreators } from 'redux'; -import { APIStatus } from '../../../actions/apiStatus'; -import APITransport from '../../../actions/apitransport/apitransport'; -import constants from '../../../actions/constants'; -import FileUploadAPI from '../../../actions/fileUpload/fileUpload'; -import removeImageExtension from '../../../actions/removeImageExtension'; +import { withRouter } from 'react-router-dom'; +import share from '../../../images/share.svg'; +import SVG from 'react-inlinesvg'; +import { APIStatus } from '../../../actions/apiStatus' +import FileUploadAPI from '../../../actions/fileUpload/fileUpload' +import APITransport from '../../../actions/apitransport/apitransport' import S3ImageAPI from '../../../actions/s3Image/s3Image'; +import constants from '../../../actions/constants' +import Collapse from '@material-ui/core/Collapse' +import List from '@material-ui/core/List' +import Divider from '@material-ui/core/Divider'; +import Variables from '../../../styles/variables' +import IconExpandLess from '@material-ui/icons/ExpandLess' +import IconExpandMore from '@material-ui/icons/ExpandMore' +import DraftsIcon from '@material-ui/icons/Drafts'; +import WhatsappIcon from '@material-ui/icons/WhatsApp'; import shortenAPI from '../../../actions/shortenAPI'; -import share from '../../../images/share.svg'; -import Variables from '../../../styles/variables'; -import ActionButtons from '../inputs/ActionButtons'; - +import removeImageExtension from '../../../actions/removeImageExtension'; const styles = theme => ({ root: { textAlign: "center", paddingTop: theme.spacing(20) }, - panelDetail: { + panelDetail :{ display: "initial !important", padding: "0px !important" } @@ -100,7 +100,7 @@ class CustomInfo extends React.Component { this.setState({ anchorEl: null }); }; - downloadAsImage = (id, title) => { + downloadAsImage = (id,title) => { let { strings } = this.props; let div = document.getElementById('card' + id); this.props.APITrans(true) @@ -115,7 +115,7 @@ class CustomInfo extends React.Component { }.bind(this)) } - shareAsImage = (shareType, id) => { + shareAsImage = (shareType,id) => { let { strings, title } = this.props; let div = document.getElementById('card' + id); var ts = Math.round((new Date()).getTime() / 1000); @@ -134,7 +134,7 @@ class CustomInfo extends React.Component { try { let fileUploadAPI = new FileUploadAPI(2000, 'dashboard', constants.FILE_UPLOAD_CARD, new File([blobData], blobData.name, { type: "image/jpeg" })); APITransport(fileUploadAPI) - } catch { } + } catch{ } }.bind(this)) } @@ -160,31 +160,32 @@ class CustomInfo extends React.Component { let file = this.props.s3ImageCard && this.props.s3ImageCard[fileId] if (file) { if ((file.match(new RegExp("https", "g")) || []).length > 1) { - var fileArr = file.split(','); - if (fileArr && fileArr.length > 0) { - image = removeImageExtension(fileArr); - } + var fileArr = file.split(','); + if(fileArr && fileArr.length>0) { + image = removeImageExtension(fileArr); + } } else { image = file } - this.setState({ anchorEl: null }); - var type = this.state.type; - var isMobileOrTablet = this.isMobileOrTablet(); - var fakeLink = document.createElement('a'); - shortenAPI(image, function (err, data) { - if (data) { + this.setState({ anchorEl: null }); + var type = this.state.type; + var isMobileOrTablet = this.isMobileOrTablet(); + var fakeLink = document.createElement('a'); + shortenAPI(image,function(err,data){ + if(data){ image = data.data; - } - if (image && type === 'whatsapp') { + } + if (image && type === 'whatsapp') { fakeLink.setAttribute('href', 'https://' + (isMobileOrTablet ? 'api' : 'web') + '.whatsapp.com/send?text=' + encodeURIComponent(image)); fakeLink.setAttribute('data-action', 'share/whatsapp/share'); fakeLink.setAttribute('target', '_blank'); fakeLink.click(); } - if (image && type === 'email') { - window.open(`mailto:?body=${encodeURIComponent(image)}`, "_blank"); - + if (image && type === 'email') { + fakeLink.setAttribute('href', 'mailto:?body=' + encodeURIComponent(image)); + fakeLink.setAttribute('target', '_top'); + fakeLink.click(); } }) } @@ -225,11 +226,11 @@ class CustomInfo extends React.Component { anchorEl: null }) }; - renderMenues(id, title) { + renderMenues(id,title) { const { classes } = this.props; let { strings } = this.props; return (
- + - this.downloadAsImage(id, title)}> + this.downloadAsImage(id,title)}> @@ -259,17 +260,17 @@ class CustomInfo extends React.Component { - this.shareAsImage('email', id, title)}> + this.shareAsImage('email',id,title)}> - + - this.shareAsImage('whatsapp', id, title)}> + this.shareAsImage('whatsapp',id,title)}> - + @@ -277,11 +278,11 @@ class CustomInfo extends React.Component {
) } - render() { - let { data } = this.props; + render() { + let { data } = this.props; return ( -
- {this.renderMenues(data.id, data.name)} +
+ {this.renderMenues(data.id,data.name)}
); } diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomMenu.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomMenu.js index 465b5fdf8f3..3d5b3ffff62 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomMenu.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/CustomMenu.js @@ -112,6 +112,7 @@ class CustomizedMenus extends Component { downloadAsImage(this.props.strings[this.props.fileName] || this.props.fileName).then(function (success) { this.props.APITrans(false) }.bind(this)).catch(function (err) { + console.log(err); this.setState({ anchorEl: null }) @@ -131,6 +132,7 @@ class CustomizedMenus extends Component { this.props.APITrans(false) } catch{ } }).catch(function (error) { + console.log(error); this.setState({ anchorEl: null }) @@ -149,6 +151,7 @@ class CustomizedMenus extends Component { APITransport(fileUploadAPI) } catch{ } }).catch(function (error) { + console.log(error); this.setState({ anchorEl: null }) @@ -187,6 +190,7 @@ class CustomizedMenus extends Component { APITransport(fileUploadAPI) } catch{ } }).catch(function (error) { + console.log(error); this.setState({ anchorEl: null }) @@ -267,7 +271,10 @@ class CustomizedMenus extends Component { fakeLink.click(); } if (image && type === 'email') { - window.open(`mailto:?body=${encodeURIComponent(image)}`, "_blank"); + fakeLink.setAttribute('href', 'mailto:?body=' + encodeURIComponent(image)); + fakeLink.setAttribute('target', '_top'); + + fakeLink.click(); } }) } @@ -318,13 +325,13 @@ class CustomizedMenus extends Component { - + - + @@ -345,25 +352,25 @@ class CustomizedMenus extends Component { - + - + - + - + diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/DateRange/index.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/DateRange/index.js index d3574961bdb..9480d951561 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/DateRange/index.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/DateRange/index.js @@ -62,6 +62,7 @@ class DateRange extends React.Component { const dateRanges = this.state.dateRanges; let customTitle = false; dateRanges.map(dateRange => { + console.log(dateRange.range().startDate, range[0].startDate); if (title == dateRange.label && this.getDate(dateRange.range().startDate, true) == this.getDate(range[0].startDate, true) && this.getDate(dateRange.range().endDate) == this.getDate(range[0].endDate)) { customTitle = true } @@ -139,7 +140,7 @@ class DateRange extends React.Component { svgWrapper = ({ dangerouslySetInnerHTML, className }) => { return ( ); @@ -180,7 +181,7 @@ class DateRange extends React.Component { label: 'This Week', range: () => ({ startDate: new Date(Number(`${moment().startOf('week').unix()}000`)), - endDate: new Date(Number(`${moment().endOf('day').unix()}000`)), + endDate: new Date(Number(`${moment().endOf('week').unix()}000`)), interval: 'week', label: 'This Week' }) @@ -189,7 +190,7 @@ class DateRange extends React.Component { label: 'This Month', range: () => ({ startDate: new Date(Number(`${moment().startOf('month').unix()}000`)), - endDate: new Date(Number(`${moment().endOf('day').unix()}000`)), + endDate: new Date(Number(`${moment().endOf('month').unix()}000`)), interval: 'week', label: 'This Month' }) @@ -198,7 +199,7 @@ class DateRange extends React.Component { label: 'This Quarter', range: () => ({ startDate: new Date(Number(`${moment().startOf('quarter').unix()}000`)), - endDate: new Date(Number(`${moment().endOf('day').unix()}000`)), + endDate: new Date(Number(`${moment().endOf('quarter').unix()}000`)), interval: 'month', label: 'This Quarter' }) diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/ExportToExel/exportToExcel.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/ExportToExel/exportToExcel.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/ExportToExel/index.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/ExportToExel/index.js index 096e205b38a..3b44c483e65 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/ExportToExel/index.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/ExportToExel/index.js @@ -3,7 +3,7 @@ import { withStyles } from '@material-ui/core/styles'; import styles from './styles'; import ActionButtons from '../inputs/ActionButtons'; import exportTo from './exportToExcel' -import { getLocaleLabels } from '../../../utils/commons'; + class ExportToExel extends React.Component { constructor(props) { super(props); @@ -21,7 +21,7 @@ class ExportToExel extends React.Component { render() { let { data } = this.props; return ( diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/Icon/Icon.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/Icon/Icon.js index 08ffd6c6e4b..7c79955ddec 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/Icon/Icon.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/Icon/Icon.js @@ -1,235 +1,64 @@ import React from "react"; -import PropertyTaxIcon from "../../../images/property-tax.svg"; -import DashBoardIcon from "../../../images/dashboards.svg"; -import ComplaintsIcon from "../../../images/complaints.svg"; -import TradeIcon from "../../../images/trade-license.svg"; -import WaterSewerage from "../../../images/water_sewerage.svg"; -import FSM from "../../../images/fsm.svg"; -import FireNoc from "../../../images/firenocdashboard.svg"; -import Mcollect from "../../../images/mcollect.svg"; -import OBPS from "../../../images/obps.svg"; -import Propertytax from "../../../images/propertytax_nurt.svg"; -import Tradelic from "../../../images/tradeLic_nurt.svg"; -import WandS from "../../../images/w&s_nurt.svg"; -import BuildingPermission from "../../../images/building_permission.svg"; -import BirthDeathIcon from "../../../images/birth_death.svg"; -import Style from "./Styles"; -import { withStyles } from "@material-ui/core/styles"; +import PropertyTaxIcon from '../../../images/property-tax.svg' +import DashBoardIcon from '../../../images/dashboards.svg' +import ComplaintsIcon from '../../../images/complaints.svg' +import TradeIcon from '../../../images/trade-license.svg' +import WaterSewerage from '../../../images/water_sewerage.svg' +import FireNOC from '../../../images/fire-noc.svg' +import MCollect from '../../../images/mcollect.svg' +import Finance from '../../../images/finance.svg' +import Style from './Styles' +import { withStyles } from '@material-ui/core/styles'; -import SVG from "react-inlinesvg"; +import SVG from 'react-inlinesvg'; class Icon extends React.Component { - constructor(props) { - super(props); - } + constructor(props) { + super(props); + + } + + renderIcons(type) { + let { classes } = this.props; + + switch (type.toLowerCase()) { + case 'overview': + case 'dss_overview': + return + case 'property tax': + case 'dss_property_tax': + return + case 'trade license': + case 'dss_trade_licence': + return + case 'complains': + case 'dss_complains': + return + case 'water sewerage': + case 'dss_water_sewerage': + return + case 'mcollect': + case 'dss_mcollect': + return + case 'fire noc': + case 'dss_firenoc_overview': + return + case 'finance': + case 'dss_finance': + return + default: + return
+ + } + - renderIcons(type) { - let { classes } = this.props; - switch (type.toLowerCase()) { - case "overview": - case "dss_overview": - return ( - - ); - case "property tax": - case "dss_property_tax": - return ( - - ); - case "trade license": - case "dss_trade_licence": - return ( - - ); - case "complains": - case "dss_pgr_overview": - case "dss_complains": - return ( - - ); - case "water sewerage": - case "dss_water_sewerage": - return ( - - ); - case "fsm": - case "dss_fsm": - return ( - - ); - case "mCollect": - case "dss_mcollect": - return ( - - ); - case "fire noc dashboard": - case "fire noc dashboard": - case "dss_firenoc_overview": - return ( - - ); - case "obps dashboard": - case "obps dashboard": - case "dss_obps_overview": - return ( - - ); - case "nurt_overview": - return ( - - ); - case "nurt_project_staus": - return ( - - ); - case "nurt_property_tax": - return ( - - ); - case "nurt_trade_licence": - return ( - - ); - case "nurt_complains": - return ( - - ); - case "nurt_water_sewerage": - return ( - - ); - case "dss_building_permission": - return ( - - ); - case "nurt_firenoc": - return ( - - ); - case "nurt_mcollect": - return ( - - ); - case "nurt_live_active_ulbs": - return ( - - ); - case "dss_birth_death": - case "nss_birth_death": - case "nurt_birth": - case "nurt_death": - case "nurt_bnd": - return ( - - ); - default: - return
; } - } - render() { - return
{this.renderIcons(this.props.type)}
; - } + render() { + return ( +
{this.renderIcons(this.props.type)}
+ ) + } } -export default withStyles(Style)(Icon); +export default withStyles(Style)(Icon); \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/TableSearch/Styles.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/TableSearch/Styles.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/TableSearch/TableSearch.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/TableSearch/TableSearch.js old mode 100755 new mode 100644 index 2c29f83f4fb..93a11d6a738 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/TableSearch/TableSearch.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/TableSearch/TableSearch.js @@ -4,7 +4,6 @@ import { withStyles } from '@material-ui/core/styles'; import CustomTextField from '../inputs/TextInput/CustomTextField'; import _ from 'lodash'; import Search from '@material-ui/icons/Search' -import { getLocaleLabels } from '../../../utils/commons'; class TableSearch extends Component { constructor(props) { @@ -144,7 +143,7 @@ class TableSearch extends Component { return (
{this.renderSearchIcon()} { displaySearchBox ? { + /* console.log(n,d,n[d],n[d]&&n[d][1],'table'); */ let value = Math.round(n[d].toString().replace(/[&\/\\#,%]/g, '')); if (value > 100) { value = 100; @@ -313,7 +313,7 @@ class EnhancedTable extends React.Component { component='td' scope='row' data-title={d} > {title === 'CUSTOM' ? d === this.props.column ? - {convertLabelValue(n[d][1])} + {n[d][1]} : (typeof n[d] === 'object') ? this.convertToDateString(n[d][1], d) @@ -330,7 +330,7 @@ class EnhancedTable extends React.Component {
: d === this.props.column ? - {convertLabelValue(n[d][1])} + {n[d][1]} : (typeof n[d] === 'object') ? this.convertToDateString(n[d][1], d) : @@ -410,6 +410,7 @@ class EnhancedTable extends React.Component { if (typeof expData[i][key] === 'object') { expData[i][key] = expData[i][key][1] } + //console.log(expData[i][key]); } } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/UiTable/UiTableHeaderStyle.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/UiTable/UiTableHeaderStyle.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/UiTable/UiTableStyles.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/UiTable/UiTableStyles.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/globalFilter/index.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/globalFilter/index.js index ced76ce12ab..7ba424ce8c0 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/globalFilter/index.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/globalFilter/index.js @@ -1,707 +1,1008 @@ -import React, { Component } from 'react'; -import { withRouter } from 'react-router-dom'; -import { withStyles } from '@material-ui/core/styles'; -import FormControl from '@material-ui/core/FormControl'; -import Input from '@material-ui/core/Input'; -import { updateGlobalFilterData } from '../../../actions/globalFilter/GFilterAction'; -import styles from './Style'; -import Cards from '../Cards/Cards' -import SVG from 'react-inlinesvg'; -import icondepartment from '../../../images/icon-calendar.svg'; -import MultipleSelects from '../inputs/MultipleSelect/MultipleSelect'; -import SwitchButton from '../switchButtons/switchButtons' -import SimpleSelect from '../inputs/DropDown/droapdown'; -import _ from 'lodash'; -import DateRange from '../DateRange/index'; -import ActionButtons from '../inputs/ActionButtons'; -import APITransport from '../../../actions/apitransport/apitransport'; -import { connect } from 'react-redux'; -import DropDownIcon from '@material-ui/icons/ArrowDropDown'; -import { bindActionCreators } from 'redux'; -import moment from 'moment'; -import { Chip } from '@material-ui/core'; -import { isMobile } from 'react-device-detect'; -import AutoComplete from '../inputs/MultipleSelect/AutoComplete' -import getFinancialYearObj from '../../../actions/getFinancialYearObj'; -import TenentAPI from '../../../actions/tenent/tenent' -import Constant from '../../../actions/constants' -import CONFIG from '../../../config/configs' -import { getTenantId, stateTenant } from '../../../utils/commons'; +import React, { Component } from "react"; +import { withRouter } from "react-router-dom"; +import { withStyles } from "@material-ui/core/styles"; +import FormControl from "@material-ui/core/FormControl"; +import Input from "@material-ui/core/Input"; +import { updateGlobalFilterData } from "../../../actions/globalFilter/GFilterAction"; +import styles from "./Style"; +import Cards from "../Cards/Cards"; +import SVG from "react-inlinesvg"; +import icondepartment from "../../../images/icon-calendar.svg"; +import MultipleSelects from "../inputs/MultipleSelect/MultipleSelect"; +import SwitchButton from "../switchButtons/switchButtons"; +import SimpleSelect from "../inputs/DropDown/droapdown"; +import _ from "lodash"; +import DateRange from "../DateRange/index"; +import ActionButtons from "../inputs/ActionButtons"; +import APITransport from "../../../actions/apitransport/apitransport"; +import { connect } from "react-redux"; +import DropDownIcon from "@material-ui/icons/ArrowDropDown"; +import { bindActionCreators } from "redux"; +import moment from "moment"; +import { Chip } from "@material-ui/core"; +import { isMobile } from "react-device-detect"; +import AutoComplete from "../inputs/MultipleSelect/AutoComplete"; +import getFinancialYearObj from "../../../actions/getFinancialYearObj"; +import TenentAPI from "../../../actions/tenent/tenent"; +import Constant from "../../../actions/constants"; +import CONFIG from "../../../config/configs"; class GlobalFilter extends Component { - constructor(props) { - super(props); - - this.state = { - open: false, - value: getFinancialYearObj(true), //fOR date range - filterData: this.props.GFilterData, - title: '', - dept: "All Services", - clear: false, - pageId: _.get(this.props, 'match.params.pageId'), - role: this.props.dashboardConfigData && Array.isArray(this.props.dashboardConfigData) && this.props.dashboardConfigData.length > 0 && this.props.dashboardConfigData[0].roleName && this.props.dashboardConfigData[0].roleName, - tenents: '', - tenentName: '', - wards: '', - wardDefValue: [], - dontShowWard: false, - tenentList: [] - } - this.handleChanges = this.handleChanges.bind(this); + constructor(props) { + super(props); + + this.state = { + open: false, + value: getFinancialYearObj(true), //fOR date range + filterData: this.props.GFilterData, + title: "", + dept: "All Services", + clear: false, + pageId: _.get(this.props, "match.params.pageId"), + role: + this.props.dashboardConfigData && + Array.isArray(this.props.dashboardConfigData) && + this.props.dashboardConfigData.length > 0 && + this.props.dashboardConfigData[0].roleName && + this.props.dashboardConfigData[0].roleName, + tenents: "", + tenentName: "", + wards: "", + wardDefValue: [], + dontShowWard: false, + tenentList: [], + }; + this.handleChanges = this.handleChanges.bind(this); + } + + /**need to be dynamic */ + getdepartFilter(value) { + if (value === "Property Tax") { + return "PT"; + } else if (value === "Trade licence") { + return "TL"; + } else if (value === "PGR") { + return "PGR"; } - - /**need to be dynamic */ - getdepartFilter(value) { - if (value === 'Property Tax') { - return 'PT' - } else if (value === 'Trade licence') { - return 'TL' - } else if (value === 'PGR') { - return 'PGR' - } - return null; - } - - componentDidMount() { - let tenentCode = `${getTenantId()}` ? `${getTenantId()}` : '' - let userInfo = JSON.parse(`${localStorage.getItem('user-info')}` ? `${localStorage.getItem('user-info')}` : ''); - let tenentList = [] - if (userInfo && userInfo['roles'] && Array.isArray(userInfo['roles']) && userInfo['roles'].length > 0) { - userInfo['roles'].map(role => { - if (!tenentList.includes(role.tenantId)) { - tenentList.push(role.tenantId) - } - }) - this.setState({ tenentList: tenentList }) - } else { - tenentList.push(tenentCode) - this.setState({ tenentList: tenentList }) - } - - - let tenent = stateTenant() || ''; - let req = { - "RequestInfo": { - "authToken": "" - }, - "MdmsCriteria": { - "tenantId": tenent && tenent !== 'null' ? tenent : '', - "moduleDetails": [ { - "moduleName": "dss-dashboard", - "masterDetails": [ - { - "name": "MODULE_LEVEL" - }, - { - "name": "SERVICES" - }, { - "name": "CHART_COLOR_CODE" - } - ] - }, - { - "moduleName": "tenant", - "masterDetails": [ - { - "name": "tenants" - }] - } - ] - } + return null; + } + + componentDidMount() { + let tenentCode = localStorage.getItem("tenant-id") + ? `${localStorage.getItem("tenant-id")}`.split(".")[0] + : "pb"; + let userInfo = JSON.parse( + `${localStorage.getItem("user-info")}` + ? `${localStorage.getItem("user-info")}` + : "" + ); + let tenentList = []; + if ( + userInfo && + userInfo["roles"] && + Array.isArray(userInfo["roles"]) && + userInfo["roles"].length > 0 + ) { + userInfo["roles"].map((role) => { + if (!tenentList.includes(role.tenantId)) { + tenentList.push(role.tenantId); } - - const { TenentTransporter } = this.props - let tenentAPI = new TenentAPI(2000, 'dashboard', Constant.TENENTS, req, ''); - TenentTransporter(tenentAPI); + }); + this.setState({ tenentList: tenentList }); + } else { + tenentList.push(tenentCode); + this.setState({ tenentList: tenentList }); } - componentDidUpdate(prevProps) { - if (prevProps.tenents !== this.props.tenents) { - let tenants = _.get(this.props.tenents, 'MdmsRes.tenant.tenants') - let tenentName = [] - let tenentObj = {} - if (this.state.tenentList && Array.isArray(this.state.tenentList) && this.state.tenentList.length > 0) { - this.state.tenentList.map(tenentVal => { - if (tenants && Array.isArray(tenants) && tenants.length > 0) { - tenants.map((t) => { - if (tenentVal === t.code) { - tenentObj[t.name] = t.code - tenentName.push(t.name) - } - }) - this.setState({ tenants: tenentObj, tenentName: tenentName }) - } - }) - } - } - - if (prevProps.wards !== this.props.wards) { - let tenantsBoundry = _.get(this.props.wards, 'MdmsRes.egov-location.TenantBoundary') - - let adminName = [] - let revenueName = [] - let wardObj = {} - let revenueBoundaryObj = {} - if (tenantsBoundry && Array.isArray(tenantsBoundry) && tenantsBoundry.length > 0) { - tenantsBoundry.map((boundaryData) => { - if (boundaryData['hierarchyType'] && boundaryData['hierarchyType'].code && boundaryData['hierarchyType'].code === 'REVENUE') { - let tenantsBoundryObj = boundaryData['boundary'] - - if (tenantsBoundryObj && tenantsBoundryObj.children && Array.isArray(tenantsBoundryObj.children) && tenantsBoundryObj.children.length > 0) { - tenantsBoundryObj.children.map(tenantsBoundryObjChildren => { - if (tenantsBoundryObjChildren && tenantsBoundryObjChildren.children && Array.isArray(tenantsBoundryObjChildren.children) && tenantsBoundryObjChildren.children.length > 0) { - tenantsBoundryObjChildren.children.map((children) => { - revenueBoundaryObj[children.name] = children.name - revenueName.push(children.name) - }) - } - }) - } - } else { - let tenantsBoundryObj = boundaryData['boundary'] - - if (tenantsBoundryObj && tenantsBoundryObj.children && Array.isArray(tenantsBoundryObj.children) && tenantsBoundryObj.children.length > 0) { - tenantsBoundryObj.children.map(tenantsBoundryObjChildren => { - if (tenantsBoundryObjChildren && tenantsBoundryObjChildren.children && Array.isArray(tenantsBoundryObjChildren.children) && tenantsBoundryObjChildren.children.length > 0) { - tenantsBoundryObjChildren.children.map((children) => { - wardObj[children.name] = children.name - adminName.push(children.name) - }) - } - }) - } - } - }) - } - if (this.state.pageId === 'ulb-pgr') { - this.setState({ wards: adminName, wardsArr: wardObj }) - } else { - this.setState({ wards: revenueName, wardsArr: revenueBoundaryObj }) - } - - } + let tenent = localStorage.getItem("tenant-id") + ? `${localStorage.getItem("tenant-id")}`.split(".")[0] + : "pb"; + let req = { + RequestInfo: { + authToken: "", + }, + MdmsCriteria: { + tenantId: tenent && tenent !== "null" ? tenent : "", + moduleDetails: [ + { + moduleName: "dss-dashboard", + masterDetails: [ + { + name: "MODULE_LEVEL", + }, + { + name: "SERVICES", + }, + { + name: "CHART_COLOR_CODE", + }, + ], + }, + { + moduleName: "tenant", + masterDetails: [ + { + name: "tenants", + }, + ], + }, + ], + }, + }; + + const { TenentTransporter } = this.props; + let tenentAPI = new TenentAPI(2000, "dashboard", Constant.TENENTS, req, ""); + TenentTransporter(tenentAPI); + } + + componentDidUpdate(prevProps) { + if (prevProps.tenents !== this.props.tenents) { + let tenants = _.get(this.props.tenents, "MdmsRes.tenant.tenants"); + let tenentName = []; + let tenentObj = {}; + if ( + this.state.tenentList && + Array.isArray(this.state.tenentList) && + this.state.tenentList.length > 0 + ) { + this.state.tenentList.map((tenentVal) => { + if (tenants && Array.isArray(tenants) && tenants.length > 0) { + tenants.map((t) => { + if (tenentVal === t.code) { + tenentObj[t.name] = t.code; + tenentName.push(t.name); + } + }); + this.setState({ tenants: tenentObj, tenentName: tenentName }); + } + }); + } } - handleChanges(open, target, value) { - if (target) { - let newFilterData = this.state.filterData; - if (target === 'Wards') { - let wardsObj = this.state.wardsArr - let wardKeys = [] - if (value) { - value.map((v) => { - wardKeys.push(wardsObj[v]) - }) + if (prevProps.wards !== this.props.wards) { + let tenantsBoundry = _.get( + this.props.wards, + "MdmsRes.egov-location.TenantBoundary" + ); + + let adminName = []; + let revenueName = []; + let wardObj = {}; + let revenueBoundaryObj = {}; + if ( + tenantsBoundry && + Array.isArray(tenantsBoundry) && + tenantsBoundry.length > 0 + ) { + tenantsBoundry.map((boundaryData) => { + if ( + boundaryData["hierarchyType"] && + boundaryData["hierarchyType"].code && + boundaryData["hierarchyType"].code === "REVENUE" + ) { + let tenantsBoundryObj = boundaryData["boundary"]; + + if ( + tenantsBoundryObj && + tenantsBoundryObj.children && + Array.isArray(tenantsBoundryObj.children) && + tenantsBoundryObj.children.length > 0 + ) { + tenantsBoundryObj.children.map((tenantsBoundryObjChildren) => { + if ( + tenantsBoundryObjChildren && + tenantsBoundryObjChildren.children && + Array.isArray(tenantsBoundryObjChildren.children) && + tenantsBoundryObjChildren.children.length > 0 + ) { + tenantsBoundryObjChildren.children.map((children) => { + revenueBoundaryObj[children.name] = children.name; + revenueName.push(children.name); + }); } - this.setState({ wardDefValue: value }) - newFilterData[target] = wardKeys; - } else { - newFilterData[target] = value; + }); } - if (target === 'Services') { - newFilterData[target] = value; - } - if (target !== 'duration') { - this.setState({ [`${target}IsOpen`]: !open, filterData: newFilterData }); - } else { - if (newFilterData.duration.title === 'CUSTOM') { - var formatL = moment.localeData().longDateFormat('ll'); - var formatYearlessL = formatL.replace(/YYYY/g,'YY'); - newFilterData.duration.title = moment.unix(_.get(newFilterData, 'duration.value.startDate')).format(formatYearlessL) - - + ' - ' + moment.unix(_.get(newFilterData, 'duration.value.endDate')).format(formatYearlessL); + } else { + let tenantsBoundryObj = boundaryData["boundary"]; + + if ( + tenantsBoundryObj && + tenantsBoundryObj.children && + Array.isArray(tenantsBoundryObj.children) && + tenantsBoundryObj.children.length > 0 + ) { + tenantsBoundryObj.children.map((tenantsBoundryObjChildren) => { + if ( + tenantsBoundryObjChildren && + tenantsBoundryObjChildren.children && + Array.isArray(tenantsBoundryObjChildren.children) && + tenantsBoundryObjChildren.children.length > 0 + ) { + tenantsBoundryObjChildren.children.map((children) => { + wardObj[children.name] = children.name; + adminName.push(children.name); + }); } - this.setState({ open: open, filterData: newFilterData }); - } - if (typeof this.props.applyFilters === 'function') { - this.props.applyFilters(newFilterData); - + }); } - if (target === 'Services') { - this.setState({ - dept: value - }) - } - - } + } + }); + } + if (this.state.pageId === "ulb-pgr") { + this.setState({ wards: adminName, wardsArr: wardObj }); + } else { + this.setState({ wards: revenueName, wardsArr: revenueBoundaryObj }); + } } - - handleFilterChange(open, target, value) { + } + + handleChanges(open, target, value) { + if (target) { + let newFilterData = this.state.filterData; + if (target === "Wards") { + let wardsObj = this.state.wardsArr; + let wardKeys = []; + if (value) { + value.map((v) => { + wardKeys.push(wardsObj[v]); + }); + } + this.setState({ wardDefValue: value }); + newFilterData[target] = wardKeys; + } else { + newFilterData[target] = value; + } + if (target === "Services") { + newFilterData[target] = value; + } + if (target !== "duration") { this.setState({ - dontShowWard: true - }) - if (target) { - - if (target === 'ULBS') { - if (value && Array.isArray(value) && value.length > 0) { - let ulbs = [] - let tenents = this.state.tenants - if (Array.isArray(value) && value.length > 0) { - value.map((d, i) => { - if (tenents[d]) { - ulbs.push(tenents[d]) - } - }) - } - - let req = { - "RequestInfo": { - "authToken": "" - }, - "MdmsCriteria": { - "tenantId": ulbs[ulbs.length - 1], - - "moduleDetails": [ - { - "moduleName": "egov-location", - "masterDetails": [ - { - "name": "TenantBoundary" - }] - } - ] - } - } - - const { WardTransporter } = this.props - let tenentAPI = new TenentAPI(2000, 'dashboard', Constant.WARD_DATA, req, ''); - WardTransporter(tenentAPI); - } else { - this.setState({ wards: '', wardDefValue: null }) - this.handleChanges(false, 'Wards', null) - } - - } - - let newFilterData = this.state.filterData; - newFilterData[target] = value; - - if (target !== 'duration') { - this.setState({ [`${target}IsOpen`]: !open, filterData: newFilterData }); - } else { - if (newFilterData.duration.title === 'CUSTOM') { - var formatL = moment.localeData().longDateFormat('ll'); - var formatYearlessL = formatL.replace(/YYYY/g,'YY'); - newFilterData.duration.title = moment.unix(_.get(newFilterData, 'duration.value.startDate')).format(formatYearlessL) - - + '-' + moment.unix(_.get(newFilterData, 'duration.value.endDate')).format(formatYearlessL); - } - this.setState({ open: open, filterData: newFilterData }); - } - - if (typeof this.props.applyFilters === 'function') { - this.props.applyFilters(newFilterData); - - } + [`${target}IsOpen`]: !open, + filterData: newFilterData, + }); + } else { + if (newFilterData.duration.title === "CUSTOM") { + var formatL = moment.localeData().longDateFormat("ll"); + var formatYearlessL = formatL.replace(/YYYY/g, "YY"); + newFilterData.duration.title = + moment + .unix(_.get(newFilterData, "duration.value.startDate")) + .format(formatYearlessL) + + " - " + + moment + .unix(_.get(newFilterData, "duration.value.endDate")) + .format(formatYearlessL); } + this.setState({ open: open, filterData: newFilterData }); + } + if (typeof this.props.applyFilters === "function") { + this.props.applyFilters(newFilterData); + } + if (target === "Services") { this.setState({ - dontShowWard: false - }) + dept: value, + }); + } } + } + + handleFilterChange(open, target, value) { + this.setState({ + dontShowWard: true, + }); + if (target) { + if (target === "ULBS") { + if (value && Array.isArray(value) && value.length > 0) { + let ulbs = []; + let tenents = this.state.tenants; + if (Array.isArray(value) && value.length > 0) { + value.map((d, i) => { + if (tenents[d]) { + ulbs.push(tenents[d]); + } + }); + } - clearFilter(value, target) { - /** - * this is for quick fix as we reloded - * - */ - let viewAll = _.get(this.props, 'match.params.viewAll'); - if (viewAll) { - let pageId = _.get(this.props, 'match.params.pageId'); - this.props.history.push(`/${pageId}`); - window.location.reload(); + let req = { + RequestInfo: { + authToken: "", + }, + MdmsCriteria: { + tenantId: ulbs[ulbs.length - 1], + + moduleDetails: [ + { + moduleName: "egov-location", + masterDetails: [ + { + name: "TenantBoundary", + }, + ], + }, + ], + }, + }; + + const { WardTransporter } = this.props; + let tenentAPI = new TenentAPI( + 2000, + "dashboard", + Constant.WARD_DATA, + req, + "" + ); + WardTransporter(tenentAPI); } else { - window.location.reload(); + this.setState({ wards: "", wardDefValue: null }); + this.handleChanges(false, "Wards", null); } + } - } + let newFilterData = this.state.filterData; + newFilterData[target] = value; - openPicker() { - this.setState({ open: true }) + if (target !== "duration") { + this.setState({ + [`${target}IsOpen`]: !open, + filterData: newFilterData, + }); + } else { + if (newFilterData.duration.title === "CUSTOM") { + var formatL = moment.localeData().longDateFormat("ll"); + var formatYearlessL = formatL.replace(/YYYY/g, "YY"); + newFilterData.duration.title = + moment + .unix(_.get(newFilterData, "duration.value.startDate")) + .format(formatYearlessL) + + "-" + + moment + .unix(_.get(newFilterData, "duration.value.endDate")) + .format(formatYearlessL); + } + this.setState({ open: open, filterData: newFilterData }); + } + if (typeof this.props.applyFilters === "function") { + this.props.applyFilters(newFilterData); + } } + this.setState({ + dontShowWard: false, + }); + } + + clearFilter(value, target) { + /** + * this is for quick fix as we reloded + * + */ + let viewAll = _.get(this.props, "match.params.viewAll"); + if (viewAll) { + let pageId = _.get(this.props, "match.params.pageId"); + this.props.history.push(`/${pageId}`); + window.location.reload(); + } else { + window.location.reload(); + } + } - handleClose(newValue) { - this.setState({ open: false }) + openPicker() { + this.setState({ open: true }); + } - if (newValue) { - this.setState({ - value: newValue - }); - } - } + handleClose(newValue) { + this.setState({ open: false }); - renderDateRange(label, data) { - let { classes } = this.props; - let { strings } = this.props; + if (newValue) { + this.setState({ + value: newValue, + }); + } + } - return ( + renderDateRange(label, data) { + let { classes } = this.props; + let { strings } = this.props; - -
- {/* + return ( + +
+ {/* */} - } - onClick={this.openPicker.bind(this)} - /> - -
- - ); - } - - renderSimpleSelect(label, data) { - let newData = _.map(data, (d, i) => { - return { - key: i + 1, - value: d + - ) - } - - renderSwitch(label, data) { - let newData = _.map(data, (d) => { - return { - key: d, - value: d + className={classes.dateFilter} + endAdornment={ + } - }) - return ( - - ) - } - - renderMultiselect(target, hndlslected, defaultV, data) { - return (); - } - - renderAutoComplete(target, hndlslected, defaultV, data, type) { - return (); - } - - handleClear() { - this.setState({ - clear: false - }) - } - applyFilter() { - this.props.applyFiltersLive(this.state.filterData); - } - renderComponents(object) { - let type = object.type; - let label = object.label; - switch (type) { - case "dropdown": - switch (label) { - case "ULBS": - return this.renderAutoComplete(object.label, this.handleChanges, this.state.ulbs, object.values, '') - case "DDRs": - return this.renderAutoComplete(object.label, this.handleChanges, this.state.ddrs, object.values, '') - case "Services": - return this.renderSimpleSelect(object.label,JSON.parse(sessionStorage.getItem('SERVICES')) , this.handleChanges) - case "Date Range": - return this.renderDateRange(object.label, object.values); - } - break; - case "switch": - return this.renderSwitch(object.label, object.values) - break; + onClick={this.openPicker.bind(this)} + /> + +
+
+ ); + } + + renderSimpleSelect(label, data) { + let newData = _.map(data, (d, i) => { + return { + key: i + 1, + value: d, + }; + }); + newData = [{ key: 0, value: `All ${label}` }, ...newData]; + return ( + + ); + } + + renderSwitch(label, data) { + let newData = _.map(data, (d) => { + return { + key: d, + value: d, + }; + }); + return ( + + ); + } + + renderMultiselect(target, hndlslected, defaultV, data) { + return ( + + ); + } + + renderAutoComplete(target, hndlslected, defaultV, data, type) { + return ( + + ); + } + + handleClear() { + this.setState({ + clear: false, + }); + } + applyFilter() { + this.props.applyFiltersLive(this.state.filterData); + } + renderComponents(object) { + let type = object.type; + let label = object.label; + switch (type) { + case "dropdown": + switch (label) { + case "ULBS": + return this.renderAutoComplete( + object.label, + this.handleChanges, + this.state.ulbs, + object.values, + "" + ); + case "DDRs": + return this.renderAutoComplete( + object.label, + this.handleChanges, + this.state.ddrs, + object.values, + "" + ); + case "Services": + return this.renderSimpleSelect( + object.label, + JSON.parse(sessionStorage.getItem("SERVICES")), + this.handleChanges + ); + case "Date Range": + return this.renderDateRange(object.label, object.values); } + break; + case "switch": + return this.renderSwitch(object.label, object.values); + break; } - - renderUlbFilters(object) { - let type = object.type; - let label = object.label; - - switch (type) { - case "dropdown": - switch (label) { - case "Date Range": - return this.renderDateRange(object.label, object.values); - case "ULBS": - return this.renderAutoComplete(object.label, this.handleFilterChange.bind(this), this.state.ulbs, this.state.tenentName, '') - case "Wards": - if (this.state.pageId === 'ulb-overview') { - return (
) - } else { - return this.renderAutoComplete(object.label, this.handleChanges, this.state.wardDefValue, this.state.wards, 'Wards') - } - case "Services": - if (this.state.pageId === 'ulb-overview') { - return this.renderSimpleSelect(object.label, object.values, this.handleChanges) - } else { - return
- } - } - break; - case "switch": - return this.renderSwitch(object.label, object.values) - break; + } + + renderUlbFilters(object) { + let type = object.type; + let label = object.label; + + switch (type) { + case "dropdown": + switch (label) { + case "Date Range": + return this.renderDateRange(object.label, object.values); + case "ULBS": + return this.renderAutoComplete( + object.label, + this.handleFilterChange.bind(this), + this.state.ulbs, + this.state.tenentName, + "" + ); + case "Wards": + if (this.state.pageId === "ulb-overview") { + return
; + } else { + return this.renderAutoComplete( + object.label, + this.handleChanges, + this.state.wardDefValue, + this.state.wards, + "Wards" + ); + } + case "Services": + if (this.state.pageId === "ulb-overview") { + return this.renderSimpleSelect( + object.label, + object.values, + this.handleChanges + ); + } else { + return
; + } } + break; + case "switch": + return this.renderSwitch(object.label, object.values); + break; } + } - handleOnDelete(target, value) { - let filterData = this.state.filterData; + handleOnDelete(target, value) { + let filterData = this.state.filterData; - let newFilterData = [] - if (filterData[target] && Array.isArray(filterData[target])) { - filterData[target].map((data) => { - if (data !== value) { - newFilterData.push(data) - } - }) - } - filterData[target] = newFilterData - this.setState({ filterData: filterData, DDRs: newFilterData }); - if (typeof this.props.applyFilters === 'function') { - this.setState({ - DDRs: newFilterData, - }) - } - if (target === 'ULBS') { - this.setState({ - ulbs: newFilterData - }) - } - if (target === 'DDRs') { - this.setState({ - ddrs: newFilterData - }) + let newFilterData = []; + if (filterData[target] && Array.isArray(filterData[target])) { + filterData[target].map((data) => { + if (data !== value) { + newFilterData.push(data); } + }); } - - renderFilters() { - let { classes, GFilterData } = this.props; - return
- {GFilterData && GFilterData.DDRs && GFilterData.DDRs.length > 0 &&
-
Selected DDRs:
-
- {GFilterData.DDRs.map(item => { - let handleOnDelete = this.handleOnDelete.bind(this) - return
- -
- }) - - } -
-
} - {GFilterData && GFilterData.ULBS && GFilterData.ULBS.length > 0 &&
-
Selected ULBs:
-
- {GFilterData.ULBS.map(item => { - let handleOnDelete = this.handleOnDelete.bind(this) - return
-
- }) - - }
-
- } -
+ filterData[target] = newFilterData; + this.setState({ filterData: filterData, DDRs: newFilterData }); + if (typeof this.props.applyFilters === "function") { + this.setState({ + DDRs: newFilterData, + }); } - - render() { - let { classes, globalFilterData, ulbFilter, mdmsData, GFilterData, ulbFilters, ulbOverViewFilters } = this.props; - let { strings } = this.props; - let role = this.props.dashboardConfigData && Array.isArray(this.props.dashboardConfigData) && this.props.dashboardConfigData.length > 0 && this.props.dashboardConfigData[0].roleName && this.props.dashboardConfigData[0].roleName - - if (role) { - if (role === 'Admin') { + if (target === "ULBS") { + this.setState({ + ulbs: newFilterData, + }); + } + if (target === "DDRs") { + this.setState({ + ddrs: newFilterData, + }); + } + } + + renderFilters() { + let { classes, GFilterData } = this.props; + return ( +
+ {GFilterData && GFilterData.DDRs && GFilterData.DDRs.length > 0 && ( +
+
+ + Selected DDRs: + +
+
+ {GFilterData.DDRs.map((item) => { + let handleOnDelete = this.handleOnDelete.bind(this); return ( - -
- - {globalFilterData.map(ro => { - if (this.props.hideDepart && ro.label == "Services") { - return (
); - - } else if (ro.label == "DDRs" && !_.isEmpty(mdmsData, true)) { - return ( -
-
{strings[ro.label_locale] || ro.label_locale}
- {this.renderComponents(mdmsData)} -
- ); - } else if (ro.label == "ULBS" && !_.isEmpty(mdmsData, true) && mdmsData.ULBS) { - return ( -
-
{strings[ro.label_locale] || ro.label_locale}
- {this.renderComponents(mdmsData.ULBS)} -
- ); - } else { - return ( -
-
{strings[ro.label_locale] || ro.label_locale}
- {this.renderComponents(ro)} -
- ); - } - }) - } - {/*
- -
*/} - - {/* {isMobile && this.renderFilters()}s */} - - {isMobile ?
- - -
- : -
- - -
- } -
-
+
+ +
); - } else { - if (this.state.pageId === 'ulb-overview') { - return ( - -
- - - {ulbOverViewFilters.map(ro => { - - return ( -
- {(this.state.pageId === 'ulb-overview' && ro.label === 'Wards') ?
:
{strings[ro.label_locale] || ro.label_locale}
} - -
- {this.renderUlbFilters(ro)} -
-
- ); - }) - } - - {isMobile ?
- - -
- : -
- - -
- } -
- -
- ); + })} +
+
+ )} + {GFilterData && GFilterData.ULBS && GFilterData.ULBS.length > 0 && ( +
+
+ + Selected ULBs: + +
+
+ {GFilterData.ULBS.map((item) => { + let handleOnDelete = this.handleOnDelete.bind(this); + return ( +
+ +
+ ); + })} +
+
+ )} +
+ ); + } + + render() { + let { + classes, + globalFilterData, + ulbFilter, + mdmsData, + GFilterData, + ulbFilters, + ulbOverViewFilters, + } = this.props; + let { strings } = this.props; + let role = + this.props.dashboardConfigData && + Array.isArray(this.props.dashboardConfigData) && + this.props.dashboardConfigData.length > 0 && + this.props.dashboardConfigData[0].roleName && + this.props.dashboardConfigData[0].roleName; + + if (role) { + if (role === "Admin") { + return ( + +
+ {globalFilterData.map((ro) => { + if (this.props.hideDepart && ro.label == "Services") { + return
; + } else if (ro.label == "DDRs" && !_.isEmpty(mdmsData, true)) { + return ( +
+
+ {strings[ro.label_locale] || ro.label_locale} +
+ {this.renderComponents(mdmsData)} +
+ ); + } else if ( + ro.label == "ULBS" && + !_.isEmpty(mdmsData, true) && + mdmsData.ULBS + ) { + return ( +
+
+ {strings[ro.label_locale] || ro.label_locale} +
+ {this.renderComponents(mdmsData.ULBS)} +
+ ); } else { - return ( - -
- - - {ulbFilters.map(ro => { - - return ( -
- {(this.state.pageId === 'ulb-overview' && ro.label === 'Wards') ?
:
{strings[ro.label_locale] || ro.label_locale}
} - -
- {this.renderUlbFilters(ro)} -
-
- ); - }) - } - - {isMobile ?
- - -
- : -
- - -
- } -
- -
- ); + return ( +
+
+ {strings[ro.label_locale] || ro.label_locale} +
+ {this.renderComponents(ro)} +
+ ); } + })} + {/*
+ +
*/} - - } - } - else { - return (
) + {/* {isMobile && this.renderFilters()}s */} + + {isMobile ? ( +
+ + +
+ ) : ( +
+ + +
+ )} +
+
+ ); + } else { + if (this.state.pageId === "ulb-overview") { + return ( + +
+ {ulbOverViewFilters.map((ro) => { + return ( +
+ {this.state.pageId === "ulb-overview" && + ro.label === "Wards" ? ( +
+ ) : ( +
+ {strings[ro.label_locale] || ro.label_locale} +
+ )} + +
{this.renderUlbFilters(ro)}
+
+ ); + })} + + {isMobile ? ( +
+ + +
+ ) : ( +
+ + +
+ )} +
+
+ ); + } else { + return ( + +
+ {ulbFilters.map((ro) => { + return ( +
+ {this.state.pageId === "ulb-overview" && + ro.label === "Wards" ? ( +
+ ) : ( +
+ {strings[ro.label_locale] || ro.label_locale} +
+ )} + +
{this.renderUlbFilters(ro)}
+
+ ); + })} + + {isMobile ? ( +
+ + +
+ ) : ( +
+ + +
+ )} +
+
+ ); } - + } + } else { + return
; } - + } } const mapStateToProps = (state) => { - return { - mdmsData: state.mdmsData, - globalFilterData: state.globalFilter, - GFilterData: state.GFilterData, - strings: state.lang, - tenents: state.tenents, - wards: state.wards, - dashboardConfigData: state.firstReducer.dashboardConfigData, - ulbFilters: state.ulbFilters, - ulbOverViewFilters: state.ulbOverViewFilters, - } -} - -const mapDispatchToProps = dispatch => { - return bindActionCreators({ - APITransport: APITransport, - updateFilterData: updateGlobalFilterData, - TenentTransporter: APITransport, - WardTransporter: APITransport, - - }, dispatch) -} - -export default withRouter(withStyles(styles)(connect(mapStateToProps, mapDispatchToProps)(GlobalFilter))); + return { + mdmsData: state.mdmsData, + globalFilterData: state.globalFilter, + GFilterData: state.GFilterData, + strings: state.lang, + tenents: state.tenents, + wards: state.wards, + dashboardConfigData: state.firstReducer.dashboardConfigData, + ulbFilters: state.ulbFilters, + ulbOverViewFilters: state.ulbOverViewFilters, + }; +}; + +const mapDispatchToProps = (dispatch) => { + return bindActionCreators( + { + APITransport: APITransport, + updateFilterData: updateGlobalFilterData, + TenentTransporter: APITransport, + WardTransporter: APITransport, + }, + dispatch + ); +}; + +export default withRouter( + withStyles(styles)(connect(mapStateToProps, mapDispatchToProps)(GlobalFilter)) +); diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/inputs/MultipleSelect/AutoComplete.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/inputs/MultipleSelect/AutoComplete.js index 3f9f644eee2..66e1e7c7df3 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/inputs/MultipleSelect/AutoComplete.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/inputs/MultipleSelect/AutoComplete.js @@ -16,7 +16,6 @@ import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'; import variables from '../../../../styles/variables'; import { isMobile } from 'react-device-detect'; import Chip from '@material-ui/core/Chip'; -import { getLocaleLabels } from '../../../../utils/commons'; const icon = ; const checkedIcon = ; @@ -28,53 +27,37 @@ const theme = createMuiTheme({ useNextVariants: true, fontFamily: variables.primaryFont }, - MuiAutocomplete: { - option: { - fontSize: '0.8rem' + MuiAutocomplete:{ + option:{ + fontSize:'0.8rem' }, popupIndicator: { - float: 'right' + float:'right' }, - inputRoot: { - paddingRight: '0px !important', - minWidth: '180px', - '@media (min-width: 1367px)': { - minWidth: '180px !important', - maxWidth: '180px !important' + inputRoot:{ + paddingRight:'0px !important', + minWidth:'180px', + '@media (min-width: 1367px)':{ + minWidth:'180px !important', + maxWidth:'180px !important' }, - '@media (min-width: 1026px) and (max-width:1300px)': { - minWidth: '150px !important', - maxWidth: '150px !important' + '@media (min-width: 1026px) and (max-width:1300px)':{ + minWidth:'150px !important', + maxWidth:'150px !important' } }, - endAdornment: { - bottom: '0px !important', + endAdornment:{ + bottom:'0px !important', top: 'initial !important' }, - clearIndicator: { - display: 'none !important' + clearIndicator:{ + display:'none !important' } } } }); -const localaliseTenant = ((tenant, type) => { - let prefix = 'DDR_' - if (type == "DDRS") { - prefix = `DDR_` ; - } else if (type == "ULBS") { - prefix = `TENANT_TENANTS_` ; - } - return getLocaleLabels(`${prefix}${getTransformedLocale(tenant)}`); -}) - - -const getTransformedLocale = label => { - if (typeof label === "number") return label; - label=label?.trim(); - return label && label.toUpperCase().replace(/[.:-\s\/]/g, "_"); -}; class CheckboxesTags extends React.Component { constructor(props) { super(props) @@ -87,14 +70,14 @@ class CheckboxesTags extends React.Component { }; } - componentDidUpdate(prevProps) { - if (prevProps.item !== this.props.item && this.props.item) { + componentDidUpdate(prevProps){ + if(prevProps.item !== this.props.item && this.props.item){ this.setState({ localItems: this.props.item }) } - if ((prevProps.item !== this.props.item) && Array.isArray(this.props.item) && this.props.item.length <= 0) { + if((prevProps.item !== this.props.item) && Array.isArray(this.props.item) && this.props.item.length <= 0) { this.setState({ label: "All " + this.props.target, }) @@ -147,7 +130,7 @@ class CheckboxesTags extends React.Component {
- + {/* {label || 'Select'} */}
{/*
@@ -156,98 +139,97 @@ class CheckboxesTags extends React.Component {
*/} - { this.props.type === 'Wards' ? value)} - disableCloseOnSelect - getOptionLabel={value => localaliseTenant(value)} - defaultValue={this.props.defaultValue ? this.props.defaultValue : []} - value={this.props.defaultValue ? this.props.defaultValue : []} - - renderOption={(option, { selected }) => ( - - - {localaliseTenant(option, this.props.logo)} - - )} - - renderTags={(value, getTagProps) => { - return this.state.localItems && this.state.localItems.length > 0 ? value.map((option, index) => ( - (this.props.defaultValue && this.props.defaultValue.includes(option)) || this.props.type !== 'Wards' ? :
- )) : '' - } - } - - style={(isMobile) ? { width: "100%", margin: "-6" } : {}} - renderInput={params => ( -
- -
- )} - /> : option)} - disableCloseOnSelect - getOptionLabel={value => value} - - renderOption={(option, { selected }) => ( - - - {localaliseTenant(option, this.props.logo)} - - )} - - renderTags={(value, getTagProps) => { - return this.state.localItems && this.state.localItems.length > 0 ? value.map((option, index) => ( - (this.props.defaultValue && this.props.defaultValue.includes(option)) || this.props.type !== 'Wards' ? :
- )) : '' - } - } - - style={(isMobile) ? { width: "100%", margin: "-6" } : {}} - renderInput={params => ( -
- -
- )} - />} + onChange={this.handleChange.bind(this)} + style={isMobile?{width:"100%",margin:"-6"}:''} + multiple + id="checkboxes-tags-demo" + options={this.state.localItems.sort()} + disableCloseOnSelect + getOptionLabel={option => option} + defaultValue = {this.props.defaultValue ? this.props.defaultValue : []} + value = {this.props.defaultValue ? this.props.defaultValue : []} + + renderOption={(option, { selected }) => ( + + + {option} + + )} + + renderTags={(value, getTagProps) =>{ + return this.state.localItems && this.state.localItems.length > 0 ? value.map((option, index) => ( + (this.props.defaultValue && this.props.defaultValue.includes(option)) || this.props.type !=='Wards' ? :
+ )) : '' + } + } + + style={(isMobile) ? { width: "100%", margin:"-6"} : {}} + renderInput={params => ( +
+ +
+ )} + /> : option} + + renderOption={(option, { selected }) => ( + + + {option} + + )} + + renderTags={(value, getTagProps) =>{ + return this.state.localItems && this.state.localItems.length > 0 ? value.map((option, index) => ( + (this.props.defaultValue && this.props.defaultValue.includes(option)) || this.props.type !=='Wards' ? :
+ )) : '' + } + } + + style={(isMobile) ? { width: "100%", margin:"-6"} : {}} + renderInput={params => ( +
+ +
+ )} + /> }
diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/numberFormater/index.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/numberFormater/index.js index df9fd279d01..c88580b1bd6 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/numberFormater/index.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/numberFormater/index.js @@ -1,71 +1,59 @@ -import _ from "lodash"; +import _ from 'lodash'; import { useSelector } from "react-redux"; -import { getLocaleLabels } from "../../../utils/commons"; export function convertJs(type, value) { - return value; + return value; } export default function NFormatter(props) { - var SI_SYMBOL = ["Unit", "Lac", "Cr"]; - var GFilterData = useSelector((state) => state.GFilterData); - // const dispatch = useDispatch(); - if (props && Object.keys(props).length > 0) { - const Rformatter = new Intl.NumberFormat("en-IN", { - maximumFractionDigits: 0, - useGrouping: true, - // currencyDisplay : Intl.NumberFormatOptions - style: "currency", - currency: "INR", - }); - switch (props.nType) { - case "amount": - case "Amount": - switch (_.get(GFilterData, "Denomination")) { - case SI_SYMBOL[1]: - if (!props.isHome || (props.value / 100000).toFixed() > 0) - return `${Rformatter.format( - (props.value / 100000).toFixed() || 0 - )} ${getLocaleLabels( - `ES_DSS_${_.get(GFilterData, "Denomination")}` - )}`; - else return `${Rformatter.format(props.value.toFixed() || 0)}`; - case SI_SYMBOL[2]: - return `${Rformatter.format( - (props.value / 10000000).toFixed() || 0 - )} ${getLocaleLabels( - `ES_DSS_${_.get(GFilterData, "Denomination")}` - )}`; - case SI_SYMBOL[0]: - if (props.value <= 9999999) { - return `${Rformatter.format(props.value || 0)}`; - } else { - let value = Rformatter.format(props.value.toFixed() || 0) - .replace("₹ ", "") - .replace("₹", ""); - var right = value.substring(value.length - 12, value.length); - var left = value.substring(0, value.length - 12).replace(",", ""); - let newVal = "₹ " + (left ? left + "," : "") + right; - return newVal.replace(",,", ","); - } - default: - return parseFloat(`${Rformatter.format(props.value || 0)}`); + var SI_SYMBOL = ["Unit", "Lac", "Cr"]; + var GFilterData = useSelector(state => state.GFilterData); + // const dispatch = useDispatch(); + if (props && Object.keys(props).length > 0) { + const Rformatter = new Intl.NumberFormat('en-IN', { + // maximumFractionDigits:0, + useGrouping: true, + // currencyDisplay : Intl.NumberFormatOptions + style: 'currency', + currency: 'INR' + }) + switch (props.nType) { + case "amount": + case "Amount": + + switch (_.get(GFilterData, 'Denomination')) { + case SI_SYMBOL[1]: + return `${Rformatter.format((props.value / 100000).toFixed(2) || 0)} ${_.get(GFilterData, 'Denomination')}` + + case SI_SYMBOL[2]: + return `${Rformatter.format((props.value / 10000000).toFixed(2) || 0)} ${_.get(GFilterData, 'Denomination')}` + case SI_SYMBOL[0]: + if (props.value <= 9999999) { + return `${Rformatter.format(props.value || 0)}` + } else { + let value = Rformatter.format((props.value).toFixed(2) || 0).replace('₹ ', '').replace('₹',''); + var right = value.substring(value.length - 12, value.length); + var left = value.substring(0, value.length - 12).replace(',', ''); + let newVal = '₹ ' + (left ? (left + ',') : '') + right; + return newVal.replace(",,", ','); + } + default: + return parseFloat(`${Rformatter.format(props.value || 0)}`); + } + case "number": + case "Number": + const Nformatter = new Intl.NumberFormat('en-IN'); + return Nformatter.format(Math.round(props.value)); + case "percentage": + case "Percentage": + const Pformatter = new Intl.NumberFormat('en-IN', { maximumSignificantDigits: 3 }); + return `${parseFloat(Pformatter.format(props.value) || '0').toFixed(2)} %`; + case "text": + case "Text": + return props.value; + default: + return props.value; + } - case "number": - case "Number": - const Nformatter = new Intl.NumberFormat("en-IN"); - return Nformatter.format(Math.round(props.value)); - case "percentage": - case "Percentage": - const Pformatter = new Intl.NumberFormat("en-IN", { - maximumSignificantDigits: 3, - }); - return `${parseFloat(props.value || "0").toFixed()} %`; - case "text": - case "Text": - return props.value; - default: - return props.value; - } - } else return 0; -} + } else return 0; +} \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/numberFormaterFun/index.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/numberFormaterFun/index.js index 5e03f93447a..74e113c492a 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/numberFormaterFun/index.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/numberFormaterFun/index.js @@ -15,10 +15,10 @@ export default function NFormatterTest(value, type, symbol, commaSeparated = fal switch (symbol) { case SI_SYMBOL[1]: - return `${Rformatter.format((value / 100000).toFixed() || 0)}` + return `${Rformatter.format((value / 100000).toFixed(2) || 0)}` case SI_SYMBOL[2]: - return `${Rformatter.format((value / 10000000).toFixed() || 0)}` + return `${Rformatter.format((value / 10000000).toFixed(2) || 0)}` case SI_SYMBOL[0]: if (value <= 9999999) { diff --git a/frontend/mono-ui/web/dss-dashboard/src/components/common/switchButtons/switchButtons.js b/frontend/mono-ui/web/dss-dashboard/src/components/common/switchButtons/switchButtons.js index 0a6ce821936..abe4646aa3e 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/components/common/switchButtons/switchButtons.js +++ b/frontend/mono-ui/web/dss-dashboard/src/components/common/switchButtons/switchButtons.js @@ -15,6 +15,7 @@ class SwitchButton extends Component { } handleAlignment = (event, newAlignment) => { + // console.log(this.state); }; handleClick(value) { diff --git a/frontend/mono-ui/web/dss-dashboard/src/config/common.js b/frontend/mono-ui/web/dss-dashboard/src/config/common.js index 1b03c5b082e..6217784f6c3 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/config/common.js +++ b/frontend/mono-ui/web/dss-dashboard/src/config/common.js @@ -1,11 +1,9 @@ -import { getTenantId, stateTenant } from "../utils/commons"; - -let tenent = stateTenant()||""; +let tenent = `${localStorage.getItem('tenant-id')}` ? (`${localStorage.getItem('tenant-id')}`).split('.')[0] : '' const commonConfig = { - MAP_API_KEY: window.globalConfigs.getConfig("GMAPS_API_KEY"), + MAP_API_KEY: "AIzaSyBN01pR2wGavj2_q3v4-vFgQzmcx-gllk0", tenantId: tenent, - forgotPasswordTenant: `${getTenantId()}` + forgotPasswordTenant: `${localStorage.getItem('tenant-id')}` }; export default commonConfig; diff --git a/frontend/mono-ui/web/dss-dashboard/src/images/complaints.svg b/frontend/mono-ui/web/dss-dashboard/src/images/complaints.svg index ae602d54572..f4392fdc3b6 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/images/complaints.svg +++ b/frontend/mono-ui/web/dss-dashboard/src/images/complaints.svg @@ -1,4 +1 @@ - - - - + diff --git a/frontend/mono-ui/web/dss-dashboard/src/images/dashboards.svg b/frontend/mono-ui/web/dss-dashboard/src/images/dashboards.svg index cad3fe02ce1..39c0f0b99ce 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/images/dashboards.svg +++ b/frontend/mono-ui/web/dss-dashboard/src/images/dashboards.svg @@ -1,3 +1 @@ - - - + \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/images/finance.svg b/frontend/mono-ui/web/dss-dashboard/src/images/finance.svg new file mode 100644 index 00000000000..d25ce7ee147 --- /dev/null +++ b/frontend/mono-ui/web/dss-dashboard/src/images/finance.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/images/property-tax.svg b/frontend/mono-ui/web/dss-dashboard/src/images/property-tax.svg index 8c194e6e58c..4451e771aa8 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/images/property-tax.svg +++ b/frontend/mono-ui/web/dss-dashboard/src/images/property-tax.svg @@ -1,3 +1 @@ - - - + \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/images/trade-license.svg b/frontend/mono-ui/web/dss-dashboard/src/images/trade-license.svg index fbff29d08a9..94d26cc0123 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/images/trade-license.svg +++ b/frontend/mono-ui/web/dss-dashboard/src/images/trade-license.svg @@ -1,3 +1 @@ - - - + \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/images/water_sewerage.svg b/frontend/mono-ui/web/dss-dashboard/src/images/water_sewerage.svg index 953889e1d16..81445e2931b 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/images/water_sewerage.svg +++ b/frontend/mono-ui/web/dss-dashboard/src/images/water_sewerage.svg @@ -1,3 +1 @@ - - - + \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/reducers/apistatus/apistatus.js b/frontend/mono-ui/web/dss-dashboard/src/reducers/apistatus/apistatus.js old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/apitransport/apitransport.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/apitransport/apitransport.js index 89446051057..855e8a91641 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/apitransport/apitransport.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/apitransport/apitransport.js @@ -16,6 +16,7 @@ export default function dispatchAPI(api, page) { } }) .catch(function(err) { + // console.log(err) dispatch(apiStatusAsync(false, true, 'api failed')) }) } @@ -33,10 +34,13 @@ export default function dispatchAPI(api, page) { } }) .catch(function(err) { + // console.log(err) dispatch(apiStatusAsync(false, true, 'api failed')) }) } } else if (api.status === 401) { + console.log('====================== logout ==========================') + // dispatch(logout('')) } else { return dispatch => { dispatch(apiStatusAsync(true, false, '')) @@ -49,6 +53,7 @@ export default function dispatchAPI(api, page) { } }) .catch(function(err) { + // console.log(err) dispatch(apiStatusAsync(false, true, 'api failed')) }) } diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/charts/allChartsAPI.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/charts/allChartsAPI.js index 39c8df40f9d..5419919f70b 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/charts/allChartsAPI.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/charts/allChartsAPI.js @@ -1,7 +1,6 @@ /** * Dashboard API */ -import { getToken } from '../../../utils/commons'; import API from '../apis/api'; import C from '../constants'; @@ -52,7 +51,7 @@ export default class AllChartsAPI extends API { headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', - 'auth-token': `${getToken()}` + 'auth-token': `${localStorage.getItem('Employee.token')}` } } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/charts/chartsAPI.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/charts/chartsAPI.js index 77a93337ea2..9221e8c9097 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/charts/chartsAPI.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/charts/chartsAPI.js @@ -1,7 +1,6 @@ /** * Dashboard API */ -import { getToken } from '../../../utils/commons'; import API from '../apis/api'; import C from '../constants'; @@ -52,7 +51,7 @@ export default class ChartsAPI extends API { headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', - 'auth-token': `${getToken()}` + 'auth-token': `${localStorage.getItem('Employee.token')}` } } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/dashboardAPI.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/dashboardAPI.js index 4fd865f42bc..62ce5f9cec4 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/dashboardAPI.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/dashboardAPI.js @@ -1,7 +1,6 @@ /** * Dashboard API */ -import { getToken } from '../../utils/commons'; import API from './apis/api'; import C from './constants'; @@ -43,7 +42,7 @@ export default class DashboardAPI extends API { return { headers: { 'Content-Type': 'application/json', - 'auth-token': `${getToken()}` + 'auth-token': `${localStorage.getItem('Employee.token')}` // 'Authorization': `Bearer ${sessionStorage.getItem('token')}` } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/demandAndC/demandAndCAPI.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/demandAndC/demandAndCAPI.js index 15512253557..4f905417c5b 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/demandAndC/demandAndCAPI.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/demandAndC/demandAndCAPI.js @@ -42,7 +42,7 @@ export default class DashboardAPI extends API { return { headers: { 'Content-Type': 'application/json', - 'auth-token': `${getToken()}` + 'auth-token': `${localStorage.getItem('Employee.token')}` } } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/fileUpload/fileUpload.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/fileUpload/fileUpload.js index 7ea118870ce..6bc530225c9 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/fileUpload/fileUpload.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/fileUpload/fileUpload.js @@ -1,6 +1,5 @@ import API from '../apis/api'; import CONFIGS from '../../config/configs' -import { getTenantId } from '../../../utils/commons'; export default class FileUploadAPI extends API { constructor(timeout = 2000, path, reqType, reqBody, queryParams = null) { @@ -29,7 +28,7 @@ export default class FileUploadAPI extends API { getFormData() { var data = new FormData(); data.append("file", this.body); - data.append("tenantId", `${getTenantId()}`); + data.append("tenantId", `${localStorage.getItem('tenant-id')}`); data.append("module", 'dashboard'); data.append("tag", '123452'); return data; diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/filterData/filterData.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/filterData/filterData.js index c7992066519..4812200dbf4 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/filterData/filterData.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/filterData/filterData.js @@ -1,7 +1,6 @@ /** * Dashboard API */ - import { stateTenant } from '../../../utils/commons'; import API from './apis/api'; import C from './constants'; @@ -36,7 +35,8 @@ export default class FIlterAPI extends API { } apiEndPoint(page) { - let tenent = stateTenant()|| ''; + let tenent = `${localStorage.getItem('tenant-id')}` ? (`${localStorage.getItem('tenant-id')}`).split('.')[0] : '' + return `${super.apiEndPoint()}/v1/_get?masterName=tenants&moduleName=tenant&tenantId=` + tenent } diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/firstAction.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/firstAction.js index d9357f20099..64da88fc511 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/firstAction.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/firstAction.js @@ -24,6 +24,7 @@ export const loadDashboardConfigData = () => dispatch => { }).then(data => { dispatch(receiveDashBoardConfigData(data["responseData"])) }).catch(err => { + console.log("Error Reading data " + err); }); } \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getChartOptions.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getChartOptions.js index d21d514da42..16ceca96a3a 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getChartOptions.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getChartOptions.js @@ -1,4 +1,3 @@ -import { getTenantId, getToken } from '../../utils/commons'; import CONFIGS from '../config/configs'; export default function getChartOptions(code, filters) { @@ -13,15 +12,15 @@ export default function getChartOptions(code, filters) { headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', - 'auth-token': `${getToken()}` + 'auth-token': `${localStorage.getItem('Employee.token')}` } }; let dataoption = { "RequestInfo":{ - "authToken": `${getToken()}` + "authToken": `${localStorage.getItem('Employee.token')}` }, "headers": { - "tenantId": `${getTenantId()}` + "tenantId": `${localStorage.getItem('tenant-id')}` }, "aggregationRequestDto": { diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getFilterObj.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getFilterObj.js index c1f85aaae45..7d18e03be81 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getFilterObj.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getFilterObj.js @@ -1,5 +1,4 @@ import _ from 'lodash'; -import { stateTenant } from '../../utils/commons'; import CONFIG from '../config/configs'; export default function getFilterObj(GFilterData, mdmsData, page) { let newGFilterData = _.cloneDeep(GFilterData); @@ -27,7 +26,7 @@ export default function getFilterObj(GFilterData, mdmsData, page) { if (newGFilterData && newGFilterData['ULBS'] && newGFilterData['ULBS'].length > 0) { for (var i = 0; i < newGFilterData['ULBS'].length; i++) { - let tenent =stateTenant() || ''; + let tenent = `${localStorage.getItem('tenant-id')}` ? (`${localStorage.getItem('tenant-id')}`).split('.')[0] : '' tempValue.push(tenent + '.' + newGFilterData['ULBS'][i].toLowerCase()); } filters['tenantId'] = tempValue; diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getFinancialYearObj.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getFinancialYearObj.js index 7c5c0e67e5a..72414cc69e9 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getFinancialYearObj.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getFinancialYearObj.js @@ -22,9 +22,7 @@ export default function getFinancialYearObj(onlyText,yearObj) { title: `FY ${moment(moment().subtract(2,'year')).month(3).startOf('month').format("YY")}-${moment(moment().subtract(1,'year')).month(2).endOf('month').format("YY")}`, value: { startDate: moment(moment().subtract(2,'year')).month(3).startOf('month').unix(), - // endDate: moment(moment().subtract(1,'year')).month(2).endOf('month').unix(), - endDate: moment().endOf('day').unix(), - + endDate: moment(moment().subtract(1,'year')).month(2).endOf('month').unix(), interval: 'month' } }) @@ -32,9 +30,7 @@ export default function getFinancialYearObj(onlyText,yearObj) { title: `FY ${moment(moment().subtract(1,'year')).month(3).startOf('month').format("YY")}-${moment().month(2).endOf('month').format("YY")}`, value: { startDate: moment(moment().subtract(1,'year')).month(3).startOf('month').unix(), - // endDate: moment().month(2).endOf('month').unix(), - endDate: moment().endOf('day').unix(), - + endDate: moment().month(2).endOf('month').unix(), interval: 'month' } }) @@ -43,9 +39,7 @@ export default function getFinancialYearObj(onlyText,yearObj) { title: `FY ${moment(moment().subtract(1,'year')).month(3).startOf('month').format("YY")}-${moment().month(2).endOf('month').format("YY")}`, value: { startDate: moment(moment().subtract(1,'year')).month(3).startOf('month').unix(), - // endDate: moment().month(2).endOf('month').unix(), - endDate: moment().endOf('day').unix(), - + endDate: moment().month(2).endOf('month').unix(), interval: 'month' } } @@ -60,9 +54,7 @@ export default function getFinancialYearObj(onlyText,yearObj) { title: `FY ${moment(moment().subtract(1,'year')).month(3).startOf('month').format("YY")}-${moment().month(2).endOf('month').format("YY")}`, value: { startDate: moment(moment().subtract(1,'year')).month(3).startOf('month').unix(), - // endDate: moment().month(2).endOf('month').unix(), - endDate: moment().endOf('day').unix(), - + endDate: moment().month(2).endOf('month').unix(), interval: 'month' } }) @@ -70,9 +62,7 @@ export default function getFinancialYearObj(onlyText,yearObj) { title: `FY ${moment().month(3).startOf('month').format("YY")}-${moment().month(2).endOf('month').add(1, 'years').format("YY")}`, value: { startDate: moment().month(3).startOf('month').unix(), - // endDate: moment().month(2).endOf('month').add(1, 'years').unix(), - endDate: moment().endOf('day').unix(), - + endDate: moment().month(2).endOf('month').add(1, 'years').unix(), interval: 'month' } }) @@ -81,9 +71,7 @@ export default function getFinancialYearObj(onlyText,yearObj) { title: `FY ${moment().month(3).startOf('month').format("YY")}-${moment().month(2).endOf('month').add(1, 'years').format("YY")}`, value: { startDate: moment().month(3).startOf('month').unix(), - // endDate: moment().month(2).endOf('month').add(1, 'years').unix(), - endDate: moment().endOf('day').unix(), - + endDate: moment().month(2).endOf('month').add(1, 'years').unix(), interval: 'month' } } diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getMDMSData.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getMDMSData.js index 2878e8e6efc..5ec39e6daeb 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getMDMSData.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getMDMSData.js @@ -1,5 +1,4 @@ import _ from 'lodash'; -import { getTenantId } from '../../utils/commons'; export default function getMDMSData(tenants){ let tempDRRsObj = {},tempDDRs=[],tempULBS=[],tenantId = "",tenantLogo ={},tenantName='',corpName = ''; @@ -9,7 +8,7 @@ _.each(tenants,(v,k) => { tenantLogo[v.code] = v.logoId; tempULBS.push(v.name); } - if(v.code === getTenantId()) + if(v.code === localStorage.getItem('tenant-id')) tenantName = v.name; if(v.city.ddrName){ tenantId = v.code; diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getPDFHeaderDetails.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getPDFHeaderDetails.js index 55e8eb6a91a..41bbe00062f 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getPDFHeaderDetails.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/getPDFHeaderDetails.js @@ -1,9 +1,8 @@ import _ from 'lodash'; -import { getTenantId } from '../../utils/commons'; export default function getPDFHeaderDetails(mdmsData) { let returnObj = {logo: '',headerText: ''}; if(!_.isEmpty(mdmsData,true)){ - returnObj.logo = mdmsData['tentantLogo'][`${getTenantId()}`]; + returnObj.logo = mdmsData['tentantLogo'][`${localStorage.getItem('tenant-id')}`]; returnObj.headerText= mdmsData['tenantName'].toUpperCase() +" "+ mdmsData['corpName'].toUpperCase(); } return returnObj; diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/mdms/mdms.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/mdms/mdms.js index f4e1316badd..967858cd40b 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/mdms/mdms.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/mdms/mdms.js @@ -3,7 +3,6 @@ import C from '../constants'; import CONFIGS from '../../config/configs'; import getMDMSData from '../getMDMSData' import { get } from 'lodash'; -import { stateTenant } from '../../../utils/commons'; export default class MdmsAPI extends API { @@ -37,7 +36,7 @@ export default class MdmsAPI extends API { } getBody() { - let tenent = stateTenant() || ""; + let tenent = `${localStorage.getItem('tenant-id')}` ? (`${localStorage.getItem('tenant-id')}`).split('.')[0] : '' return { "RequestInfo": { "authToken": "" diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/s3Image/s3Image.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/s3Image/s3Image.js index c9e74ab033b..000055a138e 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/s3Image/s3Image.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/s3Image/s3Image.js @@ -1,7 +1,6 @@ import API from '../apis/api'; import CONFIGS from '../../config/configs' -import { getTenantId } from '../../../utils/commons'; export default class S3ImageAPI extends API { constructor(timeout = 2000, path, reqType, reqBody, queryParams = null) { @@ -34,7 +33,7 @@ export default class S3ImageAPI extends API { return this.codeKey; } apiEndPoint() { - return CONFIGS.FETCH_FILE + "?tenantId="+`${getTenantId()}`+"&fileStoreIds=" + this.body + return CONFIGS.FETCH_FILE + "?tenantId="+`${localStorage.getItem('tenant-id')}`+"&fileStoreIds=" + this.body } getHeaders() { diff --git a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/shortenAPI.js b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/shortenAPI.js index 56e5882eceb..3481c285815 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/redux/actions/shortenAPI.js +++ b/frontend/mono-ui/web/dss-dashboard/src/redux/actions/shortenAPI.js @@ -11,6 +11,7 @@ export default function shortenAPI( url,callback ) { .then( response => { callback("",response); } ).catch( ( error ) => { + console.log( error ); callback(error,""); } ); } \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/styles/variables.js b/frontend/mono-ui/web/dss-dashboard/src/styles/variables.js old mode 100755 new mode 100644 index fd4aba58baf..102cc307ee4 --- a/frontend/mono-ui/web/dss-dashboard/src/styles/variables.js +++ b/frontend/mono-ui/web/dss-dashboard/src/styles/variables.js @@ -126,34 +126,7 @@ const variables = { pdf: '#ff0000', email: '#ff0000', - colors: [ - {'dark': '#0BDE85','light': 'rgba(11, 222, 133, 0.14)'}, - {'dark':'#FFCA45','light': 'rgba(255, 202, 69, 0.24)'}, - {'dark':'#8A53FF','light': 'rgba(138, 83, 255, 0.24)'}, - {'dark':'#048BD0','light': 'rgba(4, 139, 208, 0.24)'}, - {'dark': '#FF7245','light': 'rgba(255, 114, 69, 0.24)'}, - {'dark': '#53FFEA','light': 'rgba(83, 255, 234, 0.14)'}, - {'dark': '#DEBC0B','light': 'rgba(222, 188, 11, 0.24)'}, - { 'dark': '#9FFF53', 'light': 'rgba(159, 255, 83, 0.24)' }, - { 'dark': '#787878', 'light': 'rgb(120,120,120,0.35)' }, - { 'dark': '#DEBC0B', 'light': 'rgba(222, 188, 11, 0.24)' }, - { 'dark': '#DEBC0B', 'light': 'rgba(222, 188, 11, 0.24)' } - - ], - iconColors: [ - {'dark': '#0C9D95','light': 'rgba(12, 157, 149, 0.85)'}, - {'dark':'#FBC02D','light': 'rgba(251, 192, 45, 0.85)'}, - {'dark':'#4B1FA5','light': 'rgba(75, 31, 165, 0.85)'}, - {'dark':'#048BD0','light': 'rgba(4, 139, 208, 0.85)'}, - {'dark': '#EF7C5B','light': 'rgba(239, 124, 91, 0.85)'}, - {'dark': '#51D2C6','light': 'rgba(81, 210, 198, 0.85)'}, - {'dark': '#B7A545','light': 'rgba(183, 165, 69, 0.85)'}, - {'dark': '#6E8459','light': 'rgba(110, 132, 89, 1)'}, - {'dark': '#787878','light': 'rgba(120, 120, 120, 0.85)'}, - {'dark': '#B7A545','light': 'rgba(183, 165, 69, 0.85)'}, - {'dark': '#B7A545','light': 'rgba(183, 165, 69, 0.85)'}, - - ] + colors: [{'dark': '#9C27B0','light': 'rgba(156, 39, 176, 0.24)'},{'dark':'#F44336','light': 'rgba(244, 67, 54, 0.24)'},{'dark':'#4CAF50','light': 'rgba(76, 175, 80, 0.24)'},{'dark':'#FFC107','light': 'rgba(255, 193, 7, 0.24)'},{'dark':'#009688','light': 'rgba(0, 150, 136, 0.24)'},{'dark': '#2196F3','light': 'rgba(33, 150, 243, 0.24)'}] } diff --git a/frontend/mono-ui/web/dss-dashboard/src/test.js b/frontend/mono-ui/web/dss-dashboard/src/test.js index 93b8b874f04..a3981a77d77 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/test.js +++ b/frontend/mono-ui/web/dss-dashboard/src/test.js @@ -10,4 +10,39 @@ let previous = moment(current).subtract(1, 'quarter'); let previousStartOf = moment(previous).startOf('quarter'); let previousEndOf = moment(previous). endOf('quarter').add(1, 'day'); +/*console.log( + 'current ', + currentStartOf.format('DD-MM-YYYY'), + currentEndOf .format('DD-MM-YYYY') +) + +console.log( + 'previous', + previousStartOf.format('DD-MM-YYYY'), + previousEndOf .format('DD-MM-YYYY') +)*/ + +console.log( + 'Current FY', + moment().month(3).startOf('month').format("YY"), + '-', + moment().month(2).endOf('month').add(1, 'years').format("YY") +); + +console.log( + 'Previous FY', + moment(moment().subtract(2,'year')).month(3).startOf('month').format("YY"), + '-', + moment(moment().subtract(1,'year')).month(2).endOf('month').format("YY") +); + + + +console.log( + 'Previous FY', + + moment().month(3).startOf('month').format("YY"), + '-', + moment().month(2).endOf('month').add(1, 'years').format("YY") +); diff --git a/frontend/mono-ui/web/dss-dashboard/src/utils/AppRouter.js b/frontend/mono-ui/web/dss-dashboard/src/utils/AppRouter.js index 33b5c21790d..72483153e1a 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/utils/AppRouter.js +++ b/frontend/mono-ui/web/dss-dashboard/src/utils/AppRouter.js @@ -11,15 +11,16 @@ class AppRouter extends Component { return true; } + + render() { return ( -
+
- diff --git a/frontend/mono-ui/web/dss-dashboard/src/utils/Layout.js b/frontend/mono-ui/web/dss-dashboard/src/utils/Layout.js index e9e82d54492..138ae57f8be 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/utils/Layout.js +++ b/frontend/mono-ui/web/dss-dashboard/src/utils/Layout.js @@ -4,7 +4,6 @@ import AppRouter from './AppRouter'; import Spinner from '../components/common/Spinner'; // import SideBar from '../components/common/sidebar' import { isMobile } from 'react-device-detect'; -import { isNurtDashboard } from './commons'; const styles = (theme) => ({ root: { @@ -26,10 +25,6 @@ const styles = (theme) => ({ class Layout extends Component { prepareLayout() { const { classes } = this.props; - let sourceUrl = `${window.location.origin}/citizen`; - sourceUrl="https://s3.ap-south-1.amazonaws.com/egov-qa-assets"; - - const pdfUrl = "https://pg-egov-assets.s3.ap-south-1.amazonaws.com/Upyog+Code+and+Copyright+License_v1.pdf" return (
{/*
@@ -42,25 +37,11 @@ class Layout extends Component {
{/*
*/} -
+
{/* */}
-
-
- {"Powered { - window.open('https://www.digit.org/', '_blank').focus(); - }}> - | - { window.open('https://niua.in/', '_blank').focus();}} >Copyright © 2022 National Institute of Urban Affairs - | - { window.open(pdfUrl, '_blank').focus();}}>UPYOG License -
-
) diff --git a/frontend/mono-ui/web/dss-dashboard/src/utils/Share.js b/frontend/mono-ui/web/dss-dashboard/src/utils/Share.js index fe1d765f088..377f11ceb56 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/utils/Share.js +++ b/frontend/mono-ui/web/dss-dashboard/src/utils/Share.js @@ -22,10 +22,9 @@ export const handlePdfShareEmail = (pdf2) => { .uploadFile(blobData, config) .then(data => { shortenAPI(data.location,function(err,data){ - // var fakeLink = document.createElement('a'); - // fakeLink.setAttribute('href', 'mailto:?body=' + encodeURIComponent(data.data)); - // fakeLink.click(); - window.open(`mailto:?body=${encodeURIComponent(data.data)}`, "_blank"); + var fakeLink = document.createElement('a'); + fakeLink.setAttribute('href', 'mailto:?body=' + encodeURIComponent(data.data)); + fakeLink.click(); }); }) .catch(err => console.error(err)) @@ -50,7 +49,6 @@ export const handleImageShareEmail = (blobData) => { shortenAPI(data.location,function(err,data){ var fakeLink = document.createElement('a'); fakeLink.setAttribute('href', 'mailto:?body=' + encodeURIComponent(data.data)); - fakeLink.setAttribute('target', '_blank'); fakeLink.click(); }) }) diff --git a/frontend/mono-ui/web/dss-dashboard/src/utils/block.js b/frontend/mono-ui/web/dss-dashboard/src/utils/block.js index 3373a8f01ef..d3ca3496880 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/utils/block.js +++ b/frontend/mono-ui/web/dss-dashboard/src/utils/block.js @@ -10,7 +10,6 @@ import { } from "react-device-detect"; import logoNotFound from '../components/Dashboard/download/logoNotFound.png'; import logo from '../images/Digit.png'; -import { stateTenant } from './commons'; const filterFunc = function (node) { @@ -20,8 +19,7 @@ const filterFunc = function (node) { export const downloadAsImage = (name) => { // props.APITrans(true) return new Promise((resolve, reject) => { - /** commented previous mode of download */ - // if (isMobile) { + if (isMobile) { return html2canvas(document.getElementById('divToPrint'), { allowTaint: true, useCORS: true, @@ -44,8 +42,22 @@ export const downloadAsImage = (name) => { }).catch(function () { reject(false); }) - /** commented for webview code */ - /* + // let node = document.getElementById('divToPrint'); + // node.style.background = 'white' + // // node.style.width = '130mm'; + // // node.style.height = '300mm'; + // node.style.margin = '0mm'; + // node.style.marginColor = 'white'; + // domtoimage.toPng(node, { quality: 0.100, bgcolor: '#F4F7FB', filter: filterFunc }) + // .then(function (dataUrl) { + // var link = document.createElement('a'); + // link.download = name || 'image.jpeg'; + // link.href = dataUrl; + // link.click(); + // resolve({}); + // }.bind(this)).catch(function (er) { + // reject(er) + // }) } else if (isBrowser) { let div = document.getElementById('divToPrint'); domtoimage.toJpeg(div, { quality: 0.95, bgcolor: '#F4F7FB', filter: filterFunc }) @@ -60,7 +72,6 @@ export const downloadAsImage = (name) => { reject(er) }) } - */ }); } @@ -79,6 +90,7 @@ const getFilters = (tableObj) => { root.appendChild(t); return resolve() } catch (ex) { + console.log(ex) return reject(); } }) @@ -99,9 +111,7 @@ const getImageData = (dataUrl) => { const addPages = (elem, cityLogo, pdfHeader) => { return new Promise((resolve, reject) => { - if (isMobile) { - html2canvas(document.getElementById('divToPrint'), { allowTaint: true, useCORS: true, @@ -131,6 +141,7 @@ const addPages = (elem, cityLogo, pdfHeader) => { try { pdf.addImage(body, 'PNG', 5, 5, 50, 48) } catch (e) { + console.log(e); } } if (dataUrl) { @@ -165,6 +176,7 @@ const addPages = (elem, cityLogo, pdfHeader) => { }.bind(this)).catch((err) => { + console.log(err); return reject(null) }) @@ -172,28 +184,15 @@ const addPages = (elem, cityLogo, pdfHeader) => { reject(false); }) - } else { - - html2canvas(document.getElementById('divToPrint'), { - allowTaint: true, - useCORS: true, - backgroundColor: "#F4F7FB", - removeContainer: true, - x: 0, - y: 0, - width: window.innerWidth, - }).then(function (canvas) { - var dataUrl = canvas.toDataURL("image/jpeg") - /** commented for webview code */ - /* domtoimage.toJpeg(elem, { quality: 0.95, bgcolor: '#F4F7FB', filter: filterFunc }) .then(function (dataUrl) { - */ return getImageData(dataUrl).then(function (hw) { if (cityLogo) { base64Img.requestBase64(cityLogo, function (err, res, body) { - + if (err) { + console.log(err) + } var imgWidth = 210; var pageHeight = 295; @@ -224,6 +223,7 @@ const addPages = (elem, cityLogo, pdfHeader) => { doc.addImage(logo, 'PNG', 194, 1, 15, 8); } catch (e) { + console.log(e, 'LOGO NOT FOUND'); if (isLogoRequired) { doc.addImage(logoNotFound, 'PNG', 1, 1, 10, 8); } @@ -302,12 +302,15 @@ const addPages = (elem, cityLogo, pdfHeader) => { } }.bind(this)).catch((err) => { + console.log(err); return reject(null) }) }.bind(this)).catch((err) => { + console.log(err); return reject(null) }) } + }) } @@ -324,6 +327,7 @@ export const printDocument = (cityLogo, pdfHeader, name) => { return resolve(response); }.bind(this)).catch(function (error) { + console.log(error); return reject(false); }) }) @@ -337,6 +341,7 @@ export const printDocumentShare = (cityLogo, pdfHeader) => { return resolve(response); }.bind(this)).catch(function (error) { + console.log(error); return reject(false); }) }) @@ -357,10 +362,11 @@ export const loadUlbLogo = tenantid => { localStorage.setItem("UlbLogoForPdf", canvas.toDataURL()); canvas = null; }; - var tenant = stateTenant() || ""; + var tenant = tenantid ? tenantid.split('.')[0] : tenantid; img.src = `/${tenant}-egov-assets/${tenantid}/logo.png`; } catch (e) { localStorage.setItem("IsUlbLogoLoading", 'FAILED'); + console.log(e, 'LOGO IMAGE ERROR'); } }; \ No newline at end of file diff --git a/frontend/mono-ui/web/dss-dashboard/src/utils/commons.js b/frontend/mono-ui/web/dss-dashboard/src/utils/commons.js index f1d8be5d32c..b50075b6e49 100644 --- a/frontend/mono-ui/web/dss-dashboard/src/utils/commons.js +++ b/frontend/mono-ui/web/dss-dashboard/src/utils/commons.js @@ -1,61 +1,47 @@ -import CONFIGS from '../config/configs'; +import CONFIGS from "../config/configs"; + +export const removeSignFromInsightData = (value = "") => { + if (value.startsWith("-")) { + value = value.replace("-", ""); + } else if (value.startsWith("+")) { + value = value.replace("+", ""); + } + return value; +}; -export const removeSignFromInsightData = (value = '') => { - if (value.startsWith('-')) { - value = value.replace('-', ''); - } - else if (value.startsWith('+')) { - value = value.replace('+', ''); - } - return value; -} -let localisation={}; export const getLocaleLabels = (key = "", strings = {}) => { - if(strings&&Object.keys(strings).length>0){ - localisation=strings - } - strings=strings&&Object.keys(strings).length>0?strings:localisation; - return strings[removeSpaceInLocalisationKey(key)] || removeSpaceInLocalisationKey(key); -} + return ( + strings[removeSpaceInLocalisationKey(key)] || + removeSpaceInLocalisationKey(key) + ); +}; const removeSpaceInLocalisationKey = (key = "") => { - - let tempKey = key || ""; - while (tempKey.includes(' ')) { - tempKey = tempKey.replace(' ', '_'); - } - return tempKey.toUpperCase(); -} + let tempKey = key || ""; + while (tempKey.includes(" ")) { + tempKey = tempKey.replace(" ", "_"); + } + return tempKey.toUpperCase(); +}; export const getTenantId = () => { - let tenant=sessionStorage.getItem('Digit.Employee.tenantId'); - return `${JSON.parse(tenant)?.value||localStorage.getItem('tenant-id')}`; -} -export const getToken = () => { - let user=sessionStorage.getItem('Digit.User'); - return `${JSON.parse(user)?.value?.access_token||localStorage.getItem('Employee.token')}`; -} -export const stateTenant= () => { - let globalConfigs=window&&window.globalConfigs?window.globalConfigs : window.parent&&window.parent.globalConfigs; - return globalConfigs&&globalConfigs.getConfig("STATE_LEVEL_TENANT_ID")?globalConfigs.getConfig("STATE_LEVEL_TENANT_ID"):getTenantId().split('.')[0]; -} - -export const fetchLocalisationRequest = (language) => { - const reqHeaders = { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }; - const reqUrl = `${CONFIGS.LOCALISATION_URL}?locale=${language}&tenantId=${stateTenant()}&module=rainmaker-common,rainmaker-dss`; - const reqBody = {} - return { reqHeaders, reqBody, reqUrl }; -} -export const convertLabelValue=(label='',strings={})=>{ - switch(label){ - case "Boundary": - return getLocaleLabels('DSS_TB_CITY',strings); - default: - return getLocaleLabels(`DSS_TB_${label}`,strings); - } -} + return `${localStorage.getItem("tenant-id")}`; +}; -export const isNurtDashboard=()=>window.location.pathname.toLowerCase().includes("nurt_dashboard") \ No newline at end of file +export const fetchLocalisationRequest = (language, tenent) => { + const reqHeaders = { + "Content-Type": "application/json", + Accept: "application/json", + }; + const reqUrl = `${CONFIGS.LOCALISATION_URL}?locale=${language}&tenantId=${tenent}&module=rainmaker-common,rainmaker-dss`; + const reqBody = {}; + return { reqHeaders, reqBody, reqUrl }; +}; +export const convertLabelValue = (label = "", strings = {}) => { + switch (label) { + case "Boundary": + return "DSS_TB_City"; + default: + return getLocaleLabels(`DSS_TB_${label}`, strings); + } +}; diff --git a/frontend/mono-ui/web/egov-common-screen/.gitignore b/frontend/mono-ui/web/egov-common-screen/.gitignore new file mode 100644 index 00000000000..b512c09d476 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/frontend/mono-ui/web/egov-common-screen/README.md b/frontend/mono-ui/web/egov-common-screen/README.md new file mode 100644 index 00000000000..89b278ae3ed --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/README.md @@ -0,0 +1,68 @@ +This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). + +## Available Scripts + +In the project directory, you can run: + +### `yarn start` + +Runs the app in the development mode.
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser. + +The page will reload if you make edits.
+You will also see any lint errors in the console. + +### `yarn test` + +Launches the test runner in the interactive watch mode.
+See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. + +### `yarn build` + +Builds the app for production to the `build` folder.
+It correctly bundles React in production mode and optimizes the build for the best performance. + +The build is minified and the filenames include the hashes.
+Your app is ready to be deployed! + +See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. + +### `yarn eject` + +**Note: this is a one-way operation. Once you `eject`, you can’t go back!** + +If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. + +Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. + +You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. + +## Learn More + +You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). + +To learn React, check out the [React documentation](https://reactjs.org/). + +### Code Splitting + +This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting + +### Analyzing the Bundle Size + +This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size + +### Making a Progressive Web App + +This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app + +### Advanced Configuration + +This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration + +### Deployment + +This section has moved here: https://facebook.github.io/create-react-app/docs/deployment + +### `yarn build` fails to minify + +This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify diff --git a/frontend/mono-ui/web/egov-common-screen/docker/Dockerfile b/frontend/mono-ui/web/egov-common-screen/docker/Dockerfile new file mode 100644 index 00000000000..9610ced963e --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/docker/Dockerfile @@ -0,0 +1,22 @@ + +FROM node:12-alpine3.9 AS build +ARG WORK_DIR +WORKDIR /app +ENV NODE_OPTIONS "--max-old-space-size=1792" +ENV NPM_CONFIG_PREFIX=/tmp/.npm-global +ENV PATH=$PATH:/tmp/.npm-global/bin +ENV HOME=/tmp + +# copy the project files +COPY ${WORK_DIR} . +RUN apk --update add git +RUN npm i && npm run build + +# Create runtime image +FROM nginx:mainline-alpine +ENV WEB_DIR=/var/web/common + +RUN mkdir -p ${WEB_DIR} + +COPY --from=build /app/build ${WEB_DIR}/ +COPY --from=build /app/docker/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/frontend/mono-ui/web/egov-common-screen/docker/nginx.conf b/frontend/mono-ui/web/egov-common-screen/docker/nginx.conf new file mode 100644 index 00000000000..77e09c65681 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/docker/nginx.conf @@ -0,0 +1,12 @@ +server +{ + listen 80; + underscores_in_headers on; + + location /common + { + root /var/web; + index index.html index.htm; + try_files $uri $uri/ /common/index.html; + } +} diff --git a/frontend/mono-ui/web/egov-common-screen/package-lock.json b/frontend/mono-ui/web/egov-common-screen/package-lock.json new file mode 100644 index 00000000000..d6426d53675 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/package-lock.json @@ -0,0 +1,14048 @@ +{ + "name": "egov-intermediate", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/core": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.4.tgz", + "integrity": "sha512-+bYbx56j4nYBmpsWtnPUsKW3NdnYxbqyfrP2w9wILBuHzdfIKz9prieZK0DFPyIzkjYVUe4QkusGL07r5pXznQ==", + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.4", + "@babel/helpers": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "json5": "^2.1.0", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "@babel/generator": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.4.tgz", + "integrity": "sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg==", + "requires": { + "@babel/types": "^7.7.4", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.4.tgz", + "integrity": "sha512-2BQmQgECKzYKFPpiycoF9tlb5HA4lrVyAmLLVK177EcQAqjVLciUb2/R+n1boQ9y5ENV3uz2ZqiNw7QMBBw1Og==", + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.7.4.tgz", + "integrity": "sha512-Biq/d/WtvfftWZ9Uf39hbPBYDUo986m5Bb4zhkeYDGUllF43D+nUe5M6Vuo6/8JDK/0YX/uBdeoQpyaNhNugZQ==", + "requires": { + "@babel/helper-explode-assignable-expression": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-builder-react-jsx": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.7.4.tgz", + "integrity": "sha512-kvbfHJNN9dg4rkEM4xn1s8d1/h6TYNvajy9L1wx4qLn9HFg0IkTsQi4rfBe92nxrPUFcMsHoMV+8rU7MJb3fCA==", + "requires": { + "@babel/types": "^7.7.4", + "esutils": "^2.0.0" + } + }, + "@babel/helper-call-delegate": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.7.4.tgz", + "integrity": "sha512-8JH9/B7J7tCYJ2PpWVpw9JhPuEVHztagNVuQAFBVFYluRMlpG7F1CgKEgGeL6KFqcsIa92ZYVj6DSc0XwmN1ZA==", + "requires": { + "@babel/helper-hoist-variables": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-create-class-features-plugin": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.4.tgz", + "integrity": "sha512-l+OnKACG4uiDHQ/aJT8dwpR+LhCJALxL0mJ6nzjB25e5IPwqV1VOsY7ah6UB1DG+VOXAIMtuC54rFJGiHkxjgA==", + "requires": { + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-member-expression-to-functions": "^7.7.4", + "@babel/helper-optimise-call-expression": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4" + } + }, + "@babel/helper-create-regexp-features-plugin": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.4.tgz", + "integrity": "sha512-Mt+jBKaxL0zfOIWrfQpnfYCN7/rS6GKx6CCCfuoqVVd+17R8zNDlzVYmIi9qyb2wOk002NsmSTDymkIygDUH7A==", + "requires": { + "@babel/helper-regex": "^7.4.4", + "regexpu-core": "^4.6.0" + } + }, + "@babel/helper-define-map": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.7.4.tgz", + "integrity": "sha512-v5LorqOa0nVQUvAUTUF3KPastvUt/HzByXNamKQ6RdJRTV7j8rLL+WB5C/MzzWAwOomxDhYFb1wLLxHqox86lg==", + "requires": { + "@babel/helper-function-name": "^7.7.4", + "@babel/types": "^7.7.4", + "lodash": "^4.17.13" + } + }, + "@babel/helper-explode-assignable-expression": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.7.4.tgz", + "integrity": "sha512-2/SicuFrNSXsZNBxe5UGdLr+HZg+raWBLE9vC98bdYOKX/U6PY0mdGlYUJdtTDPSU0Lw0PNbKKDpwYHJLn2jLg==", + "requires": { + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-function-name": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", + "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", + "requires": { + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", + "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.4.tgz", + "integrity": "sha512-wQC4xyvc1Jo/FnLirL6CEgPgPCa8M74tOdjWpRhQYapz5JC7u3NYU1zCVoVAGCE3EaIP9T1A3iW0WLJ+reZlpQ==", + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.4.tgz", + "integrity": "sha512-9KcA1X2E3OjXl/ykfMMInBK+uVdfIVakVe7W7Lg3wfXUNyS3Q1HWLFRwZIjhqiCGbslummPDnmb7vIekS0C1vw==", + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-module-imports": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.7.4.tgz", + "integrity": "sha512-dGcrX6K9l8258WFjyDLJwuVKxR4XZfU0/vTUgOQYWEnRD8mgr+p4d6fCUMq/ys0h4CCt/S5JhbvtyErjWouAUQ==", + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-module-transforms": { + "version": "7.7.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.7.5.tgz", + "integrity": "sha512-A7pSxyJf1gN5qXVcidwLWydjftUN878VkalhXX5iQDuGyiGK3sOrrKKHF4/A4fwHtnsotv/NipwAeLzY4KQPvw==", + "requires": { + "@babel/helper-module-imports": "^7.7.4", + "@babel/helper-simple-access": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4", + "lodash": "^4.17.13" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.4.tgz", + "integrity": "sha512-VB7gWZ2fDkSuqW6b1AKXkJWO5NyNI3bFL/kK79/30moK57blr6NbH8xcl2XcKCwOmJosftWunZqfO84IGq3ZZg==", + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", + "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==" + }, + "@babel/helper-regex": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.5.5.tgz", + "integrity": "sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw==", + "requires": { + "lodash": "^4.17.13" + } + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.4.tgz", + "integrity": "sha512-Sk4xmtVdM9sA/jCI80f+KS+Md+ZHIpjuqmYPk1M7F/upHou5e4ReYmExAiu6PVe65BhJPZA2CY9x9k4BqE5klw==", + "requires": { + "@babel/helper-annotate-as-pure": "^7.7.4", + "@babel/helper-wrap-function": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-replace-supers": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.7.4.tgz", + "integrity": "sha512-pP0tfgg9hsZWo5ZboYGuBn/bbYT/hdLPVSS4NMmiRJdwWhP0IznPwN9AE1JwyGsjSPLC364I0Qh5p+EPkGPNpg==", + "requires": { + "@babel/helper-member-expression-to-functions": "^7.7.4", + "@babel/helper-optimise-call-expression": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-simple-access": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.7.4.tgz", + "integrity": "sha512-zK7THeEXfan7UlWsG2A6CI/L9jVnI5+xxKZOdej39Y0YtDYKx9raHk5F2EtK9K8DHRTihYwg20ADt9S36GR78A==", + "requires": { + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", + "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-wrap-function": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.7.4.tgz", + "integrity": "sha512-VsfzZt6wmsocOaVU0OokwrIytHND55yvyT4BPB9AIIgwr8+x7617hetdJTsuGwygN5RC6mxA9EJztTjuwm2ofg==", + "requires": { + "@babel/helper-function-name": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helpers": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.4.tgz", + "integrity": "sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg==", + "requires": { + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.4.tgz", + "integrity": "sha512-jIwvLO0zCL+O/LmEJQjWA75MQTWwx3c3u2JOTDK5D3/9egrWRRA0/0hk9XXywYnXZVVpzrBYeIQTmhwUaePI9g==" + }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.4.tgz", + "integrity": "sha512-1ypyZvGRXriY/QP668+s8sFr2mqinhkRDMPSQLNghCQE+GAkFtp+wkHVvg2+Hdki8gwP+NFzJBJ/N1BfzCCDEw==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-remap-async-to-generator": "^7.7.4", + "@babel/plugin-syntax-async-generators": "^7.7.4" + } + }, + "@babel/plugin-proposal-class-properties": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.7.4.tgz", + "integrity": "sha512-EcuXeV4Hv1X3+Q1TsuOmyyxeTRiSqurGJ26+I/FW1WbymmRRapVORm6x1Zl3iDIHyRxEs+VXWp6qnlcfcJSbbw==", + "requires": { + "@babel/helper-create-class-features-plugin": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-proposal-decorators": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.7.4.tgz", + "integrity": "sha512-GftcVDcLCwVdzKmwOBDjATd548+IE+mBo7ttgatqNDR7VG7GqIuZPtRWlMLHbhTXhcnFZiGER8iIYl1n/imtsg==", + "requires": { + "@babel/helper-create-class-features-plugin": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-decorators": "^7.7.4" + } + }, + "@babel/plugin-proposal-dynamic-import": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.7.4.tgz", + "integrity": "sha512-StH+nGAdO6qDB1l8sZ5UBV8AC3F2VW2I8Vfld73TMKyptMU9DY5YsJAS8U81+vEtxcH3Y/La0wG0btDrhpnhjQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.7.4" + } + }, + "@babel/plugin-proposal-json-strings": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.7.4.tgz", + "integrity": "sha512-wQvt3akcBTfLU/wYoqm/ws7YOAQKu8EVJEvHip/mzkNtjaclQoCCIqKXFP5/eyfnfbQCDV3OLRIK3mIVyXuZlw==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-json-strings": "^7.7.4" + } + }, + "@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.7.4.tgz", + "integrity": "sha512-TbYHmr1Gl1UC7Vo2HVuj/Naci5BEGNZ0AJhzqD2Vpr6QPFWpUmBRLrIDjedzx7/CShq0bRDS2gI4FIs77VHLVQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.7.4" + } + }, + "@babel/plugin-proposal-numeric-separator": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.7.4.tgz", + "integrity": "sha512-CG605v7lLpVgVldSY6kxsN9ui1DxFOyepBfuX2AzU2TNriMAYApoU55mrGw9Jr4TlrTzPCG10CL8YXyi+E/iPw==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-numeric-separator": "^7.7.4" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.7.tgz", + "integrity": "sha512-3qp9I8lelgzNedI3hrhkvhaEYree6+WHnyA/q4Dza9z7iEIs1eyhWyJnetk3jJ69RT0AT4G0UhEGwyGFJ7GUuQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-object-rest-spread": "^7.7.4" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.7.4.tgz", + "integrity": "sha512-DyM7U2bnsQerCQ+sejcTNZh8KQEUuC3ufzdnVnSiUv/qoGJp2Z3hanKL18KDhsBT5Wj6a7CMT5mdyCNJsEaA9w==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.7.4" + } + }, + "@babel/plugin-proposal-optional-chaining": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.7.4.tgz", + "integrity": "sha512-JmgaS+ygAWDR/STPe3/7y0lNlHgS+19qZ9aC06nYLwQ/XB7c0q5Xs+ksFU3EDnp9EiEsO0dnRAOKeyLHTZuW3A==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-optional-chaining": "^7.7.4" + } + }, + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.7.7.tgz", + "integrity": "sha512-80PbkKyORBUVm1fbTLrHpYdJxMThzM1UqFGh0ALEhO9TYbG86Ah9zQYAB/84axz2vcxefDLdZwWwZNlYARlu9w==", + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.7.4.tgz", + "integrity": "sha512-Li4+EjSpBgxcsmeEF8IFcfV/+yJGxHXDirDkEoyFjumuwbmfCVHUt0HuowD/iGM7OhIRyXJH9YXxqiH6N815+g==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-decorators": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.7.4.tgz", + "integrity": "sha512-0oNLWNH4k5ZbBVfAwiTU53rKFWIeTh6ZlaWOXWJc4ywxs0tjz5fc3uZ6jKAnZSxN98eXVgg7bJIuzjX+3SXY+A==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.7.4.tgz", + "integrity": "sha512-jHQW0vbRGvwQNgyVxwDh4yuXu4bH1f5/EICJLAhl1SblLs2CDhrsmCk+v5XLdE9wxtAFRyxx+P//Iw+a5L/tTg==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-flow": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.7.4.tgz", + "integrity": "sha512-2AMAWl5PsmM5KPkB22cvOkUyWk6MjUaqhHNU5nSPUl/ns3j5qLfw2SuYP5RbVZ0tfLvePr4zUScbICtDP2CUNw==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.7.4.tgz", + "integrity": "sha512-QpGupahTQW1mHRXddMG5srgpHWqRLwJnJZKXTigB9RPFCCGbDGCgBeM/iC82ICXp414WeYx/tD54w7M2qRqTMg==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-jsx": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.7.4.tgz", + "integrity": "sha512-wuy6fiMe9y7HeZBWXYCGt2RGxZOj0BImZ9EyXJVnVGBKO/Br592rbR3rtIQn0eQhAk9vqaKP5n8tVqEFBQMfLg==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.7.4.tgz", + "integrity": "sha512-XKh/yIRPiQTOeBg0QJjEus5qiSKucKAiApNtO1psqG7D17xmE+X2i5ZqBEuSvo0HRuyPaKaSN/Gy+Ha9KFQolw==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.7.4.tgz", + "integrity": "sha512-vmlUUBlLuFnbpaR+1kKIdo62xQEN+THWbtAHSEilo+0rHl2dKKCn6GLUVKpI848wL/T0ZPQgAy8asRJ9yYEjog==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.7.4.tgz", + "integrity": "sha512-mObR+r+KZq0XhRVS2BrBKBpr5jqrqzlPvS9C9vuOf5ilSwzloAl7RPWLrgKdWS6IreaVrjHxTjtyqFiOisaCwg==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.7.4.tgz", + "integrity": "sha512-4ZSuzWgFxqHRE31Glu+fEr/MirNZOMYmD/0BhBWyLyOOQz/gTAl7QmWm2hX1QxEIXsr2vkdlwxIzTyiYRC4xcQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.7.4.tgz", + "integrity": "sha512-2MqYD5WjZSbJdUagnJvIdSfkb/ucOC9/1fRJxm7GAxY6YQLWlUvkfxoNbUPcPLHJyetKUDQ4+yyuUyAoc0HriA==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.7.4.tgz", + "integrity": "sha512-wdsOw0MvkL1UIgiQ/IFr3ETcfv1xb8RMM0H9wbiDyLaJFyiDg5oZvDLCXosIXmFeIlweML5iOBXAkqddkYNizg==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-typescript": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.7.4.tgz", + "integrity": "sha512-77blgY18Hud4NM1ggTA8xVT/dBENQf17OpiToSa2jSmEY3fWXD2jwrdVlO4kq5yzUTeF15WSQ6b4fByNvJcjpQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.7.4.tgz", + "integrity": "sha512-zUXy3e8jBNPiffmqkHRNDdZM2r8DWhCB7HhcoyZjiK1TxYEluLHAvQuYnTT+ARqRpabWqy/NHkO6e3MsYB5YfA==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.4.tgz", + "integrity": "sha512-zpUTZphp5nHokuy8yLlyafxCJ0rSlFoSHypTUWgpdwoDXWQcseaect7cJ8Ppk6nunOM6+5rPMkod4OYKPR5MUg==", + "requires": { + "@babel/helper-module-imports": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-remap-async-to-generator": "^7.7.4" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.7.4.tgz", + "integrity": "sha512-kqtQzwtKcpPclHYjLK//3lH8OFsCDuDJBaFhVwf8kqdnF6MN4l618UDlcA7TfRs3FayrHj+svYnSX8MC9zmUyQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.7.4.tgz", + "integrity": "sha512-2VBe9u0G+fDt9B5OV5DQH4KBf5DoiNkwFKOz0TCvBWvdAN2rOykCTkrL+jTLxfCAm76l9Qo5OqL7HBOx2dWggg==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "lodash": "^4.17.13" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.4.tgz", + "integrity": "sha512-sK1mjWat7K+buWRuImEzjNf68qrKcrddtpQo3swi9j7dUcG6y6R6+Di039QN2bD1dykeswlagupEmpOatFHHUg==", + "requires": { + "@babel/helper-annotate-as-pure": "^7.7.4", + "@babel/helper-define-map": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-optimise-call-expression": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.7.4.tgz", + "integrity": "sha512-bSNsOsZnlpLLyQew35rl4Fma3yKWqK3ImWMSC/Nc+6nGjC9s5NFWAer1YQ899/6s9HxO2zQC1WoFNfkOqRkqRQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.7.4.tgz", + "integrity": "sha512-4jFMXI1Cu2aXbcXXl8Lr6YubCn6Oc7k9lLsu8v61TZh+1jny2BWmdtvY9zSUlLdGUvcy9DMAWyZEOqjsbeg/wA==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.7.tgz", + "integrity": "sha512-b4in+YlTeE/QmTgrllnb3bHA0HntYvjz8O3Mcbx75UBPJA2xhb5A8nle498VhxSXJHQefjtQxpnLPehDJ4TRlg==", + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.7.4.tgz", + "integrity": "sha512-g1y4/G6xGWMD85Tlft5XedGaZBCIVN+/P0bs6eabmcPP9egFleMAo65OOjlhcz1njpwagyY3t0nsQC9oTFegJA==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.7.4.tgz", + "integrity": "sha512-MCqiLfCKm6KEA1dglf6Uqq1ElDIZwFuzz1WH5mTf8k2uQSxEJMbOIEh7IZv7uichr7PMfi5YVSrr1vz+ipp7AQ==", + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-flow-strip-types": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.7.4.tgz", + "integrity": "sha512-w9dRNlHY5ElNimyMYy0oQowvQpwt/PRHI0QS98ZJCTZU2bvSnKXo5zEiD5u76FBPigTm8TkqzmnUTg16T7qbkA==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-flow": "^7.7.4" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.7.4.tgz", + "integrity": "sha512-zZ1fD1B8keYtEcKF+M1TROfeHTKnijcVQm0yO/Yu1f7qoDoxEIc/+GX6Go430Bg84eM/xwPFp0+h4EbZg7epAA==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.4.tgz", + "integrity": "sha512-E/x09TvjHNhsULs2IusN+aJNRV5zKwxu1cpirZyRPw+FyyIKEHPXTsadj48bVpc1R5Qq1B5ZkzumuFLytnbT6g==", + "requires": { + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.7.4.tgz", + "integrity": "sha512-X2MSV7LfJFm4aZfxd0yLVFrEXAgPqYoDG53Br/tCKiKYfX0MjVjQeWPIhPHHsCqzwQANq+FLN786fF5rgLS+gw==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-member-expression-literals": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.7.4.tgz", + "integrity": "sha512-9VMwMO7i69LHTesL0RdGy93JU6a+qOPuvB4F4d0kR0zyVjJRVJRaoaGjhtki6SzQUu8yen/vxPKN6CWnCUw6bA==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.7.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.7.5.tgz", + "integrity": "sha512-CT57FG4A2ZUNU1v+HdvDSDrjNWBrtCmSH6YbbgN3Lrf0Di/q/lWRxZrE72p3+HCCz9UjfZOEBdphgC0nzOS6DQ==", + "requires": { + "@babel/helper-module-transforms": "^7.7.5", + "@babel/helper-plugin-utils": "^7.0.0", + "babel-plugin-dynamic-import-node": "^2.3.0" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.7.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.5.tgz", + "integrity": "sha512-9Cq4zTFExwFhQI6MT1aFxgqhIsMWQWDVwOgLzl7PTWJHsNaqFvklAU+Oz6AQLAS0dJKTwZSOCo20INwktxpi3Q==", + "requires": { + "@babel/helper-module-transforms": "^7.7.5", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-simple-access": "^7.7.4", + "babel-plugin-dynamic-import-node": "^2.3.0" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.7.4.tgz", + "integrity": "sha512-y2c96hmcsUi6LrMqvmNDPBBiGCiQu0aYqpHatVVu6kD4mFEXKjyNxd/drc18XXAf9dv7UXjrZwBVmTTGaGP8iw==", + "requires": { + "@babel/helper-hoist-variables": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0", + "babel-plugin-dynamic-import-node": "^2.3.0" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.7.4.tgz", + "integrity": "sha512-u2B8TIi0qZI4j8q4C51ktfO7E3cQ0qnaXFI1/OXITordD40tt17g/sXqgNNCcMTcBFKrUPcGDx+TBJuZxLx7tw==", + "requires": { + "@babel/helper-module-transforms": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.7.4.tgz", + "integrity": "sha512-jBUkiqLKvUWpv9GLSuHUFYdmHg0ujC1JEYoZUfeOOfNydZXp1sXObgyPatpcwjWgsdBGsagWW0cdJpX/DO2jMw==", + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.7.4" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.7.4.tgz", + "integrity": "sha512-CnPRiNtOG1vRodnsyGX37bHQleHE14B9dnnlgSeEs3ek3fHN1A1SScglTCg1sfbe7sRQ2BUcpgpTpWSfMKz3gg==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.7.4.tgz", + "integrity": "sha512-ho+dAEhC2aRnff2JCA0SAK7V2R62zJd/7dmtoe7MHcso4C2mS+vZjn1Pb1pCVZvJs1mgsvv5+7sT+m3Bysb6eg==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.7.4" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.7.7.tgz", + "integrity": "sha512-OhGSrf9ZBrr1fw84oFXj5hgi8Nmg+E2w5L7NhnG0lPvpDtqd7dbyilM2/vR8CKbJ907RyxPh2kj6sBCSSfI9Ew==", + "requires": { + "@babel/helper-call-delegate": "^7.7.4", + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-property-literals": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.7.4.tgz", + "integrity": "sha512-MatJhlC4iHsIskWYyawl53KuHrt+kALSADLQQ/HkhTjX954fkxIEh4q5slL4oRAnsm/eDoZ4q0CIZpcqBuxhJQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-react-constant-elements": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.7.4.tgz", + "integrity": "sha512-U6XkHZ8RnmeEb8jBUOpeo6oFka5RhLgxAVvK4/fBbwoYlsHQYLb8I37ymTPDVsrWjqb94+hueuWQA/1OAA4rAQ==", + "requires": { + "@babel/helper-annotate-as-pure": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-react-display-name": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.7.4.tgz", + "integrity": "sha512-sBbIvqYkthai0X0vkD2xsAwluBp+LtNHH+/V4a5ydifmTtb8KOVOlrMIk/MYmIc4uTYDnjZUHQildYNo36SRJw==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-react-jsx": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.7.7.tgz", + "integrity": "sha512-SlPjWPbva2+7/ZJbGcoqjl4LsQaLpKEzxW9hcxU7675s24JmdotJOSJ4cgAbV82W3FcZpHIGmRZIlUL8ayMvjw==", + "requires": { + "@babel/helper-builder-react-jsx": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.7.4" + } + }, + "@babel/plugin-transform-react-jsx-self": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.7.4.tgz", + "integrity": "sha512-PWYjSfqrO273mc1pKCRTIJXyqfc9vWYBax88yIhQb+bpw3XChVC7VWS4VwRVs63wFHKxizvGSd00XEr+YB9Q2A==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.7.4" + } + }, + "@babel/plugin-transform-react-jsx-source": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.7.4.tgz", + "integrity": "sha512-5ZU9FnPhqtHsOXxutRtXZAzoEJwDaP32QcobbMP1/qt7NYcsCNK8XgzJcJfoEr/ZnzVvUNInNjIW22Z6I8p9mg==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.7.4" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.7.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.5.tgz", + "integrity": "sha512-/8I8tPvX2FkuEyWbjRCt4qTAgZK0DVy8QRguhA524UH48RfGJy94On2ri+dCuwOpcerPRl9O4ebQkRcVzIaGBw==", + "requires": { + "regenerator-transform": "^0.14.0" + } + }, + "@babel/plugin-transform-reserved-words": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.7.4.tgz", + "integrity": "sha512-OrPiUB5s5XvkCO1lS7D8ZtHcswIC57j62acAnJZKqGGnHP+TIc/ljQSrgdX/QyOTdEK5COAhuc820Hi1q2UgLQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-runtime": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.7.4.tgz", + "integrity": "sha512-O8kSkS5fP74Ad/8pfsCMGa8sBRdLxYoSReaARRNSz3FbFQj3z/QUvoUmJ28gn9BO93YfnXc3j+Xyaqe8cKDNBQ==", + "requires": { + "@babel/helper-module-imports": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0", + "resolve": "^1.8.1", + "semver": "^5.5.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.7.4.tgz", + "integrity": "sha512-q+suddWRfIcnyG5YiDP58sT65AJDZSUhXQDZE3r04AuqD6d/XLaQPPXSBzP2zGerkgBivqtQm9XKGLuHqBID6Q==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.7.4.tgz", + "integrity": "sha512-8OSs0FLe5/80cndziPlg4R0K6HcWSM0zyNhHhLsmw/Nc5MaA49cAsnoJ/t/YZf8qkG7fD+UjTRaApVDB526d7Q==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.7.4.tgz", + "integrity": "sha512-Ls2NASyL6qtVe1H1hXts9yuEeONV2TJZmplLONkMPUG158CtmnrzW5Q5teibM5UVOFjG0D3IC5mzXR6pPpUY7A==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.0.0" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.7.4.tgz", + "integrity": "sha512-sA+KxLwF3QwGj5abMHkHgshp9+rRz+oY9uoRil4CyLtgEuE/88dpkeWgNk5qKVsJE9iSfly3nvHapdRiIS2wnQ==", + "requires": { + "@babel/helper-annotate-as-pure": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.7.4.tgz", + "integrity": "sha512-KQPUQ/7mqe2m0B8VecdyaW5XcQYaePyl9R7IsKd+irzj6jvbhoGnRE+M0aNkyAzI07VfUQ9266L5xMARitV3wg==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-typescript": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.7.4.tgz", + "integrity": "sha512-X8e3tcPEKnwwPVG+vP/vSqEShkwODOEeyQGod82qrIuidwIrfnsGn11qPM1jBLF4MqguTXXYzm58d0dY+/wdpg==", + "requires": { + "@babel/helper-create-class-features-plugin": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-typescript": "^7.7.4" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.4.tgz", + "integrity": "sha512-N77UUIV+WCvE+5yHw+oks3m18/umd7y392Zv7mYTpFqHtkpcc+QUz+gLJNTWVlWROIWeLqY0f3OjZxV5TcXnRw==", + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/preset-env": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.7.7.tgz", + "integrity": "sha512-pCu0hrSSDVI7kCVUOdcMNQEbOPJ52E+LrQ14sN8uL2ALfSqePZQlKrOy+tM4uhEdYlCHi4imr8Zz2cZe9oSdIg==", + "requires": { + "@babel/helper-module-imports": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-async-generator-functions": "^7.7.4", + "@babel/plugin-proposal-dynamic-import": "^7.7.4", + "@babel/plugin-proposal-json-strings": "^7.7.4", + "@babel/plugin-proposal-object-rest-spread": "^7.7.7", + "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.7.7", + "@babel/plugin-syntax-async-generators": "^7.7.4", + "@babel/plugin-syntax-dynamic-import": "^7.7.4", + "@babel/plugin-syntax-json-strings": "^7.7.4", + "@babel/plugin-syntax-object-rest-spread": "^7.7.4", + "@babel/plugin-syntax-optional-catch-binding": "^7.7.4", + "@babel/plugin-syntax-top-level-await": "^7.7.4", + "@babel/plugin-transform-arrow-functions": "^7.7.4", + "@babel/plugin-transform-async-to-generator": "^7.7.4", + "@babel/plugin-transform-block-scoped-functions": "^7.7.4", + "@babel/plugin-transform-block-scoping": "^7.7.4", + "@babel/plugin-transform-classes": "^7.7.4", + "@babel/plugin-transform-computed-properties": "^7.7.4", + "@babel/plugin-transform-destructuring": "^7.7.4", + "@babel/plugin-transform-dotall-regex": "^7.7.7", + "@babel/plugin-transform-duplicate-keys": "^7.7.4", + "@babel/plugin-transform-exponentiation-operator": "^7.7.4", + "@babel/plugin-transform-for-of": "^7.7.4", + "@babel/plugin-transform-function-name": "^7.7.4", + "@babel/plugin-transform-literals": "^7.7.4", + "@babel/plugin-transform-member-expression-literals": "^7.7.4", + "@babel/plugin-transform-modules-amd": "^7.7.5", + "@babel/plugin-transform-modules-commonjs": "^7.7.5", + "@babel/plugin-transform-modules-systemjs": "^7.7.4", + "@babel/plugin-transform-modules-umd": "^7.7.4", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", + "@babel/plugin-transform-new-target": "^7.7.4", + "@babel/plugin-transform-object-super": "^7.7.4", + "@babel/plugin-transform-parameters": "^7.7.7", + "@babel/plugin-transform-property-literals": "^7.7.4", + "@babel/plugin-transform-regenerator": "^7.7.5", + "@babel/plugin-transform-reserved-words": "^7.7.4", + "@babel/plugin-transform-shorthand-properties": "^7.7.4", + "@babel/plugin-transform-spread": "^7.7.4", + "@babel/plugin-transform-sticky-regex": "^7.7.4", + "@babel/plugin-transform-template-literals": "^7.7.4", + "@babel/plugin-transform-typeof-symbol": "^7.7.4", + "@babel/plugin-transform-unicode-regex": "^7.7.4", + "@babel/types": "^7.7.4", + "browserslist": "^4.6.0", + "core-js-compat": "^3.6.0", + "invariant": "^2.2.2", + "js-levenshtein": "^1.1.3", + "semver": "^5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "@babel/preset-react": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.7.4.tgz", + "integrity": "sha512-j+vZtg0/8pQr1H8wKoaJyGL2IEk3rG/GIvua7Sec7meXVIvGycihlGMx5xcU00kqCJbwzHs18xTu3YfREOqQ+g==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-transform-react-display-name": "^7.7.4", + "@babel/plugin-transform-react-jsx": "^7.7.4", + "@babel/plugin-transform-react-jsx-self": "^7.7.4", + "@babel/plugin-transform-react-jsx-source": "^7.7.4" + } + }, + "@babel/preset-typescript": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.7.4.tgz", + "integrity": "sha512-rqrjxfdiHPsnuPur0jKrIIGQCIgoTWMTjlbWE69G4QJ6TIOVnnRnIJhUxNTL/VwDmEAVX08Tq3B1nirer5341w==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.7.4" + } + }, + "@babel/runtime": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.4.tgz", + "integrity": "sha512-r24eVUUr0QqNZa+qrImUk8fn5SPhHq+IfYvIoIMg0do3GdK9sMdiLKP3GYVVaxpPKORgm8KRKaNTEhAjgIpLMw==", + "requires": { + "regenerator-runtime": "^0.13.2" + } + }, + "@babel/runtime-corejs3": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.7.7.tgz", + "integrity": "sha512-kr3W3Fw8mB/CTru2M5zIRQZZgC/9zOxNSoJ/tVCzjPt3H1/p5uuGbz6WwmaQy/TLQcW31rUhUUWKY28sXFRelA==", + "requires": { + "core-js-pure": "^3.0.0", + "regenerator-runtime": "^0.13.2" + } + }, + "@babel/template": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/traverse": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", + "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "@babel/types": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "@cnakazawa/watch": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.3.tgz", + "integrity": "sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA==", + "requires": { + "exec-sh": "^0.3.2", + "minimist": "^1.2.0" + } + }, + "@csstools/convert-colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@csstools/convert-colors/-/convert-colors-1.4.0.tgz", + "integrity": "sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw==" + }, + "@csstools/normalize.css": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/@csstools/normalize.css/-/normalize.css-10.1.0.tgz", + "integrity": "sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg==" + }, + "@emotion/hash": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz", + "integrity": "sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==" + }, + "@hapi/address": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.1.4.tgz", + "integrity": "sha512-QD1PhQk+s31P1ixsX0H0Suoupp3VMXzIVMSwobR3F3MSUO2YCV0B7xqLcUw/Bh8yuvd3LhpyqLQWTNcRmp6IdQ==" + }, + "@hapi/bourne": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-1.3.2.tgz", + "integrity": "sha512-1dVNHT76Uu5N3eJNTYcvxee+jzX4Z9lfciqRRHCU27ihbUcYi+iSc2iml5Ke1LXe1SyJCLA0+14Jh4tXJgOppA==" + }, + "@hapi/hoek": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.5.0.tgz", + "integrity": "sha512-7XYT10CZfPsH7j9F1Jmg1+d0ezOux2oM2GfArAzLwWe4mE2Dr3hVjsAL6+TFY49RRJlCdJDMw3nJsLFroTc8Kw==" + }, + "@hapi/joi": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-15.1.1.tgz", + "integrity": "sha512-entf8ZMOK8sc+8YfeOlM8pCfg3b5+WZIKBfUaaJT8UsjAAPjartzxIYm3TIbjvA4u+u++KbcXD38k682nVHDAQ==", + "requires": { + "@hapi/address": "2.x.x", + "@hapi/bourne": "1.x.x", + "@hapi/hoek": "8.x.x", + "@hapi/topo": "3.x.x" + } + }, + "@hapi/topo": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-3.1.6.tgz", + "integrity": "sha512-tAag0jEcjwH+P2quUfipd7liWCNX2F8NvYjQp2wtInsZxnMlypdw0FtAOLxtvvkO+GSRRbmNi8m/5y42PQJYCQ==", + "requires": { + "@hapi/hoek": "^8.3.0" + } + }, + "@jest/console": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.9.0.tgz", + "integrity": "sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ==", + "requires": { + "@jest/source-map": "^24.9.0", + "chalk": "^2.0.1", + "slash": "^2.0.0" + } + }, + "@jest/core": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.9.0.tgz", + "integrity": "sha512-Fogg3s4wlAr1VX7q+rhV9RVnUv5tD7VuWfYy1+whMiWUrvl7U3QJSJyWcDio9Lq2prqYsZaeTv2Rz24pWGkJ2A==", + "requires": { + "@jest/console": "^24.7.1", + "@jest/reporters": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "graceful-fs": "^4.1.15", + "jest-changed-files": "^24.9.0", + "jest-config": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.9.0", + "jest-resolve-dependencies": "^24.9.0", + "jest-runner": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "jest-watcher": "^24.9.0", + "micromatch": "^3.1.10", + "p-each-series": "^1.0.0", + "realpath-native": "^1.1.0", + "rimraf": "^2.5.4", + "slash": "^2.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "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==" + } + } + }, + "@jest/environment": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.9.0.tgz", + "integrity": "sha512-5A1QluTPhvdIPFYnO3sZC3smkNeXPVELz7ikPbhUj0bQjB07EoE9qtLrem14ZUYWdVayYbsjVwIiL4WBIMV4aQ==", + "requires": { + "@jest/fake-timers": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0" + } + }, + "@jest/fake-timers": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.9.0.tgz", + "integrity": "sha512-eWQcNa2YSwzXWIMC5KufBh3oWRIijrQFROsIqt6v/NS9Io/gknw1jsAC9c+ih/RQX4A3O7SeWAhQeN0goKhT9A==", + "requires": { + "@jest/types": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-mock": "^24.9.0" + } + }, + "@jest/reporters": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.9.0.tgz", + "integrity": "sha512-mu4X0yjaHrffOsWmVLzitKmmmWSQ3GGuefgNscUSWNiUNcEOSEQk9k3pERKEQVBb0Cnn88+UESIsZEMH3o88Gw==", + "requires": { + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.2", + "istanbul-lib-coverage": "^2.0.2", + "istanbul-lib-instrument": "^3.0.1", + "istanbul-lib-report": "^2.0.4", + "istanbul-lib-source-maps": "^3.0.1", + "istanbul-reports": "^2.2.6", + "jest-haste-map": "^24.9.0", + "jest-resolve": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-util": "^24.9.0", + "jest-worker": "^24.6.0", + "node-notifier": "^5.4.2", + "slash": "^2.0.0", + "source-map": "^0.6.0", + "string-length": "^2.0.0" + } + }, + "@jest/source-map": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-24.9.0.tgz", + "integrity": "sha512-/Xw7xGlsZb4MJzNDgB7PW5crou5JqWiBQaz6xyPd3ArOg2nfn/PunV8+olXbbEZzNl591o5rWKE9BRDaFAuIBg==", + "requires": { + "callsites": "^3.0.0", + "graceful-fs": "^4.1.15", + "source-map": "^0.6.0" + } + }, + "@jest/test-result": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.9.0.tgz", + "integrity": "sha512-XEFrHbBonBJ8dGp2JmF8kP/nQI/ImPpygKHwQ/SY+es59Z3L5PI4Qb9TQQMAEeYsThG1xF0k6tmG0tIKATNiiA==", + "requires": { + "@jest/console": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/istanbul-lib-coverage": "^2.0.0" + } + }, + "@jest/test-sequencer": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.9.0.tgz", + "integrity": "sha512-6qqsU4o0kW1dvA95qfNog8v8gkRN9ph6Lz7r96IvZpHdNipP2cBcb07J1Z45mz/VIS01OHJ3pY8T5fUY38tg4A==", + "requires": { + "@jest/test-result": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-runner": "^24.9.0", + "jest-runtime": "^24.9.0" + } + }, + "@jest/transform": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.9.0.tgz", + "integrity": "sha512-TcQUmyNRxV94S0QpMOnZl0++6RMiqpbH/ZMccFB/amku6Uwvyb1cjYX7xkp5nGNkbX4QPH/FcB6q1HBTHynLmQ==", + "requires": { + "@babel/core": "^7.1.0", + "@jest/types": "^24.9.0", + "babel-plugin-istanbul": "^5.1.0", + "chalk": "^2.0.1", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.1.15", + "jest-haste-map": "^24.9.0", + "jest-regex-util": "^24.9.0", + "jest-util": "^24.9.0", + "micromatch": "^3.1.10", + "pirates": "^4.0.1", + "realpath-native": "^1.1.0", + "slash": "^2.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "2.4.1" + } + }, + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@material-ui/core": { + "version": "4.12.4", + "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.12.4.tgz", + "integrity": "sha512-tr7xekNlM9LjA6pagJmL8QCgZXaubWUwkJnoYcMKd4gw/t4XiyvnTkjdGrUVicyB2BsdaAv1tvow45bPM4sSwQ==", + "requires": { + "@babel/runtime": "^7.4.4", + "@material-ui/styles": "^4.11.5", + "@material-ui/system": "^4.12.2", + "@material-ui/types": "5.1.0", + "@material-ui/utils": "^4.11.3", + "@types/react-transition-group": "^4.2.0", + "clsx": "^1.0.4", + "hoist-non-react-statics": "^3.3.2", + "popper.js": "1.16.1-lts", + "prop-types": "^15.7.2", + "react-is": "^16.8.0 || ^17.0.0", + "react-transition-group": "^4.4.0" + }, + "dependencies": { + "popper.js": { + "version": "1.16.1-lts", + "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1-lts.tgz", + "integrity": "sha512-Kjw8nKRl1m+VrSFCoVGPph93W/qrSO7ZkqPpTf7F4bk/sqcfWK019dWBUpE/fBOsOQY1dks/Bmcbfn1heM/IsA==" + } + } + }, + "@material-ui/icons": { + "version": "4.11.3", + "resolved": "https://registry.npmjs.org/@material-ui/icons/-/icons-4.11.3.tgz", + "integrity": "sha512-IKHlyx6LDh8n19vzwH5RtHIOHl9Tu90aAAxcbWME6kp4dmvODM3UvOHJeMIDzUbd4muuJKHmlNoBN+mDY4XkBA==", + "requires": { + "@babel/runtime": "^7.4.4" + } + }, + "@material-ui/styles": { + "version": "4.11.5", + "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.11.5.tgz", + "integrity": "sha512-o/41ot5JJiUsIETME9wVLAJrmIWL3j0R0Bj2kCOLbSfqEkKf0fmaPt+5vtblUh5eXr2S+J/8J3DaCb10+CzPGA==", + "requires": { + "@babel/runtime": "^7.4.4", + "@emotion/hash": "^0.8.0", + "@material-ui/types": "5.1.0", + "@material-ui/utils": "^4.11.3", + "clsx": "^1.0.4", + "csstype": "^2.5.2", + "hoist-non-react-statics": "^3.3.2", + "jss": "^10.5.1", + "jss-plugin-camel-case": "^10.5.1", + "jss-plugin-default-unit": "^10.5.1", + "jss-plugin-global": "^10.5.1", + "jss-plugin-nested": "^10.5.1", + "jss-plugin-props-sort": "^10.5.1", + "jss-plugin-rule-value-function": "^10.5.1", + "jss-plugin-vendor-prefixer": "^10.5.1", + "prop-types": "^15.7.2" + } + }, + "@material-ui/system": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@material-ui/system/-/system-4.12.2.tgz", + "integrity": "sha512-6CSKu2MtmiJgcCGf6nBQpM8fLkuB9F55EKfbdTC80NND5wpTmKzwdhLYLH3zL4cLlK0gVaaltW7/wMuyTnN0Lw==", + "requires": { + "@babel/runtime": "^7.4.4", + "@material-ui/utils": "^4.11.3", + "csstype": "^2.5.2", + "prop-types": "^15.7.2" + } + }, + "@material-ui/types": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@material-ui/types/-/types-5.1.0.tgz", + "integrity": "sha512-7cqRjrY50b8QzRSYyhSpx4WRw2YuO0KKIGQEVk5J8uoz2BanawykgZGoWEqKm7pVIbzFDN0SpPcVV4IhOFkl8A==" + }, + "@material-ui/utils": { + "version": "4.11.3", + "resolved": "https://registry.npmjs.org/@material-ui/utils/-/utils-4.11.3.tgz", + "integrity": "sha512-ZuQPV4rBK/V1j2dIkSSEcH5uT6AaHuKWFfotADHsC0wVL1NLd2WkFCm4ZZbX33iO4ydl6V0GPngKm8HZQ2oujg==", + "requires": { + "@babel/runtime": "^7.4.4", + "prop-types": "^15.7.2", + "react-is": "^16.8.0 || ^17.0.0" + } + }, + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", + "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" + }, + "@sheerun/mutationobserver-shim": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.3.tgz", + "integrity": "sha512-DetpxZw1fzPD5xUBrIAoplLChO2VB8DlL5Gg+I1IR9b2wPqYIca2WSUxL5g1vLeR4MsQq1NeWriXAVffV+U1Fw==" + }, + "@svgr/babel-plugin-add-jsx-attribute": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.2.0.tgz", + "integrity": "sha512-j7KnilGyZzYr/jhcrSYS3FGWMZVaqyCG0vzMCwzvei0coIkczuYMcniK07nI0aHJINciujjH11T72ICW5eL5Ig==" + }, + "@svgr/babel-plugin-remove-jsx-attribute": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-4.2.0.tgz", + "integrity": "sha512-3XHLtJ+HbRCH4n28S7y/yZoEQnRpl0tvTZQsHqvaeNXPra+6vE5tbRliH3ox1yZYPCxrlqaJT/Mg+75GpDKlvQ==" + }, + "@svgr/babel-plugin-remove-jsx-empty-expression": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-4.2.0.tgz", + "integrity": "sha512-yTr2iLdf6oEuUE9MsRdvt0NmdpMBAkgK8Bjhl6epb+eQWk6abBaX3d65UZ3E3FWaOwePyUgNyNCMVG61gGCQ7w==" + }, + "@svgr/babel-plugin-replace-jsx-attribute-value": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-4.2.0.tgz", + "integrity": "sha512-U9m870Kqm0ko8beHawRXLGLvSi/ZMrl89gJ5BNcT452fAjtF2p4uRzXkdzvGJJJYBgx7BmqlDjBN/eCp5AAX2w==" + }, + "@svgr/babel-plugin-svg-dynamic-title": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-4.3.3.tgz", + "integrity": "sha512-w3Be6xUNdwgParsvxkkeZb545VhXEwjGMwExMVBIdPQJeyMQHqm9Msnb2a1teHBqUYL66qtwfhNkbj1iarCG7w==" + }, + "@svgr/babel-plugin-svg-em-dimensions": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-4.2.0.tgz", + "integrity": "sha512-C0Uy+BHolCHGOZ8Dnr1zXy/KgpBOkEUYY9kI/HseHVPeMbluaX3CijJr7D4C5uR8zrc1T64nnq/k63ydQuGt4w==" + }, + "@svgr/babel-plugin-transform-react-native-svg": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-4.2.0.tgz", + "integrity": "sha512-7YvynOpZDpCOUoIVlaaOUU87J4Z6RdD6spYN4eUb5tfPoKGSF9OG2NuhgYnq4jSkAxcpMaXWPf1cePkzmqTPNw==" + }, + "@svgr/babel-plugin-transform-svg-component": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-4.2.0.tgz", + "integrity": "sha512-hYfYuZhQPCBVotABsXKSCfel2slf/yvJY8heTVX1PCTaq/IgASq1IyxPPKJ0chWREEKewIU/JMSsIGBtK1KKxw==" + }, + "@svgr/babel-preset": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@svgr/babel-preset/-/babel-preset-4.3.3.tgz", + "integrity": "sha512-6PG80tdz4eAlYUN3g5GZiUjg2FMcp+Wn6rtnz5WJG9ITGEF1pmFdzq02597Hn0OmnQuCVaBYQE1OVFAnwOl+0A==", + "requires": { + "@svgr/babel-plugin-add-jsx-attribute": "^4.2.0", + "@svgr/babel-plugin-remove-jsx-attribute": "^4.2.0", + "@svgr/babel-plugin-remove-jsx-empty-expression": "^4.2.0", + "@svgr/babel-plugin-replace-jsx-attribute-value": "^4.2.0", + "@svgr/babel-plugin-svg-dynamic-title": "^4.3.3", + "@svgr/babel-plugin-svg-em-dimensions": "^4.2.0", + "@svgr/babel-plugin-transform-react-native-svg": "^4.2.0", + "@svgr/babel-plugin-transform-svg-component": "^4.2.0" + } + }, + "@svgr/core": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@svgr/core/-/core-4.3.3.tgz", + "integrity": "sha512-qNuGF1QON1626UCaZamWt5yedpgOytvLj5BQZe2j1k1B8DUG4OyugZyfEwBeXozCUwhLEpsrgPrE+eCu4fY17w==", + "requires": { + "@svgr/plugin-jsx": "^4.3.3", + "camelcase": "^5.3.1", + "cosmiconfig": "^5.2.1" + } + }, + "@svgr/hast-util-to-babel-ast": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-4.3.2.tgz", + "integrity": "sha512-JioXclZGhFIDL3ddn4Kiq8qEqYM2PyDKV0aYno8+IXTLuYt6TOgHUbUAAFvqtb0Xn37NwP0BTHglejFoYr8RZg==", + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@svgr/plugin-jsx": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@svgr/plugin-jsx/-/plugin-jsx-4.3.3.tgz", + "integrity": "sha512-cLOCSpNWQnDB1/v+SUENHH7a0XY09bfuMKdq9+gYvtuwzC2rU4I0wKGFEp1i24holdQdwodCtDQdFtJiTCWc+w==", + "requires": { + "@babel/core": "^7.4.5", + "@svgr/babel-preset": "^4.3.3", + "@svgr/hast-util-to-babel-ast": "^4.3.2", + "svg-parser": "^2.0.0" + } + }, + "@svgr/plugin-svgo": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@svgr/plugin-svgo/-/plugin-svgo-4.3.1.tgz", + "integrity": "sha512-PrMtEDUWjX3Ea65JsVCwTIXuSqa3CG9px+DluF1/eo9mlDrgrtFE7NE/DjdhjJgSM9wenlVBzkzneSIUgfUI/w==", + "requires": { + "cosmiconfig": "^5.2.1", + "merge-deep": "^3.0.2", + "svgo": "^1.2.2" + } + }, + "@svgr/webpack": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@svgr/webpack/-/webpack-4.3.3.tgz", + "integrity": "sha512-bjnWolZ6KVsHhgyCoYRFmbd26p8XVbulCzSG53BDQqAr+JOAderYK7CuYrB3bDjHJuF6LJ7Wrr42+goLRV9qIg==", + "requires": { + "@babel/core": "^7.4.5", + "@babel/plugin-transform-react-constant-elements": "^7.0.0", + "@babel/preset-env": "^7.4.5", + "@babel/preset-react": "^7.0.0", + "@svgr/core": "^4.3.3", + "@svgr/plugin-jsx": "^4.3.3", + "@svgr/plugin-svgo": "^4.3.1", + "loader-utils": "^1.2.3" + } + }, + "@testing-library/dom": { + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-6.16.0.tgz", + "integrity": "sha512-lBD88ssxqEfz0wFL6MeUyyWZfV/2cjEZZV3YRpb2IoJRej/4f1jB0TzqIOznTpfR1r34CNesrubxwIlAQ8zgPA==", + "requires": { + "@babel/runtime": "^7.8.4", + "@sheerun/mutationobserver-shim": "^0.3.2", + "@types/testing-library__dom": "^6.12.1", + "aria-query": "^4.0.2", + "dom-accessibility-api": "^0.3.0", + "pretty-format": "^25.1.0", + "wait-for-expect": "^3.0.2" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", + "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, + "@babel/runtime-corejs3": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.22.10.tgz", + "integrity": "sha512-IcixfV2Jl3UrqZX4c81+7lVg5++2ufYJyAFW3Aux/ZTvY6LVYYhJ9rMgnbX0zGVq6eqfVpnoatTjZdVki/GmWA==", + "requires": { + "core-js-pure": "^3.30.2", + "regenerator-runtime": "^0.14.0" + } + }, + "@jest/types": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", + "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^3.0.0" + } + }, + "@types/yargs": { + "version": "15.0.15", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.15.tgz", + "integrity": "sha512-IziEYMU9XoVj8hWg7k+UJrXALkGFjWJhn5QFEv9q4p+v40oZhSuC135M38st8XPjICL7Ey4TV64ferBGUoJhBg==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "aria-query": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz", + "integrity": "sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==", + "requires": { + "@babel/runtime": "^7.10.2", + "@babel/runtime-corejs3": "^7.10.2" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "core-js-pure": { + "version": "3.32.1", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.32.1.tgz", + "integrity": "sha512-f52QZwkFVDPf7UEQZGHKx6NYxsxmVGJe5DIvbzOdRMJlmT6yv0KDjR8rmy3ngr/t5wU54c7Sp/qIJH0ppbhVpQ==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "pretty-format": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz", + "integrity": "sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==", + "requires": { + "@jest/types": "^25.5.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" + } + }, + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@testing-library/jest-dom": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-4.2.4.tgz", + "integrity": "sha512-j31Bn0rQo12fhCWOUWy9fl7wtqkp7In/YP2p5ZFyRuiiB9Qs3g+hS4gAmDWONbAHcRmVooNJ5eOHQDCOmUFXHg==", + "requires": { + "@babel/runtime": "^7.5.1", + "chalk": "^2.4.1", + "css": "^2.2.3", + "css.escape": "^1.5.1", + "jest-diff": "^24.0.0", + "jest-matcher-utils": "^24.0.0", + "lodash": "^4.17.11", + "pretty-format": "^24.0.0", + "redent": "^3.0.0" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.7.tgz", + "integrity": "sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA==", + "requires": { + "regenerator-runtime": "^0.13.2" + } + } + } + }, + "@testing-library/react": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-9.5.0.tgz", + "integrity": "sha512-di1b+D0p+rfeboHO5W7gTVeZDIK5+maEgstrZbWZSSvxDyfDRkkyBE1AJR5Psd6doNldluXlCWqXriUfqu/9Qg==", + "requires": { + "@babel/runtime": "^7.8.4", + "@testing-library/dom": "^6.15.0", + "@types/testing-library__react": "^9.1.2" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", + "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + } + } + }, + "@testing-library/user-event": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-7.2.1.tgz", + "integrity": "sha512-oZ0Ib5I4Z2pUEcoo95cT1cr6slco9WY7yiPpG+RGNkj8YcYgJnM7pXmYmorNOReh8MIGcKSqXyeGjxnr8YiZbA==" + }, + "@types/babel__core": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.3.tgz", + "integrity": "sha512-8fBo0UR2CcwWxeX7WIIgJ7lXjasFxoYgRnFHUj+hRvKkpiBJbxhdAPTCY6/ZKM0uxANFVzt4yObSLuTiTnazDA==", + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.1.tgz", + "integrity": "sha512-bBKm+2VPJcMRVwNhxKu8W+5/zT7pwNEqeokFOmbvVSqGzFneNxYcEBro9Ac7/N9tlsaPYnZLK8J1LWKkMsLAew==", + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.2.tgz", + "integrity": "sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg==", + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.8.tgz", + "integrity": "sha512-yGeB2dHEdvxjP0y4UbRtQaSkXJ9649fYCmIdRoul5kfAoGCwxuCbMhag0k3RPfnuh9kPGm8x89btcfDEXdVWGw==", + "requires": { + "@babel/types": "^7.3.0" + } + }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==" + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==" + }, + "@types/istanbul-lib-report": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz", + "integrity": "sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg==", + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz", + "integrity": "sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA==", + "requires": { + "@types/istanbul-lib-coverage": "*", + "@types/istanbul-lib-report": "*" + } + }, + "@types/json-schema": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.3.tgz", + "integrity": "sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A==" + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" + }, + "@types/node": { + "version": "12.12.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.21.tgz", + "integrity": "sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA==" + }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" + }, + "@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + }, + "@types/q": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", + "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==" + }, + "@types/react": { + "version": "18.2.20", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.20.tgz", + "integrity": "sha512-WKNtmsLWJM/3D5mG4U84cysVY31ivmyw85dE84fOCk5Hx78wezB/XEjVPWl2JTZ5FkEeaTJf+VgUAUn3PE7Isw==", + "requires": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + }, + "dependencies": { + "csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + } + } + }, + "@types/react-dom": { + "version": "18.2.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.7.tgz", + "integrity": "sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA==", + "requires": { + "@types/react": "*" + } + }, + "@types/react-transition-group": { + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.6.tgz", + "integrity": "sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==", + "requires": { + "@types/react": "*" + } + }, + "@types/scheduler": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz", + "integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==" + }, + "@types/stack-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", + "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==" + }, + "@types/testing-library__dom": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@types/testing-library__dom/-/testing-library__dom-6.14.0.tgz", + "integrity": "sha512-sMl7OSv0AvMOqn1UJ6j1unPMIHRXen0Ita1ujnMX912rrOcawe4f7wu0Zt9GIQhBhJvH2BaibqFgQ3lP+Pj2hA==", + "requires": { + "pretty-format": "^24.3.0" + } + }, + "@types/testing-library__react": { + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@types/testing-library__react/-/testing-library__react-9.1.3.tgz", + "integrity": "sha512-iCdNPKU3IsYwRK9JieSYAiX0+aYDXOGAmrC/3/M7AqqSDKnWWVv07X+Zk1uFSL7cMTUYzv4lQRfohucEocn5/w==", + "requires": { + "@types/react-dom": "*", + "@types/testing-library__dom": "*", + "pretty-format": "^25.1.0" + }, + "dependencies": { + "@jest/types": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", + "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^3.0.0" + } + }, + "@types/yargs": { + "version": "15.0.15", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.15.tgz", + "integrity": "sha512-IziEYMU9XoVj8hWg7k+UJrXALkGFjWJhn5QFEv9q4p+v40oZhSuC135M38st8XPjICL7Ey4TV64ferBGUoJhBg==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "pretty-format": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz", + "integrity": "sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==", + "requires": { + "@jest/types": "^25.5.0", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@types/yargs": { + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.3.tgz", + "integrity": "sha512-K8/LfZq2duW33XW/tFwEAfnZlqIfVsoyRB3kfXdPXYhl0nfM8mmh7GS0jg7WrX2Dgq/0Ha/pR1PaR+BvmWwjiQ==", + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-13.1.0.tgz", + "integrity": "sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg==" + }, + "@typescript-eslint/eslint-plugin": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.10.0.tgz", + "integrity": "sha512-rT51fNLW0u3fnDGnAHVC5nu+Das+y2CpW10yqvf6/j5xbuUV3FxA3mBaIbM24CXODXjbgUznNb4Kg9XZOUxKAw==", + "requires": { + "@typescript-eslint/experimental-utils": "2.10.0", + "eslint-utils": "^1.4.3", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.10.0.tgz", + "integrity": "sha512-FZhWq6hWWZBP76aZ7bkrfzTMP31CCefVIImrwP3giPLcoXocmLTmr92NLZxuIcTL4GTEOE33jQMWy9PwelL+yQ==", + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.10.0", + "eslint-scope": "^5.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.10.0.tgz", + "integrity": "sha512-wQNiBokcP5ZsTuB+i4BlmVWq6o+oAhd8en2eSm/EE9m7BgZUIfEeYFd6z3S+T7bgNuloeiHA1/cevvbBDLr98g==", + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "2.10.0", + "@typescript-eslint/typescript-estree": "2.10.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.10.0.tgz", + "integrity": "sha512-oOYnplddQNm/LGVkqbkAwx4TIBuuZ36cAQq9v3nFIU9FmhemHuVzAesMSXNQDdAzCa5bFgCrfD3JWhYVKlRN2g==", + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash.unescape": "4.0.1", + "semver": "^6.3.0", + "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "@webassemblyjs/ast": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", + "integrity": "sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ==", + "requires": { + "@webassemblyjs/helper-module-context": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/wast-parser": "1.8.5" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz", + "integrity": "sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ==" + }, + "@webassemblyjs/helper-api-error": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz", + "integrity": "sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA==" + }, + "@webassemblyjs/helper-buffer": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz", + "integrity": "sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q==" + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz", + "integrity": "sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ==", + "requires": { + "@webassemblyjs/wast-printer": "1.8.5" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz", + "integrity": "sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow==" + }, + "@webassemblyjs/helper-module-context": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz", + "integrity": "sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g==", + "requires": { + "@webassemblyjs/ast": "1.8.5", + "mamacro": "^0.0.3" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz", + "integrity": "sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ==" + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz", + "integrity": "sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA==", + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz", + "integrity": "sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g==", + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.8.5.tgz", + "integrity": "sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A==", + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.8.5.tgz", + "integrity": "sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw==" + }, + "@webassemblyjs/wasm-edit": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz", + "integrity": "sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q==", + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/helper-wasm-section": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5", + "@webassemblyjs/wasm-opt": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5", + "@webassemblyjs/wast-printer": "1.8.5" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz", + "integrity": "sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg==", + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/ieee754": "1.8.5", + "@webassemblyjs/leb128": "1.8.5", + "@webassemblyjs/utf8": "1.8.5" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz", + "integrity": "sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q==", + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz", + "integrity": "sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw==", + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-api-error": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/ieee754": "1.8.5", + "@webassemblyjs/leb128": "1.8.5", + "@webassemblyjs/utf8": "1.8.5" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz", + "integrity": "sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg==", + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/floating-point-hex-parser": "1.8.5", + "@webassemblyjs/helper-api-error": "1.8.5", + "@webassemblyjs/helper-code-frame": "1.8.5", + "@webassemblyjs/helper-fsm": "1.8.5", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz", + "integrity": "sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg==", + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/wast-parser": "1.8.5", + "@xtuc/long": "4.2.2" + } + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==" + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==" + }, + "abab": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", + "integrity": "sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg==" + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "acorn": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", + "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==" + }, + "acorn-globals": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", + "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==", + "requires": { + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + }, + "dependencies": { + "acorn": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", + "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==" + } + } + }, + "acorn-jsx": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", + "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==" + }, + "acorn-walk": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", + "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==" + }, + "address": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/address/-/address-1.1.2.tgz", + "integrity": "sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA==" + }, + "adjust-sourcemap-loader": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-2.0.0.tgz", + "integrity": "sha512-4hFsTsn58+YjrU9qKzML2JSSDqKvN8mUGQ0nNIrfPi8hmIONT4L3uUaT6MKdMsZ9AjsU6D2xDkZxCkbQPxChrA==", + "requires": { + "assert": "1.4.1", + "camelcase": "5.0.0", + "loader-utils": "1.2.3", + "object-path": "0.11.4", + "regex-parser": "2.2.10" + }, + "dependencies": { + "camelcase": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" + } + } + }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-errors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", + "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==" + }, + "ajv-keywords": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", + "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==" + }, + "alphanum-sort": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", + "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=" + }, + "ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==" + }, + "ansi-escapes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.0.tgz", + "integrity": "sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg==", + "requires": { + "type-fest": "^0.8.1" + } + }, + "ansi-html": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", + "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=" + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "ansi-styles": { + "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==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "aria-query": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-3.0.0.tgz", + "integrity": "sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w=", + "requires": { + "ast-types-flow": "0.0.7", + "commander": "^2.11.0" + } + }, + "arity-n": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arity-n/-/arity-n-1.0.4.tgz", + "integrity": "sha1-2edrEXM+CFacCEeuezmyhgswt0U=" + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + }, + "array-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=" + }, + "array-flatten": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", + "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==" + }, + "array-includes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.0.tgz", + "integrity": "sha512-ONOEQoKrvXPKk7Su92Co0YMqYO32FfqJTzkKU9u2UpIXyYZIzLSvpdg4AwvSw4mSUW0czu6inK+zby6Oj6gDjQ==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.0" + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "requires": { + "util": "0.10.3" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + }, + "ast-types-flow": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", + "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=" + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==" + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" + }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + }, + "autoprefixer": { + "version": "9.7.3", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.7.3.tgz", + "integrity": "sha512-8T5Y1C5Iyj6PgkPSFd0ODvK9DIleuPKUPYniNxybS47g2k2wFgLZ46lGQHlBuGKIAEV8fbCDfKCCRS1tvOgc3Q==", + "requires": { + "browserslist": "^4.8.0", + "caniuse-lite": "^1.0.30001012", + "chalk": "^2.4.2", + "normalize-range": "^0.1.2", + "num2fraction": "^1.2.2", + "postcss": "^7.0.23", + "postcss-value-parser": "^4.0.2" + } + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.0.tgz", + "integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==" + }, + "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": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + } + } + }, + "axobject-query": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.1.1.tgz", + "integrity": "sha512-lF98xa/yvy6j3fBHAgQXIYl+J4eZadOSqsPojemUqClzNbBV38wWGpUbQbVEyf4eUF5yF7eHmGgGA2JiHyjeqw==", + "requires": { + "@babel/runtime": "^7.7.4", + "@babel/runtime-corejs3": "^7.7.4" + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "babel-eslint": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.3.tgz", + "integrity": "sha512-z3U7eMY6r/3f3/JB9mTsLjyxrv0Yb1zb8PCWCLpguxfCzBIZUwy23R1t/XKewP+8mEN2Ck8Dtr4q20z6ce6SoA==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.0.0", + "@babel/traverse": "^7.0.0", + "@babel/types": "^7.0.0", + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" + } + }, + "babel-extract-comments": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/babel-extract-comments/-/babel-extract-comments-1.0.0.tgz", + "integrity": "sha512-qWWzi4TlddohA91bFwgt6zO/J0X+io7Qp184Fw0m2JYRSTZnJbFR8+07KmzudHCZgOiKRCrjhylwv9Xd8gfhVQ==", + "requires": { + "babylon": "^6.18.0" + } + }, + "babel-jest": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.9.0.tgz", + "integrity": "sha512-ntuddfyiN+EhMw58PTNL1ph4C9rECiQXjI4nMMBKBaNjXvqLdkXpPRcMSr4iyBrJg/+wz9brFUD6RhOAT6r4Iw==", + "requires": { + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/babel__core": "^7.1.0", + "babel-plugin-istanbul": "^5.1.0", + "babel-preset-jest": "^24.9.0", + "chalk": "^2.4.2", + "slash": "^2.0.0" + } + }, + "babel-loader": { + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.6.tgz", + "integrity": "sha512-4BmWKtBOBm13uoUwd08UwjZlaw3O9GWf456R9j+5YykFZ6LUIjIKLc0zEZf+hauxPOJs96C8k6FvYD09vWzhYw==", + "requires": { + "find-cache-dir": "^2.0.0", + "loader-utils": "^1.0.2", + "mkdirp": "^0.5.1", + "pify": "^4.0.1" + } + }, + "babel-plugin-dynamic-import-node": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz", + "integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==", + "requires": { + "object.assign": "^4.1.0" + } + }, + "babel-plugin-istanbul": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz", + "integrity": "sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "find-up": "^3.0.0", + "istanbul-lib-instrument": "^3.3.0", + "test-exclude": "^5.2.3" + } + }, + "babel-plugin-jest-hoist": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.9.0.tgz", + "integrity": "sha512-2EMA2P8Vp7lG0RAzr4HXqtYwacfMErOuv1U3wrvxHX6rD1sV6xS3WXG3r8TRQ2r6w8OhvSdWt+z41hQNwNm3Xw==", + "requires": { + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-plugin-macros": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.7.1.tgz", + "integrity": "sha512-HNM284amlKSQ6FddI4jLXD+XTqF0cTYOe5uemOIZxHJHnamC+OhFQ57rMF9sgnYhkJQptVl9U1SKVZsV9/GLQQ==", + "requires": { + "@babel/runtime": "^7.7.2", + "cosmiconfig": "^6.0.0", + "resolve": "^1.12.0" + }, + "dependencies": { + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + } + } + }, + "babel-plugin-named-asset-import": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.5.tgz", + "integrity": "sha512-sGhfINU+AuMw9oFAdIn/nD5sem3pn/WgxAfDZ//Q3CnF+5uaho7C7shh2rKLk6sKE/XkfmyibghocwKdVjLIKg==" + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=" + }, + "babel-plugin-transform-object-rest-spread": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", + "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "requires": { + "babel-plugin-syntax-object-rest-spread": "^6.8.0", + "babel-runtime": "^6.26.0" + } + }, + "babel-plugin-transform-react-remove-prop-types": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz", + "integrity": "sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA==" + }, + "babel-preset-jest": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.9.0.tgz", + "integrity": "sha512-izTUuhE4TMfTRPF92fFwD2QfdXaZW08qvWTFCI51V8rW5x00UuPgc3ajRoWofXOuxjfcOM5zzSYsQS3H8KGCAg==", + "requires": { + "@babel/plugin-syntax-object-rest-spread": "^7.0.0", + "babel-plugin-jest-hoist": "^24.9.0" + } + }, + "babel-preset-react-app": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/babel-preset-react-app/-/babel-preset-react-app-9.1.0.tgz", + "integrity": "sha512-0qMOv/pCcCQWxX1eNyKD9GlzZTdzZIK/Pq3O6TGe65tZSJTSplw1pFlaPujm0GjBj4g3GeCQbP08vvzlH7OGHg==", + "requires": { + "@babel/core": "7.7.4", + "@babel/plugin-proposal-class-properties": "7.7.4", + "@babel/plugin-proposal-decorators": "7.7.4", + "@babel/plugin-proposal-nullish-coalescing-operator": "7.7.4", + "@babel/plugin-proposal-numeric-separator": "7.7.4", + "@babel/plugin-proposal-object-rest-spread": "7.7.4", + "@babel/plugin-proposal-optional-chaining": "7.7.4", + "@babel/plugin-syntax-dynamic-import": "7.7.4", + "@babel/plugin-transform-destructuring": "7.7.4", + "@babel/plugin-transform-flow-strip-types": "7.7.4", + "@babel/plugin-transform-react-display-name": "7.7.4", + "@babel/plugin-transform-runtime": "7.7.4", + "@babel/preset-env": "7.7.4", + "@babel/preset-react": "7.7.4", + "@babel/preset-typescript": "7.7.4", + "@babel/runtime": "7.7.4", + "babel-plugin-dynamic-import-node": "2.3.0", + "babel-plugin-macros": "2.7.1", + "babel-plugin-transform-react-remove-prop-types": "0.4.24" + }, + "dependencies": { + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.4.tgz", + "integrity": "sha512-rnpnZR3/iWKmiQyJ3LKJpSwLDcX/nSXhdLk4Aq/tXOApIvyu7qoabrige0ylsAJffaUC51WiBu209Q0U+86OWQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-object-rest-spread": "^7.7.4" + } + }, + "@babel/preset-env": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.7.4.tgz", + "integrity": "sha512-Dg+ciGJjwvC1NIe/DGblMbcGq1HOtKbw8RLl4nIjlfcILKEOkWT/vRqPpumswABEBVudii6dnVwrBtzD7ibm4g==", + "requires": { + "@babel/helper-module-imports": "^7.7.4", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-async-generator-functions": "^7.7.4", + "@babel/plugin-proposal-dynamic-import": "^7.7.4", + "@babel/plugin-proposal-json-strings": "^7.7.4", + "@babel/plugin-proposal-object-rest-spread": "^7.7.4", + "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.7.4", + "@babel/plugin-syntax-async-generators": "^7.7.4", + "@babel/plugin-syntax-dynamic-import": "^7.7.4", + "@babel/plugin-syntax-json-strings": "^7.7.4", + "@babel/plugin-syntax-object-rest-spread": "^7.7.4", + "@babel/plugin-syntax-optional-catch-binding": "^7.7.4", + "@babel/plugin-syntax-top-level-await": "^7.7.4", + "@babel/plugin-transform-arrow-functions": "^7.7.4", + "@babel/plugin-transform-async-to-generator": "^7.7.4", + "@babel/plugin-transform-block-scoped-functions": "^7.7.4", + "@babel/plugin-transform-block-scoping": "^7.7.4", + "@babel/plugin-transform-classes": "^7.7.4", + "@babel/plugin-transform-computed-properties": "^7.7.4", + "@babel/plugin-transform-destructuring": "^7.7.4", + "@babel/plugin-transform-dotall-regex": "^7.7.4", + "@babel/plugin-transform-duplicate-keys": "^7.7.4", + "@babel/plugin-transform-exponentiation-operator": "^7.7.4", + "@babel/plugin-transform-for-of": "^7.7.4", + "@babel/plugin-transform-function-name": "^7.7.4", + "@babel/plugin-transform-literals": "^7.7.4", + "@babel/plugin-transform-member-expression-literals": "^7.7.4", + "@babel/plugin-transform-modules-amd": "^7.7.4", + "@babel/plugin-transform-modules-commonjs": "^7.7.4", + "@babel/plugin-transform-modules-systemjs": "^7.7.4", + "@babel/plugin-transform-modules-umd": "^7.7.4", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", + "@babel/plugin-transform-new-target": "^7.7.4", + "@babel/plugin-transform-object-super": "^7.7.4", + "@babel/plugin-transform-parameters": "^7.7.4", + "@babel/plugin-transform-property-literals": "^7.7.4", + "@babel/plugin-transform-regenerator": "^7.7.4", + "@babel/plugin-transform-reserved-words": "^7.7.4", + "@babel/plugin-transform-shorthand-properties": "^7.7.4", + "@babel/plugin-transform-spread": "^7.7.4", + "@babel/plugin-transform-sticky-regex": "^7.7.4", + "@babel/plugin-transform-template-literals": "^7.7.4", + "@babel/plugin-transform-typeof-symbol": "^7.7.4", + "@babel/plugin-transform-unicode-regex": "^7.7.4", + "@babel/types": "^7.7.4", + "browserslist": "^4.6.0", + "core-js-compat": "^3.1.1", + "invariant": "^2.2.2", + "js-levenshtein": "^1.1.3", + "semver": "^5.5.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "core-js": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + } + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + } + } + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" + }, + "batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==" + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + } + } + }, + "bonjour": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz", + "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", + "requires": { + "array-flatten": "^2.1.0", + "deep-equal": "^1.0.1", + "dns-equal": "^1.0.0", + "dns-txt": "^2.0.2", + "multicast-dns": "^6.0.1", + "multicast-dns-service-types": "^1.1.0" + } + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" + }, + "bootstrap": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.1.tgz", + "integrity": "sha512-jzwza3Yagduci2x0rr9MeFSORjcHpt0lRZukZPZQJT1Dth5qzV7XcgGqYzi39KGAVYR8QEDVoO0ubFKOxzMG+g==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browser-process-hrtime": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", + "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==" + }, + "browser-resolve": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" + } + } + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "requires": { + "pako": "~1.0.5" + } + }, + "browserslist": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.8.2.tgz", + "integrity": "sha512-+M4oeaTplPm/f1pXDw84YohEv7B1i/2Aisei8s4s6k3QsoSHa7i5sz8u/cGQkkatCPxMASKxPualR4wwYgVboA==", + "requires": { + "caniuse-lite": "^1.0.30001015", + "electron-to-chromium": "^1.3.322", + "node-releases": "^1.1.42" + } + }, + "bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + }, + "buffer-indexof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz", + "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==" + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "cacache": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz", + "integrity": "sha512-5ZvAxd05HDDU+y9BVvcqYu2LLXmPnQ0hW62h32g4xBTgL/MppR4/04NHfj/ycM2y6lmTnbw6HVi+1eN0Psba6w==", + "requires": { + "chownr": "^1.1.2", + "figgy-pudding": "^3.5.1", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.2", + "infer-owner": "^1.0.4", + "lru-cache": "^5.1.1", + "minipass": "^3.0.0", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "p-map": "^3.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^2.7.1", + "ssri": "^7.0.0", + "unique-filename": "^1.1.1" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" + }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "requires": { + "callsites": "^2.0.0" + }, + "dependencies": { + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=" + } + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + }, + "camel-case": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", + "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", + "requires": { + "no-case": "^2.2.0", + "upper-case": "^1.1.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "caniuse-api": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", + "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==", + "requires": { + "browserslist": "^4.0.0", + "caniuse-lite": "^1.0.0", + "lodash.memoize": "^4.1.2", + "lodash.uniq": "^4.5.0" + } + }, + "caniuse-lite": { + "version": "1.0.30001016", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001016.tgz", + "integrity": "sha512-yYQ2QfotceRiH4U+h1Us86WJXtVHDmy3nEKIdYPsZCYnOV5/tMgGbmoIlrMzmh2VXlproqYtVaKeGDBkMZifFA==" + }, + "capture-exit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", + "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", + "requires": { + "rsvp": "^4.8.4" + } + }, + "case-sensitive-paths-webpack-plugin": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.2.0.tgz", + "integrity": "sha512-u5ElzokS8A1pm9vM3/iDgTcI3xqHxuCao94Oz8etI3cf0Tio0p8izkDYbTIn09uP3yUUr6+veaE6IkjnTYS46g==" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "dependencies": { + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "^2.1.0" + } + } + } + } + } + }, + "chownr": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.3.tgz", + "integrity": "sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==" + }, + "chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "requires": { + "tslib": "^1.9.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "clean-css": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.1.tgz", + "integrity": "sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g==", + "requires": { + "source-map": "~0.6.0" + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "clone-deep": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-0.2.4.tgz", + "integrity": "sha1-TnPdCen7lxzDhnDF3O2cGJZIHMY=", + "requires": { + "for-own": "^0.1.3", + "is-plain-object": "^2.0.1", + "kind-of": "^3.0.2", + "lazy-cache": "^1.0.3", + "shallow-clone": "^0.1.2" + } + }, + "clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "coa": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", + "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", + "requires": { + "@types/q": "^1.5.1", + "chalk": "^2.4.1", + "q": "^1.1.2" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/color/-/color-3.1.2.tgz", + "integrity": "sha512-vXTJhHebByxZn3lDvDJYw4lR5+uB3vuoHsuYA5AKuxRVn5wzzIfQKGLBmgdVRHKTJYeK5rvJcHnrd0Li49CFpg==", + "requires": { + "color-convert": "^1.9.1", + "color-string": "^1.5.2" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "color-string": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz", + "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "common-tags": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", + "integrity": "sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw==" + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + }, + "compose-function": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/compose-function/-/compose-function-3.0.3.tgz", + "integrity": "sha1-ntZ18TzFRQHTCVCkhv9qe6OrGF8=", + "requires": { + "arity-n": "^1.0.4" + } + }, + "compressible": { + "version": "2.0.17", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.17.tgz", + "integrity": "sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw==", + "requires": { + "mime-db": ">= 1.40.0 < 2" + } + }, + "compression": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "requires": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "confusing-browser-globals": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz", + "integrity": "sha512-KbS1Y0jMtyPgIxjO7ZzMAuUpAKMt1SzCL9fsrKsX6b0zJPTaT0SiSPmewwVZg9UAO83HVIlEhZF84LIjZ0lmAw==" + }, + "connect-history-api-fallback": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", + "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==" + }, + "console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==" + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=" + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=" + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "requires": { + "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + }, + "core-js": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.0.tgz", + "integrity": "sha512-AHPTNKzyB+YwgDWoSOCaid9PUSEF6781vsfiK8qUz62zRR448/XgK2NtCbpiUGizbep8Lrpt0Du19PpGGZvw3Q==" + }, + "core-js-compat": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.0.tgz", + "integrity": "sha512-Z3eCNjGgoYluH89Jt4wVkfYsc/VdLrA2/woX5lm0isO/pCT+P+Y+o65bOuEnjDJLthdwTBxbCVzptTXtc18fJg==", + "requires": { + "browserslist": "^4.8.2", + "semver": "7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==" + } + } + }, + "core-js-pure": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.0.tgz", + "integrity": "sha512-+YSSo7UFDFuVvMUr1HVFYArb22pYIKRDISBo6V50kRuS0MsXgsuDWmJYFu6dJsJupr77S486xRnDkr/BWQQonw==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "css": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", + "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==", + "requires": { + "inherits": "^2.0.3", + "source-map": "^0.6.1", + "source-map-resolve": "^0.5.2", + "urix": "^0.1.0" + } + }, + "css-blank-pseudo": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/css-blank-pseudo/-/css-blank-pseudo-0.1.4.tgz", + "integrity": "sha512-LHz35Hr83dnFeipc7oqFDmsjHdljj3TQtxGGiNWSOsTLIAubSm4TEz8qCaKFpk7idaQ1GfWscF4E6mgpBysA1w==", + "requires": { + "postcss": "^7.0.5" + } + }, + "css-color-names": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", + "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=" + }, + "css-declaration-sorter": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz", + "integrity": "sha512-BcxQSKTSEEQUftYpBVnsH4SF05NTuBokb19/sBt6asXGKZ/6VP7PLG1CBCkFDYOnhXhPh0jMhO6xZ71oYHXHBA==", + "requires": { + "postcss": "^7.0.1", + "timsort": "^0.3.0" + } + }, + "css-has-pseudo": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/css-has-pseudo/-/css-has-pseudo-0.10.0.tgz", + "integrity": "sha512-Z8hnfsZu4o/kt+AuFzeGpLVhFOGO9mluyHBaA2bA8aCGTwah5sT3WV/fTHH8UNZUytOIImuGPrl/prlb4oX4qQ==", + "requires": { + "postcss": "^7.0.6", + "postcss-selector-parser": "^5.0.0-rc.4" + }, + "dependencies": { + "cssesc": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", + "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" + }, + "postcss-selector-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", + "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", + "requires": { + "cssesc": "^2.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "css-loader": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-3.2.0.tgz", + "integrity": "sha512-QTF3Ud5H7DaZotgdcJjGMvyDj5F3Pn1j/sC6VBEOVp94cbwqyIBdcs/quzj4MC1BKQSrTpQznegH/5giYbhnCQ==", + "requires": { + "camelcase": "^5.3.1", + "cssesc": "^3.0.0", + "icss-utils": "^4.1.1", + "loader-utils": "^1.2.3", + "normalize-path": "^3.0.0", + "postcss": "^7.0.17", + "postcss-modules-extract-imports": "^2.0.0", + "postcss-modules-local-by-default": "^3.0.2", + "postcss-modules-scope": "^2.1.0", + "postcss-modules-values": "^3.0.0", + "postcss-value-parser": "^4.0.0", + "schema-utils": "^2.0.0" + } + }, + "css-prefers-color-scheme": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/css-prefers-color-scheme/-/css-prefers-color-scheme-3.1.1.tgz", + "integrity": "sha512-MTu6+tMs9S3EUqzmqLXEcgNRbNkkD/TGFvowpeoWJn5Vfq7FMgsmRQs9X5NXAURiOBmOxm/lLjsDNXDE6k9bhg==", + "requires": { + "postcss": "^7.0.5" + } + }, + "css-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.1.0.tgz", + "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==", + "requires": { + "boolbase": "^1.0.0", + "css-what": "^3.2.1", + "domutils": "^1.7.0", + "nth-check": "^1.0.2" + } + }, + "css-select-base-adapter": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", + "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==" + }, + "css-tree": { + "version": "1.0.0-alpha.37", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", + "integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==", + "requires": { + "mdn-data": "2.0.4", + "source-map": "^0.6.1" + } + }, + "css-unit-converter": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.1.tgz", + "integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=" + }, + "css-vendor": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/css-vendor/-/css-vendor-2.0.8.tgz", + "integrity": "sha512-x9Aq0XTInxrkuFeHKbYC7zWY8ai7qJ04Kxd9MnvbC1uO5DagxoHQjm4JvG+vCdXOoFtCjbL2XSZfxmoYa9uQVQ==", + "requires": { + "@babel/runtime": "^7.8.3", + "is-in-browser": "^1.0.2" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", + "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + } + } + }, + "css-what": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.2.1.tgz", + "integrity": "sha512-WwOrosiQTvyms+Ti5ZC5vGEK0Vod3FTt1ca+payZqvKuGJF+dq7bG63DstxtN0dpm6FxY27a/zS3Wten+gEtGw==" + }, + "css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s=" + }, + "cssdb": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-4.4.0.tgz", + "integrity": "sha512-LsTAR1JPEM9TpGhl/0p3nQecC2LJ0kD8X5YARu1hk/9I1gril5vDtMZyNxcEpxxDj34YNck/ucjuoUd66K03oQ==" + }, + "cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==" + }, + "cssnano": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz", + "integrity": "sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==", + "requires": { + "cosmiconfig": "^5.0.0", + "cssnano-preset-default": "^4.0.7", + "is-resolvable": "^1.0.0", + "postcss": "^7.0.0" + } + }, + "cssnano-preset-default": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz", + "integrity": "sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA==", + "requires": { + "css-declaration-sorter": "^4.0.1", + "cssnano-util-raw-cache": "^4.0.1", + "postcss": "^7.0.0", + "postcss-calc": "^7.0.1", + "postcss-colormin": "^4.0.3", + "postcss-convert-values": "^4.0.1", + "postcss-discard-comments": "^4.0.2", + "postcss-discard-duplicates": "^4.0.2", + "postcss-discard-empty": "^4.0.1", + "postcss-discard-overridden": "^4.0.1", + "postcss-merge-longhand": "^4.0.11", + "postcss-merge-rules": "^4.0.3", + "postcss-minify-font-values": "^4.0.2", + "postcss-minify-gradients": "^4.0.2", + "postcss-minify-params": "^4.0.2", + "postcss-minify-selectors": "^4.0.2", + "postcss-normalize-charset": "^4.0.1", + "postcss-normalize-display-values": "^4.0.2", + "postcss-normalize-positions": "^4.0.2", + "postcss-normalize-repeat-style": "^4.0.2", + "postcss-normalize-string": "^4.0.2", + "postcss-normalize-timing-functions": "^4.0.2", + "postcss-normalize-unicode": "^4.0.1", + "postcss-normalize-url": "^4.0.1", + "postcss-normalize-whitespace": "^4.0.2", + "postcss-ordered-values": "^4.1.2", + "postcss-reduce-initial": "^4.0.3", + "postcss-reduce-transforms": "^4.0.2", + "postcss-svgo": "^4.0.2", + "postcss-unique-selectors": "^4.0.1" + } + }, + "cssnano-util-get-arguments": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz", + "integrity": "sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8=" + }, + "cssnano-util-get-match": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz", + "integrity": "sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0=" + }, + "cssnano-util-raw-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz", + "integrity": "sha512-qLuYtWK2b2Dy55I8ZX3ky1Z16WYsx544Q0UWViebptpwn/xDBmog2TLg4f+DBMg1rJ6JDWtn96WHbOKDWt1WQA==", + "requires": { + "postcss": "^7.0.0" + } + }, + "cssnano-util-same-parent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz", + "integrity": "sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q==" + }, + "csso": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.0.2.tgz", + "integrity": "sha512-kS7/oeNVXkHWxby5tHVxlhjizRCSv8QdU7hB2FpdAibDU8FjTAolhNjKNTiLzXtUrKT6HwClE81yXwEk1309wg==", + "requires": { + "css-tree": "1.0.0-alpha.37" + } + }, + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" + }, + "cssstyle": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.4.0.tgz", + "integrity": "sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA==", + "requires": { + "cssom": "0.3.x" + } + }, + "csstype": { + "version": "2.6.21", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.21.tgz", + "integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==" + }, + "cyclist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=" + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "damerau-levenshtein": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.5.tgz", + "integrity": "sha512-CBCRqFnpu715iPmw1KrdOrzRqbdFwQTwAWyyyYS42+iAgHCuXZ+/TdMgQkUENPomxEz9z1BEzuQU2Xw0kUuAgA==" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "data-urls": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", + "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", + "requires": { + "abab": "^2.0.0", + "whatwg-mimetype": "^2.2.0", + "whatwg-url": "^7.0.0" + }, + "dependencies": { + "whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + } + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + "deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + }, + "default-gateway": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz", + "integrity": "sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA==", + "requires": { + "execa": "^1.0.0", + "ip-regex": "^2.1.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + } + } + }, + "del": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", + "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", + "requires": { + "@types/glob": "^7.1.1", + "globby": "^6.1.0", + "is-path-cwd": "^2.0.0", + "is-path-in-cwd": "^2.0.0", + "p-map": "^2.0.0", + "pify": "^4.0.1", + "rimraf": "^2.6.3" + }, + "dependencies": { + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==" + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=" + }, + "detect-node": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", + "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==" + }, + "detect-port-alt": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/detect-port-alt/-/detect-port-alt-1.1.6.tgz", + "integrity": "sha512-5tQykt+LqfJFBEYaDITx7S7cR7mJ/zQmLXZ2qt5w04ainYZw6tBf9dBunMjVeVOdYVRUzUOE4HkY5J7+uttb5Q==", + "requires": { + "address": "^1.0.1", + "debug": "^2.6.0" + } + }, + "diff-sequences": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.9.0.tgz", + "integrity": "sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew==" + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "requires": { + "arrify": "^1.0.1", + "path-type": "^3.0.0" + } + }, + "dns-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", + "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=" + }, + "dns-packet": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", + "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", + "requires": { + "ip": "^1.1.0", + "safe-buffer": "^5.0.1" + } + }, + "dns-txt": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dns-txt/-/dns-txt-2.0.2.tgz", + "integrity": "sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY=", + "requires": { + "buffer-indexof": "^1.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "requires": { + "esutils": "^2.0.2" + } + }, + "dom-accessibility-api": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.3.0.tgz", + "integrity": "sha512-PzwHEmsRP3IGY4gv/Ug+rMeaTIyTJvadCb+ujYXYeIylbHJezIyNToe8KfEgHTCEYyC+/bUghYOGg8yMGlZ6vA==" + }, + "dom-converter": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", + "integrity": "sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==", + "requires": { + "utila": "~0.4" + } + }, + "dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "requires": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", + "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, + "csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + }, + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + } + } + }, + "dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "requires": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", + "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==" + } + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==" + }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" + }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "requires": { + "webidl-conversions": "^4.0.2" + } + }, + "domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "requires": { + "is-obj": "^1.0.0" + } + }, + "dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" + }, + "dotenv-expand": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz", + "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==" + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "electron-to-chromium": { + "version": "1.3.322", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.322.tgz", + "integrity": "sha512-Tc8JQEfGQ1MzfSzI/bTlSr7btJv/FFO7Yh6tanqVmIWOuNCu6/D1MilIEgLtmWqIrsv+o4IjpLAhgMBr/ncNAA==" + }, + "elliptic": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz", + "integrity": "sha512-98p2zE+rL7/g/DzMHMTF4zZlCgeVdJ7yr6xzEpJRYwFYrGi9ANdn5DnJURg6RpBkyk60XYDnWIv51VfIhfNGuA==", + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + }, + "dependencies": { + "memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", + "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==" + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.17.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0-next.1.tgz", + "integrity": "sha512-7MmGr03N7Rnuid6+wyhD9sHNE2n4tFSwExnU2lQl3lIo2ShXWGePY80zYaoMOmILWv57H0amMjZGHNzzGG70Rw==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.0", + "string.prototype.trimright": "^2.1.0" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "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=" + }, + "escodegen": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.12.0.tgz", + "integrity": "sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg==", + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" + } + } + }, + "eslint": { + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.7.2.tgz", + "integrity": "sha512-qMlSWJaCSxDFr8fBPvJM9kJwbazrhNcBU3+DszDW1OlEwKBBRWsJc7NJFelvwQpanHCR14cOLD41x8Eqvo3Nng==", + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "globals": { + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.3.0.tgz", + "integrity": "sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw==", + "requires": { + "type-fest": "^0.8.1" + } + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==" + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + } + } + }, + "eslint-config-react-app": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-react-app/-/eslint-config-react-app-5.1.0.tgz", + "integrity": "sha512-hBaxisHC6HXRVvxX+/t1n8mOdmCVIKgkXsf2WoUkJi7upHJTwYTsdCmx01QPOjKNT34QMQQ9sL0tVBlbiMFjxA==", + "requires": { + "confusing-browser-globals": "^1.0.9" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "requires": { + "debug": "^2.6.9", + "resolve": "^1.5.0" + } + }, + "eslint-loader": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/eslint-loader/-/eslint-loader-3.0.2.tgz", + "integrity": "sha512-S5VnD+UpVY1PyYRqeBd/4pgsmkvSokbHqTXAQMpvCyRr3XN2tvSLo9spm2nEpqQqh9dezw3os/0zWihLeOg2Rw==", + "requires": { + "fs-extra": "^8.1.0", + "loader-fs-cache": "^1.0.2", + "loader-utils": "^1.2.3", + "object-hash": "^1.3.1", + "schema-utils": "^2.2.0" + } + }, + "eslint-module-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.5.0.tgz", + "integrity": "sha512-kCo8pZaNz2dsAW7nCUjuVoI11EBXXpIzfNxmaoLhXoRDOnqXLC4iSGVRdZPhOitfbdEfMEfKOiENaK6wDPZEGw==", + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "requires": { + "find-up": "^2.1.0" + } + } + } + }, + "eslint-plugin-flowtype": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.13.0.tgz", + "integrity": "sha512-bhewp36P+t7cEV0b6OdmoRWJCBYRiHFlqPZAG1oS3SF+Y0LQkeDvFSM4oxoxvczD1OdONCXMlJfQFiWLcV9urw==", + "requires": { + "lodash": "^4.17.15" + } + }, + "eslint-plugin-import": { + "version": "2.18.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz", + "integrity": "sha512-5ohpsHAiUBRNaBWAF08izwUGlbrJoJJ+W9/TBwsGoR1MnlgfwMIKrFeSjWbt6moabiXW9xNvtFz+97KHRfI4HQ==", + "requires": { + "array-includes": "^3.0.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.2", + "eslint-module-utils": "^2.4.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.0", + "read-pkg-up": "^2.0.0", + "resolve": "^1.11.0" + }, + "dependencies": { + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + } + } + }, + "eslint-plugin-jsx-a11y": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.3.tgz", + "integrity": "sha512-CawzfGt9w83tyuVekn0GDPU9ytYtxyxyFZ3aSWROmnRRFQFT2BiPJd7jvRdzNDi6oLWaS2asMeYSNMjWTV4eNg==", + "requires": { + "@babel/runtime": "^7.4.5", + "aria-query": "^3.0.0", + "array-includes": "^3.0.3", + "ast-types-flow": "^0.0.7", + "axobject-query": "^2.0.2", + "damerau-levenshtein": "^1.0.4", + "emoji-regex": "^7.0.2", + "has": "^1.0.3", + "jsx-ast-utils": "^2.2.1" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + } + } + }, + "eslint-plugin-react": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.16.0.tgz", + "integrity": "sha512-GacBAATewhhptbK3/vTP09CbFrgUJmBSaaRcWdbQLFvUZy9yVcQxigBNHGPU/KE2AyHpzj3AWXpxoMTsIDiHug==", + "requires": { + "array-includes": "^3.0.3", + "doctrine": "^2.1.0", + "has": "^1.0.3", + "jsx-ast-utils": "^2.2.1", + "object.entries": "^1.1.0", + "object.fromentries": "^2.0.0", + "object.values": "^1.1.0", + "prop-types": "^15.7.2", + "resolve": "^1.12.0" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "requires": { + "esutils": "^2.0.2" + } + } + } + }, + "eslint-plugin-react-hooks": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz", + "integrity": "sha512-iXTCFcOmlWvw4+TOE8CLWj6yX1GwzT0Y6cUfHHZqWnSk144VmVIRcVGtUAzrLES7C798lmvnt02C7rxaOX1HNA==" + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==" + }, + "espree": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.2.tgz", + "integrity": "sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA==", + "requires": { + "acorn": "^7.1.0", + "acorn-jsx": "^5.1.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "eventemitter3": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz", + "integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==" + }, + "events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", + "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==" + }, + "eventsource": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.0.7.tgz", + "integrity": "sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ==", + "requires": { + "original": "^1.0.0" + } + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "exec-sh": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.4.tgz", + "integrity": "sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A==" + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expect": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-24.9.0.tgz", + "integrity": "sha512-wvVAx8XIol3Z5m9zvZXiyZOQ+sRJqNTIm6sGjdWlaZIeupQGO3WbYI+15D/AmEwZywL6wtJkbAbJtzkOfBuR0Q==", + "requires": { + "@jest/types": "^24.9.0", + "ansi-styles": "^3.2.0", + "jest-get-type": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-regex-util": "^24.9.0" + } + }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + }, + "fast-glob": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", + "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" + }, + "dependencies": { + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "^2.1.0" + } + } + } + } + } + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, + "faye-websocket": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", + "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", + "requires": { + "websocket-driver": ">=0.5.1" + } + }, + "fb-watchman": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", + "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "requires": { + "bser": "2.1.1" + } + }, + "figgy-pudding": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", + "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==" + }, + "figures": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.1.0.tgz", + "integrity": "sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg==", + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "requires": { + "flat-cache": "^2.0.1" + } + }, + "file-loader": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-4.3.0.tgz", + "integrity": "sha512-aKrYPYjF1yG3oX0kWRrqrSMfgftm7oJW5M+m4owoldH5C51C0RkIwB++JbRvEW3IU6/ZG5n8UvEcdgwOt2UOWA==", + "requires": { + "loader-utils": "^1.2.3", + "schema-utils": "^2.5.0" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, + "filesize": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", + "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==" + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + } + }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "requires": { + "locate-path": "^3.0.0" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", + "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==" + }, + "flatten": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.3.tgz", + "integrity": "sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==" + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "follow-redirects": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.9.0.tgz", + "integrity": "sha512-CRcPzsSIbXyVDl0QI01muNDu69S8trU4jArW9LpOt2WtC6LyUJetcIrmfHsRBx7/Jb6GHJUiuqyYxPooFfNt6A==", + "requires": { + "debug": "^3.0.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "requires": { + "for-in": "^1.0.1" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "fork-ts-checker-webpack-plugin": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-3.1.0.tgz", + "integrity": "sha512-6OkRfjuNMNqb14f01xokcWcKV5Ekknc2FvziNpcTYru+kxIYFA2MtuuBI19MHThZnjSBhoi35Dcq+I0oUkFjmQ==", + "requires": { + "babel-code-frame": "^6.22.0", + "chalk": "^2.4.1", + "chokidar": "^2.0.4", + "micromatch": "^3.1.10", + "minimatch": "^3.0.4", + "semver": "^5.6.0", + "tapable": "^1.0.0", + "worker-rpc": "^0.1.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "requires": { + "map-cache": "^0.2.2" + } + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-minipass": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.0.0.tgz", + "integrity": "sha512-40Qz+LFXmd9tzYVnnBmZvFfvAADfUA14TXPK1s7IfElJTIZ97rA8w4Kin7Wt5JBrC3ShnnFJO/5vPjPEeJIq9A==", + "requires": { + "minipass": "^3.0.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz", + "integrity": "sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw==", + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1", + "node-pre-gyp": "*" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.3", + "bundled": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "debug": { + "version": "3.2.6", + "bundled": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.7", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.6.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.6", + "bundled": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.3", + "bundled": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "bundled": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "optional": true + }, + "minipass": { + "version": "2.9.0", + "bundled": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.3.3", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.9.0" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.2", + "bundled": true, + "optional": true + }, + "needle": { + "version": "2.4.0", + "bundled": true, + "optional": true, + "requires": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.14.0", + "bundled": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4.4.2" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.7", + "bundled": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.7.1", + "bundled": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "optional": true + }, + "semver": { + "version": "5.7.1", + "bundled": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "tar": { + "version": "4.4.13", + "bundled": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "yallist": { + "version": "3.1.1", + "bundled": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==" + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=" + }, + "global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "requires": { + "global-prefix": "^3.0.0" + } + }, + "global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "requires": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + } + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" + }, + "globby": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.2.tgz", + "integrity": "sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w==", + "requires": { + "array-union": "^1.0.1", + "dir-glob": "2.0.0", + "fast-glob": "^2.0.2", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + }, + "dependencies": { + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==" + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" + } + } + }, + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" + }, + "growly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=" + }, + "gzip-size": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz", + "integrity": "sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==", + "requires": { + "duplexer": "^0.1.1", + "pify": "^4.0.1" + } + }, + "handle-thing": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.0.tgz", + "integrity": "sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ==" + }, + "handlebars": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", + "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", + "requires": { + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "harmony-reflect": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/harmony-reflect/-/harmony-reflect-1.6.1.tgz", + "integrity": "sha512-WJTeyp0JzGtHcuMsi7rw2VwtkvLa+JyfEKJCFyfcS0+CDkjQ5lHPu7zEhFZP+PDSRrEgXa5Ah0l1MbgbE41XjA==" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + }, + "hex-color-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", + "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==" + }, + "history": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", + "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", + "requires": { + "@babel/runtime": "^7.1.2", + "loose-envify": "^1.2.0", + "resolve-pathname": "^3.0.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0", + "value-equal": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "requires": { + "react-is": "^16.7.0" + } + }, + "hosted-git-info": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==" + }, + "hpack.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", + "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", + "requires": { + "inherits": "^2.0.1", + "obuf": "^1.0.0", + "readable-stream": "^2.0.1", + "wbuf": "^1.1.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "hsl-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hsl-regex/-/hsl-regex-1.0.0.tgz", + "integrity": "sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4=" + }, + "hsla-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hsla-regex/-/hsla-regex-1.0.0.tgz", + "integrity": "sha1-wc56MWjIxmFAM6S194d/OyJfnDg=" + }, + "html-comment-regex": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz", + "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==" + }, + "html-encoding-sniffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "requires": { + "whatwg-encoding": "^1.0.1" + } + }, + "html-entities": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz", + "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=" + }, + "html-minifier": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.21.tgz", + "integrity": "sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA==", + "requires": { + "camel-case": "3.0.x", + "clean-css": "4.2.x", + "commander": "2.17.x", + "he": "1.2.x", + "param-case": "2.1.x", + "relateurl": "0.2.x", + "uglify-js": "3.4.x" + }, + "dependencies": { + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==" + } + } + }, + "html-webpack-plugin": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.5.tgz", + "integrity": "sha512-y5l4lGxOW3pz3xBTFdfB9rnnrWRPVxlAhX6nrBYIcW+2k2zC3mSp/3DxlWVCMBfnO6UAnoF8OcFn0IMy6kaKAQ==", + "requires": { + "html-minifier": "^3.5.20", + "loader-utils": "^1.1.0", + "lodash": "^4.17.11", + "pretty-error": "^2.1.1", + "tapable": "^1.1.0", + "util.promisify": "1.0.0" + } + }, + "htmlparser2": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", + "requires": { + "domelementtype": "^1.3.1", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.1.1" + }, + "dependencies": { + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" + } + } + }, + "http-deceiver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=" + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } + } + }, + "http-parser-js": { + "version": "0.4.10", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz", + "integrity": "sha1-ksnBN0w1CF912zWexWzCV8u5P6Q=" + }, + "http-proxy": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz", + "integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==", + "requires": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-proxy-middleware": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", + "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", + "requires": { + "http-proxy": "^1.17.0", + "is-glob": "^4.0.0", + "lodash": "^4.17.11", + "micromatch": "^3.1.10" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" + }, + "hyphenate-style-name": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz", + "integrity": "sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==" + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "icss-utils": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-4.1.1.tgz", + "integrity": "sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA==", + "requires": { + "postcss": "^7.0.14" + } + }, + "identity-obj-proxy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz", + "integrity": "sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ=", + "requires": { + "harmony-reflect": "^1.4.6" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=" + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" + }, + "immer": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/immer/-/immer-1.10.0.tgz", + "integrity": "sha512-O3sR1/opvCDGLEVcvrGTMtLac8GJ5IwZC4puPrLuRj3l7ICKvkmA0vGuU9OW8mV9WIBRnaxp5GJh9IEAaNOoYg==" + }, + "import-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz", + "integrity": "sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk=", + "requires": { + "import-from": "^2.1.0" + } + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + } + }, + "import-from": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz", + "integrity": "sha1-M1238qev/VOqpHHUuAId7ja387E=", + "requires": { + "resolve-from": "^3.0.0" + } + }, + "import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=" + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, + "inquirer": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.1.tgz", + "integrity": "sha512-V1FFQ3TIO15det8PijPLFR9M9baSlnRs9nL7zWu1MNVA2T9YVl9ZbrHJhYs7e9X8jeMZ3lr2JH/rdHFgNCBdYw==", + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^2.4.2", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.2.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + } + }, + "internal-ip": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz", + "integrity": "sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg==", + "requires": { + "default-gateway": "^4.2.0", + "ipaddr.js": "^1.9.0" + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" + }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" + }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=" + }, + "ipaddr.js": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" + }, + "is-absolute-url": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", + "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=" + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==" + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-color-stop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-color-stop/-/is-color-stop-1.1.0.tgz", + "integrity": "sha1-z/9HGu5N1cnhWFmPvhKWe1za00U=", + "requires": { + "css-color-names": "^0.0.4", + "hex-color-regex": "^1.1.0", + "hsl-regex": "^1.0.0", + "hsla-regex": "^1.0.0", + "rgb-regex": "^1.0.1", + "rgba-regex": "^1.0.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=" + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-in-browser": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-in-browser/-/is-in-browser-1.1.3.tgz", + "integrity": "sha512-FeXIBgG/CPGd/WUxuEyvgGTEfwiG9Z4EKGxjNMRqviiIIfsmgrpnHLffEDdwUHqNva1VEW91o3xBT/m8Elgl9g==" + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" + }, + "is-path-cwd": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==" + }, + "is-path-in-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", + "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", + "requires": { + "is-path-inside": "^2.1.0" + } + }, + "is-path-inside": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", + "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", + "requires": { + "path-is-inside": "^1.0.2" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "^3.0.1" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "requires": { + "has": "^1.0.1" + } + }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=" + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==" + }, + "is-root": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-root/-/is-root-2.1.0.tgz", + "integrity": "sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg==" + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-svg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz", + "integrity": "sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==", + "requires": { + "html-comment-regex": "^1.1.0" + } + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==" + }, + "istanbul-lib-instrument": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "requires": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" + } + }, + "istanbul-lib-report": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", + "requires": { + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "supports-color": "^6.1.0" + } + }, + "istanbul-lib-source-maps": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "rimraf": "^2.6.3", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "istanbul-reports": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz", + "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==", + "requires": { + "handlebars": "^4.1.2" + } + }, + "jest": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-24.9.0.tgz", + "integrity": "sha512-YvkBL1Zm7d2B1+h5fHEOdyjCG+sGMz4f8D86/0HiqJ6MB4MnDc8FgP5vdWsGnemOQro7lnYo8UakZ3+5A0jxGw==", + "requires": { + "import-local": "^2.0.0", + "jest-cli": "^24.9.0" + }, + "dependencies": { + "jest-cli": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.9.0.tgz", + "integrity": "sha512-+VLRKyitT3BWoMeSUIHRxV/2g8y9gw91Jh5z2UmXZzkZKpbC08CSehVxgHUwTpy+HwGcns/tqafQDJW7imYvGg==", + "requires": { + "@jest/core": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "import-local": "^2.0.0", + "is-ci": "^2.0.0", + "jest-config": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "prompts": "^2.0.1", + "realpath-native": "^1.1.0", + "yargs": "^13.3.0" + } + } + } + }, + "jest-changed-files": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.9.0.tgz", + "integrity": "sha512-6aTWpe2mHF0DhL28WjdkO8LyGjs3zItPET4bMSeXU6T3ub4FPMw+mcOcbdGXQOAfmLcxofD23/5Bl9Z4AkFwqg==", + "requires": { + "@jest/types": "^24.9.0", + "execa": "^1.0.0", + "throat": "^4.0.0" + } + }, + "jest-config": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.9.0.tgz", + "integrity": "sha512-RATtQJtVYQrp7fvWg6f5y3pEFj9I+H8sWw4aKxnDZ96mob5i5SD6ZEGWgMLXQ4LE8UurrjbdlLWdUeo+28QpfQ==", + "requires": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^24.9.0", + "@jest/types": "^24.9.0", + "babel-jest": "^24.9.0", + "chalk": "^2.0.1", + "glob": "^7.1.1", + "jest-environment-jsdom": "^24.9.0", + "jest-environment-node": "^24.9.0", + "jest-get-type": "^24.9.0", + "jest-jasmine2": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "micromatch": "^3.1.10", + "pretty-format": "^24.9.0", + "realpath-native": "^1.1.0" + } + }, + "jest-diff": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.9.0.tgz", + "integrity": "sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ==", + "requires": { + "chalk": "^2.0.1", + "diff-sequences": "^24.9.0", + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" + } + }, + "jest-docblock": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-24.9.0.tgz", + "integrity": "sha512-F1DjdpDMJMA1cN6He0FNYNZlo3yYmOtRUnktrT9Q37njYzC5WEaDdmbynIgy0L/IvXvvgsG8OsqhLPXTpfmZAA==", + "requires": { + "detect-newline": "^2.1.0" + } + }, + "jest-each": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.9.0.tgz", + "integrity": "sha512-ONi0R4BvW45cw8s2Lrx8YgbeXL1oCQ/wIDwmsM3CqM/nlblNCPmnC3IPQlMbRFZu3wKdQ2U8BqM6lh3LJ5Bsog==", + "requires": { + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "jest-get-type": "^24.9.0", + "jest-util": "^24.9.0", + "pretty-format": "^24.9.0" + } + }, + "jest-environment-jsdom": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.9.0.tgz", + "integrity": "sha512-Zv9FV9NBRzLuALXjvRijO2351DRQeLYXtpD4xNvfoVFw21IOKNhZAEUKcbiEtjTkm2GsJ3boMVgkaR7rN8qetA==", + "requires": { + "@jest/environment": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-util": "^24.9.0", + "jsdom": "^11.5.1" + } + }, + "jest-environment-jsdom-fourteen": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom-fourteen/-/jest-environment-jsdom-fourteen-0.1.0.tgz", + "integrity": "sha512-4vtoRMg7jAstitRzL4nbw83VmGH8Rs13wrND3Ud2o1fczDhMUF32iIrNKwYGgeOPUdfvZU4oy8Bbv+ni1fgVCA==", + "requires": { + "jest-mock": "^24.5.0", + "jest-util": "^24.5.0", + "jsdom": "^14.0.0" + }, + "dependencies": { + "acorn": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", + "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==" + }, + "jsdom": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-14.1.0.tgz", + "integrity": "sha512-O901mfJSuTdwU2w3Sn+74T+RnDVP+FuV5fH8tcPWyqrseRAb0s5xOtPgCFiPOtLcyK7CLIJwPyD83ZqQWvA5ng==", + "requires": { + "abab": "^2.0.0", + "acorn": "^6.0.4", + "acorn-globals": "^4.3.0", + "array-equal": "^1.0.0", + "cssom": "^0.3.4", + "cssstyle": "^1.1.1", + "data-urls": "^1.1.0", + "domexception": "^1.0.1", + "escodegen": "^1.11.0", + "html-encoding-sniffer": "^1.0.2", + "nwsapi": "^2.1.3", + "parse5": "5.1.0", + "pn": "^1.1.0", + "request": "^2.88.0", + "request-promise-native": "^1.0.5", + "saxes": "^3.1.9", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.5.0", + "w3c-hr-time": "^1.0.1", + "w3c-xmlserializer": "^1.1.2", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^7.0.0", + "ws": "^6.1.2", + "xml-name-validator": "^3.0.0" + } + }, + "parse5": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", + "integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ==" + }, + "whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "ws": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "requires": { + "async-limiter": "~1.0.0" + } + } + } + }, + "jest-environment-node": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.9.0.tgz", + "integrity": "sha512-6d4V2f4nxzIzwendo27Tr0aFm+IXWa0XEUnaH6nU0FMaozxovt+sfRvh4J47wL1OvF83I3SSTu0XK+i4Bqe7uA==", + "requires": { + "@jest/environment": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-util": "^24.9.0" + } + }, + "jest-get-type": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz", + "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==" + }, + "jest-haste-map": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.9.0.tgz", + "integrity": "sha512-kfVFmsuWui2Sj1Rp1AJ4D9HqJwE4uwTlS/vO+eRUaMmd54BFpli2XhMQnPC2k4cHFVbB2Q2C+jtI1AGLgEnCjQ==", + "requires": { + "@jest/types": "^24.9.0", + "anymatch": "^2.0.0", + "fb-watchman": "^2.0.0", + "fsevents": "^1.2.7", + "graceful-fs": "^4.1.15", + "invariant": "^2.2.4", + "jest-serializer": "^24.9.0", + "jest-util": "^24.9.0", + "jest-worker": "^24.9.0", + "micromatch": "^3.1.10", + "sane": "^4.0.3", + "walker": "^1.0.7" + } + }, + "jest-jasmine2": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.9.0.tgz", + "integrity": "sha512-Cq7vkAgaYKp+PsX+2/JbTarrk0DmNhsEtqBXNwUHkdlbrTBLtMJINADf2mf5FkowNsq8evbPc07/qFO0AdKTzw==", + "requires": { + "@babel/traverse": "^7.1.0", + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "co": "^4.6.0", + "expect": "^24.9.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "pretty-format": "^24.9.0", + "throat": "^4.0.0" + } + }, + "jest-leak-detector": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.9.0.tgz", + "integrity": "sha512-tYkFIDsiKTGwb2FG1w8hX9V0aUb2ot8zY/2nFg087dUageonw1zrLMP4W6zsRO59dPkTSKie+D4rhMuP9nRmrA==", + "requires": { + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" + } + }, + "jest-matcher-utils": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.9.0.tgz", + "integrity": "sha512-OZz2IXsu6eaiMAwe67c1T+5tUAtQyQx27/EMEkbFAGiw52tB9em+uGbzpcgYVpA8wl0hlxKPZxrly4CXU/GjHA==", + "requires": { + "chalk": "^2.0.1", + "jest-diff": "^24.9.0", + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" + } + }, + "jest-message-util": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.9.0.tgz", + "integrity": "sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw==", + "requires": { + "@babel/code-frame": "^7.0.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/stack-utils": "^1.0.1", + "chalk": "^2.0.1", + "micromatch": "^3.1.10", + "slash": "^2.0.0", + "stack-utils": "^1.0.1" + } + }, + "jest-mock": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.9.0.tgz", + "integrity": "sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w==", + "requires": { + "@jest/types": "^24.9.0" + } + }, + "jest-pnp-resolver": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz", + "integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==" + }, + "jest-regex-util": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-24.9.0.tgz", + "integrity": "sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA==" + }, + "jest-resolve": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.9.0.tgz", + "integrity": "sha512-TaLeLVL1l08YFZAt3zaPtjiVvyy4oSA6CRe+0AFPPVX3Q/VI0giIWWoAvoS5L96vj9Dqxj4fB5p2qrHCmTU/MQ==", + "requires": { + "@jest/types": "^24.9.0", + "browser-resolve": "^1.11.3", + "chalk": "^2.0.1", + "jest-pnp-resolver": "^1.2.1", + "realpath-native": "^1.1.0" + } + }, + "jest-resolve-dependencies": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.9.0.tgz", + "integrity": "sha512-Fm7b6AlWnYhT0BXy4hXpactHIqER7erNgIsIozDXWl5dVm+k8XdGVe1oTg1JyaFnOxarMEbax3wyRJqGP2Pq+g==", + "requires": { + "@jest/types": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-snapshot": "^24.9.0" + } + }, + "jest-runner": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.9.0.tgz", + "integrity": "sha512-KksJQyI3/0mhcfspnxxEOBueGrd5E4vV7ADQLT9ESaCzz02WnbdbKWIf5Mkaucoaj7obQckYPVX6JJhgUcoWWg==", + "requires": { + "@jest/console": "^24.7.1", + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.4.2", + "exit": "^0.1.2", + "graceful-fs": "^4.1.15", + "jest-config": "^24.9.0", + "jest-docblock": "^24.3.0", + "jest-haste-map": "^24.9.0", + "jest-jasmine2": "^24.9.0", + "jest-leak-detector": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-resolve": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-util": "^24.9.0", + "jest-worker": "^24.6.0", + "source-map-support": "^0.5.6", + "throat": "^4.0.0" + } + }, + "jest-runtime": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.9.0.tgz", + "integrity": "sha512-8oNqgnmF3v2J6PVRM2Jfuj8oX3syKmaynlDMMKQ4iyzbQzIG6th5ub/lM2bCMTmoTKM3ykcUYI2Pw9xwNtjMnw==", + "requires": { + "@jest/console": "^24.7.1", + "@jest/environment": "^24.9.0", + "@jest/source-map": "^24.3.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/yargs": "^13.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.1.15", + "jest-config": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "realpath-native": "^1.1.0", + "slash": "^2.0.0", + "strip-bom": "^3.0.0", + "yargs": "^13.3.0" + } + }, + "jest-serializer": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.9.0.tgz", + "integrity": "sha512-DxYipDr8OvfrKH3Kel6NdED3OXxjvxXZ1uIY2I9OFbGg+vUkkg7AGvi65qbhbWNPvDckXmzMPbK3u3HaDO49bQ==" + }, + "jest-snapshot": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.9.0.tgz", + "integrity": "sha512-uI/rszGSs73xCM0l+up7O7a40o90cnrk429LOiK3aeTvfC0HHmldbd81/B7Ix81KSFe1lwkbl7GnBGG4UfuDew==", + "requires": { + "@babel/types": "^7.0.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "expect": "^24.9.0", + "jest-diff": "^24.9.0", + "jest-get-type": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-resolve": "^24.9.0", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "pretty-format": "^24.9.0", + "semver": "^6.2.0" + } + }, + "jest-util": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.9.0.tgz", + "integrity": "sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg==", + "requires": { + "@jest/console": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/source-map": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "callsites": "^3.0.0", + "chalk": "^2.0.1", + "graceful-fs": "^4.1.15", + "is-ci": "^2.0.0", + "mkdirp": "^0.5.1", + "slash": "^2.0.0", + "source-map": "^0.6.0" + } + }, + "jest-validate": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.9.0.tgz", + "integrity": "sha512-HPIt6C5ACwiqSiwi+OfSSHbK8sG7akG8eATl+IPKaeIjtPOeBUd/g3J7DghugzxrGjI93qS/+RPKe1H6PqvhRQ==", + "requires": { + "@jest/types": "^24.9.0", + "camelcase": "^5.3.1", + "chalk": "^2.0.1", + "jest-get-type": "^24.9.0", + "leven": "^3.1.0", + "pretty-format": "^24.9.0" + } + }, + "jest-watch-typeahead": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/jest-watch-typeahead/-/jest-watch-typeahead-0.4.2.tgz", + "integrity": "sha512-f7VpLebTdaXs81rg/oj4Vg/ObZy2QtGzAmGLNsqUS5G5KtSN68tFcIsbvNODfNyQxU78g7D8x77o3bgfBTR+2Q==", + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^2.4.1", + "jest-regex-util": "^24.9.0", + "jest-watcher": "^24.3.0", + "slash": "^3.0.0", + "string-length": "^3.1.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + }, + "string-length": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-3.1.0.tgz", + "integrity": "sha512-Ttp5YvkGm5v9Ijagtaz1BnN+k9ObpvS0eIBblPMp2YWL8FBmi9qblQ9fexc2k/CXFgrTIteU3jAw3payCnwSTA==", + "requires": { + "astral-regex": "^1.0.0", + "strip-ansi": "^5.2.0" + } + } + } + }, + "jest-watcher": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.9.0.tgz", + "integrity": "sha512-+/fLOfKPXXYJDYlks62/4R4GoT+GU1tYZed99JSCOsmzkkF7727RqKrjNAxtfO4YpGv11wybgRvCjR73lK2GZw==", + "requires": { + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/yargs": "^13.0.0", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "jest-util": "^24.9.0", + "string-length": "^2.0.0" + }, + "dependencies": { + "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==" + } + } + }, + "jest-worker": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz", + "integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==", + "requires": { + "merge-stream": "^2.0.0", + "supports-color": "^6.1.0" + } + }, + "jquery": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz", + "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==" + }, + "js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "jsdom": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", + "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", + "requires": { + "abab": "^2.0.0", + "acorn": "^5.5.3", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": "^1.0.0", + "data-urls": "^1.0.0", + "domexception": "^1.0.1", + "escodegen": "^1.9.1", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.3.0", + "nwsapi": "^2.0.7", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.87.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.4", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.1", + "ws": "^5.2.0", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==" + } + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "requires": { + "jsonify": "~0.0.0" + } + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "json3": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.3.tgz", + "integrity": "sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA==" + }, + "json5": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", + "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", + "requires": { + "minimist": "^1.2.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jss": { + "version": "10.10.0", + "resolved": "https://registry.npmjs.org/jss/-/jss-10.10.0.tgz", + "integrity": "sha512-cqsOTS7jqPsPMjtKYDUpdFC0AbhYFLTcuGRqymgmdJIeQ8cH7+AgX7YSgQy79wXloZq2VvATYxUOUQEvS1V/Zw==", + "requires": { + "@babel/runtime": "^7.3.1", + "csstype": "^3.0.2", + "is-in-browser": "^1.1.3", + "tiny-warning": "^1.0.2" + }, + "dependencies": { + "csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + } + } + }, + "jss-plugin-camel-case": { + "version": "10.10.0", + "resolved": "https://registry.npmjs.org/jss-plugin-camel-case/-/jss-plugin-camel-case-10.10.0.tgz", + "integrity": "sha512-z+HETfj5IYgFxh1wJnUAU8jByI48ED+v0fuTuhKrPR+pRBYS2EDwbusU8aFOpCdYhtRc9zhN+PJ7iNE8pAWyPw==", + "requires": { + "@babel/runtime": "^7.3.1", + "hyphenate-style-name": "^1.0.3", + "jss": "10.10.0" + } + }, + "jss-plugin-default-unit": { + "version": "10.10.0", + "resolved": "https://registry.npmjs.org/jss-plugin-default-unit/-/jss-plugin-default-unit-10.10.0.tgz", + "integrity": "sha512-SvpajxIECi4JDUbGLefvNckmI+c2VWmP43qnEy/0eiwzRUsafg5DVSIWSzZe4d2vFX1u9nRDP46WCFV/PXVBGQ==", + "requires": { + "@babel/runtime": "^7.3.1", + "jss": "10.10.0" + } + }, + "jss-plugin-global": { + "version": "10.10.0", + "resolved": "https://registry.npmjs.org/jss-plugin-global/-/jss-plugin-global-10.10.0.tgz", + "integrity": "sha512-icXEYbMufiNuWfuazLeN+BNJO16Ge88OcXU5ZDC2vLqElmMybA31Wi7lZ3lf+vgufRocvPj8443irhYRgWxP+A==", + "requires": { + "@babel/runtime": "^7.3.1", + "jss": "10.10.0" + } + }, + "jss-plugin-nested": { + "version": "10.10.0", + "resolved": "https://registry.npmjs.org/jss-plugin-nested/-/jss-plugin-nested-10.10.0.tgz", + "integrity": "sha512-9R4JHxxGgiZhurDo3q7LdIiDEgtA1bTGzAbhSPyIOWb7ZubrjQe8acwhEQ6OEKydzpl8XHMtTnEwHXCARLYqYA==", + "requires": { + "@babel/runtime": "^7.3.1", + "jss": "10.10.0", + "tiny-warning": "^1.0.2" + } + }, + "jss-plugin-props-sort": { + "version": "10.10.0", + "resolved": "https://registry.npmjs.org/jss-plugin-props-sort/-/jss-plugin-props-sort-10.10.0.tgz", + "integrity": "sha512-5VNJvQJbnq/vRfje6uZLe/FyaOpzP/IH1LP+0fr88QamVrGJa0hpRRyAa0ea4U/3LcorJfBFVyC4yN2QC73lJg==", + "requires": { + "@babel/runtime": "^7.3.1", + "jss": "10.10.0" + } + }, + "jss-plugin-rule-value-function": { + "version": "10.10.0", + "resolved": "https://registry.npmjs.org/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.10.0.tgz", + "integrity": "sha512-uEFJFgaCtkXeIPgki8ICw3Y7VMkL9GEan6SqmT9tqpwM+/t+hxfMUdU4wQ0MtOiMNWhwnckBV0IebrKcZM9C0g==", + "requires": { + "@babel/runtime": "^7.3.1", + "jss": "10.10.0", + "tiny-warning": "^1.0.2" + } + }, + "jss-plugin-vendor-prefixer": { + "version": "10.10.0", + "resolved": "https://registry.npmjs.org/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.10.0.tgz", + "integrity": "sha512-UY/41WumgjW8r1qMCO8l1ARg7NHnfRVWRhZ2E2m0DMYsr2DD91qIXLyNhiX83hHswR7Wm4D+oDYNC1zWCJWtqg==", + "requires": { + "@babel/runtime": "^7.3.1", + "css-vendor": "^2.0.8", + "jss": "10.10.0" + } + }, + "jsx-ast-utils": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz", + "integrity": "sha512-EdIHFMm+1BPynpKOpdPqiOsvnIrInRGJD7bzPZdPkjitQEqpdpUuFpq4T0npZFKTiB3RhWFdGN+oqOJIdhDhQA==", + "requires": { + "array-includes": "^3.0.3", + "object.assign": "^4.1.0" + } + }, + "killable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", + "integrity": "sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==" + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" + }, + "last-call-webpack-plugin": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/last-call-webpack-plugin/-/last-call-webpack-plugin-3.0.0.tgz", + "integrity": "sha512-7KI2l2GIZa9p2spzPIVZBYyNKkN+e/SQPpnjlTiPhdbDW3F86tdKKELxKpzJ5sgU19wQWsACULZmpTPYHeWO5w==", + "requires": { + "lodash": "^4.17.5", + "webpack-sources": "^1.1.0" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "requires": { + "invert-kv": "^2.0.0" + } + }, + "left-pad": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", + "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==" + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==" + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "^1.2.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, + "loader-fs-cache": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/loader-fs-cache/-/loader-fs-cache-1.0.2.tgz", + "integrity": "sha512-70IzT/0/L+M20jUlEqZhZyArTU6VKLRTYRDAYN26g4jfzpJqjipLL3/hgYpySqI9PwsVRHHFja0LfEmsx9X2Cw==", + "requires": { + "find-cache-dir": "^0.1.1", + "mkdirp": "0.5.1" + }, + "dependencies": { + "find-cache-dir": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", + "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", + "requires": { + "commondir": "^1.0.1", + "mkdirp": "^0.5.1", + "pkg-dir": "^1.0.0" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "requires": { + "find-up": "^1.0.0" + } + } + } + }, + "loader-runner": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==" + }, + "loader-utils": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", + "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^2.0.0", + "json5": "^1.0.1" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "requires": { + "minimist": "^1.2.0" + } + } + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=" + }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=" + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=" + }, + "lodash.template": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", + "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", + "requires": { + "lodash._reinterpolate": "^3.0.0", + "lodash.templatesettings": "^4.0.0" + } + }, + "lodash.templatesettings": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", + "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", + "requires": { + "lodash._reinterpolate": "^3.0.0" + } + }, + "lodash.unescape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", + "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=" + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" + }, + "loglevel": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.6.tgz", + "integrity": "sha512-Sgr5lbboAUBo3eXCSPL4/KoVz3ROKquOjcctxmHIt+vol2DrqTQe3SwkKKuYhEiWB5kYa13YyopJ69deJ1irzQ==" + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lower-case": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", + "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=" + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + }, + "dependencies": { + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + } + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "requires": { + "tmpl": "1.0.x" + } + }, + "mamacro": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", + "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==" + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "requires": { + "p-defer": "^1.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "mdn-data": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", + "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "merge-deep": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.2.tgz", + "integrity": "sha512-T7qC8kg4Zoti1cFd8Cr0M+qaZfOwjlPDEdZIIPPB2JZctjaPM4fX+i7HOId69tAti2fvO6X5ldfYUONDODsrkA==", + "requires": { + "arr-union": "^3.1.0", + "clone-deep": "^0.2.4", + "kind-of": "^3.0.2" + } + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "merge2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "microevent.ts": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/microevent.ts/-/microevent.ts-0.1.1.tgz", + "integrity": "sha512-jo1OfR4TaEwd5HOrt5+tAZ9mqT4jmpNAusXtyfNzqVm9uiSYFZlKM1wYL4oU7azZW/PxQW53wM0S6OR1JHNa2g==" + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + } + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" + }, + "mime-db": { + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", + "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==" + }, + "mime-types": { + "version": "2.1.25", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz", + "integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==", + "requires": { + "mime-db": "1.42.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, + "min-indent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.0.tgz", + "integrity": "sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY=" + }, + "mini-css-extract-plugin": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.8.0.tgz", + "integrity": "sha512-MNpRGbNA52q6U92i0qbVpQNsgk7LExy41MdAlG84FeytfDOtRIf/mCHdEgG8rpTKOaNKiqUnZdlptF469hxqOw==", + "requires": { + "loader-utils": "^1.1.0", + "normalize-url": "1.9.1", + "schema-utils": "^1.0.0", + "webpack-sources": "^1.1.0" + }, + "dependencies": { + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "minipass": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.1.tgz", + "integrity": "sha512-UFqVihv6PQgwj8/yTGvl9kPz7xIAY+R5z6XYjRInD3Gk3qx6QGSD6zEcpeG4Dy/lQnv1J6zv8ejV90hyYIKf3w==", + "requires": { + "yallist": "^4.0.0" + } + }, + "minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-pipeline": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.2.tgz", + "integrity": "sha512-3JS5A2DKhD2g0Gg8x3yamO0pj7YeKGwVlDS90pF++kxptwx/F+B//roxf9SqYil5tQo65bijy+dAuAFZmYOouA==", + "requires": { + "minipass": "^3.0.0" + } + }, + "mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mixin-object": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mixin-object/-/mixin-object-2.0.1.tgz", + "integrity": "sha1-T7lJRB2rGCVA8f4DW6YOGUel5X4=", + "requires": { + "for-in": "^0.1.3", + "is-extendable": "^0.1.1" + }, + "dependencies": { + "for-in": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.8.tgz", + "integrity": "sha1-2Hc5COMSVhCZUrH9ubP6hn0ndeE=" + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } + } + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "multicast-dns": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.2.3.tgz", + "integrity": "sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g==", + "requires": { + "dns-packet": "^1.3.1", + "thunky": "^1.0.2" + } + }, + "multicast-dns-service-types": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", + "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=" + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + } + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + }, + "neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==" + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + }, + "no-case": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", + "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", + "requires": { + "lower-case": "^1.1.1" + } + }, + "node-forge": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", + "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==" + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=" + }, + "node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } + } + } + } + }, + "node-modules-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", + "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=" + }, + "node-notifier": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.3.tgz", + "integrity": "sha512-M4UBGcs4jeOK9CjTsYwkvH6/MzuUmGCyTW+kCY7uO+1ZVr0+FHGdPdIf5CCLqAaxnRrWidyoQlNkMIIVwbKB8Q==", + "requires": { + "growly": "^1.3.0", + "is-wsl": "^1.1.0", + "semver": "^5.5.0", + "shellwords": "^0.1.1", + "which": "^1.3.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "node-releases": { + "version": "1.1.43", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.43.tgz", + "integrity": "sha512-Rmfnj52WNhvr83MvuAWHEqXVoZXCcDQssSOffU4n4XOL9sPrP61mSZ88g25NqmABDvH7PiAlFCzoSCSdzA293w==", + "requires": { + "semver": "^6.3.0" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=" + }, + "normalize-url": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz", + "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=", + "requires": { + "object-assign": "^4.0.1", + "prepend-http": "^1.0.0", + "query-string": "^4.1.0", + "sort-keys": "^1.0.0" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "^2.0.0" + } + }, + "nth-check": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", + "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "requires": { + "boolbase": "~1.0.0" + } + }, + "num2fraction": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", + "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=" + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "nwsapi": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==" + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "object-hash": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", + "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==" + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" + }, + "object-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.2.tgz", + "integrity": "sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ==" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object-path": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.4.tgz", + "integrity": "sha1-NwrnUvvzfePqcKhhwju6iRVpGUk=" + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.entries": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.1.tgz", + "integrity": "sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, + "object.fromentries": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.2.tgz", + "integrity": "sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0-next.1.tgz", + "integrity": "sha512-7MmGr03N7Rnuid6+wyhD9sHNE2n4tFSwExnU2lQl3lIo2ShXWGePY80zYaoMOmILWv57H0amMjZGHNzzGG70Rw==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.0", + "string.prototype.trimright": "^2.1.0" + } + } + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "^3.0.1" + } + }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, + "obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "open": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/open/-/open-7.0.0.tgz", + "integrity": "sha512-K6EKzYqnwQzk+/dzJAQSBORub3xlBTxMz+ntpZpH/LyCa1o6KjXhuN+2npAaI9jaSmU3R1Q8NWf4KUWcyytGsQ==", + "requires": { + "is-wsl": "^2.1.0" + }, + "dependencies": { + "is-wsl": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.1.1.tgz", + "integrity": "sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog==" + } + } + }, + "opn": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", + "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", + "requires": { + "is-wsl": "^1.1.0" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + } + } + }, + "optimize-css-assets-webpack-plugin": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.3.tgz", + "integrity": "sha512-q9fbvCRS6EYtUKKSwI87qm2IxlyJK5b4dygW1rKUBT6mMDhdG5e5bZT63v6tnJR9F9FB/H5a0HTmtw+laUBxKA==", + "requires": { + "cssnano": "^4.1.10", + "last-call-webpack-plugin": "^3.0.0" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "original": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", + "integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==", + "requires": { + "url-parse": "^1.4.3" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=" + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" + }, + "p-each-series": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz", + "integrity": "sha1-kw89Et0fUOdDRFeiLNbwSsatf3E=", + "requires": { + "p-reduce": "^1.0.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==" + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-reduce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", + "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=" + }, + "p-retry": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-3.0.1.tgz", + "integrity": "sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w==", + "requires": { + "retry": "^0.12.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "pako": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==" + }, + "parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", + "requires": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "param-case": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", + "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", + "requires": { + "no-case": "^2.2.0" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-asn1": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", + "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==" + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==" + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + } + } + }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "^2.0.0" + } + }, + "pirates": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", + "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", + "requires": { + "node-modules-regexp": "^1.0.0" + } + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "requires": { + "find-up": "^3.0.0" + } + }, + "pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "requires": { + "find-up": "^2.1.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + } + } + }, + "pn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==" + }, + "pnp-webpack-plugin": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/pnp-webpack-plugin/-/pnp-webpack-plugin-1.5.0.tgz", + "integrity": "sha512-jd9olUr9D7do+RN8Wspzhpxhgp1n6Vd0NtQ4SFkmIACZoEL1nkyAdW9Ygrinjec0vgDcWjscFQQ1gDW8rsfKTg==", + "requires": { + "ts-pnp": "^1.1.2" + } + }, + "popper.js": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", + "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==" + }, + "portfinder": { + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.25.tgz", + "integrity": "sha512-6ElJnHBbxVA1XSLgBp7G1FiCkQdlqGzuF7DswL5tcea+E8UpuvPU7beVAjjRwCioTS9ZluNbu+ZyRvgTsmqEBg==", + "requires": { + "async": "^2.6.2", + "debug": "^3.1.1", + "mkdirp": "^0.5.1" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + }, + "postcss": { + "version": "7.0.25", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.25.tgz", + "integrity": "sha512-NXXVvWq9icrm/TgQC0O6YVFi4StfJz46M1iNd/h6B26Nvh/HKI+q4YZtFN/EjcInZliEscO/WL10BXnc1E5nwg==", + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + } + }, + "postcss-attribute-case-insensitive": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-4.0.1.tgz", + "integrity": "sha512-L2YKB3vF4PetdTIthQVeT+7YiSzMoNMLLYxPXXppOOP7NoazEAy45sh2LvJ8leCQjfBcfkYQs8TtCcQjeZTp8A==", + "requires": { + "postcss": "^7.0.2", + "postcss-selector-parser": "^5.0.0" + }, + "dependencies": { + "cssesc": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", + "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" + }, + "postcss-selector-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", + "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", + "requires": { + "cssesc": "^2.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "postcss-browser-comments": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-browser-comments/-/postcss-browser-comments-3.0.0.tgz", + "integrity": "sha512-qfVjLfq7HFd2e0HW4s1dvU8X080OZdG46fFbIBFjW7US7YPDcWfRvdElvwMJr2LI6hMmD+7LnH2HcmXTs+uOig==", + "requires": { + "postcss": "^7" + } + }, + "postcss-calc": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.1.tgz", + "integrity": "sha512-oXqx0m6tb4N3JGdmeMSc/i91KppbYsFZKdH0xMOqK8V1rJlzrKlTdokz8ozUXLVejydRN6u2IddxpcijRj2FqQ==", + "requires": { + "css-unit-converter": "^1.1.1", + "postcss": "^7.0.5", + "postcss-selector-parser": "^5.0.0-rc.4", + "postcss-value-parser": "^3.3.1" + }, + "dependencies": { + "cssesc": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", + "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" + }, + "postcss-selector-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", + "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", + "requires": { + "cssesc": "^2.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-color-functional-notation": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/postcss-color-functional-notation/-/postcss-color-functional-notation-2.0.1.tgz", + "integrity": "sha512-ZBARCypjEDofW4P6IdPVTLhDNXPRn8T2s1zHbZidW6rPaaZvcnCS2soYFIQJrMZSxiePJ2XIYTlcb2ztr/eT2g==", + "requires": { + "postcss": "^7.0.2", + "postcss-values-parser": "^2.0.0" + } + }, + "postcss-color-gray": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-color-gray/-/postcss-color-gray-5.0.0.tgz", + "integrity": "sha512-q6BuRnAGKM/ZRpfDascZlIZPjvwsRye7UDNalqVz3s7GDxMtqPY6+Q871liNxsonUw8oC61OG+PSaysYpl1bnw==", + "requires": { + "@csstools/convert-colors": "^1.4.0", + "postcss": "^7.0.5", + "postcss-values-parser": "^2.0.0" + } + }, + "postcss-color-hex-alpha": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/postcss-color-hex-alpha/-/postcss-color-hex-alpha-5.0.3.tgz", + "integrity": "sha512-PF4GDel8q3kkreVXKLAGNpHKilXsZ6xuu+mOQMHWHLPNyjiUBOr75sp5ZKJfmv1MCus5/DWUGcK9hm6qHEnXYw==", + "requires": { + "postcss": "^7.0.14", + "postcss-values-parser": "^2.0.1" + } + }, + "postcss-color-mod-function": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/postcss-color-mod-function/-/postcss-color-mod-function-3.0.3.tgz", + "integrity": "sha512-YP4VG+xufxaVtzV6ZmhEtc+/aTXH3d0JLpnYfxqTvwZPbJhWqp8bSY3nfNzNRFLgB4XSaBA82OE4VjOOKpCdVQ==", + "requires": { + "@csstools/convert-colors": "^1.4.0", + "postcss": "^7.0.2", + "postcss-values-parser": "^2.0.0" + } + }, + "postcss-color-rebeccapurple": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-4.0.1.tgz", + "integrity": "sha512-aAe3OhkS6qJXBbqzvZth2Au4V3KieR5sRQ4ptb2b2O8wgvB3SJBsdG+jsn2BZbbwekDG8nTfcCNKcSfe/lEy8g==", + "requires": { + "postcss": "^7.0.2", + "postcss-values-parser": "^2.0.0" + } + }, + "postcss-colormin": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.3.tgz", + "integrity": "sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw==", + "requires": { + "browserslist": "^4.0.0", + "color": "^3.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-convert-values": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz", + "integrity": "sha512-Kisdo1y77KUC0Jmn0OXU/COOJbzM8cImvw1ZFsBgBgMgb1iL23Zs/LXRe3r+EZqM3vGYKdQ2YJVQ5VkJI+zEJQ==", + "requires": { + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-custom-media": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-7.0.8.tgz", + "integrity": "sha512-c9s5iX0Ge15o00HKbuRuTqNndsJUbaXdiNsksnVH8H4gdc+zbLzr/UasOwNG6CTDpLFekVY4672eWdiiWu2GUg==", + "requires": { + "postcss": "^7.0.14" + } + }, + "postcss-custom-properties": { + "version": "8.0.11", + "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-8.0.11.tgz", + "integrity": "sha512-nm+o0eLdYqdnJ5abAJeXp4CEU1c1k+eB2yMCvhgzsds/e0umabFrN6HoTy/8Q4K5ilxERdl/JD1LO5ANoYBeMA==", + "requires": { + "postcss": "^7.0.17", + "postcss-values-parser": "^2.0.1" + } + }, + "postcss-custom-selectors": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/postcss-custom-selectors/-/postcss-custom-selectors-5.1.2.tgz", + "integrity": "sha512-DSGDhqinCqXqlS4R7KGxL1OSycd1lydugJ1ky4iRXPHdBRiozyMHrdu0H3o7qNOCiZwySZTUI5MV0T8QhCLu+w==", + "requires": { + "postcss": "^7.0.2", + "postcss-selector-parser": "^5.0.0-rc.3" + }, + "dependencies": { + "cssesc": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", + "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" + }, + "postcss-selector-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", + "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", + "requires": { + "cssesc": "^2.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "postcss-dir-pseudo-class": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-dir-pseudo-class/-/postcss-dir-pseudo-class-5.0.0.tgz", + "integrity": "sha512-3pm4oq8HYWMZePJY+5ANriPs3P07q+LW6FAdTlkFH2XqDdP4HeeJYMOzn0HYLhRSjBO3fhiqSwwU9xEULSrPgw==", + "requires": { + "postcss": "^7.0.2", + "postcss-selector-parser": "^5.0.0-rc.3" + }, + "dependencies": { + "cssesc": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", + "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" + }, + "postcss-selector-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", + "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", + "requires": { + "cssesc": "^2.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "postcss-discard-comments": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz", + "integrity": "sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg==", + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-discard-duplicates": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz", + "integrity": "sha512-ZNQfR1gPNAiXZhgENFfEglF93pciw0WxMkJeVmw8eF+JZBbMD7jp6C67GqJAXVZP2BWbOztKfbsdmMp/k8c6oQ==", + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-discard-empty": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz", + "integrity": "sha512-B9miTzbznhDjTfjvipfHoqbWKwd0Mj+/fL5s1QOz06wufguil+Xheo4XpOnc4NqKYBCNqqEzgPv2aPBIJLox0w==", + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-discard-overridden": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz", + "integrity": "sha512-IYY2bEDD7g1XM1IDEsUT4//iEYCxAmP5oDSFMVU/JVvT7gh+l4fmjciLqGgwjdWpQIdb0Che2VX00QObS5+cTg==", + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-double-position-gradients": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postcss-double-position-gradients/-/postcss-double-position-gradients-1.0.0.tgz", + "integrity": "sha512-G+nV8EnQq25fOI8CH/B6krEohGWnF5+3A6H/+JEpOncu5dCnkS1QQ6+ct3Jkaepw1NGVqqOZH6lqrm244mCftA==", + "requires": { + "postcss": "^7.0.5", + "postcss-values-parser": "^2.0.0" + } + }, + "postcss-env-function": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/postcss-env-function/-/postcss-env-function-2.0.2.tgz", + "integrity": "sha512-rwac4BuZlITeUbiBq60h/xbLzXY43qOsIErngWa4l7Mt+RaSkT7QBjXVGTcBHupykkblHMDrBFh30zchYPaOUw==", + "requires": { + "postcss": "^7.0.2", + "postcss-values-parser": "^2.0.0" + } + }, + "postcss-flexbugs-fixes": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.1.0.tgz", + "integrity": "sha512-jr1LHxQvStNNAHlgco6PzY308zvLklh7SJVYuWUwyUQncofaAlD2l+P/gxKHOdqWKe7xJSkVLFF/2Tp+JqMSZA==", + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-focus-visible": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-focus-visible/-/postcss-focus-visible-4.0.0.tgz", + "integrity": "sha512-Z5CkWBw0+idJHSV6+Bgf2peDOFf/x4o+vX/pwcNYrWpXFrSfTkQ3JQ1ojrq9yS+upnAlNRHeg8uEwFTgorjI8g==", + "requires": { + "postcss": "^7.0.2" + } + }, + "postcss-focus-within": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-focus-within/-/postcss-focus-within-3.0.0.tgz", + "integrity": "sha512-W0APui8jQeBKbCGZudW37EeMCjDeVxKgiYfIIEo8Bdh5SpB9sxds/Iq8SEuzS0Q4YFOlG7EPFulbbxujpkrV2w==", + "requires": { + "postcss": "^7.0.2" + } + }, + "postcss-font-variant": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-font-variant/-/postcss-font-variant-4.0.0.tgz", + "integrity": "sha512-M8BFYKOvCrI2aITzDad7kWuXXTm0YhGdP9Q8HanmN4EF1Hmcgs1KK5rSHylt/lUJe8yLxiSwWAHdScoEiIxztg==", + "requires": { + "postcss": "^7.0.2" + } + }, + "postcss-gap-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-gap-properties/-/postcss-gap-properties-2.0.0.tgz", + "integrity": "sha512-QZSqDaMgXCHuHTEzMsS2KfVDOq7ZFiknSpkrPJY6jmxbugUPTuSzs/vuE5I3zv0WAS+3vhrlqhijiprnuQfzmg==", + "requires": { + "postcss": "^7.0.2" + } + }, + "postcss-image-set-function": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/postcss-image-set-function/-/postcss-image-set-function-3.0.1.tgz", + "integrity": "sha512-oPTcFFip5LZy8Y/whto91L9xdRHCWEMs3e1MdJxhgt4jy2WYXfhkng59fH5qLXSCPN8k4n94p1Czrfe5IOkKUw==", + "requires": { + "postcss": "^7.0.2", + "postcss-values-parser": "^2.0.0" + } + }, + "postcss-initial": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/postcss-initial/-/postcss-initial-3.0.2.tgz", + "integrity": "sha512-ugA2wKonC0xeNHgirR4D3VWHs2JcU08WAi1KFLVcnb7IN89phID6Qtg2RIctWbnvp1TM2BOmDtX8GGLCKdR8YA==", + "requires": { + "lodash.template": "^4.5.0", + "postcss": "^7.0.2" + } + }, + "postcss-lab-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/postcss-lab-function/-/postcss-lab-function-2.0.1.tgz", + "integrity": "sha512-whLy1IeZKY+3fYdqQFuDBf8Auw+qFuVnChWjmxm/UhHWqNHZx+B99EwxTvGYmUBqe3Fjxs4L1BoZTJmPu6usVg==", + "requires": { + "@csstools/convert-colors": "^1.4.0", + "postcss": "^7.0.2", + "postcss-values-parser": "^2.0.0" + } + }, + "postcss-load-config": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-2.1.0.tgz", + "integrity": "sha512-4pV3JJVPLd5+RueiVVB+gFOAa7GWc25XQcMp86Zexzke69mKf6Nx9LRcQywdz7yZI9n1udOxmLuAwTBypypF8Q==", + "requires": { + "cosmiconfig": "^5.0.0", + "import-cwd": "^2.0.0" + } + }, + "postcss-loader": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-3.0.0.tgz", + "integrity": "sha512-cLWoDEY5OwHcAjDnkyRQzAXfs2jrKjXpO/HQFcc5b5u/r7aa471wdmChmwfnv7x2u840iat/wi0lQ5nbRgSkUA==", + "requires": { + "loader-utils": "^1.1.0", + "postcss": "^7.0.0", + "postcss-load-config": "^2.0.0", + "schema-utils": "^1.0.0" + }, + "dependencies": { + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, + "postcss-logical": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-logical/-/postcss-logical-3.0.0.tgz", + "integrity": "sha512-1SUKdJc2vuMOmeItqGuNaC+N8MzBWFWEkAnRnLpFYj1tGGa7NqyVBujfRtgNa2gXR+6RkGUiB2O5Vmh7E2RmiA==", + "requires": { + "postcss": "^7.0.2" + } + }, + "postcss-media-minmax": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-media-minmax/-/postcss-media-minmax-4.0.0.tgz", + "integrity": "sha512-fo9moya6qyxsjbFAYl97qKO9gyre3qvbMnkOZeZwlsW6XYFsvs2DMGDlchVLfAd8LHPZDxivu/+qW2SMQeTHBw==", + "requires": { + "postcss": "^7.0.2" + } + }, + "postcss-merge-longhand": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz", + "integrity": "sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw==", + "requires": { + "css-color-names": "0.0.4", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0", + "stylehacks": "^4.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-merge-rules": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz", + "integrity": "sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ==", + "requires": { + "browserslist": "^4.0.0", + "caniuse-api": "^3.0.0", + "cssnano-util-same-parent": "^4.0.0", + "postcss": "^7.0.0", + "postcss-selector-parser": "^3.0.0", + "vendors": "^1.0.0" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "requires": { + "dot-prop": "^4.1.1", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "postcss-minify-font-values": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz", + "integrity": "sha512-j85oO6OnRU9zPf04+PZv1LYIYOprWm6IA6zkXkrJXyRveDEuQggG6tvoy8ir8ZwjLxLuGfNkCZEQG7zan+Hbtg==", + "requires": { + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-minify-gradients": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz", + "integrity": "sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q==", + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "is-color-stop": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-minify-params": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz", + "integrity": "sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg==", + "requires": { + "alphanum-sort": "^1.0.0", + "browserslist": "^4.0.0", + "cssnano-util-get-arguments": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0", + "uniqs": "^2.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-minify-selectors": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz", + "integrity": "sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g==", + "requires": { + "alphanum-sort": "^1.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-selector-parser": "^3.0.0" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "requires": { + "dot-prop": "^4.1.1", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "postcss-modules-extract-imports": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz", + "integrity": "sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ==", + "requires": { + "postcss": "^7.0.5" + } + }, + "postcss-modules-local-by-default": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.2.tgz", + "integrity": "sha512-jM/V8eqM4oJ/22j0gx4jrp63GSvDH6v86OqyTHHUvk4/k1vceipZsaymiZ5PvocqZOl5SFHiFJqjs3la0wnfIQ==", + "requires": { + "icss-utils": "^4.1.1", + "postcss": "^7.0.16", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.0.0" + } + }, + "postcss-modules-scope": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.1.1.tgz", + "integrity": "sha512-OXRUPecnHCg8b9xWvldG/jUpRIGPNRka0r4D4j0ESUU2/5IOnpsjfPPmDprM3Ih8CgZ8FXjWqaniK5v4rWt3oQ==", + "requires": { + "postcss": "^7.0.6", + "postcss-selector-parser": "^6.0.0" + } + }, + "postcss-modules-values": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz", + "integrity": "sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg==", + "requires": { + "icss-utils": "^4.0.0", + "postcss": "^7.0.6" + } + }, + "postcss-nesting": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-7.0.1.tgz", + "integrity": "sha512-FrorPb0H3nuVq0Sff7W2rnc3SmIcruVC6YwpcS+k687VxyxO33iE1amna7wHuRVzM8vfiYofXSBHNAZ3QhLvYg==", + "requires": { + "postcss": "^7.0.2" + } + }, + "postcss-normalize": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize/-/postcss-normalize-8.0.1.tgz", + "integrity": "sha512-rt9JMS/m9FHIRroDDBGSMsyW1c0fkvOJPy62ggxSHUldJO7B195TqFMqIf+lY5ezpDcYOV4j86aUp3/XbxzCCQ==", + "requires": { + "@csstools/normalize.css": "^10.1.0", + "browserslist": "^4.6.2", + "postcss": "^7.0.17", + "postcss-browser-comments": "^3.0.0", + "sanitize.css": "^10.0.0" + } + }, + "postcss-normalize-charset": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz", + "integrity": "sha512-gMXCrrlWh6G27U0hF3vNvR3w8I1s2wOBILvA87iNXaPvSNo5uZAMYsZG7XjCUf1eVxuPfyL4TJ7++SGZLc9A3g==", + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-normalize-display-values": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz", + "integrity": "sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ==", + "requires": { + "cssnano-util-get-match": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-normalize-positions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz", + "integrity": "sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA==", + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-normalize-repeat-style": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz", + "integrity": "sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q==", + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "cssnano-util-get-match": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-normalize-string": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz", + "integrity": "sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA==", + "requires": { + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-normalize-timing-functions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz", + "integrity": "sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A==", + "requires": { + "cssnano-util-get-match": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-normalize-unicode": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz", + "integrity": "sha512-od18Uq2wCYn+vZ/qCOeutvHjB5jm57ToxRaMeNuf0nWVHaP9Hua56QyMF6fs/4FSUnVIw0CBPsU0K4LnBPwYwg==", + "requires": { + "browserslist": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-normalize-url": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz", + "integrity": "sha512-p5oVaF4+IHwu7VpMan/SSpmpYxcJMtkGppYf0VbdH5B6hN8YNmVyJLuY9FmLQTzY3fag5ESUUHDqM+heid0UVA==", + "requires": { + "is-absolute-url": "^2.0.0", + "normalize-url": "^3.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "normalize-url": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", + "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==" + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-normalize-whitespace": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz", + "integrity": "sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA==", + "requires": { + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-ordered-values": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz", + "integrity": "sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw==", + "requires": { + "cssnano-util-get-arguments": "^4.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-overflow-shorthand": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-overflow-shorthand/-/postcss-overflow-shorthand-2.0.0.tgz", + "integrity": "sha512-aK0fHc9CBNx8jbzMYhshZcEv8LtYnBIRYQD5i7w/K/wS9c2+0NSR6B3OVMu5y0hBHYLcMGjfU+dmWYNKH0I85g==", + "requires": { + "postcss": "^7.0.2" + } + }, + "postcss-page-break": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-page-break/-/postcss-page-break-2.0.0.tgz", + "integrity": "sha512-tkpTSrLpfLfD9HvgOlJuigLuk39wVTbbd8RKcy8/ugV2bNBUW3xU+AIqyxhDrQr1VUj1RmyJrBn1YWrqUm9zAQ==", + "requires": { + "postcss": "^7.0.2" + } + }, + "postcss-place": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-place/-/postcss-place-4.0.1.tgz", + "integrity": "sha512-Zb6byCSLkgRKLODj/5mQugyuj9bvAAw9LqJJjgwz5cYryGeXfFZfSXoP1UfveccFmeq0b/2xxwcTEVScnqGxBg==", + "requires": { + "postcss": "^7.0.2", + "postcss-values-parser": "^2.0.0" + } + }, + "postcss-preset-env": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/postcss-preset-env/-/postcss-preset-env-6.7.0.tgz", + "integrity": "sha512-eU4/K5xzSFwUFJ8hTdTQzo2RBLbDVt83QZrAvI07TULOkmyQlnYlpwep+2yIK+K+0KlZO4BvFcleOCCcUtwchg==", + "requires": { + "autoprefixer": "^9.6.1", + "browserslist": "^4.6.4", + "caniuse-lite": "^1.0.30000981", + "css-blank-pseudo": "^0.1.4", + "css-has-pseudo": "^0.10.0", + "css-prefers-color-scheme": "^3.1.1", + "cssdb": "^4.4.0", + "postcss": "^7.0.17", + "postcss-attribute-case-insensitive": "^4.0.1", + "postcss-color-functional-notation": "^2.0.1", + "postcss-color-gray": "^5.0.0", + "postcss-color-hex-alpha": "^5.0.3", + "postcss-color-mod-function": "^3.0.3", + "postcss-color-rebeccapurple": "^4.0.1", + "postcss-custom-media": "^7.0.8", + "postcss-custom-properties": "^8.0.11", + "postcss-custom-selectors": "^5.1.2", + "postcss-dir-pseudo-class": "^5.0.0", + "postcss-double-position-gradients": "^1.0.0", + "postcss-env-function": "^2.0.2", + "postcss-focus-visible": "^4.0.0", + "postcss-focus-within": "^3.0.0", + "postcss-font-variant": "^4.0.0", + "postcss-gap-properties": "^2.0.0", + "postcss-image-set-function": "^3.0.1", + "postcss-initial": "^3.0.0", + "postcss-lab-function": "^2.0.1", + "postcss-logical": "^3.0.0", + "postcss-media-minmax": "^4.0.0", + "postcss-nesting": "^7.0.0", + "postcss-overflow-shorthand": "^2.0.0", + "postcss-page-break": "^2.0.0", + "postcss-place": "^4.0.1", + "postcss-pseudo-class-any-link": "^6.0.0", + "postcss-replace-overflow-wrap": "^3.0.0", + "postcss-selector-matches": "^4.0.0", + "postcss-selector-not": "^4.0.0" + } + }, + "postcss-pseudo-class-any-link": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-6.0.0.tgz", + "integrity": "sha512-lgXW9sYJdLqtmw23otOzrtbDXofUdfYzNm4PIpNE322/swES3VU9XlXHeJS46zT2onFO7V1QFdD4Q9LiZj8mew==", + "requires": { + "postcss": "^7.0.2", + "postcss-selector-parser": "^5.0.0-rc.3" + }, + "dependencies": { + "cssesc": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", + "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" + }, + "postcss-selector-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", + "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", + "requires": { + "cssesc": "^2.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "postcss-reduce-initial": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz", + "integrity": "sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA==", + "requires": { + "browserslist": "^4.0.0", + "caniuse-api": "^3.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0" + } + }, + "postcss-reduce-transforms": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz", + "integrity": "sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg==", + "requires": { + "cssnano-util-get-match": "^4.0.0", + "has": "^1.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-replace-overflow-wrap": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-3.0.0.tgz", + "integrity": "sha512-2T5hcEHArDT6X9+9dVSPQdo7QHzG4XKclFT8rU5TzJPDN7RIRTbO9c4drUISOVemLj03aezStHCR2AIcr8XLpw==", + "requires": { + "postcss": "^7.0.2" + } + }, + "postcss-safe-parser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-4.0.1.tgz", + "integrity": "sha512-xZsFA3uX8MO3yAda03QrG3/Eg1LN3EPfjjf07vke/46HERLZyHrTsQ9E1r1w1W//fWEhtYNndo2hQplN2cVpCQ==", + "requires": { + "postcss": "^7.0.0" + } + }, + "postcss-selector-matches": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-selector-matches/-/postcss-selector-matches-4.0.0.tgz", + "integrity": "sha512-LgsHwQR/EsRYSqlwdGzeaPKVT0Ml7LAT6E75T8W8xLJY62CE4S/l03BWIt3jT8Taq22kXP08s2SfTSzaraoPww==", + "requires": { + "balanced-match": "^1.0.0", + "postcss": "^7.0.2" + } + }, + "postcss-selector-not": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-selector-not/-/postcss-selector-not-4.0.0.tgz", + "integrity": "sha512-W+bkBZRhqJaYN8XAnbbZPLWMvZD1wKTu0UxtFKdhtGjWYmxhkUneoeOhRJKdAE5V7ZTlnbHfCR+6bNwK9e1dTQ==", + "requires": { + "balanced-match": "^1.0.0", + "postcss": "^7.0.2" + } + }, + "postcss-selector-parser": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz", + "integrity": "sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg==", + "requires": { + "cssesc": "^3.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "postcss-svgo": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.2.tgz", + "integrity": "sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw==", + "requires": { + "is-svg": "^3.0.0", + "postcss": "^7.0.0", + "postcss-value-parser": "^3.0.0", + "svgo": "^1.0.0" + }, + "dependencies": { + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + } + } + }, + "postcss-unique-selectors": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz", + "integrity": "sha512-+JanVaryLo9QwZjKrmJgkI4Fn8SBgRO6WXQBJi7KiAVPlmxikB5Jzc4EvXMT2H0/m0RjrVVm9rGNhZddm/8Spg==", + "requires": { + "alphanum-sort": "^1.0.0", + "postcss": "^7.0.0", + "uniqs": "^2.0.0" + } + }, + "postcss-value-parser": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.2.tgz", + "integrity": "sha512-LmeoohTpp/K4UiyQCwuGWlONxXamGzCMtFxLq4W1nZVGIQLYvMCJx3yAF9qyyuFpflABI9yVdtJAqbihOsCsJQ==" + }, + "postcss-values-parser": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz", + "integrity": "sha512-2tLuBsA6P4rYTNKCXYG/71C7j1pU6pK503suYOmn4xYrQIzW+opD+7FAFNuGSdZC/3Qfy334QbeMu7MEb8gOxg==", + "requires": { + "flatten": "^1.0.2", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" + }, + "pretty-bytes": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.3.0.tgz", + "integrity": "sha512-hjGrh+P926p4R4WbaB6OckyRtO0F0/lQBiT+0gnxjV+5kjPBrfVBFCsCLbMqVQeydvIoouYTCmmEURiH3R1Bdg==" + }, + "pretty-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.1.tgz", + "integrity": "sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM=", + "requires": { + "renderkid": "^2.0.1", + "utila": "~0.4" + } + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + } + } + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" + }, + "promise": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.0.3.tgz", + "integrity": "sha512-HeRDUL1RJiLhyA0/grn+PTShlBAcLuh/1BJGtrvjwbvRDCTLLMEz9rOGCV+R3vHY4MixIuoMEd9Yq/XvsTPcjw==", + "requires": { + "asap": "~2.0.6" + } + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=" + }, + "prompts": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.0.tgz", + "integrity": "sha512-NfbbPPg/74fT7wk2XYQ7hAIp9zJyZp5Fu19iRbORqqy1BhtrkZ0fPafBU+7bmn8ie69DpT0R6QpJIN2oisYjJg==", + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.3" + } + }, + "prop-types": { + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + } + }, + "proxy-addr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.0" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + }, + "psl": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.6.0.tgz", + "integrity": "sha512-SYKKmVel98NCOYXpkwUqZqh0ahZeeKfmisiLIcEZdsb+WbLv02g/dI5BUmZnIyOe7RzZtLax81nnb2HbvC2tzA==" + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "query-string": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", + "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", + "requires": { + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=" + }, + "querystringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==" + }, + "raf": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "requires": { + "performance-now": "^2.1.0" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "dependencies": { + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + } + } + }, + "react": { + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", + "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2" + } + }, + "react-app-polyfill": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/react-app-polyfill/-/react-app-polyfill-1.0.5.tgz", + "integrity": "sha512-RcbV6+msbvZJZUIK/LX3UafPtoaDSJgUWu4sqBxHKTVmBsnlU2QWCKJRBRmgjxu+ivW/GPINbPWRM4Ppa6Lbgw==", + "requires": { + "core-js": "^3.4.1", + "object-assign": "^4.1.1", + "promise": "^8.0.3", + "raf": "^3.4.1", + "regenerator-runtime": "^0.13.3", + "whatwg-fetch": "^3.0.0" + } + }, + "react-dev-utils": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-10.0.0.tgz", + "integrity": "sha512-8OKSJvl8ccXJDNf0YGw377L9v1OnT16skD/EuZWm0M/yr255etP4x4kuUCT1EfFfJ7Rhc4ZTpPTfPrvgiXa50Q==", + "requires": { + "@babel/code-frame": "7.5.5", + "address": "1.1.2", + "browserslist": "4.7.3", + "chalk": "2.4.2", + "cross-spawn": "6.0.5", + "detect-port-alt": "1.1.6", + "escape-string-regexp": "1.0.5", + "filesize": "3.6.1", + "find-up": "3.0.0", + "fork-ts-checker-webpack-plugin": "3.1.0", + "global-modules": "2.0.0", + "globby": "8.0.2", + "gzip-size": "5.1.1", + "immer": "1.10.0", + "inquirer": "6.5.0", + "is-root": "2.1.0", + "loader-utils": "1.2.3", + "open": "^7.0.0", + "pkg-up": "2.0.0", + "react-error-overlay": "^6.0.4", + "recursive-readdir": "2.2.2", + "shell-quote": "1.7.2", + "strip-ansi": "5.2.0", + "text-table": "0.2.0" + }, + "dependencies": { + "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-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "browserslist": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.7.3.tgz", + "integrity": "sha512-jWvmhqYpx+9EZm/FxcZSbUZyDEvDTLDi3nSAKbzEkyWvtI0mNSmUosey+5awDW1RUlrgXbQb5A6qY1xQH9U6MQ==", + "requires": { + "caniuse-lite": "^1.0.30001010", + "electron-to-chromium": "^1.3.306", + "node-releases": "^1.1.40" + } + }, + "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" + } + }, + "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" + } + }, + "inquirer": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.0.tgz", + "integrity": "sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA==", + "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.12", + "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" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "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" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + } + } + }, + "react-dom": { + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.14.0.tgz", + "integrity": "sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2", + "scheduler": "^0.19.1" + } + }, + "react-error-overlay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.4.tgz", + "integrity": "sha512-ueZzLmHltszTshDMwyfELDq8zOA803wQ1ZuzCccXa1m57k1PxSHfflPD5W9YIiTXLs0JTLzoj6o1LuM5N6zzNA==" + }, + "react-faq-component": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/react-faq-component/-/react-faq-component-1.3.4.tgz", + "integrity": "sha512-oRXUfdr5OItsW4fRp5RMIUh4P2G1PAVMlFizWGR3ecwuCiNv/Akjx63yeOBrupCfh4AYqumPvQ3+hhKdxNkvxw==" + }, + "react-is": { + "version": "16.12.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz", + "integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==" + }, + "react-router": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", + "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", + "requires": { + "@babel/runtime": "^7.12.13", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", + "loose-envify": "^1.3.1", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", + "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "requires": { + "isarray": "0.0.1" + } + }, + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + } + } + }, + "react-router-dom": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz", + "integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==", + "requires": { + "@babel/runtime": "^7.12.13", + "history": "^4.9.0", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.2", + "react-router": "5.3.4", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", + "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + } + } + }, + "react-scripts": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-3.3.0.tgz", + "integrity": "sha512-hzPc6bxCc9GnsspWqk494c2Gpd0dRbk/C8q76BNQIENi9GMwoxFljOEcZoZcpFpJgQ45alxFR6QaLt+51qie7g==", + "requires": { + "@babel/core": "7.7.4", + "@svgr/webpack": "4.3.3", + "@typescript-eslint/eslint-plugin": "^2.8.0", + "@typescript-eslint/parser": "^2.8.0", + "babel-eslint": "10.0.3", + "babel-jest": "^24.9.0", + "babel-loader": "8.0.6", + "babel-plugin-named-asset-import": "^0.3.5", + "babel-preset-react-app": "^9.1.0", + "camelcase": "^5.3.1", + "case-sensitive-paths-webpack-plugin": "2.2.0", + "css-loader": "3.2.0", + "dotenv": "8.2.0", + "dotenv-expand": "5.1.0", + "eslint": "^6.6.0", + "eslint-config-react-app": "^5.1.0", + "eslint-loader": "3.0.2", + "eslint-plugin-flowtype": "3.13.0", + "eslint-plugin-import": "2.18.2", + "eslint-plugin-jsx-a11y": "6.2.3", + "eslint-plugin-react": "7.16.0", + "eslint-plugin-react-hooks": "^1.6.1", + "file-loader": "4.3.0", + "fs-extra": "^8.1.0", + "fsevents": "2.1.2", + "html-webpack-plugin": "4.0.0-beta.5", + "identity-obj-proxy": "3.0.0", + "jest": "24.9.0", + "jest-environment-jsdom-fourteen": "0.1.0", + "jest-resolve": "24.9.0", + "jest-watch-typeahead": "0.4.2", + "mini-css-extract-plugin": "0.8.0", + "optimize-css-assets-webpack-plugin": "5.0.3", + "pnp-webpack-plugin": "1.5.0", + "postcss-flexbugs-fixes": "4.1.0", + "postcss-loader": "3.0.0", + "postcss-normalize": "8.0.1", + "postcss-preset-env": "6.7.0", + "postcss-safe-parser": "4.0.1", + "react-app-polyfill": "^1.0.5", + "react-dev-utils": "^10.0.0", + "resolve": "1.12.2", + "resolve-url-loader": "3.1.1", + "sass-loader": "8.0.0", + "semver": "6.3.0", + "style-loader": "1.0.0", + "terser-webpack-plugin": "2.2.1", + "ts-pnp": "1.1.5", + "url-loader": "2.3.0", + "webpack": "4.41.2", + "webpack-dev-server": "3.9.0", + "webpack-manifest-plugin": "2.2.0", + "workbox-webpack-plugin": "4.3.1" + }, + "dependencies": { + "fsevents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", + "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", + "optional": true + }, + "resolve": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.2.tgz", + "integrity": "sha512-cAVTI2VLHWYsGOirfeYVVQ7ZDejtQ9fp4YhYckWDEkFfqbVjaT11iM8k6xSAfGFMM+gDpZjMnFssPu8we+mqFw==", + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "requires": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + } + }, + "react-translate": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/react-translate/-/react-translate-7.0.1.tgz", + "integrity": "sha512-YHKsjj3+3qy6i/lY463I/B1BY5iNc57In/B6pKNiqVYps95mZNTeFIpJAS8M6AmfwLxuHpmrNdI0pvde6jA7Ug==", + "requires": { + "invariant": "^2.1.2" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + }, + "dependencies": { + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "requires": { + "pify": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + } + } + }, + "readable-stream": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "realpath-native": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.1.0.tgz", + "integrity": "sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA==", + "requires": { + "util.promisify": "^1.0.0" + } + }, + "recursive-readdir": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", + "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", + "requires": { + "minimatch": "3.0.4" + } + }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==" + }, + "regenerate-unicode-properties": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz", + "integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==", + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-runtime": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", + "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==" + }, + "regenerator-transform": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.1.tgz", + "integrity": "sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ==", + "requires": { + "private": "^0.1.6" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regex-parser": { + "version": "2.2.10", + "resolved": "https://registry.npmjs.org/regex-parser/-/regex-parser-2.2.10.tgz", + "integrity": "sha512-8t6074A68gHfU8Neftl0Le6KTDwfGAj7IyjPIMSfikI2wJUTHDMaIq42bUsfVnj8mhx0R+45rdUXHGpN164avA==" + }, + "regexp.prototype.flags": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, + "regexpp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.0.0.tgz", + "integrity": "sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g==" + }, + "regexpu-core": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.6.0.tgz", + "integrity": "sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg==", + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.1.0", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "regjsgen": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz", + "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==" + }, + "regjsparser": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.1.tgz", + "integrity": "sha512-7LutE94sz/NKSYegK+/4E77+8DipxF+Qn2Tmu362AcmsF2NYq/wx3+ObvU90TKEhjf7hQoFXo23ajjrXP7eUgg==", + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" + } + } + }, + "relateurl": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", + "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=" + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + }, + "renderkid": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-2.0.3.tgz", + "integrity": "sha512-z8CLQp7EZBPCwCnncgf9C4XAi3WR0dv+uWu/PjIyhhAb5d6IJ/QZqlHFprHeKT+59//V6BNUsLbvN8+2LarxGA==", + "requires": { + "css-select": "^1.1.0", + "dom-converter": "^0.2", + "htmlparser2": "^3.3.0", + "strip-ansi": "^3.0.0", + "utila": "^0.4.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "css-select": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "requires": { + "boolbase": "~1.0.0", + "css-what": "2.1", + "domutils": "1.5.1", + "nth-check": "~1.0.1" + } + }, + "css-what": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", + "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==" + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + } + } + }, + "request-promise-core": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.3.tgz", + "integrity": "sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ==", + "requires": { + "lodash": "^4.17.15" + } + }, + "request-promise-native": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.8.tgz", + "integrity": "sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ==", + "requires": { + "request-promise-core": "1.1.3", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, + "resolve": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", + "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=" + }, + "resolve-pathname": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", + "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + }, + "resolve-url-loader": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-3.1.1.tgz", + "integrity": "sha512-K1N5xUjj7v0l2j/3Sgs5b8CjrrgtC70SmdCuZiJ8tSyb5J+uk3FoeZ4b7yTnH6j7ngI+Bc5bldHJIa8hYdu2gQ==", + "requires": { + "adjust-sourcemap-loader": "2.0.0", + "camelcase": "5.3.1", + "compose-function": "3.0.3", + "convert-source-map": "1.7.0", + "es6-iterator": "2.0.3", + "loader-utils": "1.2.3", + "postcss": "7.0.21", + "rework": "1.0.1", + "rework-visit": "1.0.0", + "source-map": "0.6.1" + }, + "dependencies": { + "postcss": { + "version": "7.0.21", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.21.tgz", + "integrity": "sha512-uIFtJElxJo29QC753JzhidoAhvp/e/Exezkdhfmt8AymWT6/5B7W1WmponYWkHk2eg6sONyTch0A3nkMPun3SQ==", + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + } + } + } + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" + }, + "rework": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rework/-/rework-1.0.1.tgz", + "integrity": "sha1-MIBqhBNCtUUQqkEQhQzUhTQUSqc=", + "requires": { + "convert-source-map": "^0.3.3", + "css": "^2.0.0" + }, + "dependencies": { + "convert-source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-0.3.5.tgz", + "integrity": "sha1-8dgClQr33SYxof6+BZZVDIarMZA=" + } + } + }, + "rework-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rework-visit/-/rework-visit-1.0.0.tgz", + "integrity": "sha1-mUWygD8hni96ygCtuLyfZA+ELJo=" + }, + "rgb-regex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz", + "integrity": "sha1-wODWiC3w4jviVKR16O3UGRX+rrE=" + }, + "rgba-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rgba-regex/-/rgba-regex-1.0.0.tgz", + "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=" + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rsvp": { + "version": "4.8.5", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", + "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==" + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "requires": { + "is-promise": "^2.1.0" + } + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "requires": { + "aproba": "^1.1.1" + } + }, + "rxjs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz", + "integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==", + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "sane": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", + "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", + "requires": { + "@cnakazawa/watch": "^1.0.3", + "anymatch": "^2.0.0", + "capture-exit": "^2.0.0", + "exec-sh": "^0.3.2", + "execa": "^1.0.0", + "fb-watchman": "^2.0.0", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5" + } + }, + "sanitize.css": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/sanitize.css/-/sanitize.css-10.0.0.tgz", + "integrity": "sha512-vTxrZz4dX5W86M6oVWVdOVe72ZiPs41Oi7Z6Km4W5Turyz28mrXSJhhEBZoRtzJWIv3833WKVwLSDWWkEfupMg==" + }, + "sass-loader": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-8.0.0.tgz", + "integrity": "sha512-+qeMu563PN7rPdit2+n5uuYVR0SSVwm0JsOUsaJXzgYcClWSlmX0iHDnmeOobPkf5kUglVot3QS6SyLyaQoJ4w==", + "requires": { + "clone-deep": "^4.0.1", + "loader-utils": "^1.2.3", + "neo-async": "^2.6.1", + "schema-utils": "^2.1.0", + "semver": "^6.3.0" + }, + "dependencies": { + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "requires": { + "kind-of": "^6.0.2" + } + } + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "saxes": { + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.11.tgz", + "integrity": "sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g==", + "requires": { + "xmlchars": "^2.1.1" + } + }, + "scheduler": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz", + "integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "schema-utils": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.6.1.tgz", + "integrity": "sha512-0WXHDs1VDJyo+Zqs9TKLKyD/h7yDpHUhEFsM2CzkICFdoX1av+GBq/J2xRTFfsQO5kBfhZzANf2VcIm84jqDbg==", + "requires": { + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1" + } + }, + "select-hose": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", + "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=" + }, + "selfsigned": { + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.7.tgz", + "integrity": "sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==", + "requires": { + "node-forge": "0.9.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, + "serialize-javascript": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", + "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==" + }, + "serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", + "requires": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.17", + "parseurl": "~1.3.2" + }, + "dependencies": { + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shallow-clone": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-0.1.2.tgz", + "integrity": "sha1-WQnodLp3EG1zrEFM/sH/yofZcGA=", + "requires": { + "is-extendable": "^0.1.1", + "kind-of": "^2.0.1", + "lazy-cache": "^0.2.3", + "mixin-object": "^2.0.1" + }, + "dependencies": { + "kind-of": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-2.0.1.tgz", + "integrity": "sha1-AY7HpM5+OobLkUG+UZ0kyPqpgbU=", + "requires": { + "is-buffer": "^1.0.2" + } + }, + "lazy-cache": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", + "integrity": "sha1-f+3fLctu23fRHvHRF6tf/fCrG2U=" + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "shell-quote": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", + "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==" + }, + "shellwords": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "requires": { + "is-arrayish": "^0.3.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + } + } + }, + "sisteransi": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.4.tgz", + "integrity": "sha512-/ekMoM4NJ59ivGSfKapeG+FWtrmWvA1p6FBZwXrqojw90vJu8lBmrTxCMuBCydKtkaUe2zt4PlxeTKpjwMbyig==" + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==" + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + } + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "requires": { + "kind-of": "^3.2.0" + } + }, + "sockjs": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz", + "integrity": "sha512-V48klKZl8T6MzatbLlzzRNhMepEys9Y4oGFpypBFFn1gLI/QQ9HtLLyWJNbPlwGLelOVOEijUbTTJeLLI59jLw==", + "requires": { + "faye-websocket": "^0.10.0", + "uuid": "^3.0.1" + } + }, + "sockjs-client": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.4.0.tgz", + "integrity": "sha512-5zaLyO8/nri5cua0VtOrFXBPK1jbL4+1cebT/mmKA1E1ZXOvJrII75bPu0l0k843G/+iAbhEqzyKr0w/eCCj7g==", + "requires": { + "debug": "^3.2.5", + "eventsource": "^1.0.7", + "faye-websocket": "~0.11.1", + "inherits": "^2.0.3", + "json3": "^3.3.2", + "url-parse": "^1.4.3" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "faye-websocket": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz", + "integrity": "sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA==", + "requires": { + "websocket-driver": ">=0.5.1" + } + } + } + }, + "sort-keys": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", + "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", + "requires": { + "is-plain-obj": "^1.0.0" + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==" + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", + "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" + }, + "spdy": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.1.tgz", + "integrity": "sha512-HeZS3PBdMA+sZSu0qwpCxl3DeALD5ASx8pAX0jZdKXSpPWbQ6SYGnlg3BBmYLx5LtiZrmkAZfErCm2oECBcioA==", + "requires": { + "debug": "^4.1.0", + "handle-thing": "^2.0.0", + "http-deceiver": "^1.2.7", + "select-hose": "^2.0.0", + "spdy-transport": "^3.0.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "spdy-transport": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", + "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", + "requires": { + "debug": "^4.1.0", + "detect-node": "^2.0.4", + "hpack.js": "^2.1.6", + "obuf": "^1.1.2", + "readable-stream": "^3.0.6", + "wbuf": "^1.7.3" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "ssri": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-7.1.0.tgz", + "integrity": "sha512-77/WrDZUWocK0mvA5NTRQyveUf+wsrIc6vyrxpS8tVvYBcX215QbafrJR3KtkpskIzoFLqqNuuYQvxaMjXJ/0g==", + "requires": { + "figgy-pudding": "^3.5.1", + "minipass": "^3.1.1" + } + }, + "stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==" + }, + "stack-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz", + "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==" + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" + }, + "string-length": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", + "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", + "requires": { + "astral-regex": "^1.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "string.prototype.trimleft": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", + "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", + "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "requires": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "requires": { + "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + } + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + }, + "strip-comments": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/strip-comments/-/strip-comments-1.0.2.tgz", + "integrity": "sha512-kL97alc47hoyIQSV165tTt9rG5dn4w1dNnBhOQ3bOU1Nc1hel09jnXANaHJ7vzHLd4Ju8kseDGzlev96pghLFw==", + "requires": { + "babel-extract-comments": "^1.0.0", + "babel-plugin-transform-object-rest-spread": "^6.26.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "requires": { + "min-indent": "^1.0.0" + } + }, + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==" + }, + "style-loader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-1.0.0.tgz", + "integrity": "sha512-B0dOCFwv7/eY31a5PCieNwMgMhVGFe9w+rh7s/Bx8kfFkrth9zfTZquoYvdw8URgiqxObQKcpW51Ugz1HjfdZw==", + "requires": { + "loader-utils": "^1.2.3", + "schema-utils": "^2.0.1" + } + }, + "stylehacks": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz", + "integrity": "sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==", + "requires": { + "browserslist": "^4.0.0", + "postcss": "^7.0.0", + "postcss-selector-parser": "^3.0.0" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "requires": { + "dot-prop": "^4.1.1", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + } + } + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "svg-parser": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.2.tgz", + "integrity": "sha512-1gtApepKFweigFZj3sGO8KT8LvVZK8io146EzXrpVuWCDAbISz/yMucco3hWTkpZNoPabM+dnMOpy6Swue68Zg==" + }, + "svgo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz", + "integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==", + "requires": { + "chalk": "^2.4.1", + "coa": "^2.0.2", + "css-select": "^2.0.0", + "css-select-base-adapter": "^0.1.1", + "css-tree": "1.0.0-alpha.37", + "csso": "^4.0.2", + "js-yaml": "^3.13.1", + "mkdirp": "~0.5.1", + "object.values": "^1.1.0", + "sax": "~1.2.4", + "stable": "^0.1.8", + "unquote": "~1.1.1", + "util.promisify": "~1.0.0" + } + }, + "symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==" + }, + "terser": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.4.3.tgz", + "integrity": "sha512-0ikKraVtRDKGzHrzkCv5rUNDzqlhmhowOBqC0XqUHFpW+vJ45+20/IFBcebwKfiS2Z9fJin6Eo+F1zLZsxi8RA==", + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + } + }, + "terser-webpack-plugin": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.2.1.tgz", + "integrity": "sha512-jwdauV5Al7zopR6OAYvIIRcxXCSvLjZjr7uZE8l2tIWb/ryrGN48sJftqGf5k9z09tWhajx53ldp0XPI080YnA==", + "requires": { + "cacache": "^13.0.1", + "find-cache-dir": "^3.0.0", + "jest-worker": "^24.9.0", + "schema-utils": "^2.5.0", + "serialize-javascript": "^2.1.0", + "source-map": "^0.6.1", + "terser": "^4.3.9", + "webpack-sources": "^1.4.3" + }, + "dependencies": { + "find-cache-dir": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz", + "integrity": "sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==", + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.0", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "make-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", + "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "requires": { + "semver": "^6.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "requires": { + "find-up": "^4.0.0" + } + } + } + }, + "test-exclude": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", + "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "requires": { + "glob": "^7.1.3", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^2.0.0" + }, + "dependencies": { + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + }, + "throat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", + "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=" + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "thunky": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", + "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==" + }, + "timers-browserify": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", + "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", + "requires": { + "setimmediate": "^1.0.4" + } + }, + "timsort": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", + "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=" + }, + "tiny-invariant": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz", + "integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==" + }, + "tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "tmpl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=" + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=" + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "requires": { + "punycode": "^2.1.0" + } + }, + "ts-pnp": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ts-pnp/-/ts-pnp-1.1.5.tgz", + "integrity": "sha512-ti7OGMOUOzo66wLF3liskw6YQIaSsBgc4GOAlWRnIEj8htCxJUxskanMUoJOD6MDCRAXo36goXJZch+nOS0VMA==" + }, + "tslib": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" + }, + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "requires": { + "tslib": "^1.8.1" + } + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "uglify-js": { + "version": "3.4.10", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", + "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==", + "requires": { + "commander": "~2.19.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" + } + } + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==" + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz", + "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==" + }, + "unicode-property-aliases-ecmascript": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", + "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==" + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=" + }, + "uniqs": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", + "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=" + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "unquote": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=" + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==" + }, + "upper-case": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", + "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=" + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + } + } + }, + "url-loader": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-2.3.0.tgz", + "integrity": "sha512-goSdg8VY+7nPZKUEChZSEtW5gjbS66USIGCeSJ1OVOJ7Yfuh/36YxCwMi5HVEJh6mqUYOoy3NJ0vlOMrWsSHog==", + "requires": { + "loader-utils": "^1.2.3", + "mime": "^2.4.4", + "schema-utils": "^2.5.0" + } + }, + "url-parse": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", + "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "requires": { + "inherits": "2.0.1" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "utila": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz", + "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==" + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "value-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", + "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "vendors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.3.tgz", + "integrity": "sha512-fOi47nsJP5Wqefa43kyWSg80qF+Q3XA6MUkgi7Hp1HQaKDQW4cQrK2D0P7mmbFtsV1N89am55Yru/nyEwRubcw==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" + }, + "w3c-hr-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", + "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "requires": { + "browser-process-hrtime": "^0.1.2" + } + }, + "w3c-xmlserializer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz", + "integrity": "sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg==", + "requires": { + "domexception": "^1.0.1", + "webidl-conversions": "^4.0.2", + "xml-name-validator": "^3.0.0" + } + }, + "wait-for-expect": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/wait-for-expect/-/wait-for-expect-3.0.2.tgz", + "integrity": "sha512-cfS1+DZxuav1aBYbaO/kE06EOS8yRw7qOFoD3XtjTkYvCvh3zUvNST8DXK/nPaeqIzIv3P3kL3lRJn8iwOiSag==" + }, + "walker": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "requires": { + "makeerror": "1.0.x" + } + }, + "watchpack": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", + "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "requires": { + "chokidar": "^2.0.2", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0" + } + }, + "wbuf": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", + "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", + "requires": { + "minimalistic-assert": "^1.0.0" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" + }, + "webpack": { + "version": "4.41.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.41.2.tgz", + "integrity": "sha512-Zhw69edTGfbz9/8JJoyRQ/pq8FYUoY0diOXqW0T6yhgdhCv6wr0hra5DwwWexNRns2Z2+gsnrNcbe9hbGBgk/A==", + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-module-context": "1.8.5", + "@webassemblyjs/wasm-edit": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5", + "acorn": "^6.2.1", + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^4.1.0", + "eslint-scope": "^4.0.3", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.4.0", + "loader-utils": "^1.2.3", + "memory-fs": "^0.4.1", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.1", + "neo-async": "^2.6.1", + "node-libs-browser": "^2.2.1", + "schema-utils": "^1.0.0", + "tapable": "^1.1.3", + "terser-webpack-plugin": "^1.4.1", + "watchpack": "^1.6.0", + "webpack-sources": "^1.4.1" + }, + "dependencies": { + "acorn": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", + "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==" + }, + "cacache": { + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz", + "integrity": "sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw==", + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "terser-webpack-plugin": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz", + "integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==", + "requires": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^2.1.2", + "source-map": "^0.6.1", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + } + } + } + }, + "webpack-dev-middleware": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.2.tgz", + "integrity": "sha512-1xC42LxbYoqLNAhV6YzTYacicgMZQTqRd27Sim9wn5hJrX3I5nxYy1SxSd4+gjUFsz1dQFj+yEe6zEVmSkeJjw==", + "requires": { + "memory-fs": "^0.4.1", + "mime": "^2.4.4", + "mkdirp": "^0.5.1", + "range-parser": "^1.2.1", + "webpack-log": "^2.0.0" + } + }, + "webpack-dev-server": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.9.0.tgz", + "integrity": "sha512-E6uQ4kRrTX9URN9s/lIbqTAztwEPdvzVrcmHE8EQ9YnuT9J8Es5Wrd8n9BKg1a0oZ5EgEke/EQFgUsp18dSTBw==", + "requires": { + "ansi-html": "0.0.7", + "bonjour": "^3.5.0", + "chokidar": "^2.1.8", + "compression": "^1.7.4", + "connect-history-api-fallback": "^1.6.0", + "debug": "^4.1.1", + "del": "^4.1.1", + "express": "^4.17.1", + "html-entities": "^1.2.1", + "http-proxy-middleware": "0.19.1", + "import-local": "^2.0.0", + "internal-ip": "^4.3.0", + "ip": "^1.1.5", + "is-absolute-url": "^3.0.3", + "killable": "^1.0.1", + "loglevel": "^1.6.4", + "opn": "^5.5.0", + "p-retry": "^3.0.1", + "portfinder": "^1.0.25", + "schema-utils": "^1.0.0", + "selfsigned": "^1.10.7", + "semver": "^6.3.0", + "serve-index": "^1.9.1", + "sockjs": "0.3.19", + "sockjs-client": "1.4.0", + "spdy": "^4.0.1", + "strip-ansi": "^3.0.1", + "supports-color": "^6.1.0", + "url": "^0.11.0", + "webpack-dev-middleware": "^3.7.2", + "webpack-log": "^2.0.0", + "ws": "^6.2.1", + "yargs": "12.0.5" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + }, + "is-absolute-url": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz", + "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + } + } + }, + "ws": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "requires": { + "async-limiter": "~1.0.0" + } + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "webpack-log": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/webpack-log/-/webpack-log-2.0.0.tgz", + "integrity": "sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg==", + "requires": { + "ansi-colors": "^3.0.0", + "uuid": "^3.3.2" + } + }, + "webpack-manifest-plugin": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webpack-manifest-plugin/-/webpack-manifest-plugin-2.2.0.tgz", + "integrity": "sha512-9S6YyKKKh/Oz/eryM1RyLVDVmy3NSPV0JXMRhZ18fJsq+AwGxUY34X54VNwkzYcEmEkDwNxuEOboCZEebJXBAQ==", + "requires": { + "fs-extra": "^7.0.0", + "lodash": ">=3.5 <5", + "object.entries": "^1.1.0", + "tapable": "^1.0.0" + }, + "dependencies": { + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + } + } + }, + "webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } + }, + "websocket-driver": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.3.tgz", + "integrity": "sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==", + "requires": { + "http-parser-js": ">=0.4.0 <0.4.11", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + } + }, + "websocket-extensions": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", + "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==" + }, + "whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "requires": { + "iconv-lite": "0.4.24" + } + }, + "whatwg-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" + }, + "whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==" + }, + "whatwg-url": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", + "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + }, + "workbox-background-sync": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-background-sync/-/workbox-background-sync-4.3.1.tgz", + "integrity": "sha512-1uFkvU8JXi7L7fCHVBEEnc3asPpiAL33kO495UMcD5+arew9IbKW2rV5lpzhoWcm/qhGB89YfO4PmB/0hQwPRg==", + "requires": { + "workbox-core": "^4.3.1" + } + }, + "workbox-broadcast-update": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-broadcast-update/-/workbox-broadcast-update-4.3.1.tgz", + "integrity": "sha512-MTSfgzIljpKLTBPROo4IpKjESD86pPFlZwlvVG32Kb70hW+aob4Jxpblud8EhNb1/L5m43DUM4q7C+W6eQMMbA==", + "requires": { + "workbox-core": "^4.3.1" + } + }, + "workbox-build": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-build/-/workbox-build-4.3.1.tgz", + "integrity": "sha512-UHdwrN3FrDvicM3AqJS/J07X0KXj67R8Cg0waq1MKEOqzo89ap6zh6LmaLnRAjpB+bDIz+7OlPye9iii9KBnxw==", + "requires": { + "@babel/runtime": "^7.3.4", + "@hapi/joi": "^15.0.0", + "common-tags": "^1.8.0", + "fs-extra": "^4.0.2", + "glob": "^7.1.3", + "lodash.template": "^4.4.0", + "pretty-bytes": "^5.1.0", + "stringify-object": "^3.3.0", + "strip-comments": "^1.0.2", + "workbox-background-sync": "^4.3.1", + "workbox-broadcast-update": "^4.3.1", + "workbox-cacheable-response": "^4.3.1", + "workbox-core": "^4.3.1", + "workbox-expiration": "^4.3.1", + "workbox-google-analytics": "^4.3.1", + "workbox-navigation-preload": "^4.3.1", + "workbox-precaching": "^4.3.1", + "workbox-range-requests": "^4.3.1", + "workbox-routing": "^4.3.1", + "workbox-strategies": "^4.3.1", + "workbox-streams": "^4.3.1", + "workbox-sw": "^4.3.1", + "workbox-window": "^4.3.1" + }, + "dependencies": { + "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" + } + } + } + }, + "workbox-cacheable-response": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-cacheable-response/-/workbox-cacheable-response-4.3.1.tgz", + "integrity": "sha512-Rp5qlzm6z8IOvnQNkCdO9qrDgDpoPNguovs0H8C+wswLuPgSzSp9p2afb5maUt9R1uTIwOXrVQMmPfPypv+npw==", + "requires": { + "workbox-core": "^4.3.1" + } + }, + "workbox-core": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-core/-/workbox-core-4.3.1.tgz", + "integrity": "sha512-I3C9jlLmMKPxAC1t0ExCq+QoAMd0vAAHULEgRZ7kieCdUd919n53WC0AfvokHNwqRhGn+tIIj7vcb5duCjs2Kg==" + }, + "workbox-expiration": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-expiration/-/workbox-expiration-4.3.1.tgz", + "integrity": "sha512-vsJLhgQsQouv9m0rpbXubT5jw0jMQdjpkum0uT+d9tTwhXcEZks7qLfQ9dGSaufTD2eimxbUOJfWLbNQpIDMPw==", + "requires": { + "workbox-core": "^4.3.1" + } + }, + "workbox-google-analytics": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-google-analytics/-/workbox-google-analytics-4.3.1.tgz", + "integrity": "sha512-xzCjAoKuOb55CBSwQrbyWBKqp35yg1vw9ohIlU2wTy06ZrYfJ8rKochb1MSGlnoBfXGWss3UPzxR5QL5guIFdg==", + "requires": { + "workbox-background-sync": "^4.3.1", + "workbox-core": "^4.3.1", + "workbox-routing": "^4.3.1", + "workbox-strategies": "^4.3.1" + } + }, + "workbox-navigation-preload": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-navigation-preload/-/workbox-navigation-preload-4.3.1.tgz", + "integrity": "sha512-K076n3oFHYp16/C+F8CwrRqD25GitA6Rkd6+qAmLmMv1QHPI2jfDwYqrytOfKfYq42bYtW8Pr21ejZX7GvALOw==", + "requires": { + "workbox-core": "^4.3.1" + } + }, + "workbox-precaching": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-precaching/-/workbox-precaching-4.3.1.tgz", + "integrity": "sha512-piSg/2csPoIi/vPpp48t1q5JLYjMkmg5gsXBQkh/QYapCdVwwmKlU9mHdmy52KsDGIjVaqEUMFvEzn2LRaigqQ==", + "requires": { + "workbox-core": "^4.3.1" + } + }, + "workbox-range-requests": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-range-requests/-/workbox-range-requests-4.3.1.tgz", + "integrity": "sha512-S+HhL9+iTFypJZ/yQSl/x2Bf5pWnbXdd3j57xnb0V60FW1LVn9LRZkPtneODklzYuFZv7qK6riZ5BNyc0R0jZA==", + "requires": { + "workbox-core": "^4.3.1" + } + }, + "workbox-routing": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-routing/-/workbox-routing-4.3.1.tgz", + "integrity": "sha512-FkbtrODA4Imsi0p7TW9u9MXuQ5P4pVs1sWHK4dJMMChVROsbEltuE79fBoIk/BCztvOJ7yUpErMKa4z3uQLX+g==", + "requires": { + "workbox-core": "^4.3.1" + } + }, + "workbox-strategies": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-strategies/-/workbox-strategies-4.3.1.tgz", + "integrity": "sha512-F/+E57BmVG8dX6dCCopBlkDvvhg/zj6VDs0PigYwSN23L8hseSRwljrceU2WzTvk/+BSYICsWmRq5qHS2UYzhw==", + "requires": { + "workbox-core": "^4.3.1" + } + }, + "workbox-streams": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-streams/-/workbox-streams-4.3.1.tgz", + "integrity": "sha512-4Kisis1f/y0ihf4l3u/+ndMkJkIT4/6UOacU3A4BwZSAC9pQ9vSvJpIi/WFGQRH/uPXvuVjF5c2RfIPQFSS2uA==", + "requires": { + "workbox-core": "^4.3.1" + } + }, + "workbox-sw": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-sw/-/workbox-sw-4.3.1.tgz", + "integrity": "sha512-0jXdusCL2uC5gM3yYFT6QMBzKfBr2XTk0g5TPAV4y8IZDyVNDyj1a8uSXy3/XrvkVTmQvLN4O5k3JawGReXr9w==" + }, + "workbox-webpack-plugin": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-webpack-plugin/-/workbox-webpack-plugin-4.3.1.tgz", + "integrity": "sha512-gJ9jd8Mb8wHLbRz9ZvGN57IAmknOipD3W4XNE/Lk/4lqs5Htw4WOQgakQy/o/4CoXQlMCYldaqUg+EJ35l9MEQ==", + "requires": { + "@babel/runtime": "^7.0.0", + "json-stable-stringify": "^1.0.1", + "workbox-build": "^4.3.1" + } + }, + "workbox-window": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/workbox-window/-/workbox-window-4.3.1.tgz", + "integrity": "sha512-C5gWKh6I58w3GeSc0wp2Ne+rqVw8qwcmZnQGpjiek8A2wpbxSJb1FdCoQVO+jDJs35bFgo/WETgl1fqgsxN0Hg==", + "requires": { + "workbox-core": "^4.3.1" + } + }, + "worker-farm": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", + "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "requires": { + "errno": "~0.1.7" + } + }, + "worker-rpc": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/worker-rpc/-/worker-rpc-0.1.1.tgz", + "integrity": "sha512-P1WjMrUB3qgJNI9jfmpZ/htmBEjFh//6l/5y8SD9hg1Ef5zTTVVoRjTrTEzPrNBQvmhMxkoTsjOXN10GWU7aCg==", + "requires": { + "microevent.ts": "~0.1.1" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "requires": { + "mkdirp": "^0.5.1" + } + }, + "write-file-atomic": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.1.tgz", + "integrity": "sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg==", + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "requires": { + "async-limiter": "~1.0.0" + } + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==" + }, + "xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "yaml": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.7.2.tgz", + "integrity": "sha512-qXROVp90sb83XtAoqE8bP9RwAkTTZbugRUTm5YeFCBfNRPEp2YzTeqWiz7m5OORHzEvrA/qcGS8hp/E+MMROYw==", + "requires": { + "@babel/runtime": "^7.6.3" + } + }, + "yargs": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } +} diff --git a/frontend/mono-ui/web/egov-common-screen/package.json b/frontend/mono-ui/web/egov-common-screen/package.json new file mode 100644 index 00000000000..cbab8b5d182 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/package.json @@ -0,0 +1,46 @@ +{ + "name": "egov-intermediate", + "version": "0.1.0", + "private": true, + "homepage": "https://mseva-uat.lgpunjab.gov.in/common/", + "proxy": "https://mseva-uat.lgpunjab.gov.in", + "dependencies": { + "@material-ui/core": "^4.12.4", + "@material-ui/icons": "^4.11.3", + "@testing-library/jest-dom": "^4.2.4", + "@testing-library/react": "^9.5.0", + "@testing-library/user-event": "^7.1.2", + "axios": "^0.19.2", + "bootstrap": "^5.3.1", + "jquery": "^3.7.0", + "popper.js": "^1.16.1", + "react": "^16.14.0", + "react-dom": "^16.14.0", + "react-faq-component": "^1.3.4", + "react-router": "^5.3.4", + "react-router-dom": "^5.3.4", + "react-scripts": "3.3.0", + "react-translate": "^7.0.1" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/frontend/mono-ui/web/egov-common-screen/public/assets/Punjab-bg-QA.jpg b/frontend/mono-ui/web/egov-common-screen/public/assets/Punjab-bg-QA.jpg new file mode 100644 index 00000000000..ee6d239ee66 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/public/assets/Punjab-bg-QA.jpg differ diff --git a/frontend/mono-ui/web/egov-common-screen/public/assets/citizen.png b/frontend/mono-ui/web/egov-common-screen/public/assets/citizen.png new file mode 100644 index 00000000000..aef7d25c731 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/public/assets/citizen.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/public/assets/mseva-punjab.png b/frontend/mono-ui/web/egov-common-screen/public/assets/mseva-punjab.png new file mode 100644 index 00000000000..2e57d7aaa5a Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/public/assets/mseva-punjab.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/public/assets/municiple-employee.png b/frontend/mono-ui/web/egov-common-screen/public/assets/municiple-employee.png new file mode 100644 index 00000000000..4aaefae7e13 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/public/assets/municiple-employee.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/public/browser-icon.png b/frontend/mono-ui/web/egov-common-screen/public/browser-icon.png new file mode 100644 index 00000000000..32e2488b00e Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/public/browser-icon.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/public/index.html b/frontend/mono-ui/web/egov-common-screen/public/index.html new file mode 100644 index 00000000000..8b747c23963 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/public/index.html @@ -0,0 +1,35 @@ + + + + + + + + + mSeva - Portal for availing Urban Municipal Services Online - Department of Local Government Punjab + + + + + + + + + + + + + + + + +
+ + + diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/public/manifest.json b/frontend/mono-ui/web/egov-common-screen/public/manifest.json similarity index 100% rename from frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/public/manifest.json rename to frontend/mono-ui/web/egov-common-screen/public/manifest.json diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/public/robots.txt b/frontend/mono-ui/web/egov-common-screen/public/robots.txt similarity index 100% rename from frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/public/robots.txt rename to frontend/mono-ui/web/egov-common-screen/public/robots.txt diff --git a/frontend/mono-ui/web/egov-common-screen/public/ror.xml b/frontend/mono-ui/web/egov-common-screen/public/ror.xml new file mode 100644 index 00000000000..73724bcc002 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/public/ror.xml @@ -0,0 +1,17 @@ + + + + ROR Sitemap for https://mseva.lgpunjab.gov.in/common-screen + https://mseva.lgpunjab.gov.in/common-screen + + + https://mseva.lgpunjab.gov.in/common-screen + mSeva - Portal for availing Urban Municipal Services Online - Department of Local Government Punjab + Through mSeva you can avail services in Urban Local Bodies like Property Tax , Trade License , Fire NOC , Complaints , Public Grievance Redressal , New Water Connection , New Sewerage connection , Pay utility Bills like water and sewerage + weekly + 0 + sitemap + + + + \ No newline at end of file diff --git a/frontend/mono-ui/web/egov-common-screen/public/sitemap.html b/frontend/mono-ui/web/egov-common-screen/public/sitemap.html new file mode 100644 index 00000000000..6de0c1abbc0 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/public/sitemap.html @@ -0,0 +1,140 @@ + + + + + + mseva.lgpunjab.gov.in Site Map - Generated by www.xml-sitemaps.com + + + + + +
+ +

+Last updated: 2023, September 1
+Total pages: 1
+mseva.lgpunjab.gov.in Homepage +

+ + + + + \ No newline at end of file diff --git a/frontend/mono-ui/web/egov-common-screen/public/sitemap.xml b/frontend/mono-ui/web/egov-common-screen/public/sitemap.xml new file mode 100644 index 00000000000..48d7262ca37 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/public/sitemap.xml @@ -0,0 +1,17 @@ + + + + + + + https://mseva.lgpunjab.gov.in/common-screen + 2023-08-25T11:57:13+00:00 + weekly + + + + \ No newline at end of file diff --git a/frontend/mono-ui/web/egov-common-screen/public/sitemap.xml.gz b/frontend/mono-ui/web/egov-common-screen/public/sitemap.xml.gz new file mode 100644 index 00000000000..7b25c4adcc9 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/public/sitemap.xml.gz differ diff --git a/frontend/mono-ui/web/egov-common-screen/public/urllist.txt b/frontend/mono-ui/web/egov-common-screen/public/urllist.txt new file mode 100644 index 00000000000..4dcea487784 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/public/urllist.txt @@ -0,0 +1 @@ +https://mseva.lgpunjab.gov.in/common-screen diff --git a/frontend/mono-ui/web/egov-common-screen/src/App.css b/frontend/mono-ui/web/egov-common-screen/src/App.css new file mode 100644 index 00000000000..dc0d479eead --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/App.css @@ -0,0 +1,3 @@ +.app-grid { + height: 100%; +} \ No newline at end of file diff --git a/frontend/mono-ui/web/egov-common-screen/src/App.js b/frontend/mono-ui/web/egov-common-screen/src/App.js new file mode 100644 index 00000000000..5221ecb92e5 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/App.js @@ -0,0 +1,40 @@ +import React from 'react'; +import './App.css'; +import { Grid } from '@material-ui/core'; +//import LandingPage from './components/LandingPage'; +import Header from './components/Header'; +import Cards from './components/Cards'; +import Faqs from './components/Faqs'; +import Footer from './components/Footer'; +import digitLogo from "./img/digit-footer.png"; + + + +function App() { + return ( + + +
+
+ +

Frequently Asked Questions

+
+
+ +
+
+
+ ); +} +export default App; \ No newline at end of file diff --git a/frontend/mono-ui/web/egov-common-screen/src/App.test.js b/frontend/mono-ui/web/egov-common-screen/src/App.test.js new file mode 100644 index 00000000000..4db7ebc25c2 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/App.test.js @@ -0,0 +1,9 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import App from './App'; + +test('renders learn react link', () => { + const { getByText } = render(); + const linkElement = getByText(/learn react/i); + expect(linkElement).toBeInTheDocument(); +}); diff --git a/frontend/mono-ui/web/egov-common-screen/src/Roboto-Regular.ttf b/frontend/mono-ui/web/egov-common-screen/src/Roboto-Regular.ttf new file mode 100644 index 00000000000..3d6861b4239 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/Roboto-Regular.ttf differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/components/Cards/index.css b/frontend/mono-ui/web/egov-common-screen/src/components/Cards/index.css new file mode 100644 index 00000000000..6aa707fc6a7 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/components/Cards/index.css @@ -0,0 +1,405 @@ + +#card1{ + background: #FFFFFF; + box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12); + border-radius: 8px; +} +#card2{ + background: #FFFFFF; + box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12); + border-radius: 8px; + +} +#card3{ + background: #FFFFFF; + box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12); + border-radius: 8px; + +} +.cardservice h5 { + color: #F47738; +} +#paylink1 +{ + background: #F47738; + border-radius: 32px; + width: 168px; + height: 32px; + left: 146px; + top: 504px; + color:#FFFFFF; + margin-top: 10%; + +} +#arrowicon1{ + height: 12px; + width: 12px; +} +#arrowicon2{ + height: 12px; + width: 12px; +} +#arrowicon3{ + height: 12px; + width: 12px; +} + +#paylink2 +{ + background: #F47738; + border-radius: 32px; + width: 168px; + height: 32px; + left: 146px; + top: 504px; + color:#FFFFFF; + margin-top: 5%; + +} +#paylink3 +{ + background: #F47738; + border-radius: 32px; + width: 95px; + height: 32px; + left: 146px; + top: 504px; + color:#FFFFFF; + margin-top: 10%; +} +#cardheadingsnew +{ + width: 104px; + height: 8px; + left: 200px; + top: 369px; + margin-left: 71px; + font-weight: 500; +} + +#carddescription +{ + font-family: Roboto; +font-style: normal; +font-weight: normal; +font-size: 14px; +line-height: 20px; +} +@media only screen and (max-width: 576px) { + + + #card1 + { + height: auto !important; + width: auto !important; + margin-top: 10px!important; + margin-left: auto !important; + } + #card2 + { + height: auto !important; + width: auto !important; + margin-top: auto !important; + margin-left: auto !important; + + } + #card3 + { + height: auto !important; + margin-top: auto !important; + margin-left: auto !important; + width: 100% !important; + + } + + +} + + +@media only screen and (max-width: 1920px) { + + /* #container + { + margin-left: 2%; + margin-right: 2%; + + } */ + + + #griditem + { + z-index: 100; + } + + #card1 + { + height: 270px; + margin-top: -114px; + } + #card2 + { + height: 270px; + margin-top: -114px; + + } + #card3 + { + height: 270px; + margin-top: -114px; + } + +} + + +@media only screen and (max-width: 1600px) { + + #container + { + margin-left: 2%; + margin-right: 2%; + + } + + + #griditem + { + z-index: 100; + } + + #card1 + { + height: 265px; + margin-top: -114px; + } + #card2 + { + height: 265px; + margin-top: -114px; + + } + #card3 + { + height: 265px; + margin-top: -114px; + } + +} + + +@media only screen and (max-width: 1367px) { + + + #card1 + { + height: 285px; + margin-top: -114px; + } + #card2 + { + height: 285px; + margin-top: -114px; + + } + #card3 + { + height: 285px; + margin-top: -114px; + } + + +} +@media only screen and (max-width: 1280px) { + + + + #card1 + { + height: 270px; + margin-top: -114px; + } + #card2 + { + height: 270px; + margin-top: -114px; + + } + #card3 + { + height: 270px; + margin-top: -114px; + } + +} + + +@media only screen and (max-width: 1200px) { + + /* #container + { + //margin-left: 50px; + + } */ + #griditem + { + width: auto; + z-index: 100; + } + + #card1 + { + height: 280px; + margin-top: -114px; + } + #card2 + { + height: 280px; + margin-top: -114px; + } + #card3 + { + height: 280px; + margin-top: -114px; + } + +} + + +@media only screen and (max-width: 1152px) { + + /* #container + { + //margin-left: 50px; + + } */ + #griditem + { + width: auto; + z-index: 100; + } + + #card1 + { + height: 326px; + margin-top: -114px; + } + #card2 + { + height: 326px;; + margin-top: -114px; + } + #card3 + { + height: 326px; + margin-top: -114px; + + } + +} + + + +@media only screen and (max-width: 1025px) +{ + #card1 + { + height: 310px; + margin-top: -114px; + } + #card2 + { + height: 310px; + margin-top: -114px; + } + #card3 + { + height: 310px; + margin-top: -114px; + } + +} + +@media only screen and (max-width: 900px) +{ + #container + { + margin-left: 0%; + margin-right: 0%; + + } + #card1 + { + height: 250px; + margin-top: -50px; + } + #card2 + { + height: 250px; + margin-top: 0px; + } + #card3 + { + height: 250px; + margin-top: 0px; + + } + #paylink1 { + background: #F47738; + border-radius: 32px; + width: 168px; + height: 32px; + left: 146px; + top: 504px; + color: #FFFFFF; + margin-top: 7%; + } + #paylink2 { + background: #F47738; + border-radius: 32px; + width: 168px; + height: 32px; + left: 146px; + top: 504px; + color: #FFFFFF; + margin-top: 7%; + } + #paylink3 { + background: #F47738; + border-radius: 32px; + width: 95px; + height: 32px; + left: 146px; + top: 504px; + color: #FFFFFF; + margin-top: 7%; + } + +} + + +@media only screen and (max-width: 800px) +{ + #container + { + margin-left: 0%; + margin-right: 0%; + + } + #card1 + { + height: 250px; + margin-top: -50px; + } + #card2 + { + height: 250px; + margin-top: 0px; + } + #card3 + { + height: 250px; + margin-top: 0px; + + } + +} + diff --git a/frontend/mono-ui/web/egov-common-screen/src/components/Cards/index.js b/frontend/mono-ui/web/egov-common-screen/src/components/Cards/index.js new file mode 100644 index 00000000000..4705307407f --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/components/Cards/index.js @@ -0,0 +1,116 @@ +import React from 'react'; +import { makeStyles } from '@material-ui/core/styles'; +import Paper from '@material-ui/core/Paper'; +import { + Grid, + Card, + CardActions, + CardContent, + List, + ListItem, + ListItemText, + Typography, +} from "@material-ui/core"; +import Propertyimg from'../../img/icons/1.png'; +import Tradeimg from'../../img/icons/3.png'; +import waterimg from'../../img/icons/5.png'; +import Sewargeimg from'../../img/icons/7.png'; +import Fireimg from'../../img/icons/9.png'; +import Petimg from'../../img/icons/11.png'; +import obps from'../../img/icons/13.png'; +import pgr from'../../img/icons/1q.png'; +import "./index.css"; + + +const useStyles = makeStyles((theme) => ({ + + card: + { + textAlign: 'center' + } + +})); + +export default function CenteredGrid() { + const classes = useStyles(); + + return ( +
+ ); +} diff --git a/frontend/mono-ui/web/egov-common-screen/src/components/Faqs/index.css b/frontend/mono-ui/web/egov-common-screen/src/components/Faqs/index.css new file mode 100644 index 00000000000..d517487b5cb --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/components/Faqs/index.css @@ -0,0 +1,130 @@ + +.faq-row +{ + margin-left: 15px; +} + +.row-title-text +{ + border-bottom: 10px #f49666; + font-family: Roboto; + font-style: normal; + font-weight: normal; + font-size: 16px; + line-height: 24px; + +} +.styles_row-content-text__2sgAB +{ + font-family: Roboto; + font-style: normal; + font-size: 14px !important; + font-weight: 400; + line-height: 20px; + color: rgba(0, 0, 0, 0.6) !important; +} + +.faq-row-wrapper +{ + background: #FFFFFF; + box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12); + border-radius: 8px; +} + + +#flex-container { + display: flex; + background-color: #FFF; + height: 64px; +} + +#flex-container>div { + margin: 1px; + font-size: 16px; +} + +.styles_faq-row-wrapper__3vA1D .styles_row-body__1NvUo .styles_faq-row__2YF3c .styles_row-title__1YiiY .styles_icon-wrapper__2cftw { + color: #F47738 !important; + } + + #faqs { + margin-left: 10%; + margin-right: 10%; + margin-top: 3%; + + } + + +@media only screen and (max-width: 1920px) { + + #faqs { + margin-left: 10%; + margin-right: 10%; + } + + +} +@media only screen and (max-width: 1600px) { + + #faqs { + margin-left: 10%; + margin-right: 10%; + } +} + + +@media only screen and (max-width: 1440px) { + + #faqs { + margin-left: 10%; + margin-right: 10%; + } + + +} + +@media only screen and (max-width: 1367px) { + + +/* #links { + display: inline-flex; + margin-left: 58%; + } + */ + +} + + + + + + +@media only screen and (max-width: 900px) { + + + #faqs { + margin-left: 10%; + margin-right: 10%; + } + +} + + +@media only screen and (max-width: 800px) { + + + #faqs { + margin-left: 10%; + margin-right: 10%; + } + +} + +@media only screen and (max-width: 576px) { + + #faqs { + margin-left: 10%; + margin-right: 10%; + } +} + diff --git a/frontend/mono-ui/web/egov-common-screen/src/components/Faqs/index.js b/frontend/mono-ui/web/egov-common-screen/src/components/Faqs/index.js new file mode 100644 index 00000000000..aa84d4bd2b0 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/components/Faqs/index.js @@ -0,0 +1,90 @@ +import React from "react"; +import Faq from "react-faq-component"; +import "./index.css"; + + +const data = { + title: "", + rows: [ + { + title: "How do I pay my property tax?", + content: `You can pay your property tax by searching your property either with Unique Property Id / Old Property Id or with property details like mohalla, door number and owner name and using credit / debit cards, netbanking to make an online payment`, + }, + { + title: "How to apply & pay Fire NOC?", + content: `Fire NOC issued by the respective state fire service verifies that a building is resistant or unlikely to observe any fire related accidents. By meeting certain guidelines laid down by the fire department, an applicant can obtain NOC for his residential/ commercial building.`, + }, + { + title: "How can I apply for water connection?", + content: `You can apply for water connection by register on mSeva portal as customer. To apply for water connection you can enter information like property id , name and mobile number with address.`, + }, + { + title: "What is the difference between Property Unique ID and Old Property ID?", + content: + "Old Property Id is an Id previously given by your Local body and can be found on your old payment receipts while Property Unique Id is an Id generated by mSeva system and can be seen post searching your property on this portal. You can search your property using both Ids", + }, + { + title: "Why should I apply for a Trade License?", + content: `A Trade License is permission issued by an Urban Local Body (ULB) to conduct specific trade or business according to the relevant rules, standards and safety guidelines on premises for which it has been issued. Any unauthorised running of trade is an offence which may result in a substantial penalty and subsequent prosecution. Business owners must apply for Trade License before commencement of any trade.`, + }, + { + title: "Can I apply for a mutation of my registered property?", + content: `Yes. You can apply for Mutation online by clicking on ‘Register Property' link under Property Tax section above. Please login, search for your property and open up the details page. You can initiate Mutation process by clicking on 'Transfer Ownership’ option`, + }, + { + title: "My property details have changed. How do I make these changes online? Do I need to submit documents while making changes to my existing property details?", + content: `Currently, you will have to visit your ULB office to make these changes along with documents like ID Proof, Proof of Property Ownership and any other relevant document`, + }, + { + title: "How do I check my property tax online?", + content: `You can check your property tax online by searching for your property`, + }, + { + title: "How do I access previous payments made for my property?", + content: `You can view previous payments made for your property by visiting this page. Please login, search for your property and open up the details page. You can view previous payments under 'Payment History’ section`, + }, + { + title: "How do I renew my trade license?", + content: `You can renew your Trade License by visiting ‘Renewal of License' option under Trade License section above. Please login, go to ‘My Applications’ under Trade License and click on 'Renew’ for License to be renewed`, + }, + { + title: "I have paid my trade license fee. How do I download the payment receipt?", + content: `You can download payment receipt for your Trade License by visiting this page. Please login, go to ‘My Applications’ under Trade License and click on License number. You can click on ‘Download’ button to download your receipt`, + }, + { + title: "My license application is approved. How do I download the license certificate?", + content: `You can download license certificate for your Trade License by visiting this page. Please login, go to ‘My Applications’ under Trade License and click on License number. You can click on ‘Download’ button to download your certificate`, + }, + ], +}; + +const styles = { + // bgColor: 'white', + titleTextColor: "black", + rowTitleColor: "black", + rowTitleTextSize: "16px", + // rowContentColor: 'grey', + // arrowColor: "red", + rowContentPaddingTop:"12px", + +}; + +const config = { + animate: true, + arrowIcon: "+", + // tabFocus: true +}; + + +export default function SectionFAQs() { + + return ( +
+ +
+ ); +} \ No newline at end of file diff --git a/frontend/mono-ui/web/egov-common-screen/src/components/Footer/index.css b/frontend/mono-ui/web/egov-common-screen/src/components/Footer/index.css new file mode 100644 index 00000000000..4d8752439dc --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/components/Footer/index.css @@ -0,0 +1,39 @@ +.footerchange { + font-size: 14px; + font-weight: 600; + background: #0000004f; + height: 30px; + color: white; +} +img.wz { + width: 50px; + height: auto; +} +a#flink { + color: white !important; +} +a.email { + color: white; +} +.makeStyles-root-6 { + flex-grow: 1; + background-color: #0b519e !important; + /* background-image: linear-gradient(to right, #0d1a86 , #0aa236); */ + +} + +.infofoot { + background: white; + padding: 20px 0px; +} +.infofoot center { + color: black !important; + font-weight: 600; +} + +@media only screen and (max-width: 780px) and (min-width: 230px) { +.lupwz { + background: #064199; + text-align: center; +} +} \ No newline at end of file diff --git a/frontend/mono-ui/web/egov-common-screen/src/components/Footer/index.js b/frontend/mono-ui/web/egov-common-screen/src/components/Footer/index.js new file mode 100644 index 00000000000..0687bf8b2cd --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/components/Footer/index.js @@ -0,0 +1,357 @@ +import React from 'react'; +import { makeStyles } from '@material-ui/core/styles'; +import 'bootstrap/dist/css/bootstrap.min.css'; +import Paper from '@material-ui/core/Paper'; +import { + Grid, + Card, + CardActions, + CardContent, + List, + ListItem, + ListItemText, + Typography, +} from "@material-ui/core"; +import "./index.css"; + +import facebook from "../../img/facebook.png"; +import twitter from "../../img/twitter.png"; +import chrome from "../../img/chrome.png"; +import edge from "../../img/edge.png"; +import mozilla from "../../img/mozilla.png"; +import wz from "../../img/w3c.jpg"; +import gigw from "../../img/GIGW_LOGO.png"; +import privacy from "../../img/Data-Policy.pdf"; +import BlockchainStrategy from "../../img/BlockchainStrategymerged.pdf"; +import AIStrategy from "../../img/AIStrategymerged.pdf"; +import Emerging from "../../img/Emerging-Technologies.pdf"; +const useStyles = makeStyles((theme) => ({ + root: { + flexGrow: 1, + + backgroundColor:"#0b519e" + + }, + container : + { + marginLeft:"10%", + marginRight:"10%", + marginTop:"10%", + paddingRight:"18%", + paddingTop: "50px" + + }, + header : + { + fontFamily: "Roboto", + fontStyle: "normal", + fontWeight: "500", + fontSize: "16px", + lineHeight: "24px", + color : "#FFFFFF" + + }, + paragraph : + { + color : "#FFFFFF", + fontFamily: "Roboto", + fontStyle: "normal", + fontWeight: "normal", + fontSize: "14px", + lineHeight: "20px" + + }, + paper: { + padding: theme.spacing(2), + textAlign: 'center', + color: theme.palette.text.secondary, + }, +})); + +//var counterContainer = document.querySelector(".website-counter"); +var counterContainer; +var resetButton = document.querySelector("#reset"); +var visitCount = localStorage.getItem("page_view"); + +// Check if page_view entry is present +if (visitCount) { + visitCount = Number(visitCount) + 1; + localStorage.setItem("page_view", visitCount); +} else { + visitCount = 1; + localStorage.setItem("page_view", 1); +} +counterContainer= visitCount; + +// Adding onClick event listener +// resetButton.addEventListener("click", () => { +// visitCount = 1; +// localStorage.setItem("page_view", 1); +// counterContainer = visitCount; +// }); + +export default function CenteredGrid() { + const classes = useStyles(); + const dateyear = new Date(); + let currentyear = dateyear.getFullYear(); + return ( +
+ + + +

+

+ Contact Details +

+

+ Office Address:
+ Punjab Municipal Bhawan,
3, Dakshin Marg, 35A,
+ Chandigarh, 160022
+

+

+ Call Us:
+ 1800 1800 0172
+

+

+ Email Us:
+ pgrs.lg@punjab.gov.in +

+

+ For any issues regarding online payments:
+

+ egovdolg@gmail.com +

+ + mSewa Punjab + + mSewa Punjab +

+
+ + +

+

Other Departments
+

+ + Local Government Punjab +
+ + PMIDC +
+ + Contact Us +
+ + Privacy policy +
+ + Citizen Survey +
+
+ + +

+

User Manuals
+

+ + Property Tax +
+ + Trade Licence +
+ + Water & Sewerage +
+ + Public Grievances & Redressal +
+ + Fire NOC +
+ + AI Strategy +
+ + Block Chain Strategy +
+ + Emerging Technologies +
+ + mSewa YouTube Channel +
+ +
+ + +

+

About Us
+

+ + About mSewa +
+ + + About eGov Foundation +
+ + What's New +
+ + Service Delivery Charter +
+ + + Holiday List +
+ + Data Security Policy +
+ +
+ +

+
+
Information provided online is update and no physical visit is required

+ {/*
Last Updated July 2021

*/} +
Number of Visitor 1224{counterContainer}

+
*Supported browser versions

+
+ + + + + {/* */} + + + + + {/* */} + + + +
mSewa Punjab
mSewa Punjab
>V-81
>V-84
>V-79
+
+
+
+
+ +
+

© {currentyear} PMIDC, GOVERNMENT OF PUNJAB. All Rights Reserved by PMIDC

+
+
+

Last updated on : 01-02-2024 | mSewa Punjab mSewa Punjab

+
+
+
+
+
+ + ); +} diff --git a/frontend/mono-ui/web/egov-common-screen/src/components/Header/index.js b/frontend/mono-ui/web/egov-common-screen/src/components/Header/index.js new file mode 100644 index 00000000000..cf74375df79 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/components/Header/index.js @@ -0,0 +1,167 @@ +import React from "react"; +import "./myindex.css"; +import 'bootstrap/dist/css/bootstrap.min.css'; +import { + Grid, + Card, + CardActions, + CardContent, + List, + ListItem, + ListItemText, + Typography, +} from "@material-ui/core"; +import { withStyles } from "@material-ui/core/styles"; +import axios from "axios"; +import rightImage from "../../img/pmidc - final logo.png"; +import leftImage from "../../img/Govt. of Punjab.png"; +import slideone from '../../img/pmidcgurughar.jpg'; +import homeicon from '../../img/homepage-icon.png'; + +const styles = (theme) => ({ + root: { + paddingTop: "0px", + overflow: "visible", + height: "100%", + }, + btn: { + padding: "2.5% 5% ", + width: "20%", + borderRadius: 4, + fontSize: "15px", + background: "#EA784E", + color: "white", + textDecoration: "none", + textAlign: "center", + // marginTop: "42px", + }, + text: { + padding: "12px", + fontSize: "22px", + fontWeight: "680", + lineHeight: 2, + }, + listStyle: {}, +}); + +class Header extends React.Component { + state = { + backgroundUrl: "", + logoUrl: "", + }; + + componentDidMount() { + let tenantIdFromPath = ""; + tenantIdFromPath = document.location.search + ? document.location.search.split("=")[1] + : "pb"; + console.log(tenantIdFromPath, "tenant"); + const RequestInfo = { + RequestInfo: { + apiId: "Rainmaker", + ver: ".01", + ts: "", + action: "_search", + did: "1", + key: "", + msgId: "20170310130900|en_IN", + authToken: null, + }, + MdmsCriteria: { + tenantId: tenantIdFromPath, + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "StateInfo", + }, + ], + }, + ], + }, + }; + axios + .post( + `${document.location.origin}/egov-mdms-service/v1/_search?tenantId=${tenantIdFromPath}`, + RequestInfo + ) + .then((response) => { + console.log("ResponseInfo", response.data); + this.setValuestoState("tenantId", tenantIdFromPath); + this.setValuestoState( + "backgroundUrl", + response.data.MdmsRes["common-masters"].StateInfo[0].bannerUrl + ); + this.setValuestoState( + "logoUrl", + response.data.MdmsRes["common-masters"].StateInfo[0].logoUrl + ); + }) + .catch((err) => { + console.log(err, "error"); + }); + } + setValuestoState = (property, value) => { + this.setState({ + [property]: value, + }); + }; + render() { + const { classNamees } = this.props; + + + return ( +
+
+
+
+
+ +
+ +
+
+ +
+ + + -A + A + +A +
+
+
+
+ +
+
+
+
+ PMIDC +
+
+ +
+ {/*
+
+ Dear Citizen , One Time settlement for Property Tax has been implemented in mSeva. You requested check and Re-Assess your property before paying tax . +
+
*/} +
+
+ PMIDC +
+
+ +
+
+ + ); + } +} +export default withStyles(styles)(Header); diff --git a/frontend/mono-ui/web/egov-common-screen/src/components/Header/myindex.css b/frontend/mono-ui/web/egov-common-screen/src/components/Header/myindex.css new file mode 100644 index 00000000000..84ae702b380 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/components/Header/myindex.css @@ -0,0 +1,274 @@ +.msewalogo { + width: 60px; + height: auto; + left: 130px; + top: 7px; + margin-top: 10px; + margin-bottom: 5px; +} +#note{ + color:red; +} +/* image rotate */ +@-webkit-keyframes rotate { + 0% { -webkit-transform: rotate(0deg) scale(1.0); } + 100% { -webkit-transform: rotate(360deg) scale(1.1); } + } + @-moz-keyframes rotate { + 0% { -moz-transform: rotate(0deg) scale(1.0); } + 100% { -moz-transform: rotate(360deg) scale(1.1); } + } + @-o-keyframes rotate { + 0% { -o-transform: rotate(0deg) scale(1.0); } + 100% { -o-transform: rotate(360deg) scale(1.1); } + } + @-ms-keyframes rotate { + 0% { -ms-transform: rotate(0deg) scale(1.0); } + 100% { -ms-transform: rotate(360deg) scale(1.1); } + } + @keyframes rotate { + 0% { transform: rotate(0deg) scale(1.0); } + 100% { transform: rotate(360deg) scale(1.1); } + } + @-webkit-keyframes rori { + 0% { -webkit-transform: rotate(360deg) scale(1.1); } + 100% { -webkit-transform: rotate(0deg) scale(1.0); } + } + @-moz-keyframes rori { + 0% { -moz-transform: rotate(360deg) scale(1.1); } + 100% { -moz-transform: rotate(0deg) scale(1.0); } + } + @-o-keyframes rori { + 0% { -o-transform: rotate(360deg) scale(1.1); } + 100% { -o-transform: rotate(0deg) scale(1.0); } + } + @-ms-keyframes rori { + 0% { -ms-transform: rotate(360deg) scale(1.1); } + 100% { -ms-transform: rotate(0deg) scale(1.0); } + } + @keyframes rori { + 0% { transform: rotate(360deg) scale(1.1); } + 100% { transform: rotate(0deg) scale(1.0); } + } + div.cardservice img:hover { + -webkit-animation-name: rotate; + -moz-animation-name: rotate; + -ms-animation-name: rotate; + -o-animation-name: rotate; + animation-name: rotate; + -webkit-animation-duration: 500ms; + -moz-animation-duration: 500ms; + -ms-animation-duration: 500ms; + -o-animation-duration: 500ms; + animation-duration: 500ms; + -webkit-animation-iteration-count: 1; + -moz-animation-iteration-count: 1; + -ms-animation-iteration-count: 1; + -o-animation-iteration-count: 1; + animation-iteration-count: 1; + -webkit-animation-timing-function: ease; + -moz-animation-timing-function: ease; + -ms-animation-timing-function: ease; + -o-animation-timing-function: ease; + animation-timing-function: ease; + -webkit-animation-fill-mode: forwards; + -moz-animation-fill-mode: forwards; + -ms-animation-fill-mode: forwards; + -o-animation-fill-mode: forwards; + animation-fill-mode: forwards; + cursor: url('https://ia801504.us.archive.org/31/items/abcde_201612/aero_link2.cur'), auto !important; + } + div.cardservice img { + -webkit-animation-name: rori; + -moz-animation-name: rori; + -ms-animation-name: rori; + -o-animation-name: rori; + animation-name: rori; + -webkit-animation-duration: 500ms; + -moz-animation-duration: 500ms; + -ms-animation-duration: 500ms; + -o-animation-duration: 500ms; + animation-duration: 500ms; + -webkit-animation-iteration-count: 1; + -moz-animation-iteration-count: 1; + -ms-animation-iteration-count: 1; + -o-animation-iteration-count: 1; + animation-iteration-count: 1; + -webkit-animation-timing-function: ease; + -moz-animation-timing-function: ease; + -ms-animation-timing-function: ease; + -o-animation-timing-function: ease; + animation-timing-function: ease; + vertical-align: middle; + max-width: 175px; + max-height: 175px; + text-align: center; + /* border: 1px solid #87CEEB !important; + background-color: #D9F9FF; */ + margin: 25px; + /* cursor: url('https://ia801504.us.archive.org/31/items/abcde_201612/aero_link2.cur'), auto !important; */ + } +/* services */ +.cardservice img { + width: 100px; + height: auto; +} +.cardservice { + text-align: center; +} +.hearderchange { + background: #064199; +} +.hearderchange img { + margin-left: 70px; +} +.langu { + width: 160px; + float: left; + color: white; + text-align: center; +} +.langu a { + color: white; +} +.boldText a { + color: white; + font-size: 14px; + padding-left: 10px; +} +/* end */ +.secondpart { + padding-bottom: 40px; +} +.msewa-logo-postion{text-align: center; width: 30%; float: left; margin-left: 10%;} +#emplogin{ + width: 70%; float: right; margin-right: 10%; +} +#rightimg { + width: 100px; + margin-bottom: 12px; + margin-left: 24px; +} +.rightharder{ + padding-top: 10px; + text-align: center; +} + +.rightharder a { + position: relative; + top: 0px; + color: #0b519e; + font-weight: 600; +} +.row.features { + padding-top: 50px; +} +.featurestwo{ + padding-top: 30px; +} +.row.featuresthree { + padding-top: 20px; + padding-bottom: 30px; +} +.bodaypage{ + background:#e5e5e5; +} +a.custom-btn { + background: #f47738; + color: white; + padding: 5px 60px; + border-radius: 20px; +} +.message { + background-color: #f3e5de; + color: #f47738; + opacity: .8; + border-radius: 8px; + text-align: center; + border-color: #fb590059; + margin-top: 30px; +} +.asq h1 { + text-align: center; +} +.asq div { + background: #ff870b; + height: 4px; + width: 180px; + margin-left: 40%; + margin-top: 17px; + margin-bottom: 40px; + +} +button.btn.btn-link.collapsed { + color: #000000d6 !important; + font-weight: 600; +} +button.btn.btn-link { + color: #000000d6; + text-decoration: none; + font-weight: 600; +} +button.btn.btn-link:hover { + color: #000000d6; + text-decoration: none; + font-weight: 600; +} +.card-body { + border-bottom: 10px #f49666; + font-size: 14px; + line-height: 20px; +} +.card-body h4 { + border-bottom: 10px #f49666; + font-size: 16px; + line-height: 24px; +} +/* --------------- */ + +/* --------------------- */ + +@media only screen and (max-width: 780px) and (min-width: 230px) { + .row.features { + position: relative; + bottom: 0px; + } + .featurestwo{ + position: relative; + bottom: 0px; + } + .card { + margin-top: 10px; + } + img.msewalogo { + position: relative; + right: 0px; + } + .rightharder { + padding-top: 15px; + padding-bottom: 30px; + } + a.custom-btn { + font-size: 12px; + } + .message { + background-color: #f3e5de; + color: #f47738; + opacity: .8; + border-radius: 8px; + text-align: center; + border-color: #fb590059; + margin-top: 20px; + } +} +@media only screen and (max-width: 990px) and (min-width: 780px) { + a.custom-btn { + font-size: 10px; + padding: 10px 35px; + } + h5.card-title { + font-size: 18px; + } +} + + \ No newline at end of file diff --git a/frontend/mono-ui/web/egov-common-screen/src/components/LandingPage/index.css b/frontend/mono-ui/web/egov-common-screen/src/components/LandingPage/index.css new file mode 100644 index 00000000000..80d11a02b5d --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/components/LandingPage/index.css @@ -0,0 +1,109 @@ +/* body{ + background: linear-gradient(rgba(255,255,255,.5), + rgba(255,255,255,.5)); +} */ +/* .common-background{ + background: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.5)), url("/assets/Punjab-bg-QA.jpg")); + background-repeat: no-repeat; + background-position: center; + background-size: cover; +} */ + +.common-background{ + background-size: cover!important; +} +@media only screen and (max-width: 750px) { + .header-logo + { + width : 80% !important; + } + .common-background { + background-size: cover!important; + height: 1300px !important; + } + #buttonlink + { + margin-top : 15px; + width:120px !important; + + } + #buttonlink2 + { + width:120px !important; + + } + .rlink + { + text-align: left !important; + margin-left: 33px !important; + margin-right: 20px !important; + } +} + +@media only screen and (max-width: 600px) { + .header-logo + { + width : 80% !important; + } + .common-background { + background-size: cover!important; + height: 1300px !important; + } + .firstcard + { + border-radius: 0px; + height: 450px !important; + } + #buttonlink + { + margin-top : 34px; + width:120px !important; + + } + #buttonlink2 + { + width:120px !important; + + } + .rlink + { + text-align: left !important; + margin-left: 33px !important; + margin-right: 20px !important; + } +} + + +.common-grid +{ + padding: 16px 30px !important; +} + + +@media only screen and (max-width:1280px){ + + .common-background + { + background-size: cover; + height: 110% ; + + } + +} + +@media only screen and (min-width: 320px) and (max-width: 330px) + +{ + + .firstcard + { + border-radius: 0px; + height: 487px !important; + } + .csButton + { + margin-top: 63px; + } + + +} diff --git a/frontend/mono-ui/web/egov-common-screen/src/components/LandingPage/index.js b/frontend/mono-ui/web/egov-common-screen/src/components/LandingPage/index.js new file mode 100644 index 00000000000..c166189ca8b --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/components/LandingPage/index.js @@ -0,0 +1,337 @@ +import React from "react"; +import "./index.css"; +import { + Grid, + Card, + CardActions, + CardContent, + List, + ListItem, + ListItemText, + Typography, +} from "@material-ui/core"; +import { withStyles } from "@material-ui/core/styles"; +import axios from "axios"; + +const styles = (theme) => ({ + root: { + paddingTop: "0px", + overflow: "visible", + height: "100%", + }, + btn: { + padding: "2.5% 5% ", + width: "20%", + borderRadius: 4, + fontSize: "15px", + background: "#EA784E", + color: "white", + textDecoration: "none", + textAlign: "center", + // marginTop: "42px", + }, + text: { + padding: "12px", + fontSize: "22px", + fontWeight: "680", + lineHeight: 2, + }, + listStyle: {}, +}); + +class LandingPage extends React.Component { + state = { + backgroundUrl: "", + logoUrl: "", + }; + + componentDidMount() { + let tenantIdFromPath = ""; + tenantIdFromPath = document.location.search + ? document.location.search.split("=")[1] + : "uk"; + console.log(tenantIdFromPath, "tenant"); + const RequestInfo = { + RequestInfo: { + apiId: "Rainmaker", + ver: ".01", + ts: "", + action: "_search", + did: "1", + key: "", + msgId: "20170310130900|en_IN", + authToken: null, + }, + MdmsCriteria: { + tenantId: tenantIdFromPath, + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "StateInfo", + }, + ], + }, + ], + }, + }; + axios + .post( + `${document.location.origin}/egov-mdms-service/v1/_search?tenantId=${tenantIdFromPath}`, + RequestInfo + ) + .then((response) => { + console.log("ResponseInfo", response.data); + this.setValuestoState("tenantId", tenantIdFromPath); + this.setValuestoState( + "backgroundUrl", + response.data.MdmsRes["common-masters"].StateInfo[0].bannerUrl + ); + this.setValuestoState( + "logoUrl", + response.data.MdmsRes["common-masters"].StateInfo[0].logoUrl + ); + }) + .catch((err) => { + console.log(err, "error"); + }); + } + setValuestoState = (property, value) => { + this.setState({ + [property]: value, + }); + }; + render() { + const { classes } = this.props; + const { backgroundUrl, logoUrl } = this.state; + + console.log("state", this.state); + + return ( +
+ + + + company-logo + + + + + + + + + + + citizen-logo + + + + + + नागरिक + + } + secondary={ + + Citizen + + } + /> + + + + + + + + नगरसेवा नागरिक खाता नागरिकों को शहरी स्थानीय निकाय + (नगर पालिका / नगर निगम) द्वारा प्रदान की गई विभिन्न + सेवाओं का ऑनलाइन लाभ उठाने में सक्षम बनाता है। शहरी + स्थानीय निकाय प्रमुख रूप से व्यापार लाइसेंस, संपत्ति + कर और नागरिक शिकायतों आदि से संबंधित सेवाएं प्रदान + करते हैं। रजिस्टर / कृपया लॉग इन करने के लिए नीचे + क्लिक करें। + + } + secondary={ + + A NagarSewa citizen account enables citizens to + avail the various services online rendered by the + urban local body (Municipality/ Municipal + Corporation). The major services which the local + body provides are related to Trade License, Property + Tax, and Citizen Grievances etc. Please click below + to register/log in. + + } + /> + + + + + + लॉग इन / LOGIN + + + + + + + + + + municiple-employee-logo + + + + + + नगर निगम कर्मचारी + + } + secondary={ + + Municipal Employee + + } + /> + + + + + + + + नगरसेवा कर्मचारी खाता शहरी स्थानीय निकाय (नगर पालिका + / नगर निगम) के कर्मचारी को दिन-प्रतिदिन की + गतिविधियों के लिए सक्षम बनाता है और उसे नागरिकों + द्वारा सौंपे गए सेवा अनुरोध की समय पर डिलीवरी + सुनिश्चित करता है। कृपया लॉग इन करने के लिए नीचे + क्लिक करें। + + } + secondary={ + + A NagarSewa employee account enables the employee of + urban local body (Municipality/ Municipal + Corporation) to perform its day to day activities + and ensure the timely delivery of services applied + by citizen assigned to him/her. Please click below + to login. + + } + /> + + + + + + लॉग इन / LOGIN + + + + + + +

+ For Right of Way/Road Cutting/Road Digging Service{" "} + + APPLY HERE + +

+
+
+ +
+
+
+ ); + } +} +export default withStyles(styles)(LandingPage); diff --git a/frontend/mono-ui/web/egov-common-screen/src/components/Sitemaps/index.js b/frontend/mono-ui/web/egov-common-screen/src/components/Sitemaps/index.js new file mode 100644 index 00000000000..3e387f8e91e --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/components/Sitemaps/index.js @@ -0,0 +1,91 @@ +import React from "react"; +import Faq from "react-faq-component"; +import "./index.css"; + + +const data = { + title: "", + rows: [ + { + title: "How do I pay my property tax?", + content: `You can pay your property tax by searching your property either with Unique Property Id / Old Property Id or with property details like mohalla, door number and owner name and using credit / debit cards, netbanking to make an online payment`, + }, + { + title: "How to apply & pay Fire NOC?", + content: `Fire NOC issued by the respective state fire service verifies that a building is resistant or unlikely to observe any fire related accidents. By meeting certain guidelines laid down by the fire department, an applicant can obtain NOC for his residential/ commercial building.`, + }, + { + title: "How can I apply for water connection?", + content: `You can apply for water connection by register on mSeva portal as customer. To apply for water connection you can enter information like property id , name and mobile number with address.`, + }, + { + title: "What is the difference between Property Unique ID and Old Property ID?", + content: + "Old Property Id is an Id previously given by your Local body and can be found on your old payment receipts while Property Unique Id is an Id generated by mSeva system and can be seen post searching your property on this portal. You can search your property using both Ids", + }, + { + title: "Why should I apply for a Trade License?", + content: `A Trade License is permission issued by an Urban Local Body (ULB) to conduct specific trade or business according to the relevant rules, standards and safety guidelines on premises for which it has been issued. Any unauthorised running of trade is an offence which may result in a substantial penalty and subsequent prosecution. Business owners must apply for Trade License before commencement of any trade.`, + }, + { + title: "Can I apply for a mutation of my registered property?", + content: `Yes. You can apply for Mutation online by clicking on ‘Register Property' link under Property Tax section above. Please login, search for your property and open up the details page. You can initiate Mutation process by clicking on 'Transfer Ownership’ option`, + }, + { + title: "My property details have changed. How do I make these changes online? Do I need to submit documents while making changes to my existing property details?", + content: `Currently, you will have to visit your ULB office to make these changes along with documents like ID Proof, Proof of Property Ownership and any other relevant document`, + }, + { + title: "How do I check my property tax online?", + content: `You can check your property tax online by searching for your property`, + }, + { + title: "How do I access previous payments made for my property?", + content: `You can view previous payments made for your property by visiting this page. Please login, search for your property and open up the details page. You can view previous payments under 'Payment History’ section`, + }, + { + title: "How do I renew my trade license?", + content: `You can renew your Trade License by visiting ‘Renewal of License' option under Trade License section above. Please login, go to ‘My Applications’ under Trade License and click on 'Renew’ for License to be renewed`, + }, + { + title: "I have paid my trade license fee. How do I download the payment receipt?", + content: `You can download payment receipt for your Trade License by visiting this page. Please login, go to ‘My Applications’ under Trade License and click on License number. You can click on ‘Download’ button to download your receipt`, + }, + { + title: "My license application is approved. How do I download the license certificate?", + content: `You can download license certificate for your Trade License by visiting this page. Please login, go to ‘My Applications’ under Trade License and click on License number. You can click on ‘Download’ button to download your certificate`, + }, + ], +}; + +const styles = { + // bgColor: 'white', + titleTextColor: "black", + rowTitleColor: "black", + rowTitleTextSize: "16px", + // rowContentColor: 'grey', + // arrowColor: "red", + rowContentPaddingTop:"12px", + +}; + +const config = { + animate: true, + arrowIcon: "+", + // tabFocus: true +}; + + +export default function SectionFAQs() { + + return ( +
+ {/* */} +

Sitemaps

+
+ ); +} \ No newline at end of file diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/AIStrategymerged.pdf b/frontend/mono-ui/web/egov-common-screen/src/img/AIStrategymerged.pdf new file mode 100644 index 00000000000..46695e77e79 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/AIStrategymerged.pdf differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/BlockchainStrategymerged.pdf b/frontend/mono-ui/web/egov-common-screen/src/img/BlockchainStrategymerged.pdf new file mode 100644 index 00000000000..0a20b3bec9f Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/BlockchainStrategymerged.pdf differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/Data-Policy.pdf b/frontend/mono-ui/web/egov-common-screen/src/img/Data-Policy.pdf new file mode 100644 index 00000000000..6cf8ea990e3 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/Data-Policy.pdf differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/Emerging-Technologies.pdf b/frontend/mono-ui/web/egov-common-screen/src/img/Emerging-Technologies.pdf new file mode 100644 index 00000000000..029a46b0e97 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/Emerging-Technologies.pdf differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/GIGW_LOGO.png b/frontend/mono-ui/web/egov-common-screen/src/img/GIGW_LOGO.png new file mode 100644 index 00000000000..578216bf986 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/GIGW_LOGO.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/Govt. of Punjab.png b/frontend/mono-ui/web/egov-common-screen/src/img/Govt. of Punjab.png new file mode 100644 index 00000000000..631bd38e5de Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/Govt. of Punjab.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/PMIDCsewa.jpg b/frontend/mono-ui/web/egov-common-screen/src/img/PMIDCsewa.jpg new file mode 100644 index 00000000000..2af5b258e0d Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/PMIDCsewa.jpg differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/arrow.png b/frontend/mono-ui/web/egov-common-screen/src/img/arrow.png new file mode 100644 index 00000000000..69420d60ad9 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/arrow.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/chrome.png b/frontend/mono-ui/web/egov-common-screen/src/img/chrome.png new file mode 100644 index 00000000000..0b6791b38a3 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/chrome.png differ diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/public/digit-footer.png b/frontend/mono-ui/web/egov-common-screen/src/img/digit-footer.png similarity index 100% rename from frontend/mono-ui/web/rainmaker/packages/citizen/public/digit-footer.png rename to frontend/mono-ui/web/egov-common-screen/src/img/digit-footer.png diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/edge.png b/frontend/mono-ui/web/egov-common-screen/src/img/edge.png new file mode 100644 index 00000000000..11c900066b8 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/edge.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/facebook.png b/frontend/mono-ui/web/egov-common-screen/src/img/facebook.png new file mode 100644 index 00000000000..cb2d3e14fa5 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/facebook.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/homepage-icon.png b/frontend/mono-ui/web/egov-common-screen/src/img/homepage-icon.png new file mode 100644 index 00000000000..1c83ffea05c Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/homepage-icon.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/1.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/1.png new file mode 100644 index 00000000000..dfaa2cfba6a Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/1.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/10.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/10.png new file mode 100644 index 00000000000..3df4abac281 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/10.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/11.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/11.png new file mode 100644 index 00000000000..a32757938f2 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/11.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/12.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/12.png new file mode 100644 index 00000000000..cf519a693b8 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/12.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/13.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/13.png new file mode 100644 index 00000000000..4448b3d60ac Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/13.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/1q.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/1q.png new file mode 100644 index 00000000000..155fe716211 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/1q.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/2.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/2.png new file mode 100644 index 00000000000..24f534a30a8 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/2.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/2q.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/2q.png new file mode 100644 index 00000000000..4d6a3706648 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/2q.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/3.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/3.png new file mode 100644 index 00000000000..0475075267a Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/3.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/4.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/4.png new file mode 100644 index 00000000000..f2ab4d2867d Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/4.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/5.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/5.png new file mode 100644 index 00000000000..f8eb9751078 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/5.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/6.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/6.png new file mode 100644 index 00000000000..40a44a45ba1 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/6.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/7.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/7.png new file mode 100644 index 00000000000..a29bbe4d2bb Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/7.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/8.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/8.png new file mode 100644 index 00000000000..ef85f6cc62c Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/8.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/9.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/9.png new file mode 100644 index 00000000000..22a3cebfa42 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/9.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/icons/mSeva - Portal for availing Urban Municipal Services Online.png b/frontend/mono-ui/web/egov-common-screen/src/img/icons/mSeva - Portal for availing Urban Municipal Services Online.png new file mode 100644 index 00000000000..97979fda361 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/icons/mSeva - Portal for availing Urban Municipal Services Online.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/logo.png b/frontend/mono-ui/web/egov-common-screen/src/img/logo.png new file mode 100644 index 00000000000..ebfb6bab8dc Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/logo.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/mSewa-punjab.png b/frontend/mono-ui/web/egov-common-screen/src/img/mSewa-punjab.png new file mode 100644 index 00000000000..639dd414193 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/mSewa-punjab.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/mozilla.png b/frontend/mono-ui/web/egov-common-screen/src/img/mozilla.png new file mode 100644 index 00000000000..daaeed1c9d5 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/mozilla.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/pmidc - final logo.png b/frontend/mono-ui/web/egov-common-screen/src/img/pmidc - final logo.png new file mode 100644 index 00000000000..22c7d31733d Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/pmidc - final logo.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/pmidcPT.jpg b/frontend/mono-ui/web/egov-common-screen/src/img/pmidcPT.jpg new file mode 100644 index 00000000000..da1c072040a Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/pmidcPT.jpg differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/pmidcgurughar.jpg b/frontend/mono-ui/web/egov-common-screen/src/img/pmidcgurughar.jpg new file mode 100644 index 00000000000..88d97ab0671 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/pmidcgurughar.jpg differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/property_tax.png b/frontend/mono-ui/web/egov-common-screen/src/img/property_tax.png new file mode 100644 index 00000000000..9462b9f9535 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/property_tax.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/roadcutting.png b/frontend/mono-ui/web/egov-common-screen/src/img/roadcutting.png new file mode 100644 index 00000000000..3274fd305fb Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/roadcutting.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/tradelicence.png b/frontend/mono-ui/web/egov-common-screen/src/img/tradelicence.png new file mode 100644 index 00000000000..7a000f0dead Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/tradelicence.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/twitter.png b/frontend/mono-ui/web/egov-common-screen/src/img/twitter.png new file mode 100644 index 00000000000..76376866828 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/twitter.png differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/img/w3c.jpg b/frontend/mono-ui/web/egov-common-screen/src/img/w3c.jpg new file mode 100644 index 00000000000..096b62e22a4 Binary files /dev/null and b/frontend/mono-ui/web/egov-common-screen/src/img/w3c.jpg differ diff --git a/frontend/mono-ui/web/egov-common-screen/src/index.css b/frontend/mono-ui/web/egov-common-screen/src/index.css new file mode 100644 index 00000000000..c47d44fba33 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/index.css @@ -0,0 +1,57 @@ +html{ + height: 100%; + margin:0; + padding:0; +} + +@font-face { + font-family: Roboto; + src: url(Roboto-Regular.ttf); +} +body { + height: 100%; + margin: 0; + font-family: 'Roboto'; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + background: #E5E5E5; + margin:0; + padding:0; +} + +#root{ + width: 100%; + height: 100%; + padding: 0px; + margin: 0px; + overflow-x: hidden; + } +@media only screen and (max-width: 1024px) { + +/* #root +{ + overflow-x: hidden; +} */ +} + +a:hover, a:visited, a:link, a:active +{ + text-decoration: none; +} + +a { color: #F47738; + + font-family: Roboto; + font-style: normal; + font-weight: 500; + font-size: 14px; + line-height: 32px; + text-decoration: none; +} + + + +code { + font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', + monospace; +} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/index.js b/frontend/mono-ui/web/egov-common-screen/src/index.js similarity index 100% rename from frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/index.js rename to frontend/mono-ui/web/egov-common-screen/src/index.js diff --git a/frontend/mono-ui/web/egov-common-screen/src/logo.svg b/frontend/mono-ui/web/egov-common-screen/src/logo.svg new file mode 100644 index 00000000000..6b60c1042f5 --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/logo.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/serviceWorker.js b/frontend/mono-ui/web/egov-common-screen/src/serviceWorker.js similarity index 97% rename from frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/serviceWorker.js rename to frontend/mono-ui/web/egov-common-screen/src/serviceWorker.js index f8c7e50c201..8703ddb7ecb 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/serviceWorker.js +++ b/frontend/mono-ui/web/egov-common-screen/src/serviceWorker.js @@ -14,7 +14,7 @@ const isLocalhost = Boolean( window.location.hostname === 'localhost' || // [::1] is the IPv6 localhost address. window.location.hostname === '[::1]' || - // 127.0.0.1/8 is considered localhost for IPv4. + // 127.0.0.0/8 are considered localhost for IPv4. window.location.hostname.match( /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ ) @@ -100,7 +100,9 @@ function registerValidSW(swUrl, config) { function checkValidServiceWorker(swUrl, config) { // Check if the service worker can be found. If it can't reload the page. - fetch(swUrl) + fetch(swUrl, { + headers: { 'Service-Worker': 'script' } + }) .then(response => { // Ensure service worker exists, and that we really are getting a JS file. const contentType = response.headers.get('content-type'); diff --git a/frontend/mono-ui/web/egov-common-screen/src/setupTests.js b/frontend/mono-ui/web/egov-common-screen/src/setupTests.js new file mode 100644 index 00000000000..74b1a275a0e --- /dev/null +++ b/frontend/mono-ui/web/egov-common-screen/src/setupTests.js @@ -0,0 +1,5 @@ +// jest-dom adds custom jest matchers for asserting on DOM nodes. +// allows you to do things like: +// expect(element).toHaveTextContent(/react/i) +// learn more: https://github.com/testing-library/jest-dom +import '@testing-library/jest-dom/extend-expect'; diff --git a/frontend/mono-ui/web/rainmaker-webview/.editorconfig b/frontend/mono-ui/web/rainmaker-webview/.editorconfig old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/.gitignore b/frontend/mono-ui/web/rainmaker-webview/.gitignore old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/LICENSE b/frontend/mono-ui/web/rainmaker-webview/LICENSE old mode 100755 new mode 100644 index 43771c89fb0..4cccf1e0358 --- a/frontend/mono-ui/web/rainmaker-webview/LICENSE +++ b/frontend/mono-ui/web/rainmaker-webview/LICENSE @@ -1,91 +1,21 @@ -# UPYOG CODE, COPYRIGHT AND CONTRIBUTION LICENSE TERMS - -THIS OPEN SOURCE LICENSE ("LICENSE") DEFINES THE RIGHTS OF USE, COPY, REPRODUCTION, DISPLAY, PUBLICATION, DISTRIBUTION, REDISTRIBUTION AND MODIFICATION OF UPYOG, ORIGINALLY RELEASED BY THE NATIONAL INSTITUTE OF URBAN AFFAIRS (“NIUA”) ACTING ON BEHALF OF THE MINISTRY OF HOUSING AND URBAN AFFAIRS, GOVERNMENT OF INDIA. ANYONE WHO USES, COPIES, REPRODUCES, DISPLAYS, PUBLISHES, DISTRIBUTES, REDISTRIBUTES OR MODIFIES ‘UPYOG’ OR ANY PART THEREOF, IS BY THAT ACTION, ACCEPTING IN FULL THE RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS LICENSE. - -PLEASE READ THIS LICENSE CAREFULLY. - - -## 1. DEFINITION - -1.1. “Contributor” means any person or entity that creates or contributes to the creation of Modifications. - -1.2. “Covered Code” means the combination of the Original Code and any Modifications, and/or any portion thereof. - -1.3. “Larger Work” means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. - -1.4. “Modification” means any improvement, bug fix, error correction, embedded commenting enhancement, extension, rewrite, edit, addition to, deletion from, derivative work and/ or change to, the substance and/or structure of the Original Code and any previous Modifications, and/or any respective portions thereof, which is conceived and/or developed pursuant to this License, including by You and/or Your Representatives. - -1.5. “Original Code” means (a) the source code of UPYOG originally made available by the NIUA under this License as well as the source code of any updates or upgrades to UPYOG made available by the NIUA under this License; and (b) the object code compiled from such source code and originally made available by NIUA under this License. - -1.6. “Public money” means money, funds, or accounts, regardless of the source from which they are derived, that are owned, owed to, held, or administered by the Central Government any State Government(s), the local Government(s) or any ministry, department, agency, or any other person for or on behalf of any Local, State, or Central Government or any ministry, department or agency (collectively "Public Functionary"), including but not limited to those funded or controlled, directly or indirectly, by a State as defined in Article 12 of the Constitution of India. - -1.7. “Representative” means with respect to You, any and all of Your employees, directors, officers, consultants, advisors, agents, other lawful representatives and third party agencies such as implementation partner, engaged by You. - -1.8. “UPYOG” means an open-source, shared digital platform to enable the rollout of urban e-Governance services as part of the offerings under National Urban Digital Mission aimed to support States and Union Territories in their efforts to roll out the online delivery of municipal services in all their Urban Local Bodies ("ULBs"). This includes the common platform components and the reference applications, and additional applications which may be required by the ULBs, developed under the National Urban Digital Mission. - -1.9. “You” or “Your” means any legal person (individual, entity, organisation, company, trust, public sector undertaking, government departments and bodies, constitutional authorities etc.) exercising the rights granted under this License. - - -## 2. GRANT OF LICENSE - -2.1. Subject to the terms and conditions of this License, NIUA hereby grants You, a perpetual, non-exclusive, worldwide, open, no-charge, royalty-free, irrevocable copyright license, to the extent of NIUA’s copyrights covering the Original Code, to deal in the Original Code without restriction, including without limitation, the rights to use, copy, display, publish, reproduce, distribute, modify, redistribute, download or onboard the Original Code or any part thereof, for commercial or non-commercial purposes, and permit persons to whom the Original Code or Modification is furnished to do the same. Provided, however: (i) You shall retain and reproduce in all copies of the Original Code, the copyright notice, trademark, attribution notices, disclaimers of warranty, or limitations of liability as they appear in the Original Code and keep intact all notices in the Original Code that refer to this License; and (ii) You shall provide a copy of this License with every copy of the Original Code or Modification you distribute, redistribute, sell etc. - -2.2. You may modify the Original Code and use, copy, display, publish, reproduce, distribute, redistribute Your Modifications and the Covered Code for commercial or non-commercial purposes, provided that in each instance you shall: - -2.2.1. Satisfy all the conditions of the Proviso to Clause 2.1 with respect to the Original Code; - -2.2.2. You must identify yourself as the originator of Your Modification in a manner that reasonably allows subsequent recipients to identify and contact You as the originator of the Modification and cause the modified files to carry prominent notices stating that You modified the files. In fulfilment of these requirements, You must include a file (e.g., a change log file) that describes the alterations made to the Original Code, the date of the alterations, and include an express statement that the Modification is derived, directly or indirectly, from the Original Code provided by NIUA and give due acknowledgment and credit to Upyog by indicating that the Modification developed using the Original Code is ‘Powered by Upyog’; and - -2.2.3. In case Your Modification is sponsored by or done from Public Moneys, Your Modification and the Covered Code must be released under the same terms, applicable on a reciprocal basis, as set forth in this License and You shall furnish to NIUA, the source code and object code of such Modification and the Covered Code. Therefore, as a condition to the rights granted to You under this License and in consideration of the Public Moneys utilised by You for developing the Modification and the Covered Code, you hereby grant a perpetual, non-exclusive, worldwide, open, no-charge, royalty-free, irrevocable license to NIUA, to the extent of Your copyrights and other intellectual property rights owned or controlled by You in such Modification and Covered Code, to deal in Your Modification and/or the Covered Code without restriction, including but not limited to, use, copy, display, publish, reproduce, distribute, modify, redistribute, download or onboard Your Modification, the Covered Code or any part thereof, for commercial or non-commercial purposes, in source code and object form and permit persons to whom Your Modification, the Covered Code or any part thereof is furnished to do the same. - -2.3. You expressly agree and acknowledge that no assurances are provided by NIUA that the Original Code does not infringe intellectual property rights of any other entity. NIUA disclaims any liability to You for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, You hereby assume sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow You to distribute Your Modification and/ or Covered Code and/ or Larger Work, it is your responsibility to acquire the license before distributing such work. In each such instance, You must make sure the requirements of this License are fulfilled for the Original Code and/or the Covered Code, or any portion thereof, as applicable. - -2.4. You may not make any representation in the Original Code or in any promotional, advertising or other material that may be construed as an endorsement by NIUA of any product or service provided by You, or seek to obtain any commercial advantage by the fact of NIUA's participation in this License. - - -## 3. DISCLAIMER OF WARRANTIES AND LIABILITIES; WAIVER AND INDEMNIFICATION - -3.1. THE ORIGINAL CODE MAY CONTAIN ERRORS THAT COULD CAUSE FAILURES OR LOSS OF DATA, AND MAY BE INCOMPLETE OR CONTAIN INACCURACIES. YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT USE OF THE ORIGINAL CODE, OR ANY PORTION THEREOF, IS AT YOUR SOLE AND ENTIRE RISK. THE ORIGINAL CODE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE ORIGINAL CODE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT. THE GOVERNMENT OF INDIA AND NIUA DO NOT WARRANT AGAINST INTERFERNCE OF YOUR ENJOYMENT OF THE ORIGINAL CODE, THAT THE OPERATION OF THE ORIGINAL CODE WILL BE UNITERRUPTED OR ERROR FREE, OR THAT DEFECTS IN THE ORIGINAL CODE WILL BE CORRECTED. SHOULD THE ORIGINAL CODE PROVE DEFECTIVE IN ANY RESPECT, YOU ASSUME THE COST OF ANY NECESSARRY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF THE ORIGINAL CODE IS AUTHORISED UNDER THIS LICENSE EXCEPT UNDER THIS DISCLAIMER. - -3.2. YOU AGREE TO WAIVE ANY AND ALL CLAIMS AGAINST THE GOVERNMENT OF INDIA AND NIUA. IF YOUR USE OF THE ORIGINAL CODE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, YOU SHALL INDEMNIFY AND HOLD HARMLESS THE GOVERNMENT OF INDIA AND NIUA, TO THE EXTENT PERMITTED BY LAW. - -3.3. YOU HEREBY AGREE TO DEFEND AND INDEMNIFY THE GOVERNMENT OF INDIA AND NIUA AGAINST ANY LOSSES, DAMAGES AND COSTS (COLLECTIVELY “LOSSES”) ARISING FROM CLAIMS, LAWSUITS AND OTHER LEGAL ACTIONS BROUGHT BY A THIRD PARTY AGAINST THE GOVERNMENT OF INDIA AND NIUA CAUSED BY YOUR BREACH OF ANY OF THE TERMS OF THIS LICENSE AND/OR YOUR REPRESENTATIONS, COVENANTS AND/ OR OBLIGATIONS. - -3.4. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE GOVERNMENT OF INDIA AND NIUA, BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR LOSSES WHETHER COMMERCIAL OR OTHERWISE, ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE ORIGINAL CODE, OR ANY PORTION THEREOF. - -3.5. YOU SHALL NOTIFY THE GOVERNMENT OF INDIA AND NIUA IN WRITING OF (I) ANY ACTUAL, SUSPECTED OR APPARENT MISUSE OR MISAPPROPRIATION OF THE ORIGINAL CODE BY ANY THIRD PARTY; (II) ANY ALLEGATION OR CLAIM BY A THIRD PARTY THAT THE USE OF ORIGINAL CODE INFRINGES SUCH THIRD PARTY’S INTELLECTUAL PROPERTY RIGHTS; OR (III) ANY OTHER CIRCUMSTANCE WHICH MAY ADVERSLY AFFECT THE RIGHTS OF THE GOVERNMENT OF INDIA AND NIUA. - -3.6. UNDER THIS LICENSE; WHICH COMES TO YOUR ATTENTION OR YOU MAY BECOME AWARE OF, IMMEDIATELY ON SUCH INFORMATION OR KNOWLEDGE BEING RECEIVED BY YOU, GIVING FULL PARTICULARS THEREOF. - - -## 4. COMMERCIAL DISTRIBUTION - -4.1. In the event You include the Original Code in a commercial product offering, you should do so in a manner that does not create potential liability for the Government of India and NIUA. Therefore, you hereby agree to defend and indemnify the Government of India and NIUA against any Losses arising from claims, lawsuits and other legal actions brought by a third party against the Government of India and NIUA caused by Your acts or omissions in connection with Your distribution of the Original Code in the commercial product offering. - -4.2. In case You choose to offer, and to charge a fee for, warranty, support, indemnity and/or liability obligations to one or more recipients of the Original Code, you do so only on Your own behalf and as Your sole responsibility, and not on behalf of the Government of India, NIUA or any other Contributor. You must make it absolutely clear that any such warranty, support, indemnity and/or liability obligation is offered by You alone. Further, you agree to indemnify, defend and hold harmless the Government of India, NIUA and every other Contributor for any liability incurred by or claim asserted against the Government of India, NIUA or such Contributor as a result of such warranty, support, indemnity and/or liability offered by You. - - -## 5. TRADEMARK - -5.1. This License does not grant any rights to use the trademarks, service marks, logos or trade names or symbols belonging to or associated with NIUA, CDG, UPYOG or any government or other agencies associated with UPYOG (“collectively Marks”). You agree not to use any Marks in or as part of the name of products derived from the Original Code or to endorse or promote products derived from the Original Code. - - -## 6. OWNERSHIP -6.1. NIUA retains all rights title and interest in and to the Original Code and any Modifications made by or on behalf of NIUA. Subject to and save and except as set out in the terms of this License, each Contributor retains all rights, title and interest in and to any Modification made by such Contributor. - - -## 7. GENERAL TERMS -7.1. This License will not be construed as creating an agency, partnership, joint venture, association of persons or any other form of association, legal or otherwise, between or among You and NIUA, and You will not represent to the contrary, whether expressly, by implication, appearance or otherwise. Nothing contained in this License shall be construed to (i) constitute any form of a fiduciary relationship between You and NIUA; or (ii) give You the authority to bind, to contract in the name of, or to create a liability for NIUA, in any manner. - -7.2. Nothing in this License will impair NIUA’s rights to acquire, license, develop, have others develop for it, technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Larger Works, technology, or products You may develop, produce, market or distribute. - -7.3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License. - -7.4. This License shall be governed by and construed in accordance with the laws of India. - -7.5. Any litigation relating to this License may be brought only in the courts of New Delhi and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict of law provisions. - - -## 8. END OF UPYOG code, copyright, and contribution license terms. - - +The MIT License (MIT) + +Copyright (c) 2017 Infeeds; Developed by Ghazi Khan under https://infeeds.com domain + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/frontend/mono-ui/web/rainmaker-webview/README.md b/frontend/mono-ui/web/rainmaker-webview/README.md old mode 100755 new mode 100644 index 1cba7c25c77..d7fb1b09706 --- a/frontend/mono-ui/web/rainmaker-webview/README.md +++ b/frontend/mono-ui/web/rainmaker-webview/README.md @@ -1,5 +1,7 @@ [![Java](https://forthebadge.com/images/badges/made-with-java.svg)](https://github.com/org/Android-SmartWebView) +[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php) + # Android Smart WebView This project is developed to help you create Hybrid Android applications with just webview. Hybrid app comes in between webview and native forms, with this project you can embed any existing webpage or setup an Offline HTML/CSS/Javascript based project. @@ -66,13 +68,30 @@ COOKIE "long" for longitude ``` ## Author +This project is initially developed by **Ghazi Khan**. + +Public Profiles: +* [Personal Blog](https://org.infeeds.com) +* [Facebook](https://www.facebook.com/getmgks) +* [Twitter](https://twitter.com/getmgks) + +### Would you like to buy me a cup of coffee? +#### I'd appreciate even your little contribution to my work, it helps me keep this Open Source updated. If this project helped you or your business and if you feel like donating some bucks, you can Paypal me - getmgks@gmail.com +Buy Me a Coffee at ko-fi.com + + ## License -UPYOG Source Code is open sources under License [UPYOG CODE, COPYRIGHT AND CONTRIBUTION LICENSE TERMS](https://upyog.niua.org/employee/Upyog%20Code%20and%20Copyright%20License_v1.pdf) +This project is licensed under the MIT License - see [LICENSE.md](LICENSE.md) file for details or read [MIT license](https://opensource.org/licenses/MIT). + +## Acknowledgment +Rating method (Android-Rate) used in this app is developed by [hotchemi](https://github.com/hotchemi) and thanks to other programmers who contributed to this project. +Post in Github Repo issues section if you got any problem handling the project and if you want to contribute, you're most welcome to help me make a smarter project than what it is. +Just drop me a mail at: [getmgks@gmail.com](mailto:getmgks@gmail.com) **This project on Infeeds - [Android Smart WebView open source to upload files, get GPS locations and more advanced features](https://infeeds.com/d/CODEmgks/25019/android-smart-webview-open-source-upload)** diff --git a/frontend/mono-ui/web/rainmaker-webview/build.gradle b/frontend/mono-ui/web/rainmaker-webview/build.gradle old mode 100755 new mode 100644 index ebb685a734b..1788cfc1bc8 --- a/frontend/mono-ui/web/rainmaker-webview/build.gradle +++ b/frontend/mono-ui/web/rainmaker-webview/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath 'com.android.tools.build:gradle:3.3.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -22,22 +22,6 @@ allprojects { android { compileSdkVersion 26 - - signingConfigs { - Citizen { - keyAlias 'your_key_alias' - keyPassword '123456' - storeFile file('your_key_name.keystore') - storePassword '123456' - } - Employee { - keyAlias 'your_key_alias' - keyPassword '123456' - storeFile file('your_key_name.keystore') - storePassword '123456' - } - } - buildTypes { release { minifyEnabled true @@ -45,12 +29,8 @@ android { applicationVariants.all { variant -> variant.outputs.all { def date = new Date() - def formattedDate = date.format('ddMMMyyyy') - + def formattedDate = date.format('ddMMMyyyy_HH:mm:ss') outputFileName = "${variant.name}_${variant.versionName}_${formattedDate}.apk" - if(variant.name.contains('Release')){ - outputFileName = "${variant.name}_${variant.versionName}.apk" - } } } } @@ -61,147 +41,90 @@ android { abortOnError false } + signingConfigs { + Citizen { + keyAlias 'mseva.punjab.citizen' + keyPassword 'egov123' + storeFile file('keystore/citizen/keystore') + storePassword 'egov123' + } + Employee { + keyAlias 'mseva.punjab.employee' + keyPassword 'egov123' + storeFile file('keystore/employee/keystore') + storePassword 'egov123' + } + } + flavorDimensions "default" productFlavors { CitizenProd { minSdkVersion 19 applicationId 'org.egovernment.mseva.citizen' targetSdkVersion 26 - versionCode 14 - versionName '2.3.0' - resValue "string", "app_name", "mSeva-Citizen-DEV" + testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' + versionCode 13 + versionName '1.0.14' + resValue "string", "app_name", "mSeva-Punjab" resValue "string", "launcher_icon", "@mipmap/ic_launcher_citizen" signingConfig signingConfigs.Citizen - buildConfigField 'String', 'url', '"https://dev.digit.org/citizen/user/register"' - buildConfigField 'String', 'gatewayHost', '"test.ccavenue.com"' + // Production + buildConfigField 'String', 'url', '"https://mseva.lgpunjab.gov.in/citizen/user/register"' } EmployeeProd { minSdkVersion 19 applicationId 'org.egovernment.mseva.employee' targetSdkVersion 26 testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' - versionCode 14 - versionName '2.3.0' + versionCode 13 + versionName '1.0.14' resValue "string", "app_name", "mSeva-Punjab Employee" resValue "string", "launcher_icon", "@mipmap/ic_launcher_employee" signingConfig signingConfigs.Employee // Production buildConfigField 'String', 'url', '"https://mseva.lgpunjab.gov.in/employee/user/login"' - buildConfigField 'String', 'gatewayHost', '"migs.mastercard.co.in"' } - CitizenDEV { + CitizenUAT { minSdkVersion 19 applicationId 'org.egovernment.mseva.citizen' targetSdkVersion 26 testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' - versionCode 14 - versionName '2.3.0' - resValue "string", "app_name", "mSeva-Citizen-DEV" + versionCode 13 + versionName '1.0.14' + resValue "string", "app_name", "UAT mSeva-Punjab" resValue "string", "launcher_icon", "@mipmap/ic_launcher_citizen" signingConfig signingConfigs.Citizen - buildConfigField 'String', 'url', '"https://dev.digit.org/digit-ui/citizen"' - buildConfigField 'String', 'gatewayHost', '"test.ccavenue.com"' - } - EmployeeDEV { - minSdkVersion 19 - applicationId 'org.egovernment.mseva.employee' - targetSdkVersion 26 - testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' - versionCode 14 - versionName '2.3.0' - resValue "string", "app_name", "mSeva-Employee-DEV" - resValue "string", "launcher_icon", "@mipmap/ic_launcher_employee" - signingConfig signingConfigs.Employee + // QA +// buildConfigField 'String', 'url', '"https://egov-micro-qa.egovernments.org/citizen/user/register"' - buildConfigField 'String', 'url', '"https://dev.digit.org/digit-ui/employee"' - buildConfigField 'String', 'gatewayHost', '"migs.mastercard.co.in"' - } - CitizenQA{ - minSdkVersion 19 - applicationId 'org.egovernment.mseva.citizen' - targetSdkVersion 26 - testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' - versionCode 14 - versionName '2.3.0' - resValue "string", "app_name", "mSeva-Citizen-QA" - resValue "string", "launcher_icon", "@mipmap/ic_launcher_citizen" - signingConfig signingConfigs.Citizen + // DEV +// buildConfigField 'String', 'url', '"https://egov-micro-dev.egovernments.org/citizen/user/register"' - buildConfigField 'String', 'url', '"https://qa.digit.org/digit-ui/citizen"' - buildConfigField 'String', 'gatewayHost', '"migs.mastercard.co.in"' - } - EmployeeQA { - minSdkVersion 19 - applicationId 'org.egovernment.mseva.employee' - targetSdkVersion 26 - testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' - versionCode 14 - versionName '2.3.0' - resValue "string", "app_name", "mSeva-Employee-QA" - resValue "string", "launcher_icon", "@mipmap/ic_launcher_employee" - signingConfig signingConfigs.Employee - - buildConfigField 'String', 'url', '"https://qa.digit.org/digit-ui/employee"' - buildConfigField 'String', 'gatewayHost', '"migs.mastercard.co.in"' - } - CitizenUAT{ - minSdkVersion 19 - applicationId 'org.egovernment.mseva.citizen' - targetSdkVersion 26 - testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' - versionCode 14 - versionName '2.3.0' - resValue "string", "app_name", "mSeva-Citizen-UAT" - resValue "string", "launcher_icon", "@mipmap/ic_launcher_citizen" - signingConfig signingConfigs.Citizen - - buildConfigField 'String', 'url', '"https://uat.digit.org/digit-ui/citizen"' - buildConfigField 'String', 'gatewayHost', '"migs.mastercard.co.in"' + //UAT + buildConfigField 'String', 'url', '"https://mseva-uat.lgpunjab.gov.in/citizen/user/register"' } EmployeeUAT { minSdkVersion 19 applicationId 'org.egovernment.mseva.employee' targetSdkVersion 26 testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' - versionCode 14 - versionName '2.3.0' - resValue "string", "app_name", "mSeva-Employee-UAT" + versionCode 13 + versionName '1.0.14' + resValue "string", "app_name", "UAT mSeva-Punjab Employee" resValue "string", "launcher_icon", "@mipmap/ic_launcher_employee" signingConfig signingConfigs.Employee - buildConfigField 'String', 'url', '"https://uat.digit.org/digit-ui/employee"' - buildConfigField 'String', 'gatewayHost', '"migs.mastercard.co.in"' - } - CitizenSTAGING{ - minSdkVersion 19 - applicationId 'org.egovernment.mseva.citizen' - targetSdkVersion 26 - testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' - versionCode 14 - versionName '2.3.0' - resValue "string", "app_name", "mSeva-Citizen-STAGING" - resValue "string", "launcher_icon", "@mipmap/ic_launcher_citizen" - signingConfig signingConfigs.Citizen + //QA +// buildConfigField 'String', 'url', '"https://egov-micro-qa.egovernments.org/employee/user/login"' - buildConfigField 'String', 'url', '"https://staging.digit.org/citizen/user/register"' - buildConfigField 'String', 'gatewayHost', '"migs.mastercard.co.in"' - } - EmployeeSTAGING { - minSdkVersion 19 - applicationId 'org.egovernment.mseva.employee' - targetSdkVersion 26 - testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' - versionCode 14 - versionName '2.3.0' - resValue "string", "app_name", "mSeva-Employee-STAGING" - resValue "string", "launcher_icon", "@mipmap/ic_launcher_employee" - signingConfig signingConfigs.Employee + //DEV +// buildConfigField 'String', 'url', '"https://egov-micro-dev.egovernments.org/employee/user/login"' - buildConfigField 'String', 'url', '"https://staging.digit.org//employee/user/login"' - buildConfigField 'String', 'gatewayHost', '"migs.mastercard.co.in"' + //UAT + buildConfigField 'String', 'url', '"https://mseva-uat.lgpunjab.gov.in/employee/user/login"' } } } @@ -210,4 +133,3 @@ dependencies { implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.google.android.gms:play-services-base:15.0.1' } - diff --git a/frontend/mono-ui/web/rainmaker-webview/gradle/wrapper/gradle-wrapper.jar b/frontend/mono-ui/web/rainmaker-webview/gradle/wrapper/gradle-wrapper.jar old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/gradle/wrapper/gradle-wrapper.properties b/frontend/mono-ui/web/rainmaker-webview/gradle/wrapper/gradle-wrapper.properties old mode 100755 new mode 100644 index 9cd79b5a2f1..e4b65b521f6 --- a/frontend/mono-ui/web/rainmaker-webview/gradle/wrapper/gradle-wrapper.properties +++ b/frontend/mono-ui/web/rainmaker-webview/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Jan 23 10:17:12 IST 2023 +#Thu Sep 12 18:02:38 IST 2019 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip diff --git a/frontend/mono-ui/web/rainmaker-webview/gradlew b/frontend/mono-ui/web/rainmaker-webview/gradlew old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/gradlew.bat b/frontend/mono-ui/web/rainmaker-webview/gradlew.bat old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/proguard-rules.pro b/frontend/mono-ui/web/rainmaker-webview/proguard-rules.pro old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/androidTest/java/org/egovernment/mseva/ExampleInstrumentedTest.java b/frontend/mono-ui/web/rainmaker-webview/src/androidTest/java/org/egovernment/mseva/ExampleInstrumentedTest.java old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/AndroidManifest.xml b/frontend/mono-ui/web/rainmaker-webview/src/main/AndroidManifest.xml old mode 100755 new mode 100644 index b9cc10fd265..3dabb89a58d --- a/frontend/mono-ui/web/rainmaker-webview/src/main/AndroidManifest.xml +++ b/frontend/mono-ui/web/rainmaker-webview/src/main/AndroidManifest.xml @@ -1,41 +1,41 @@ + xmlns:tools="http://schemas.android.com/tools" + package="org.egovernment.mseva" + android:installLocation="auto"> - - - - - + + + - + - + - + - + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + android:name="com.google.android.gms.version" + android:value="@integer/google_play_services_version" /> + diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/assets/error.html b/frontend/mono-ui/web/rainmaker-webview/src/main/assets/error.html old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/assets/logo.png b/frontend/mono-ui/web/rainmaker-webview/src/main/assets/logo.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/ic_launcher-web.png b/frontend/mono-ui/web/rainmaker-webview/src/main/ic_launcher-web.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/ic_launcher_citizen-web.png b/frontend/mono-ui/web/rainmaker-webview/src/main/ic_launcher_citizen-web.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/ic_launcher_employee-web.png b/frontend/mono-ui/web/rainmaker-webview/src/main/ic_launcher_employee-web.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/AppJavaScriptProxy.java b/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/AppJavaScriptProxy.java old mode 100755 new mode 100644 index f467af41d76..37f3df12292 --- a/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/AppJavaScriptProxy.java +++ b/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/AppJavaScriptProxy.java @@ -124,16 +124,11 @@ public void downloadBase64File(String base64Data, String filename) throws IOExce final File dwldsPath = new File(Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_DOWNLOADS) + "/" + filename); byte[] pdfAsBytes = Base64.decode(base64Data.replaceFirst("^data:[^;]+;base64,", ""), 0); - FileOutputStream os=null; - try{ - os = new FileOutputStream(dwldsPath, false); - os.write(pdfAsBytes); - }catch (Exception e){ - Log.v("Error while creating temp report."); - }finally { - os.flush(); - os.close(); - } + FileOutputStream os; + os = new FileOutputStream(dwldsPath, false); + os.write(pdfAsBytes); + os.flush(); + createFileDownloadedNotification(dwldsPath, contentType); } diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/DetectConnection.java b/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/DetectConnection.java old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/MainActivity.java b/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/MainActivity.java old mode 100755 new mode 100644 index 720ebeb15a7..2c65cd023f5 --- a/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/MainActivity.java +++ b/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/MainActivity.java @@ -1,8 +1,8 @@ package org.egovernment.mseva; /* - * Giving right credit to developers encourages them to create better projects, just want you to know that :) - */ +* Giving right credit to developers encourages them to create better projects, just want you to know that :) +*/ import android.Manifest; import android.annotation.SuppressLint; @@ -10,7 +10,6 @@ import android.app.Activity; import android.app.ActivityManager; import android.content.ActivityNotFoundException; -import android.content.ComponentName; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.ApplicationInfo; @@ -31,7 +30,6 @@ import android.view.KeyEvent; import android.view.View; import android.view.WindowManager; -import android.webkit.ConsoleMessage; import android.webkit.CookieManager; import android.webkit.GeolocationPermissions; import android.webkit.URLUtil; @@ -79,20 +77,20 @@ public class MainActivity extends AppCompatActivity { final private int REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS = 124; private static String URL =BuildConfig.url; - private String FILE_TYPE = "*/*"; //to upload any file type using "*/*"; check file type references for more + private String FILE_TYPE = "image/*"; //to upload any file type using "*/*"; check file type references for more public static String HOST = getHost(URL); //Careful with these variable names if altering - private WebView webView; + private WebView webView; - private String asw_cam_message; - private ValueCallback asw_file_message; - private ValueCallback asw_file_path; + private String asw_cam_message; + private ValueCallback asw_file_message; + private ValueCallback asw_file_path; - // permissions code + // permissions code private final static int MY_PERMISSIONS_REQUEST_LOCATION = 21; - private final static int asw_file_req = 1; + private final static int asw_file_req = 1; private final static int REQUEST_FILE_PERMISSIONS = 2; private final static int loc_perm = 3; private final static int sms_receive_perm = 4; @@ -109,50 +107,50 @@ public class MainActivity extends AppCompatActivity { private static final String TAG = MainActivity.class.getSimpleName(); - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent intent) { - super.onActivityResult(requestCode, resultCode, intent); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimary)); - Uri[] results = null; - if (resultCode == Activity.RESULT_OK) { - if (requestCode == asw_file_req) { - if (null == asw_file_path) { - return; - } - if (intent == null || intent.getFlags() == 0) { - if (asw_cam_message != null) { - results = new Uri[]{Uri.parse(asw_cam_message)}; - } - } else { - String dataString = intent.getDataString(); - if (dataString != null) { - results = new Uri[]{ Uri.parse(dataString) }; - } - } - } - } - asw_file_path.onReceiveValue(results); - asw_file_path = null; - } else { - if (requestCode == asw_file_req) { - if (null == asw_file_message) return; - Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData(); - asw_file_message.onReceiveValue(result); - asw_file_message = null; - } - } - } - - @SuppressLint({"SetJavaScriptEnabled", "WrongViewCast"}) - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - if (proxy == null) { - proxy = new AppJavaScriptProxy(this); + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent intent) { + super.onActivityResult(requestCode, resultCode, intent); + if (Build.VERSION.SDK_INT >= 21) { + getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimary)); + Uri[] results = null; + if (resultCode == Activity.RESULT_OK) { + if (requestCode == asw_file_req) { + if (null == asw_file_path) { + return; + } + if (intent == null || intent.getFlags() == 0) { + if (asw_cam_message != null) { + results = new Uri[]{Uri.parse(asw_cam_message)}; + } + } else { + String dataString = intent.getDataString(); + if (dataString != null) { + results = new Uri[]{ Uri.parse(dataString) }; + } + } + } + } + asw_file_path.onReceiveValue(results); + asw_file_path = null; + } else { + if (requestCode == asw_file_req) { + if (null == asw_file_message) return; + Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData(); + asw_file_message.onReceiveValue(result); + asw_file_message = null; + } + } + } + + @SuppressLint({"SetJavaScriptEnabled", "WrongViewCast"}) + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + if (proxy == null) { + proxy = new AppJavaScriptProxy(this); } if (Build.VERSION.SDK_INT >= 23) { @@ -166,13 +164,11 @@ protected void onCreate(Bundle savedInstanceState) { } } - //Move this to Javascript Proxy + //Move this to Javascript Proxy webView = (WebView) findViewById(R.id.webview); - webView.getSettings().setJavaScriptEnabled(true); webView.addJavascriptInterface(proxy, "mSewaApp"); - String versionName = ""; int versionCode = 0; try { @@ -196,20 +192,18 @@ protected void onCreate(Bundle savedInstanceState) { webSettings.setDomStorageEnabled(true); webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimaryDark)); - webView.setLayerType(View.LAYER_TYPE_HARDWARE, null); - webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); + if (Build.VERSION.SDK_INT >= 21) { + getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimaryDark)); + webView.setLayerType(View.LAYER_TYPE_HARDWARE, null); + webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.setAcceptThirdPartyCookies(webView, true); - } else if (Build.VERSION.SDK_INT >= 19) { - webView.setLayerType(View.LAYER_TYPE_HARDWARE, null); - } - webView.setVerticalScrollBarEnabled(false); - webView.setWebViewClient(new CustomWebView()); - - + } else if (Build.VERSION.SDK_INT >= 19) { + webView.setLayerType(View.LAYER_TYPE_HARDWARE, null); + } + webView.setVerticalScrollBarEnabled(false); + webView.setWebViewClient(new CustomWebView()); webView.getSettings().setGeolocationDatabasePath(getFilesDir().getPath()); if (BuildConfig.DEBUG) { webView.setWebContentsDebuggingEnabled(true); @@ -218,25 +212,25 @@ protected void onCreate(Bundle savedInstanceState) { webView.setDownloadListener(new DownloadListener() { @Override public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long contentLength) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) - == PackageManager.PERMISSION_GRANTED) { - Log.v(TAG,"Permission is granted"); - downloadDialog(url,userAgent,contentDisposition,mimeType); - } else { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) + == PackageManager.PERMISSION_GRANTED) { + Log.v(TAG,"Permission is granted"); + downloadDialog(url,userAgent,contentDisposition,mimeType); + } else { - Log.v(TAG,"Permission is revoked"); - //requesting permissions. - ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1); + Log.v(TAG,"Permission is revoked"); + //requesting permissions. + ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1); + } + } + else { + //Code for devices below API 23 or Marshmallow + Log.v(TAG,"Permission is granted"); + downloadDialog(url,userAgent,contentDisposition,mimeType); } } - else { - //Code for devices below API 23 or Marshmallow - Log.v(TAG,"Permission is granted"); - downloadDialog(url,userAgent,contentDisposition,mimeType); - } - } }); /*webView.setDownloadListener(new DownloadListener() { @@ -267,16 +261,12 @@ public void onDownloadStart(String url, String userAgent, } }); */ - //Rendering the default URL - loadView(URL,false); + //Rendering the default URL + loadView(URL,false); + + webView.setWebChromeClient(new WebChromeClient() { + // handling geolocation - webView.setWebChromeClient(new WebChromeClient() { - // handling geolocation - @Override - public boolean onConsoleMessage(ConsoleMessage consoleMessage) { - android.util.Log.d("WebView", consoleMessage.message()); - return true; - } @Override public void onGeolocationPermissionsShowPrompt(final String origin, final GeolocationPermissions.Callback callback) { @@ -285,15 +275,15 @@ public void onGeolocationPermissionsShowPrompt(final String origin, final Geoloc if(ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,Manifest.permission.ACCESS_FINE_LOCATION)){ String message = "Allow Rainmaker to access location details?"; showMessageOKCancel(message, - new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface dialog, int which) { - mGeoLocationCallback = callback; - mGeoLocationRequestOrigin = origin; - ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},MY_PERMISSIONS_REQUEST_LOCATION); - } - }); + new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + mGeoLocationCallback = callback; + mGeoLocationRequestOrigin = origin; + ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},MY_PERMISSIONS_REQUEST_LOCATION); + } + }); } // code is duplication; to be changed! else{ @@ -308,16 +298,16 @@ public void onClick(DialogInterface dialog, int which) { } //Handling input[type="file"] requests for android API 16+ - public void openFileChooser(ValueCallback uploadMsg, String acceptType, String capture){ - asw_file_message = uploadMsg; - Intent i = new Intent(Intent.ACTION_GET_CONTENT); - i.addCategory(Intent.CATEGORY_OPENABLE); - i.setType(FILE_TYPE); - startActivityForResult(Intent.createChooser(i, "File Chooser"), asw_file_req); + public void openFileChooser(ValueCallback uploadMsg, String acceptType, String capture){ + asw_file_message = uploadMsg; + Intent i = new Intent(Intent.ACTION_GET_CONTENT); + i.addCategory(Intent.CATEGORY_OPENABLE); + i.setType(FILE_TYPE); + startActivityForResult(Intent.createChooser(i, "File Chooser"), asw_file_req); - } - //Handling input[type="file"] requests for android API 21+ - public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback,WebChromeClient.FileChooserParams fileChooserParams){ + } + //Handling input[type="file"] requests for android API 21+ + public boolean onShowFileChooser(WebView webView, ValueCallback filePathCallback,WebChromeClient.FileChooserParams fileChooserParams){ if (asw_file_path != null) { asw_file_path.onReceiveValue(null); @@ -334,12 +324,12 @@ public boolean onShowFileChooser(WebView webView, ValueCallback filePathC showFileDialog(); } return true; - } + } - }); - if (getIntent().getData() != null) { - String path = getIntent().getDataString(); + }); + if (getIntent().getData() != null) { + String path = getIntent().getDataString(); /* If you want to check or use specific directories or schemes or hosts @@ -349,11 +339,11 @@ public boolean onShowFileChooser(WebView webView, ValueCallback filePathC List pr = data.getPathSegments(); String param1 = pr.get(0); */ - loadView(path,false); - } + loadView(path,false); + } - } + } public void downloadDialog(final String url,final String userAgent,String contentDisposition,String mimetype) @@ -365,37 +355,37 @@ public void downloadDialog(final String url,final String userAgent,String conten - @Override - public void onResume() { - super.onResume(); - //Coloring the "recent apps" tab header; doing it onResume, as an insurance - if (Build.VERSION.SDK_INT >= 23) { - Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher); - ActivityManager.TaskDescription taskDesc = null; - taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, getColor(R.color.colorPrimary)); - MainActivity.this.setTaskDescription(taskDesc); - } + @Override + public void onResume() { + super.onResume(); + //Coloring the "recent apps" tab header; doing it onResume, as an insurance + if (Build.VERSION.SDK_INT >= 23) { + Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher); + ActivityManager.TaskDescription taskDesc = null; + taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, getColor(R.color.colorPrimary)); + MainActivity.this.setTaskDescription(taskDesc); + } - } + } - //Setting activity layout visibility + //Setting activity layout visibility private class CustomWebView extends WebViewClient { - public void onPageStarted(WebView view, String url, Bitmap favicon) { + public void onPageStarted(WebView view, String url, Bitmap favicon) { - } + } - public void onPageFinished(WebView view, String url) { - } - //For android below API 23 + public void onPageFinished(WebView view, String url) { + } + //For android below API 23 @SuppressWarnings("deprecation") @Override - public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { - Toast.makeText(getApplicationContext(), description, Toast.LENGTH_SHORT).show(); + public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { + Toast.makeText(getApplicationContext(), description, Toast.LENGTH_SHORT).show(); // loadView("file:///android_asset/error.html", false); } - @Override - public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { + @Override + public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Toast.makeText(getApplicationContext(), error.getDescription(), Toast.LENGTH_SHORT).show(); } @@ -417,25 +407,23 @@ public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request // startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(request.toString()))); return url_actions(view, request.getUrl().toString()); // return true; - } + } - } + } //Actions based on shouldOverrideUrlLoading public boolean url_actions(WebView view, String url){ boolean returnValue = true; //Show toast error if not connected to the network if (!DetectConnection.isInternetAvailable(MainActivity.this)) { -// Toast.makeText(getApplicationContext(), "Please check your Network Connection!", Toast.LENGTH_SHORT).show(); - + Toast.makeText(getApplicationContext(), "Please check your Network Connection!", Toast.LENGTH_SHORT).show(); //Use this in a hyperlink to redirect back to default URL :: href="refresh:android" } else if (url.startsWith("refresh:")) { loadView(URL, false); - - //Use this in a hyperlink to launch default phone dialer for specific number :: href="tel:+919876543210" + //Use this in a hyperlink to launch default phone dialer for specific number :: href="tel:+919876543210" } else if (url.startsWith("tel:")) { Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(url)); startActivity(intent); @@ -454,14 +442,13 @@ public boolean url_actions(WebView view, String url){ intent.addCategory(Intent.CATEGORY_HOME); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); - } - /** added a new condition to support 3 rd party payment **/ - else if (getHost(url).contains(BuildConfig.gatewayHost)) { - return false; + //Use to do download support } - - //Use to do download support +// else if (url.contains("98jf4")) { +// loadView(url, true); +// //Opening external URLs in android default web browser +// } else if (!getHost(url).equals(HOST)) { try { Intent intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME); @@ -479,9 +466,6 @@ else if (!getHost(url).equals(HOST)) { loadView(url,false); } - } - else if(!getHost(url).contains("digit.org")){ - return true; } else { returnValue = false; } @@ -518,28 +502,16 @@ private String random_id() { //Opening URLs inside webview with request void loadView(String url, Boolean tab) { - Intent request = getIntent(); // possibly coming from a malicious app - ComponentName component = request.getComponent(); - if( isValidComponent(component) ) { if (tab) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(url)); startActivity(intent); } else { webView.loadUrl(url); - }} - } - // Validates the request component - private boolean isValidComponent(ComponentName component) { - String activityName = component.getClassName(); - if(activityName.contains("MainActivity")){ - return true; } - return false; } - //Checking if particular permission is given or not public boolean check_permission(int permission){ switch(permission){ @@ -559,7 +531,6 @@ public boolean check_permission(int permission){ return false; } - private void showFileDialog(){ Intent contentSelectionIntent = new Intent(Intent.ACTION_GET_CONTENT); contentSelectionIntent.addCategory(Intent.CATEGORY_OPENABLE); @@ -597,15 +568,13 @@ private void showFileDialog(){ } //Creating image file for upload - private File create_image() throws IOException { - @SuppressLint("SimpleDateFormat") - String file_name = new SimpleDateFormat("yyyy_mm_ss").format(new Date()); - String new_name = "file_"+file_name+"_"; - final File root = new File(Environment.getExternalStorageDirectory() + File.separator + "MyDir" + File.separator); - root.mkdirs(); - //File sd_directory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); - return File.createTempFile(new_name, ".jpg", root); - } + private File create_image() throws IOException { + @SuppressLint("SimpleDateFormat") + String file_name = new SimpleDateFormat("yyyy_mm_ss").format(new Date()); + String new_name = "file_"+file_name+"_"; + File sd_directory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); + return File.createTempFile(new_name, ".jpg", sd_directory); + } @Override @@ -631,12 +600,12 @@ public boolean onKeyDown(int keyCode, @NonNull KeyEvent event) { //path may be dynamic. need to be changed acc to UI if(currentWebViewUrl.endsWith("/employee/all-complaints") || currentWebViewUrl.endsWith("/citizen/")){ showMessageOKCancel(message, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - finish(); - } - }); + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + finish(); + } + }); } else{ webView.goBack(); @@ -650,35 +619,35 @@ public void onClick(DialogInterface dialog, int which) { return super.onKeyDown(keyCode, event); } - @Override - protected void onStart() { - super.onStart(); - } + @Override + protected void onStart() { + super.onStart(); + } - @Override - protected void onStop() { - super.onStop(); + @Override + protected void onStop() { + super.onStop(); // if (proxy.smsReceiverRunning()) { // proxy.stopSMSReceiver(); // } - } + } - @Override - public void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - } + @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + } - @Override - protected void onSaveInstanceState(Bundle outState){ - super.onSaveInstanceState(outState); - webView.saveState(outState); - } + @Override + protected void onSaveInstanceState(Bundle outState){ + super.onSaveInstanceState(outState); + webView.saveState(outState); + } - @Override - protected void onRestoreInstanceState(Bundle savedInstanceState){ - super.onRestoreInstanceState(savedInstanceState); - webView.restoreState(savedInstanceState); - } + @Override + protected void onRestoreInstanceState(Bundle savedInstanceState){ + super.onRestoreInstanceState(savedInstanceState); + webView.restoreState(savedInstanceState); + } @Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { @@ -696,14 +665,14 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in // Check for ACCESS_FINE_LOCATION if (perms.get(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED - ) { + ) { // All Permissions Granted // Do nothing } else { // Permission Denied Toast.makeText(MainActivity.this, "One or More Permissions are DENIED Exiting App", Toast.LENGTH_SHORT) - .show(); + .show(); finish(); } } @@ -726,7 +695,7 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in case REQUEST_FILE_PERMISSIONS : { if (check_permission(2) && check_permission(3)){ - showFileDialog(); + showFileDialog(); } else{ Toast.makeText(getApplicationContext(), "Please give access to External Storage and Camera", Toast.LENGTH_SHORT).show(); @@ -755,10 +724,10 @@ private void handleMarshMellow() { for (int i = 1; i < permissionsNeeded.size(); i++) requestPermissions(permissionsList.toArray(new String[permissionsList.size()]), - REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS); + REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS); } requestPermissions(permissionsList.toArray(new String[permissionsList.size()]), - REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS); + REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS); return; } } @@ -766,11 +735,11 @@ private void handleMarshMellow() { private void showMessageOKCancel(String message, DialogInterface.OnClickListener okListener) { new AlertDialog.Builder(MainActivity.this) - .setMessage(message) - .setPositiveButton("OK", okListener) - .setNegativeButton("Cancel", null) - .create() - .show(); + .setMessage(message) + .setPositiveButton("OK", okListener) + .setNegativeButton("Cancel", null) + .create() + .show(); } diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/SmsReceiver.java b/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/SmsReceiver.java old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/SplashScreen.java b/frontend/mono-ui/web/rainmaker-webview/src/main/java/org/egovernment/mseva/SplashScreen.java old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/drawable-hdpi/ic_notification.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/drawable-hdpi/ic_notification.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/drawable-mdpi/ic_notification.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/drawable-mdpi/ic_notification.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/drawable/background_splash.xml b/frontend/mono-ui/web/rainmaker-webview/src/main/res/drawable/background_splash.xml old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/drawable/banner.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/drawable/banner.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/layout/activity_main.xml b/frontend/mono-ui/web/rainmaker-webview/src/main/res/layout/activity_main.xml old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/layout/activity_splash.xml b/frontend/mono-ui/web/rainmaker-webview/src/main/res/layout/activity_splash.xml old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-hdpi/ic_launcher.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-hdpi/ic_launcher.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-hdpi/ic_launcher_citizen.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-hdpi/ic_launcher_citizen.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-hdpi/ic_launcher_employee.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-hdpi/ic_launcher_employee.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-mdpi/ic_launcher.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-mdpi/ic_launcher.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-mdpi/ic_launcher_citizen.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-mdpi/ic_launcher_citizen.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-mdpi/ic_launcher_employee.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-mdpi/ic_launcher_employee.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xhdpi/ic_launcher.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xhdpi/ic_launcher.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xhdpi/ic_launcher_citizen.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xhdpi/ic_launcher_citizen.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xhdpi/ic_launcher_employee.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xhdpi/ic_launcher_employee.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxhdpi/ic_launcher.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxhdpi/ic_launcher.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxhdpi/ic_launcher_citizen.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxhdpi/ic_launcher_citizen.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxhdpi/ic_launcher_employee.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxhdpi/ic_launcher_employee.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxxhdpi/ic_launcher.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxxhdpi/ic_launcher_citizen.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxxhdpi/ic_launcher_citizen.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxxhdpi/ic_launcher_employee.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/mipmap-xxxhdpi/ic_launcher_employee.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/raw/error.html b/frontend/mono-ui/web/rainmaker-webview/src/main/res/raw/error.html old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/raw/logo.png b/frontend/mono-ui/web/rainmaker-webview/src/main/res/raw/logo.png old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/values-v21/themes.xml b/frontend/mono-ui/web/rainmaker-webview/src/main/res/values-v21/themes.xml old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/values-w820dp/dimens.xml b/frontend/mono-ui/web/rainmaker-webview/src/main/res/values-w820dp/dimens.xml old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/values/colors.xml b/frontend/mono-ui/web/rainmaker-webview/src/main/res/values/colors.xml old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/values/dimens.xml b/frontend/mono-ui/web/rainmaker-webview/src/main/res/values/dimens.xml old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/values/strings.xml b/frontend/mono-ui/web/rainmaker-webview/src/main/res/values/strings.xml old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/values/styles.xml b/frontend/mono-ui/web/rainmaker-webview/src/main/res/values/styles.xml old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/src/main/res/xml/provider_paths.xml b/frontend/mono-ui/web/rainmaker-webview/src/main/res/xml/provider_paths.xml index 2be00abaf41..2b01c092787 100644 --- a/frontend/mono-ui/web/rainmaker-webview/src/main/res/xml/provider_paths.xml +++ b/frontend/mono-ui/web/rainmaker-webview/src/main/res/xml/provider_paths.xml @@ -1,6 +1,5 @@ - diff --git a/frontend/mono-ui/web/rainmaker-webview/src/test/java/org/egovernment/mseva/ExampleUnitTest.java b/frontend/mono-ui/web/rainmaker-webview/src/test/java/org/egovernment/mseva/ExampleUnitTest.java old mode 100755 new mode 100644 diff --git a/frontend/mono-ui/web/rainmaker-webview/your_key_name.keystore b/frontend/mono-ui/web/rainmaker-webview/your_key_name.keystore deleted file mode 100644 index 69f1fe4f0ff..00000000000 Binary files a/frontend/mono-ui/web/rainmaker-webview/your_key_name.keystore and /dev/null differ diff --git a/frontend/mono-ui/web/rainmaker/.gitignore b/frontend/mono-ui/web/rainmaker/.gitignore index 121452d78fd..61171897820 100644 --- a/frontend/mono-ui/web/rainmaker/.gitignore +++ b/frontend/mono-ui/web/rainmaker/.gitignore @@ -22,4 +22,3 @@ yarn-debug.log* yarn-error.log* lerna-debug.log* -index.css* \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/README.md b/frontend/mono-ui/web/rainmaker/README.md index 53475190736..f800238d33f 100644 --- a/frontend/mono-ui/web/rainmaker/README.md +++ b/frontend/mono-ui/web/rainmaker/README.md @@ -41,11 +41,6 @@ $ npm run dev:employee ``` -if windows os - -Then set this dev:employee command with "yarn run build-css-employee && cd packages/employee && set PORT=3006 && yarn start", - - ### Steps for production - Step 1 - lerna bootstrap will link dependencies in the repo together @@ -105,7 +100,6 @@ Murali M ### Updated by Gyan, -Sudhanshu Deshmukh, -Jagan, +Sudhanshu Deshmukh --- diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/README.md b/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/README.md index fab6254390a..479d632a5f0 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/README.md +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/README.md @@ -653,6 +653,7 @@ Here is an example: import React from 'react'; import logo from './logo.png'; // Tell Webpack this JS file uses this image +console.log(logo); // /logo.84287d09.png function Header() { // Import result is the URL of your image diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/offline-package.json b/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/offline-package.json deleted file mode 100644 index e0e260f66bc..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/offline-package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "egov-abg-dev", - "version": "0.0.2", - "license": "egov", - "private": true, - "homepage": "https://egov-micro-dev.egovernments.org/employee-abg/", - "proxy": "https://egov-micro-dev.egovernments.org/", - "dependencies": { - "@babel/runtime": "^7.3.1", - "@material-ui/core": "^1.5.1", - "@material-ui/icons": "^2.0.3", - "autoselector": "^1.1.0", - "autosuggest-highlight": "^3.1.1", - "axios": "^0.18.0", - "babel-polyfill": "^6.26.0", - "egov-ui-framework": "0.1.41", - "egov-ui-kit": "^0.0.1", - "html2canvas": "^1.0.0-alpha.12", - "jquery": "^3.3.1", - "jspdf": "^1.5.3", - "lodash": "^4.17.10", - "marker-animate-unobtrusive": "^0.2.8", - "mui-datatables": "^2.0.0-beta.58", - "node-sass-chokidar": "^1.2.2", - "pdfmake": "^0.1.40", - "prop-types": "^15.6.2", - "react": "^16.7.0", - "react-autosuggest": "^9.4.3", - "react-dom": "^16.7.0", - "react-google-maps": "^9.4.5", - "react-json-view": "^1.19.1", - "react-loadable": "^5.4.0", - "react-redux": "^5.1.1", - "react-responsive-carousel": "^3.1.45", - "react-router-dom": "^4.3.1", - "react-scripts": "^1.1.4", - "react-select": "^2.3.0", - "react-swipeable-views": "^0.13.1", - "react-text-mask": "^5.4.2", - "recompose": "^0.27.1", - "redux": "^4.0.1", - "redux-logger": "^3.0.6", - "redux-thunk": "^2.3.0", - "url-search-params-polyfill": "^5.0.0" - }, - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-loader": "^7.1.5", - "babel-preset-env": "^1.7.0", - "babel-preset-react": "^6.24.1", - "css-loader": "^1.0.0", - "html-webpack-plugin": "^3.2.0", - "style-loader": "^0.21.0" - }, - "scripts": { - "start": "react-scripts start", - "build-css": "node-sass-chokidar src/ -o src/", - "transpile": "npm run build-css && babel src -d ../../packages/egov-abg --copy-files", - "build": "react-scripts build", - "test": "react-scripts test --env=jsdom", - "eject": "react-scripts eject" - } -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/package.json b/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/package.json index 8c7d5888f0c..e0e260f66bc 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/package.json +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/package.json @@ -1,8 +1,64 @@ { "name": "egov-abg-dev", - "version": "0.0.1", + "version": "0.0.2", "license": "egov", "private": true, - "dependencies": {}, - "scripts": {} + "homepage": "https://egov-micro-dev.egovernments.org/employee-abg/", + "proxy": "https://egov-micro-dev.egovernments.org/", + "dependencies": { + "@babel/runtime": "^7.3.1", + "@material-ui/core": "^1.5.1", + "@material-ui/icons": "^2.0.3", + "autoselector": "^1.1.0", + "autosuggest-highlight": "^3.1.1", + "axios": "^0.18.0", + "babel-polyfill": "^6.26.0", + "egov-ui-framework": "0.1.41", + "egov-ui-kit": "^0.0.1", + "html2canvas": "^1.0.0-alpha.12", + "jquery": "^3.3.1", + "jspdf": "^1.5.3", + "lodash": "^4.17.10", + "marker-animate-unobtrusive": "^0.2.8", + "mui-datatables": "^2.0.0-beta.58", + "node-sass-chokidar": "^1.2.2", + "pdfmake": "^0.1.40", + "prop-types": "^15.6.2", + "react": "^16.7.0", + "react-autosuggest": "^9.4.3", + "react-dom": "^16.7.0", + "react-google-maps": "^9.4.5", + "react-json-view": "^1.19.1", + "react-loadable": "^5.4.0", + "react-redux": "^5.1.1", + "react-responsive-carousel": "^3.1.45", + "react-router-dom": "^4.3.1", + "react-scripts": "^1.1.4", + "react-select": "^2.3.0", + "react-swipeable-views": "^0.13.1", + "react-text-mask": "^5.4.2", + "recompose": "^0.27.1", + "redux": "^4.0.1", + "redux-logger": "^3.0.6", + "redux-thunk": "^2.3.0", + "url-search-params-polyfill": "^5.0.0" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", + "babel-loader": "^7.1.5", + "babel-preset-env": "^1.7.0", + "babel-preset-react": "^6.24.1", + "css-loader": "^1.0.0", + "html-webpack-plugin": "^3.2.0", + "style-loader": "^0.21.0" + }, + "scripts": { + "start": "react-scripts start", + "build-css": "node-sass-chokidar src/ -o src/", + "transpile": "npm run build-css && babel src -d ../../packages/egov-abg --copy-files", + "build": "react-scripts build", + "test": "react-scripts test --env=jsdom", + "eject": "react-scripts eject" + } } diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/public/index.html b/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/public/index.html index e386b139730..4dcd156af54 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/public/index.html +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-abg-dev/public/index.html @@ -4,6 +4,13 @@ + + + + + + - - - - - - - - React App - - - -
- - - diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/public/manifest.json b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/public/manifest.json deleted file mode 100644 index ef19ec243e7..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/public/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - } - ], - "start_url": "./index.html", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/public/materialicons.woff2 b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/public/materialicons.woff2 deleted file mode 100644 index 59f7a18587b..00000000000 Binary files a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/public/materialicons.woff2 and /dev/null differ diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/config/common.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/config/common.js deleted file mode 100644 index ff9fb6a5393..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/config/common.js +++ /dev/null @@ -1,12 +0,0 @@ -const commonConfig = { - MAP_API_KEY: globalConfigExists() ? window.globalConfigs.getConfig("GMAPS_API_KEY") : process.env.REACT_APP_GMAPS_API_KEY, - tenantId: globalConfigExists() ? window.globalConfigs.getConfig("STATE_LEVEL_TENANT_ID") : process.env.REACT_APP_DEFAULT_TENANT_ID, - singleInstance: globalConfigExists() ? window.globalConfigs.getConfig("ENABLE_SINGLEINSTANCE") || false : false, - S3BUCKET: globalConfigExists() ? window.globalConfigs.getConfig("S3BUCKET") :"", -}; - -function globalConfigExists() { - return typeof window.globalConfigs !== "undefined" && typeof window.globalConfigs.getConfig === "function"; -} - -export default commonConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/index.js deleted file mode 100644 index cb2c9dfd5d4..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/index.js +++ /dev/null @@ -1,32 +0,0 @@ -// support for older browsers -import "babel-polyfill"; -import "url-search-params-polyfill"; -import React from "react"; -import ReactDOM from "react-dom"; -import { BrowserRouter as Router } from "react-router-dom"; -import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles"; -import themeObject from "ui-config/themes"; -import { Provider } from "react-redux"; -import store from "ui-redux/store"; -import "./index.css"; -import App from "ui-views/App"; -// import registerServiceWorker from "./registerServiceWorker"; - -const theme = createMuiTheme(themeObject); - -// move it to a env file -window.basename = - process.env.NODE_ENV === "production" ? "/employee-tradelicence" : ""; -// hardcoded the base; to be changed soon!!!!! - -ReactDOM.render( - - - - - - - , - document.getElementById("root") -); -// registerServiceWorker(); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/index.scss b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/index.scss deleted file mode 100644 index bdd927bee60..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/index.scss +++ /dev/null @@ -1,180 +0,0 @@ -body { - margin: 0; - padding: 0; - font-family: sans-serif; - background: #f4f7fb; -} - -.text-center { - text-align: center; -} - -.container-padding { - margin: 8px; -} - -.mihy-stepper-overide { - margin-top: 32px; -} - -.apply-application-for-new { - color: #484848; - font-family: Roboto; - font-size: 24px; - font-weight: 400; - line-height: 29px; - text-align: left; - margin-bottom: 32px; -} - -.apply-wizard-footer { - background-color: #ffffff; - box-shadow: 0 -2px 4px 0 rgba(0, 0, 0, 0.24); - padding: 8px; - position: fixed !important; - bottom: 0; - left: 0; - width: 100vw; - /* z-index: 1000; */ - /* height: 55px; */ - text-align: right; -} - -.common-div-css { - margin: 80px 16px 88px 16px; -} - -.common-card-css { - background-color: #ffffff; - border: 0.5px solid rgba(255, 255, 255, 0.800000011920929); - border-radius: 2px; - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.23999999463558197), - 0 0 2px 0 rgba(0, 0, 0, 0.11999999731779099); - /* width: 100%; */ - margin-bottom: 24px; - /* margin-right: 24px; */ - padding: 16px; -} - -.mihy-subheader { - color: rgba(0, 0, 0, 0.8700000047683716); - font-family: Roboto; - font-size: 20px; - font-weight: 400; - letter-spacing: 0.83px; - line-height: 24px; - text-align: left; -} - -.mihy-paragraph { - color: rgba(0, 0, 0, 0.6000000238418579); - font-family: Roboto; - font-size: 14px; - font-weight: 400; - line-height: 20px; - width: 881px; - text-align: left; -} - -.mihy-primary-button { - background-color: #fe7a51; - border-radius: 2px; - box-shadow: 0 8px 8px 0 rgba(0, 0, 0, 0.23999999463558197), - 0 0 8px 0 rgba(0, 0, 0, 0.11999999731779099), - 0 2px 2px 0 rgba(0, 0, 0, 0.23999999463558197), - 0 0 2px 0 rgba(0, 0, 0, 0.11999999731779099); - width: 200px; - height: 48px; -} - -span[class^="MuiFormLabel-asterisk"] { - color: #e54d42; -} - -.search-preview div[id^="material-ui-item"] div[id^="material-ui-cardContent"] { - padding: 8px 1px 1px 1px; -} - -.search-preview - div[id^="material-ui-item"] - div[id^="material-ui-cardContent"] - span[class^="MuiIconButton-label"] { - display: none; -} - -.search-preview button[aria-label="Remove"] { - display: none; -} - -.select-field-placeholder { - color: rgba(162, 162, 162, 0.77); -} - -input[type="date"]::before { - content: attr(placeholder); - width: 100%; - color: rgba(162, 162, 162, 0.77); -} - -input[type="date"]:focus::before, -input[type="date"]:valid::before { - display: none; -} - -/* div[class^="MuiGrid-item"] { - padding-right: 80px -} */ - -@media only screen and (max-width: 768px) { - #custom-atoms-applicationSuccessFooter, - #custom-atoms-paymentSuccessFooter { - display: block; - text-align: center; - } - #custom-atoms-applicationSuccessFooter button { - margin-top: 5px; - } - #material-ui-applicationSuccessContainer { - display: table !important; - } - #material-ui-applicationSuccessContainer div:first-child { - margin-left: 16px; - margin-bottom: 16px; - } - #material-ui-applicationSuccessContainer #custom-atoms-tail { - display: block; - text-align: left !important; - margin-left: 16px; - margin-top: 16px; - } - .citizen-payment-confirmation .apply-wizard-footer { - display: block; - text-align: center; - } - .citizen-payment-confirmation { - padding-bottom: 166px; - } - .tl-total-amount-text, - .tl-total-amount-value { - display: none !important; - } - .tl-application-table-total-value aside { - font-weight: 600; - font-size: 18px; - } - #custom-atoms-paymentSuccessFooter #material-ui-printReceiptButton { - margin-right: 16px !important; - } - #custom-atoms-applicationSuccessCard { - margin-bottom: 190px; - } - /* .MuiFormControl-fullWidth-296 { - width: 100% !important; - } */ -} - -@media only screen and (min-width: 768px) { - .common-div-css { - margin: 30px 16px 88px 16px; - } -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/package.json b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/package.json deleted file mode 100644 index af541ea2ef9..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "egov-bnd", - "version": "1.8.1", - "license": "egov", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - } -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/registerServiceWorker.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/registerServiceWorker.js deleted file mode 100644 index a3e6c0cfc10..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/registerServiceWorker.js +++ /dev/null @@ -1,117 +0,0 @@ -// In production, we register a service worker to serve assets from local cache. - -// This lets the app load faster on subsequent visits in production, and gives -// it offline capabilities. However, it also means that developers (and users) -// will only see deployed updates on the "N+1" visit to a page, since previously -// cached resources are updated in the background. - -// To learn more about the benefits of this model, read https://goo.gl/KwvDNy. -// This link also includes instructions on opting out of this behavior. - -const isLocalhost = Boolean( - window.location.hostname === 'localhost' || - // [::1] is the IPv6 localhost address. - window.location.hostname === '[::1]' || - // 127.0.0.1/8 is considered localhost for IPv4. - window.location.hostname.match( - /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ - ) -); - -export default function register() { - if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { - // The URL constructor is available in all browsers that support SW. - const publicUrl = new URL(process.env.PUBLIC_URL, window.location); - if (publicUrl.origin !== window.location.origin) { - // Our service worker won't work if PUBLIC_URL is on a different origin - // from what our page is served on. This might happen if a CDN is used to - // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374 - return; - } - - window.addEventListener('load', () => { - const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; - - if (isLocalhost) { - // This is running on localhost. Lets check if a service worker still exists or not. - checkValidServiceWorker(swUrl); - - // Add some additional logging to localhost, pointing developers to the - // service worker/PWA documentation. - navigator.serviceWorker.ready.then(() => { - console.log( - 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://goo.gl/SC7cgQ' - ); - }); - } else { - // Is not local host. Just register service worker - registerValidSW(swUrl); - } - }); - } -} - -function registerValidSW(swUrl) { - navigator.serviceWorker - .register(swUrl) - .then(registration => { - registration.onupdatefound = () => { - const installingWorker = registration.installing; - installingWorker.onstatechange = () => { - if (installingWorker.state === 'installed') { - if (navigator.serviceWorker.controller) { - // At this point, the old content will have been purged and - // the fresh content will have been added to the cache. - // It's the perfect time to display a "New content is - // available; please refresh." message in your web app. - console.log('New content is available; please refresh.'); - } else { - // At this point, everything has been precached. - // It's the perfect time to display a - // "Content is cached for offline use." message. - console.log('Content is cached for offline use.'); - } - } - }; - }; - }) - .catch(error => { - console.error('Error during service worker registration:', error); - }); -} - -function checkValidServiceWorker(swUrl) { - // Check if the service worker can be found. If it can't reload the page. - fetch(swUrl) - .then(response => { - // Ensure service worker exists, and that we really are getting a JS file. - if ( - response.status === 404 || - response.headers.get('content-type').indexOf('javascript') === -1 - ) { - // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then(registration => { - registration.unregister().then(() => { - window.location.reload(); - }); - }); - } else { - // Service worker found. Proceed as normal. - registerValidSW(swUrl); - } - }) - .catch(() => { - console.log( - 'No internet connection found. App is running in offline mode.' - ); - }); -} - -export function unregister() { - if ('serviceWorker' in navigator) { - navigator.serviceWorker.ready.then(registration => { - registration.unregister(); - }); - } -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-atoms-local/AutoSuggest/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-atoms-local/AutoSuggest/index.js deleted file mode 100644 index 466cbaf6093..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-atoms-local/AutoSuggest/index.js +++ /dev/null @@ -1,247 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import Select from "react-select"; -import { withStyles } from "@material-ui/core/styles"; -import Typography from "@material-ui/core/Typography"; -import TextField from "@material-ui/core/TextField"; -import Paper from "@material-ui/core/Paper"; -import MenuItem from "@material-ui/core/MenuItem"; -import "./index.css"; -import { sortDropdownLabels, sortDropdownNames } from "egov-ui-framework/ui-utils/commons"; -const getSuggestions = suggestions => { - return ( - suggestions && - suggestions.length > 0 && - suggestions.map(suggestion => ({ - value: suggestion.code, - label: suggestion.name - })).sort(sortDropdownLabels) - ); -}; - -const styles = theme => ({ - ac_root: { - flexGrow: 1, - height: 250 - }, - ac_input: { - marginTop:"-5px", - display: "flex", - padding: 0 - }, - ac_valueContainer: { - display: "flex", - // flexWrap: "wrap", - // marginTop:'-2px', - flex: 1, - alignItems: "center" - }, - ac_noOptionsMessage: { - padding: `${theme.spacing.unit}px ${theme.spacing.unit * 2}px` - }, - ac_singleValue: { - fontSize: 16, - marginBottom: 2 - }, - ac_placeholder: { - position: "absolute", - top: 4, - fontSize: 16, - color: "rgba(162, 162, 162, 0.77)" - }, - ac_paper: { - position: "absolute", - zIndex: 1105, - left: 0, - right: 0, - marginTop: theme.spacing.unit - }, - ac_divider: { - height: theme.spacing.unit * 2 - } -}); - -function NoOptionsMessage(props) { - return ( - - {props.children} - - ); -} - -function inputComponent({ inputRef, ...props }) { - return
; -} - -function Control(props) { - return ( - - ); -} - -function Option(props) { - return ( - - {props.children} - - ); -} - -function Placeholder(props) { - return ( - - {props.children} - - ); -} - -function SingleValue(props) { - return ( - - {props.children} - - ); -} - -function ValueContainer(props) { - return ( -
- {props.children} -
- ); -} - -function Menu(props) { - const { className } = props.selectProps.menuProps; - return ( - -
{props.children}
-
- ); -} - -const components = { - Control, - Menu, - NoOptionsMessage, - Option, - Placeholder, - SingleValue, - ValueContainer -}; - -class IntegrationReactSelect extends React.Component { - state = { - single: null - }; - - componentDidMount = () => { - const { fieldValue } = this.props; - if (fieldValue && fieldValue.code) { - this.setState({ single: fieldValue }); - } - }; - - handleChange = name => value => { - this.setState({ - [name]: value - }); - this.props.onSelect(value); - }; - - render() { - const { - classes, - theme, - suggestions, - label, - placeholder, - fullwidth = true, - required = true, - value, - className, - inputLabelProps = { - shrink: true - }, - ...rest - } = this.props; - const selectStyles = { - input: base => ({ - ...base, - color: theme.palette.text.primary, - "& input": { - font: "inherit" - } - }) - }; - return ( -
- { - event.target.value = null; - }} - {...inputProps} - /> - {/* */} -
- ); -}; - -export default UploadFile; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-atoms-local/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-atoms-local/index.js deleted file mode 100644 index 57f1b62ddba..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-atoms-local/index.js +++ /dev/null @@ -1,37 +0,0 @@ -import React from "react"; -import Loadable from "react-loadable"; -import LinearProgress from "egov-ui-framework/ui-atoms/LinearSpinner"; - -const Loading = () => ; -const TestAtoms = Loadable({ - loader: () => import("./TestAtoms"), - loading: () => -}); - -const LinkButton = Loadable({ - loader: () => import("./LinkButton"), - loading: () => -}); - -const AutoSuggest = Loadable({ - loader: () => import("./AutoSuggest"), - loading: () => -}); - -const Checkbox = Loadable({ - loader: () => import("./Checkbox"), - loading: () => -}); - -const UploadFile = Loadable({ - loader: () => import("./UploadFile"), - loading: () => -}); - -export { - TestAtoms, - LinkButton, - AutoSuggest, - Checkbox, - UploadFile -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/commonConfig/remote-component-paths/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/commonConfig/remote-component-paths/index.js deleted file mode 100644 index bc4af6a0c7a..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/commonConfig/remote-component-paths/index.js +++ /dev/null @@ -1,10 +0,0 @@ -const remoteComponentPath = (moduleName, path) => { - let component = null; - switch (moduleName) { - default: - break; - } - return component; -}; - -export default remoteComponentPath; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/commonConfig/remote-config-paths/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/commonConfig/remote-config-paths/index.js deleted file mode 100644 index a9334ed2982..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/commonConfig/remote-config-paths/index.js +++ /dev/null @@ -1,11 +0,0 @@ -const remoteConfigPath = (path, screenKey) => { - let config = {}; - switch (path) { - default: - config = require(`ui-config/screens/specs/${path}/${screenKey}`).default; - break; - } - return config; -}; - -export default remoteConfigPath; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/index.js deleted file mode 100644 index e522ebe949f..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import appRoutes from "./routes"; - -export { - appRoutes -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/noc-app-config.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/noc-app-config.js deleted file mode 100644 index 55dbce3845f..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/noc-app-config.js +++ /dev/null @@ -1,2 +0,0 @@ -export const defaultLocation = { lat: 30.7333, lng: 76.7794 }; -export const MAP_API_KEY = process.env.REACT_APP_GMAPS_API_KEY ? process.env.REACT_APP_GMAPS_API_KEY : "AIzaSyCH9PmCbk_mcpgijAAlTeltC4deOxC5wEM"; //CHANGE THIS diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/index.js deleted file mode 100644 index 6b0be3bf990..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/index.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from "react"; -import Loadable from 'react-loadable'; -import LoadingIndicator from 'egov-ui-framework/ui-molecules/LoadingIndicator'; -import * as mainRouteConstants from "./route-names"; - -const Loading = () => ; - -const Landing = Loadable({ - loader: () => import('ui-views/Landing'), - loading: Loading, -}); - -const Playground = Loadable({ - loader: () => import('ui-views/Playground'), - loading: Loading, -}); - -const ScreenInterface=Loadable({ - loader:()=>import ('ui-views/ScreenInterface'), - loading:Loading -}) - -const mainRoutes = [ - { - path: mainRouteConstants.LANDING, - component: Landing - }, - { - path:mainRouteConstants.SCREEN_INTERFACE, - component:ScreenInterface - }, - { - path: mainRouteConstants.PLAYGROUND, - component: Playground - }, - { - isRedirect:true, - to:mainRouteConstants.REDIRECT - } -]; - -export default mainRoutes; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/mihy/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/mihy/index.js deleted file mode 100644 index 2c82e3eb47d..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/mihy/index.js +++ /dev/null @@ -1,21 +0,0 @@ -import React from "react"; -import Loadable from 'react-loadable'; -import * as mainRouteConstants from "./route-names"; -import LoadingIndicator from 'egov-ui-framework/ui-molecules/LoadingIndicator'; - -const Loading = () => ; - - -const ScreenInterface=Loadable({ - loader:()=>import ('ui-views/ScreenInterface'), - loading:Loading -}) - -const mainRoutes = [ - { - path:mainRouteConstants.SCREEN_INTERFACE, - component:ScreenInterface - } -]; - -export default mainRoutes; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/mihy/route-names.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/mihy/route-names.js deleted file mode 100644 index c3c6609b366..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/mihy/route-names.js +++ /dev/null @@ -1 +0,0 @@ -export const SCREEN_INTERFACE="/egov-ui-framework/:path?/:screenKey?/:hasRemoteConfig?"; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/route-names.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/route-names.js deleted file mode 100644 index 6f2b402ee76..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/routes/route-names.js +++ /dev/null @@ -1,4 +0,0 @@ -export const LANDING="/landing"; -export const SCREEN_INTERFACE="/egov-ui-framework/:path?/:screenKey?/:hasRemoteConfig?"; -export const PLAYGROUND="/ui-framework/playground"; -export const REDIRECT="/egov-ui-framework/egov-bnd/login"; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-citizen/home.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-citizen/home.js deleted file mode 100644 index c2c987d9b1b..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-citizen/home.js +++ /dev/null @@ -1,118 +0,0 @@ -import React from "react"; -import { getCommonHeader } from "egov-ui-framework/ui-config/screens/specs/utils"; -//import { cityPicker } from "./citypicker"; -import BirthIcon from "../../../../ui-atoms-local/Icons/BirthIcon"; -import GetCertIcon from "../../../../ui-atoms-local/Icons/GetCertIcon"; -import HelpIcon from "../../../../ui-atoms-local/Icons/HelpIcon"; -import "../utils/index.css"; -import { getRequiredDocData } from "egov-ui-framework/ui-utils/commons"; -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -const header = getCommonHeader( - { - labelName: "Lams", - labelKey: "BND_BIRTH_COMMON" - }, - { - classes: { - root: "common-header-cont" - } - } -); - -const cardItems = [ - { - label: { - labelKey: "BND_BIRTH_APPLY_CERT", - labelName: "Apply for Certificate" - }, - icon: , - route: "../birth-common/getCertificate" - }, - { - label: { - labelKey: "BND_MY_REQUESTS", - labelName: "My Applications" - }, - icon: , - route: "../birth-citizen/myApplications" - }, - // { - // label: { - // labelKey: "BND_HOW_IT_WORKS", - // labelName: "How It Works" - // }, - // icon: , - // route: "how-it-works-birth" - // } - - -]; - -const tradeLicenseSearchAndResult = { - uiFramework: "material-ui", - name: "home", - beforeInitScreen: (action, state, dispatch) => { - return action; - }, - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - // props: { - // className: "common-div-css" - // }, - children: { - header: header, - applyCard: { - uiFramework: "custom-molecules", - componentPath: "LandingPage", - props: { - items: cardItems, - history: {} - } - } - // listCard: { - // uiFramework: "custom-molecules-local", - // moduleName: "egov-tradelicence", - // componentPath: "HowItWorks" - // } - } - }, - - // cityPickerDialog: { - // componentPath: "Dialog", - // props: { - // open: false, - // maxWidth: "md" - // }, - // children: { - // dialogContent: { - // componentPath: "DialogContent", - // props: { - // classes: { - // root: "city-picker-dialog-style" - // } - // // style: { minHeight: "180px", minWidth: "365px" } - // }, - // children: { - // popup: cityPicker - // } - // } - // } - // }, - // adhocDialog: { - // uiFramework: "custom-containers", - // componentPath: "DialogContainer", - // props: { - // open: false, - // maxWidth: false, - // screenKey: "home" - // }, - // children: { - // popup: {} - // } - // } - } -}; - -export default tradeLicenseSearchAndResult; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-citizen/how-it-works-birth.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-citizen/how-it-works-birth.js deleted file mode 100644 index bbf00f31135..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-citizen/how-it-works-birth.js +++ /dev/null @@ -1,37 +0,0 @@ - -import { getCommonHeader } from "egov-ui-framework/ui-config/screens/specs/utils"; -const header = getCommonHeader( - { - labelName: "How It Works", - labelKey: "BND_HOW_IT_WORKS" - }, - { - classes: { - root: "common-header-cont" - } - } -); -const screenConfig = { - uiFramework: "material-ui", - name: "HowItWorks", - - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - children: { - header: header, - howitWoorksDiv:{ - uiFramework: "custom-molecules-local", - moduleName: "egov-bnd", - componentPath: "HowItWorks", - props: { - className: "common-div-css" - } - } - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-citizen/myApplications.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-citizen/myApplications.js deleted file mode 100644 index 9984c62a528..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-citizen/myApplications.js +++ /dev/null @@ -1,136 +0,0 @@ -import { - getCommonHeader, - getCommonCard, - getCommonTitle, -} from "egov-ui-framework/ui-config/screens/specs/utils"; - -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; //returns action object -import { - toggleSpinner, - toggleSnackbar, -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { httpRequest } from "egov-ui-framework/ui-utils/api"; -import { convertEpochToDate } from "egov-ui-framework/ui-config/screens/specs/utils"; -import { downloadReceipt } from "../utils"; -import { downloadReceiptFromFilestoreID } from "egov-common/ui-utils/commons"; - - -const getMyApplications = async (action, state, dispatch) => { - try { - const queryParams = []; - let payload = null; - payload = await httpRequest( - "post", - "birth-death-services/birth/_searchapplications", - "_search", - queryParams, - {} - ); - return payload; - } catch (e) { - toggleSnackbar( - true, - { - labelName: "Could not load lease Details", - labelKey: "ERR_API_ERROR", - }, - "error" - ); - } - return null; -}; - -const certificateDowloadHandler = (fileStoreId) => { - //Download Certificate by sending filestoreid and mode - downloadReceiptFromFilestoreID(fileStoreId, "download"); -}; - -const downloadReceiptHandler = async (consumerCode, tenantId) => { - downloadReceipt(consumerCode, tenantId); -}; - -const header = getCommonHeader( - { - labelName: "My Applications", - labelKey: "BND_CITIZEN_MY_APPLICATIONS", - }, - { - classes: { - root: "common-header-cont", - }, - } -); - -const myApplications = { - uiFramework: "material-ui", - name: "myApplications", - beforeInitScreen: (action, state, dispatch) => { - dispatch(toggleSpinner()); - getMyApplications().then((response) => { - dispatch(toggleSpinner()); - try { - dispatch(prepareFinalObject("searchResults", response.applications)); - } catch (e) { - toggleSnackbar( - true, - { - labelName: "Could not load lease Details", - labelKey: "ERR_API_ERROR", - }, - "error" - ); - } - }); - - return action; - }, - - afterInitForm: (action, state, dispatch) => {}, - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - children: { - header: header, - applicationsCard: { - uiFramework: "custom-molecules-local", - moduleName: "egov-bnd", - componentPath: "SingleApplication", - visible: true, - props: { - contents: [ - { - label: "BND_APPL_DATE", - jsonPath: "applicationDate", - isDate: true, - }, - { - label: "BND_CERT_REG_NO", - jsonPath: "regNo", - }, - { - label: "BND_CERT_NAME", - jsonPath: "name", - }, - { - label: "BND_APPL_TYPE", - jsonPath: "applicationType", - prefix: "BND_", - }, - { - label: "BND_APPL_STATUS", - jsonPath: "status", - prefix: "BND_STATUS_", - }, - ], - moduleName: "BIRTH", - homeURL: "/birth-citizen/home", - certificateDowloadHandler: certificateDowloadHandler, - downloadReceiptHandler: downloadReceiptHandler, - }, - }, - }, - }, - }, -}; -export default myApplications; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/apply_old.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/apply_old.js deleted file mode 100644 index 55cadaa4317..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/apply_old.js +++ /dev/null @@ -1,119 +0,0 @@ -import { - getCommonCardWithHeader, - getLabel -} from "egov-ui-framework/ui-config/screens/specs/utils"; - -import { getCommonCard, getCommonContainer, getCommonHeader, getCommonParagraph, getCommonTitle, getStepperObject } from "egov-ui-framework/ui-config/screens/specs/utils"; -import {billSearchCard} from "./birthSearchResources/birthSearchCard"; - -export const stepsData = [ - { labelName: "Search", labelKey: "BND_SEARCH" }, - { labelName: "Review Details", labelKey: "BND_DETAILS" }, - { labelName: "Pay", labelKey: "BND_PAY" }, -]; - -export const stepper = getStepperObject( - { props: { activeStep: 0 } }, - stepsData -); - -export const formwizardFirstStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form1" - }, - children: { - //searchForm - } - }; - -export const formwizardSecondStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form2" - }, - children: { - - }, - visible: false -}; - -export const formwizardThirdStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form3" - }, - children: { - - }, - visible: false -}; - -export const formwizardFourthStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form4" - }, - children: { - - }, - visible: false -}; - -export const header = getCommonContainer({ - header: - getCommonHeader({ - labelName: 'Apply for New Trade License' , - labelKey: "APPLY" - }), - applicationNumber: { - uiFramework: "custom-atoms-local", - moduleName: "egov-tradelicence", - componentPath: "ApplicationNoContainer", - props: { - number: "NA" - }, - visible: false - } -}); - -const screenConfig = { - uiFramework: "material-ui", - name: "mihyLoginScreen", - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "common-div-css" - }, - children: { - headerDiv: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - header: { - gridDefination: { - xs: 12, - sm: 10 - }, - ...header - } - } - }, - stepper, - formwizardFirstStep, - formwizardSecondStep, - formwizardThirdStep, - formwizardFourthStep, - //footer - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/birthSearchCard.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/birthSearchCard.js deleted file mode 100644 index ffb7a53486d..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/birthSearchCard.js +++ /dev/null @@ -1,649 +0,0 @@ -import { - getBreak, - getCommonCaption, - getCommonCard, - getCommonContainer, - getCommonHeader, - getDateField, - getDivider, - getLabel, - getPattern, - getSelectField, - getTextField -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { - handleScreenConfigurationFieldChange as handleField, - prepareFinalObject -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { getTodaysDateInYMD } from "egov-ui-framework/ui-utils/commons"; -import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; -import get from "lodash/get"; -import { loadHospitals } from "./../../utils"; -import { disclaimerDialog } from "./disclaimerDialog"; -import { searchApiCall } from "./function"; -import "./index.css"; - -const resetFields = (state, dispatch) => { - //Clear advanced Search - let componentPath = - "components.div.children.birthSearchCard.children.cardContent.children.searchContainer2.children.details.children"; - for (var child in get( - state, - "screenConfiguration.screenConfig.getCertificate." + componentPath - )) { - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.value", - "" - ) - ); - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.helperText", - "" - ) - ); - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.error", - false - ) - ); - } - - //Clear Mandatory Search Attributes - componentPath = - "components.div.children.birthSearchCard.children.cardContent.children.searchContainerCommon.children"; - for (var child in get( - state, - "screenConfiguration.screenConfig.getCertificate." + componentPath - )) { - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.value", - "" - ) - ); - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.helperText", - "" - ) - ); - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.error", - false - ) - ); - } - if (!(process.env.REACT_APP_NAME === "Citizen")) { - let tenantId = getTenantId(); - dispatch(prepareFinalObject("bnd.birth.tenantId", tenantId)); - } - dispatch( - prepareFinalObject("bnd.birth.birthSearchResponse", []) - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.data", - [] - ) - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.tableData", - [] - ) - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.rows", - 0 - ) - ); - - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "visible", - false - ) - ); -}; - -const cbChanged = (action, state, dispatch) => { - let tenantId = get( - state.screenConfiguration.preparedFinalObject.bnd.birth, - "tenantId" - ); - - loadHospitals(action, state, dispatch, "death", tenantId).then((response) => { - if(response && response.MdmsRes && response.MdmsRes["birth-death-service"] && response.MdmsRes["birth-death-service"].hospitalList) - { - const hptList= response.MdmsRes["birth-death-service"].hospitalList; - const newList=[...hptList.filter(hos=>hos.active), { - hospitalName : "Others" }] - for (let hospital of newList) { - hospital.code = hospital.hospitalName; - hospital.name = hospital.hospitalName; - } - dispatch(prepareFinalObject("bnd.allHospitals", newList)); - }else{ - dispatch(prepareFinalObject("bnd.allHospitals", [{code:"Others",name:"Others"}])); - } - }); -}; - -const setVisibilityOptionsSet1 = (state, dispatch, visible) => { - dispatch( - handleField( - "getCertificate", - "components.div.children.birthSearchCard.children.cardContent.children.searchContainer1", - "visible", - visible - ) - ); -}; - -const setVisibilityOptionsSet2 = (state, dispatch, visible) => { - dispatch( - handleField( - "getCertificate", - "components.div.children.birthSearchCard.children.cardContent.children.searchContainer2", - "visible", - visible - ) - ); -}; - -export const showHideConfirmationPopup = (state, dispatch) => { - let toggle = get( - state.screenConfiguration.screenConfig["getCertificate"], - "components.div.children.birthSearchCard.children.cardContent.children.disclaimerDialog.props.open", - false - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.birthSearchCard.children.cardContent.children.disclaimerDialog", - "props.open", - !toggle - ) - ); -}; - -export const searchSetCommon = getCommonContainer({ - cantonmentSelect: { - uiFramework: "custom-containers-local", - moduleName: "egov-bnd", - componentPath: "AutosuggestContainer", - jsonPath: "bnd.birth.tenantId", - sourceJsonPath: "bnd.allTenants", - visible: true, - autoSelect: true, - props: { - autoSelect: true, - isDisabled: false, - //isClearable:true, - className: "autocomplete-dropdown", - suggestions: [], - disabled: false, //getQueryArg(window.location.href, "action") === "EDITRENEWAL"? true:false, - label: { - labelName: "Select Cantonment", - labelKey: "BND_APPL_CANT", - }, - placeholder: { - labelName: "Select Cantonment", - labelKey: "BND_APPL_CANT_PLACEHOLDER", - }, - localePrefix: { - moduleName: "TENANT", - masterName: "TENANTS", - }, - labelsFromLocalisation: true, - required: true, - errorText:"Required", - jsonPath: "bnd.birth.tenantId", - sourceJsonPath: "bnd.allTenants", - inputLabelProps: { - shrink: true, - }, - onClickHandler: (action, state, dispatch) => { - }, - }, - gridDefination: { - xs: 12, - sm: 4, - }, - required: true, - beforeFieldChange: (action, state, dispatch) => {}, - afterFieldChange: (action, state, dispatch) => { - cbChanged(action, state, dispatch); - }, - }, - dob: getDateField({ - label: { labelName: "DOB", labelKey: "BND_BIRTH_DOB" }, - placeholder: { - labelName: "Date of Birth", - labelKey: "BND_BIRTH_DOB_PLACEHOLDER", - }, - jsonPath: "bnd.birth.dob", - gridDefination: { - xs: 12, - sm: 4, - }, - pattern: getPattern("Date"), - errorMessage: "ERR_INVALID_DATE", - required: true, - props: { - inputProps: { - max: getTodaysDateInYMD(), - }, - }, - visible: process.env.REACT_APP_NAME === "Citizen" ? true : false, - }), - fromdate: getDateField({ - label: { labelName: "DOB", labelKey: "BND_FROM_DATE" }, - placeholder: { - labelName: "FromDate of Search", - labelKey: "BND_BIRTH_DOB_PLACEHOLDER", - }, - jsonPath: "bnd.birth.fromdate", - gridDefination: { - xs: 12, - sm: 4, - }, - pattern: getPattern("Date"), - errorMessage: "ERR_INVALID_DATE", - required: true, - props: { - inputProps: { - max: getTodaysDateInYMD(), - }, - }, - visible: process.env.REACT_APP_NAME === "Employee" ? true : false, - }), - todate: getDateField({ - label: { labelName: "DOB", labelKey: "BND_TO_DATE" }, - placeholder: { - labelName: "ToDate of Search", - labelKey: "BND_BIRTH_DOB_PLACEHOLDER", - }, - jsonPath: "bnd.birth.todate", - gridDefination: { - xs: 12, - sm: 4, - }, - pattern: getPattern("Date"), - errorMessage: "ERR_INVALID_DATE", - required: true, - props: { - inputProps: { - max: getTodaysDateInYMD(), - }, - }, - visible: process.env.REACT_APP_NAME === "Employee" ? true : false, - }), - gender: getSelectField({ - label: { - labelName: "Select Gender", - labelKey: "BND_GENDER", - }, - placeholder: { - labelName: "Select Gender", - labelKey: "BND_GENDER_PLACEHOLDER", - }, - required: true, - localePrefix: { - moduleName: "BIRTH", - masterName: "GENDER", - }, - data: [ - { - code: "1", - label: "MALE", - }, - { - code: "2", - label: "FEMALE", - }, - { - code: "3", - label: "TRANSGENDER", - }, - ], - props: { - disabled: false, - }, - gridDefination: { - xs: 12, - sm: 4, - }, - jsonPath: "bnd.birth.gender", - autoSelect: true, - visible: true, - beforeFieldChange: (action, state, dispatch) => {}, - afterFieldChange: (action, state, dispatch) => {}, - }) -}); - -export const searchSet1 = getCommonContainer({ - // registrationNo: getTextField({ - // label: { - // labelName: "Registration No", - // labelKey: "BND_REG_NO_LABEL" - // }, - // placeholder: { - // labelName: "Registration No", - // labelKey: "BND_REG_NO_PLACEHOLDER" - // }, - // required:true, - // visible: true, - // jsonPath: "bnd.birth.registrationNo", - // gridDefination: { - // xs: 12, - // sm: 4 - // } - // }), - clickHereLink: { - uiFramework: "custom-atoms-local", - moduleName: "egov-bnd", - componentPath: "LinkButton", - props: { - disableValidation: true, - url: "teat", - labelKey: "BND_DONT_KNOW_REGNO_MSG", - onClickDefination: { - callBack: (state, dispatch) => { - setVisibilityOptionsSet1(state, dispatch, false); - setVisibilityOptionsSet2(state, dispatch, true); - }, - }, - }, - gridDefination: { xs: 12, sm: 4, md: 4 }, - }, -}); - -export const searchSet2 = getCommonContainer({ - registrationNo: getTextField({ - label: { - labelName: "Registration No", - labelKey: "BND_REG_NO_LABEL", - }, - placeholder: { - labelName: "Registration No", - labelKey: "BND_REG_NO_LABEL", - }, - required: false, - visible: true, - jsonPath: "bnd.birth.registrationNo", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - hospital: { - uiFramework: "custom-containers-local", - moduleName: "egov-bnd", - componentPath: "AutosuggestContainer", - jsonPath: "bnd.birth.hosptialId", - sourceJsonPath: "bnd.allHospitals", - visible: true, - autoSelect: true, - props: { - autoSelect: true, - //isClearable:true, - className: "autocomplete-dropdown", - suggestions: [], - disabled: false, //getQueryArg(window.location.href, "action") === "EDITRENEWAL"? true:false, - label: { - labelName: "Select Hospital", - labelKey: "BND_BIRTH_APPL_HOSP", - }, - placeholder: { - labelName: "Select Hospital", - labelKey: "BND_BIRTH_APPL_HOSP_PLACEHOLDER", - }, - localePrefix: { - moduleName: "TENANT", - masterName: "TENANTS", - }, - labelsFromLocalisation: false, - required: false, - jsonPath: "bnd.birth.hosptialId", - sourceJsonPath: "bnd.allHospitals", - inputLabelProps: { - shrink: true, - }, - onClickHandler: (action, state, dispatch) => { - }, - }, - gridDefination: { - xs: 12, - sm: 4, - }, - beforeFieldChange: (action, state, dispatch) => {}, - afterFieldChange: (action, state, dispatch) => {}, - }, - fathersName: getTextField({ - label: { - labelName: "Father's Name", - labelKey: "BND_FATHERS_NAME_LABEL", - }, - placeholder: { - labelName: "Father's Name", - labelKey: "BND_FATHERS_NAME_PLACEHOLDER", - }, - required: false, - visible: true, - jsonPath: "bnd.birth.fathersName", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - mothersName: getTextField({ - label: { - labelName: "Mother's Name", - labelKey: "BND_MOTHERS_NAME_LABEL", - }, - placeholder: { - labelName: "Mother's Name", - labelKey: "BND_MOTHERS_NAME_PLACEHOLDER", - }, - required: false, - visible: true, - jsonPath: "bnd.birth.mothersName", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - // clickHereLink: { - // uiFramework: "custom-atoms-local", - // moduleName: "egov-bnd", - // componentPath: "LinkButton", - // props: { - // disableValidation:true, - // url: "teat" , - // labelKey:"BND_DONT_KNOW_DETAILS_MSG", - // onClickDefination: { - // callBack: (state, dispatch) => { - // setVisibilityOptionsSet1(state,dispatch,true); - // setVisibilityOptionsSet2(state,dispatch,false); - // } - // }, - // }, - // gridDefination: { xs: 12, sm: 4, md: 4 } - // }, -}); - -export const buttonContainer = getCommonContainer({ - firstCont: { - uiFramework: "custom-atoms", - componentPath: "Div", - gridDefination: { - xs: 12, - sm: 3, - }, - }, - resetButton: { - componentPath: "Button", - gridDefination: { - xs: 12, - sm: 3, - // align: "center" - }, - props: { - variant: "outlined", - style: { - color: "#696969", - // backgroundColor: "#FE7A51", - border: "#696969 solid 1px", - borderRadius: "2px", - width: window.innerWidth > 480 ? "80%" : "100%", - height: "48px", - }, - }, - children: { - buttonLabel: getLabel({ - labelName: "RESET", - labelKey: "BND_RESET_BUTTON", - }), - }, - onClickDefination: { - action: "condition", - callBack: resetFields, - }, - }, - searchButton: { - componentPath: "Button", - gridDefination: { - xs: 12, - sm: 3, - // align: "center" - }, - props: { - variant: "contained", - style: { - color: "white", - backgroundColor: "#696969", - borderRadius: "2px", - width: window.innerWidth > 480 ? "80%" : "100%", - height: "48px", - }, - }, - children: { - buttonLabel: getLabel({ - labelName: "SEARCH", - labelKey: "BND_SEARCH_BUTTON", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - searchApiCall(state, dispatch); - }, - }, - }, - - lastCont: { - uiFramework: "custom-atoms", - componentPath: "Div", - gridDefination: { - xs: 12, - sm: 3, - }, - }, -}); - -export const birthSearchCard = getCommonCard({ - header: getCommonHeader({ - labelName: "Search Bill", - labelKey: "BND_SEARCH_REGISTRY", - }), - // subheader: getCommonSubHeader({ - // labelName: "Provide at least one parameter to search for an application", - // labelKey: "ABG_SEARCH_BILL_COMMON_SUB_HEADER" - // }), - - break1: getBreak(), - searchContainerCommon: searchSetCommon, - //break1: getBreak(), - divider1: getDivider(), - searchContainer1: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: {}, - children: { - details: searchSet1, - }, - visible: false, - }, - importantNote2: getCommonCaption( - { - labelName: "Imp Note", - labelKey: "BND_SELECTION_NOTE", - }, - { - disableValidation: true, - style: { - color: "#ff8100", - fontSize: "16px", - }, - } - ), - break2: getBreak(), - searchContainer2: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: {}, - children: { - details: searchSet2, - }, - visible: true, - }, - buttonContainer: buttonContainer, - disclaimerDialog: { - componentPath: "Dialog", - props: { - open: false, - maxWidth: "sm", - disableValidation: true, - }, - children: { - dialogContent: { - componentPath: "DialogContent", - props: { - classes: { - root: "city-picker-dialog-style", - }, - // style: { minHeight: "180px", minWidth: "365px" } - }, - children: { - popup: disclaimerDialog, - }, - }, - }, - }, -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/disclaimerDialog.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/disclaimerDialog.js deleted file mode 100644 index 6e3f7c46b9c..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/disclaimerDialog.js +++ /dev/null @@ -1,202 +0,0 @@ -import { - getBreak, - getCommonCaption, - getCommonContainer, - getCommonGrayCard, - getCommonHeader, - getCommonParagraph, - getDivider, - getLabel, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { toggleSnackbar } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import get from "lodash/get"; -import { triggerDownload } from "../../utils"; -import { showHideConfirmationPopup } from "./birthSearchCard"; - -const dSignAgreePath = "bnd.birth.iAgree"; -export const disclaimerDialog = getCommonContainer({ - headerDiv: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - style: { - width: "100%", - marginBottom: "10px", - }, - }, - children: { - header0: getCommonHeader( - { - labelName: "", - labelKey: "BND_IMPORTANT", - }, - { - style: { - fontSize: "20px", - display: "inline", - }, - } - ), - closeButton: { - componentPath: "Button", - props: { - style: { - margin: "-10px", - float: "right", - color: "rgba(0, 0, 0, 0.60)", - }, - }, - children: { - previousButtonIcon: { - uiFramework: "custom-atoms", - componentPath: "Icon", - props: { - iconName: "close", - }, - }, - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => - showHideConfirmationPopup(state, dispatch, "getCertificate"), - }, - }, - }, - }, - divider1: getDivider(), - downloadNote: getCommonContainer({ - value0: getCommonCaption( - { - labelName: "", - labelKey: "BND_DOWNLOAD_NOTE", - }, - { - style: { - fontSize: "14px", - }, - } - ), - break1: getBreak(), - }), - header: getCommonHeader( - { - labelName: "Confirm Download", - labelKey: "BND_DOWNLOAD_TERMS", - }, - { - style: { - fontSize: "20px", - }, - } - ), - confirmationContents: getCommonContainer({ - termsContainer: getCommonGrayCard({ - value0: getCommonParagraph({ - labelName: - "Important : The application form is to be signed by the original lessee or his/her successors/heir. Otherwise considered invalid.", - labelKey: "BND_DOWNLOAD_TERMS_CONTENT1", - }), - }), - - break2: getBreak, - checkBox: { - required: true, - uiFramework: "custom-atoms-local", - moduleName: "egov-bnd", - componentPath: "Checkbox", - props: { - label: { - labelKey: "BND_DOWNLOAD_IAGREE", - labelName: "I agree and wish to continue", - }, - jsonPath: dSignAgreePath, - }, - }, - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - style: { - width: "100%", - textAlign: "center", - display: "flex", - flexDirection: "row-reverse", - }, - }, - children: { - yesButton: { - componentPath: "Button", - props: { - variant: "contained", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "20px", - marginTop: "16px", - boxShadow: "none", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "YES", - labelKey: "BND_DOWNLOAD_PROCEED", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - let iAgree = get( - state.screenConfiguration.preparedFinalObject, - dSignAgreePath - ); - if (iAgree) { - triggerDownload("birth"); - showHideConfirmationPopup(state, dispatch, "getCertificate"); - } else { - dispatch( - toggleSnackbar( - true, - { - labelName: - "You have to agree to terms and conditions before you proceed.", - labelKey: "ERR_BND_DOWNLOAD_IAGREE", - }, - "error" - ) - ); - } - }, - }, - }, - cancelButton: { - componentPath: "Button", - props: { - variant: "outlined", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "4px", - marginTop: "16px", - color: "gray", - border: "none", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "NO", - labelKey: "BND_CANCEL_DOWNLOAD_IAGREE", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - showHideConfirmationPopup(state, dispatch, "getCertificate"); - }, - }, - }, - }, - }, - }), -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/function.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/function.js deleted file mode 100644 index 13feab8fbd5..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/function.js +++ /dev/null @@ -1,242 +0,0 @@ -import { - handleScreenConfigurationFieldChange as handleField, - prepareFinalObject, - toggleSnackbar -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { getLocaleLabels } from "egov-ui-framework/ui-utils/commons"; -import get from "lodash/get"; -import { searchForBirth } from "../../../../../ui-utils/commons"; -import { genderValues } from "../../../../../ui-utils/constants"; -import { convertDateToEpoch, convertEpochToDate, convertEpochToDateWithTimeIST, validateFields } from "../../utils"; - -export const searchApiCall = async (state, dispatch) => { - showHideTable(false, dispatch); - - let queryParams = [ - //{ key: "limit", value: "10" } - ]; - - let tenantId = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.tenantId" - ); - if (tenantId) queryParams.push({ key: "tenantId", value: tenantId }); - - let dateOfBirth = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.dob" - ); - let fromdate = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.fromdate" - ); - let todate = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.todate" - ); - if (dateOfBirth) { - queryParams.push({ - key: "dateOfBirth", - value: convertEpochToDate(convertDateToEpoch(dateOfBirth)).replaceAll( - "/", - "-" - ), - }); - } - if (fromdate) { - queryParams.push({ - key: "fromDate", - value: convertEpochToDate(convertDateToEpoch(fromdate)).replaceAll( - "/", - "-" - ), - }); - } - if (todate) { - queryParams.push({ - key: "toDate", - value: convertEpochToDate(convertDateToEpoch(todate)).replaceAll( - "/", - "-" - ), - }); - } - let gender = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.gender" - ); - if (gender) queryParams.push({ key: "gender", value: gender }); - - let registrationNo = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.registrationNo" - ); - if (registrationNo) - queryParams.push({ key: "registrationNo", value: registrationNo }); - - let hospitalId = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.hosptialId" - ); - if (hospitalId) queryParams.push({ key: "hospitalId", value: hospitalId }); - - let mothersName = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.mothersName" - ); - if (mothersName) queryParams.push({ key: "motherName", value: mothersName }); - - let fathersName = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.fathersName" - ); - if (fathersName) queryParams.push({ key: "fatherName", value: fathersName }); - - let searchSet1Visible = get( - state.screenConfiguration, - "screenConfig.getCertificate.components.div.children.birthSearchCard.children.cardContent.children.searchContainer1.visible", - {} - ); - - const isSearchSet1Valid = validateFields( - "components.div.children.birthSearchCard.children.cardContent.children.searchContainer1.children.details.children", - state, - dispatch, - "getCertificate" - ); - const isSearchSet2Valid = validateFields( - "components.div.children.birthSearchCard.children.cardContent.children.searchContainer2.children.details.children", - state, - dispatch, - "getCertificate" - ); - const isSearchSetCommonValid = validateFields( - "components.div.children.birthSearchCard.children.cardContent.children.searchContainerCommon.children", - state, - dispatch, - "getCertificate" - ); - - if (!isSearchSetCommonValid) { - dispatch( - toggleSnackbar( - true, - { - labelName: "Please fill the required fields to search.", - labelKey: "BND_COMMON_REQ_FIELDS_ERR", - }, - "warning" - ) - ); - return; - } - if (fromdate && todate) { - let fromdateofsearch = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.fromdate" - ); - let todateepochofsearch = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.todate" - ); - if (fromdateofsearch > todateepochofsearch) { - dispatch( - toggleSnackbar( - true, - { - labelName: "", - labelKey: "From Date should not be before To Date ", - }, - "warning" - ) - ); - return; - } - } - - const responseFromAPI = await searchForBirth(dispatch, queryParams); - const births = (responseFromAPI && responseFromAPI.birthCerts) || []; //|| [{"id":"1","dateofbirth":1614241552,"firstname":"san","gender":"1","registrationno":"2021-1","counter":0,"birthFatherInfo":{"firstname":"abc"},"birthMotherInfo":{"firstname":"abc1"},"tenantid":"pb.agra"},{"id":"2","dateofbirth":1614241552,"firstname":"san1","gender":"1","registrationno":"2021-2","counter":0,"birthFatherInfo":{"firstname":"abcd"},"birthMotherInfo":{"firstname":"abcd1"},"tenantid":"pb.agra"}]; - - const birthTableData = births.map((item) => { - return { - id: get(item, "id"), - registrationNo: get(item, "registrationno"), - nameOfChild: get(item, "fullName"), - dateOfbirth: get(item, "dateofbirth"), - gender: getLocaleLabels( - `BIRTH_GENDER_${get(item, "gender")}`, - `BIRTH_GENDER_${get(item, "gender")}` - ), - mothersName: get(item, "birthMotherInfo.fullName"), - fathersName: get(item, "birthFatherInfo.fullName"), - action: getActionItem(get(item, "counter")), - tenantId: get(item, "tenantid"), - payRequired: get(item, "payRequired"), - }; - }); - dispatch(prepareFinalObject("bnd.birth.birthSearchResponse", births)); - - try { - let data = birthTableData.map((item) => ({ - ["BND_COMMON_TABLE_ID"]: item.id || "-", - ["BND_COMMON_TABLE_REGNO"]: item.registrationNo || "-", - ["BND_COMMON_NAME"]: item.nameOfChild || "-", - ["BND_BIRTH_DATE"]: convertEpochToDateWithTimeIST(item.dateOfbirth), - ["BND_COMMON_GENDER"]: item.gender || "-", - ["BND_COMMON_MOTHERSNAME"]: item.mothersName || "-", - ["BND_COMMON_FATHERSNAME"]: item.fathersName || "-", - ["BND_COMMON_TABLE_ACTION"]: item.action || "-", - ["BUSINESS_SERVICE"]: "BIRTH_CERT", - ["TENANT_ID"]: item.tenantId, - ["BND_VIEW_CERTIFICATE"]: "BND_VIEW_CERTIFICATE", - })); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.data", - data - ) - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.tableData", - birthTableData - ) - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.rows", - birthTableData.length - ) - ); - - showHideTable(true, dispatch); - } catch (error) { - dispatch(toggleSnackbar(true, error.message, "error")); - } -}; - -const showHideTable = (booleanHideOrShow, dispatch) => { - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "visible", - booleanHideOrShow - ) - ); -}; - -const getActionItem = (counter) => { - if (counter < 1) return "FREE_DOWNLOAD"; - else return "PAY_AND_DOWNLOAD"; -}; - -const getGenderValue = (genderCode) => { - return genderValues[genderCode]; -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/index.scss b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/index.scss deleted file mode 100644 index 7eedebffbe1..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/index.scss +++ /dev/null @@ -1,39 +0,0 @@ - .autocomplete-dropdown { - min-width: 80%; - position: absolute; - z-index: 1900; - max-height: 150px; - overflow: hidden; - } - .autocomplete-dropdown div { - min-width: 80%; - max-height: 150px; - overflow: auto; - } - - @media only screen and (max-width: 768px) { - - .bd-search-header{ - #custom-atoms-headerDiv{ - flex-flow:inherit; - } - } - .bd-btn-hiw{ - flex-basis: unset; - align-self: self-end; - div{ - max-width:unset; - flex-basis: unset; - button{ - min-width: unset!important; - } - } - } - } - input[type="date"]{ - cursor: pointer; - } - - .date-common-field{ - cursor: pointer; - } \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/searchResults.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/searchResults.js deleted file mode 100644 index 7490c72d629..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/birthSearchResources/searchResults.js +++ /dev/null @@ -1,241 +0,0 @@ -import React from "react"; -import { - sortByEpoch, - getEpochForDate, - getTextToLocalMapping, -} from "../../utils"; -import { - download, - downloadReceiptFromFilestoreID, - downloadChallan, -} from "egov-common/ui-utils/commons"; -import { getLocaleLabels } from "egov-ui-framework/ui-utils/commons"; -import { downloadCert } from "../../utils"; -import store from "ui-redux/store"; -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { showHideConfirmationPopup } from "./birthSearchCard"; - -export const searchResults = { - uiFramework: "custom-molecules", - componentPath: "Table", - visible: false, - props: { - columns: [ - // { - // labelName: "Bill No.", - // labelKey: "ABG_COMMON_TABLE_COL_BILL_NO", - // options: { - // filter: false, - // customBodyRender: (value, tableMeta, updateValue) => ( - // { - // const receiptQueryString = [ - // { - // key: 'challanNo', - // value: tableMeta.rowData[1] - // }, - // { key: 'tenantId', value: tableMeta.rowData[10] }]; - // downloadChallan(receiptQueryString,"download"); - // // downloadBill(tableMeta.rowData[1], tableMeta.rowData[10], tableMeta.rowData[9],tableMeta.rowData[12]); - // }} - // > - // {value} - // - // ) - // } - // }, - { - labelName: "Id", - labelKey: "BND_COMMON_TABLE_ID", - options: { - display: false, - viewColumns: false, - }, - }, - { - labelName: "Registration Number", - labelKey: "BND_COMMON_TABLE_REGNO", - }, - { - labelName: "Name", - labelKey: "BND_COMMON_NAME", - }, - { - labelName: "Birth Date", - labelKey: "BND_BIRTH_DATE", - }, - { - labelName: "Gender", - labelKey: "BND_COMMON_GENDER", - }, - { - labelName: "Mother's Name", - labelKey: "BND_COMMON_MOTHERSNAME", - }, - { - labelName: "Father's Name", - labelKey: "BND_COMMON_FATHERSNAME", - }, - { - labelName: "Action", - labelKey: "BND_COMMON_TABLE_ACTION", - options: { - display: process.env.REACT_APP_NAME === "Citizen", - viewColumns: process.env.REACT_APP_NAME === "Citizen", - filter: false, - customBodyRender: (value, tableMeta) => - value === "PAY AND DOWNLOAD" - ? tableMeta.rowData[4] > 0 - ? getActionButton(value, tableMeta) - : tableMeta.rowData[4] <= 0 && tableMeta.rowData[13] - ? getActionButton(value, tableMeta) - : "" - : getActionButton(value, tableMeta), - }, - }, - // { - // labelName: "Status", - // labelKey: "ABG_COMMON_TABLE_COL_STATUS", - // options:{ - // filter: false, - // customBodyRender: value => ( - // - // {getLocaleLabels(value.toUpperCase(),value.toUpperCase())} - // - // ) - // } - // }, - // { - // labelName: "Action", - // labelKey: "ABG_COMMON_TABLE_COL_ACTION", - // options: { - // filter: false, - // customBodyRender: (value, tableMeta) => value === "PAY" ? (tableMeta.rowData[4] > 0 ? getActionButton(value, tableMeta):(tableMeta.rowData[4] <= 0 && tableMeta.rowData[13] ? getActionButton(value, tableMeta) : "")) : getActionButton(value, tableMeta) - // } - // }, - { - labelName: "Tenant Id", - labelKey: "TENANT_ID", - options: { - display: false, - viewColumns: false, - }, - }, - { - labelName: "Business Service", - labelKey: "BUSINESS_SERVICE", - options: { - display: false, - viewColumns: false, - }, - }, - { - labelName: "BND_VIEW_CERTIFICATE", - labelKey: "BND_VIEW_CERTIFICATE", - options: { - display: process.env.REACT_APP_NAME === "Employee", - viewColumns: process.env.REACT_APP_NAME === "Employee", - customBodyRender: (value, tableMeta) => - getViewButton(value, tableMeta), - }, - }, - - // { - // labelName: "Pay Required", - // labelKey: "PAYREQUIRED", - // options: { - // display: false, - // viewColumns :false - // } - // } - ], - title: { - labelName: "Search Results for Birth", - labelKey: "BND_SEARCH_TABLE_HEADER", - }, - rows: "", - options: { - filter: false, - download: false, - responsive: "stacked", - selectableRows: false, - hover: true, - ignoreFirstColumnHover: true, - rowsPerPageOptions: [10, 15, 20], - }, - customSortColumn: { - column: "Birth Date", - sortingFn: (data, i, sortDateOrder) => { - const epochDates = data.reduce((acc, curr) => { - acc.push([...curr, getEpochForDate(curr[4], "dayend")]); - return acc; - }, []); - const order = sortDateOrder === "asc" ? true : false; - const finalData = sortByEpoch(epochDates, !order).map((item) => { - item.pop(); - return item; - }); - return { data: finalData, currentOrder: !order ? "asc" : "desc" }; - }, - }, - }, -}; - -const getActionButton = (value, tableMeta) => { - return ( - { - let tenantId = tableMeta.rowData[8]; - let id = tableMeta.rowData[0]; - let action = tableMeta.rowData[7]; - let businessService = tableMeta.rowData[9]; - - store.dispatch( - prepareFinalObject("bnd.birth.download.certificateId", id) - ); - store.dispatch( - prepareFinalObject("bnd.birth.download.tenantId", tenantId) - ); - store.dispatch( - prepareFinalObject( - "bnd.birth.download.businessService", - businessService - ) - ); - - showHideConfirmationPopup( - store.getState(), - store.dispatch, - "getCertificate" - ); - }} - > - {getLocaleLabels(value, value)} - - ); -}; - -const getViewButton = (value, tableMeta) => { - return ( - { - let id = tableMeta.rowData[0]; - let tenantId = tableMeta.rowData[8]; - let url = `/employee/bnd-common/fullViewCertificate?tenantId=${tenantId}&certificateId=${id}&module=birth`; - document.location.href = `${document.location.origin}${url}`; - }} - > - {getLocaleLabels(value, value)} - - ); -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/getCertificate.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/getCertificate.js deleted file mode 100644 index c6a8a66d8dd..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/getCertificate.js +++ /dev/null @@ -1,201 +0,0 @@ -import { - getBreak, - getCommonHeader, - getLabel, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; //returns action object -import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; -import jp from "jsonpath"; -import { get, set } from "lodash"; -import { ifUserRoleExists, loadHospitals, loadMdmsData } from "./../utils"; -import { birthSearchCard } from "./birthSearchResources/birthSearchCard"; -import { searchResults } from "./birthSearchResources/searchResults"; -import "./birthSearchResources/index.css"; - -const header = getCommonHeader({ - labelName: "Search Certificate", - labelKey: "BND_BIRTH_SEARCH_DOWNLOAD", -}); - -const getCertificate = { - uiFramework: "material-ui", - name: "getCertificate", - beforeInitScreen: (action, state, dispatch) => { - loadMdmsData(action, state, dispatch).then((response) => { - const tenants = get(response, "MdmsRes.tenant.tenants"); - //Requires City Module Updations of MDMS? tobechanged - let jpFilter = "$[?(@.code != 'pb')]"; - let onlyCBs = jp.query(tenants, jpFilter); - if (!(process.env.REACT_APP_NAME === "Citizen")) { - let tenantId = getTenantId(); - let currentCbFilter = "$[?(@.code == '" + tenantId + "')]"; - onlyCBs = jp.query(onlyCBs, currentCbFilter); - - dispatch(prepareFinalObject("bnd.birth.tenantId", tenantId)); - loadHospitals(action, state, dispatch, "death", tenantId).then( - (response) => { - if ( - response && - response.MdmsRes && - response.MdmsRes["birth-death-service"] && - response.MdmsRes["birth-death-service"].hospitalList - ) { - const hptList = - response.MdmsRes["birth-death-service"].hospitalList; - const newList = [ - ...hptList.filter((hos) => hos.active), - { - hospitalName: "Others", - }, - ]; - for (let hospital of newList) { - hospital.code = hospital.hospitalName; - hospital.name = hospital.hospitalName; - } - dispatch(prepareFinalObject("bnd.allHospitals", newList)); - } else { - dispatch( - prepareFinalObject("bnd.allHospitals", [ - { code: "Others", name: "Others" }, - ]) - ); - } - } - ); - set( - action.screenConfig, - "components.div.children.birthSearchCard.children.cardContent.children.searchContainerCommon.children.cantonmentSelect.props.isDisabled", - true - ); - set( - action.screenConfig, - "components.div.children.birthSearchCard.children.cardContent.children.searchContainerCommon.children.gender.props.required", - false - ); - set( - action.screenConfig, - "components.div.children.birthSearchCard.children.cardContent.children.searchContainerCommon.children.gender.required", - false - ); - } - onlyCBs.sort((a, b) => (a.code > b.code ? 1 : -1)); - dispatch(prepareFinalObject("bnd.allTenants", onlyCBs)); - }); - - return action; - }, - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - className: "common-div-css bd-search-header", - id: "bndBirthSearch", - }, - children: { - headerDiv: { - uiFramework: "custom-atoms", - componentPath: "Container", - props: { - className: "bd-btn-hiw", - }, - children: { - header: { - gridDefination: { - xs: 12, - sm: 6, - }, - ...header, - }, - groupBillButton: { - componentPath: "Button", - gridDefination: { - xs: 12, - sm: 6, - align: "right", - }, - visible: - process.env.REACT_APP_NAME !== "Citizen" && - ifUserRoleExists("BIRTH_APPLICATION_CREATOR"), - props: { - variant: "contained", - color: "primary", - style: { - color: "white", - borderRadius: "2px", - width: "250px", - height: "48px", - }, - }, - children: { - plusIconInsideButton: { - uiFramework: "custom-atoms", - componentPath: "Icon", - props: { - iconName: "add", - style: { - fontSize: "24px", - }, - }, - }, - ButtonLabel: getLabel({ - labelName: "Group Bills", - labelKey: "ACTION_TEST_BIRTH_NEW_REGISTRATION", - }), - }, - onClickDefination: { - action: "page_change", - path: - process.env.REACT_APP_SELF_RUNNING === "true" - ? `/egov-ui-framework/birth-employee/newRegistration` - : `/birth-employee/newRegistration`, - }, - }, - howitWorksButton: { - componentPath: "Button", - gridDefination: { - xs: 12, - sm: 6, - align: "right", - }, - visible: false, - props: { - //variant: "outlined", - color: "primary", - className: "bd-btn-hiw", - style: { - minWidth: "180px", - height: "48px", - marginRight: "45", - borderRadius: "inherit", - }, - }, - onClickDefination: { - action: "page_change", - path: `/birth-common/how-it-works-birth`, - }, - children: { - helpButtonIcon: { - uiFramework: "custom-atoms", - componentPath: "Icon", - props: { - iconName: "help-circle", - }, - }, - helpButtonLabel: getLabel({ - labelName: "Birth How it Works", - labelKey: "BND_HELP", - }), - }, - }, - }, - }, - birthSearchCard, - breakAfterSearch: getBreak(), - searchResults, - }, - }, - }, -}; - -export default getCertificate; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/how-it-works-birth.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/how-it-works-birth.js deleted file mode 100644 index e4f8146eb48..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/how-it-works-birth.js +++ /dev/null @@ -1,36 +0,0 @@ -import { getCommonHeader } from "egov-ui-framework/ui-config/screens/specs/utils"; -const header = getCommonHeader( - { - labelName: "How It Works", - labelKey: "BND_HELP" - }, - { - classes: { - root: "common-header-cont" - } - } -); -const screenConfig = { - uiFramework: "material-ui", - name: "HowItWorks", - - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - children: { - header: header, - howitWoorksDiv:{ - uiFramework: "custom-molecules-local", - moduleName: "egov-bnd", - componentPath: "HowItWorks", - props: { - className: "common-div-css" - } - } - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/login_old.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/login_old.js deleted file mode 100644 index 82e310823c1..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/login_old.js +++ /dev/null @@ -1,222 +0,0 @@ -import { - getCommonCardWithHeader, - getLabel -} from "egov-ui-framework/ui-config/screens/specs/utils"; - -import { getCommonCard, getCommonContainer, getCommonHeader, getCommonParagraph, getCommonTitle, getStepperObject } from "egov-ui-framework/ui-config/screens/specs/utils"; - - -export const stepsData = [ - { labelName: "Trade Details", labelKey: "TL_COMMON_TR_DETAILS" }, - { labelName: "Owner Details", labelKey: "TL_COMMON_OWN_DETAILS" }, - { labelName: "Documents", labelKey: "TL_COMMON_DOCS" }, - { labelName: "Summary", labelKey: "TL_COMMON_SUMMARY" } -]; - -export const stepper = getStepperObject( - { props: { activeStep: 0 } }, - stepsData -); - -export const formwizardFirstStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form1" - }, - children: { - - } - }; - -export const formwizardSecondStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form2" - }, - children: { - - }, - visible: false -}; - -export const formwizardThirdStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form3" - }, - children: { - - }, - visible: false -}; - -export const formwizardFourthStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form4" - }, - children: { - - }, - visible: false -}; - -export const header = getCommonContainer({ - header: - getCommonHeader({ - labelName: 'Apply for New Trade License' , - labelKey: "APPLY" - }), - applicationNumber: { - uiFramework: "custom-atoms-local", - moduleName: "egov-tradelicence", - componentPath: "ApplicationNoContainer", - props: { - number: "NA" - }, - visible: false - } -}); - -const screenConfig = { - uiFramework: "material-ui", - name: "mihyLoginScreen", - components: { - mihyLoginGrid: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - mihyEmptyRow: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4 - } - }, - mihyLoginItem: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4, - xs: 12 - }, - children: { - - headerDiv: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - header: { - gridDefination: { - xs: 12, - sm: 10 - }, - ...header - } - } - }, - stepper, - formwizardFirstStep, - formwizardSecondStep, - formwizardThirdStep, - formwizardFourthStep, - //footer, - - mihyLoginCard: getCommonCardWithHeader( - { - mihyloginDiv: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "text-center" - }, - children: { - mihyLoginUsername: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Email", - margin: "normal", - fullWidth: true, - autoFocus: true, - required: true, - iconObj: { - position: "end", - iconName: "email" - } - }, - required: true, - jsonPath: "body.mihy.username", - pattern: "^([a-zA-Z0-9@.])+$" - }, - mihyLoginPassword: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Password", - type: "password", - margin: "normal", - fullWidth: true, - required: true, - iconObj: { position: "end", iconName: "lock" } - }, - jsonPath: "body.mihy.password", - required: true, - pattern: "^([a-zA-Z0-9!])+$" - }, - mihyBreakOne: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyBreakTwo: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyLoginButton: { - componentPath: "Button", - props: { - color: "primary", - fullWidth: true - }, - children: { - mihyLoginButtonText: getLabel({label:"Let's go"}) - } - // onClickDefination:{ - // action:"submit", - // method:"get", - // endPoint:"afbc.com", - // purpose:"authLogin", - // redirectionUrl:"/" - // } - } - } - } - }, - { - mihyLoginHeader: { - componentPath: "Typography", - children: { - mihyLoginHeaderText: getLabel({label:"Login"}) - }, - props: { - align: "center", - variant: "title", - style: { - color: "white" - } - } - } - } - ) - } - } - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/register_old.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/register_old.js deleted file mode 100644 index 6934c8d95f0..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/register_old.js +++ /dev/null @@ -1,137 +0,0 @@ -import { - getCommonCardWithHeader, - getLabel -} from "egov-ui-framework/ui-config/screens/specs/utils"; - -const screenConfig = { - uiFramework: "material-ui", - name: "mihyRegisterScreen", - components: { - mihyRegisterGrid: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - mihyEmptyRow: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4 - } - }, - mihyRegisterItem: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4, - xs: 12 - }, - children: { - mihyRegisterCard: getCommonCardWithHeader( - { - mihyloginDiv: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "text-center" - }, - children: { - mihyRegisterUsername: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Email", - margin: "normal", - fullWidth: true, - autoFocus: true, - required: true, - iconObj: { - position: "end", - iconName: "email" - } - }, - required: true, - jsonPath: "body.mihy.username", - pattern: "^([a-zA-Z0-9@.])+$" - }, - mihyRegisterPassword: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Password", - type: "password", - margin: "normal", - fullWidth: true, - required: true, - iconObj: { position: "end", iconName: "lock" } - }, - jsonPath: "body.mihy.password", - required: true, - pattern: "^([a-zA-Z0-9!])+$" - }, - mihyRegisterConfirmPassword: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Confirm password", - type: "password", - margin: "normal", - fullWidth: true, - required: true, - iconObj: { position: "end", iconName: "confirmation_number" } - }, - jsonPath: "body.mihy.password", - required: true, - pattern: "^([a-zA-Z0-9!])+$" - }, - mihyBreakOne: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyBreakTwo: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyRegisterButton: { - componentPath: "Button", - props: { - color: "primary", - fullWidth: true - }, - children: { - mihyRegisterButtonText: getLabel({label:"Let's go"}) - } - // onClickDefination:{ - // action:"submit", - // method:"get", - // endPoint:"afbc.com", - // purpose:"authRegister", - // redirectionUrl:"/" - // } - } - } - } - }, - { - mihyRegisterHeader: { - componentPath: "Typography", - children: { - mihyRegisterHeaderText: getLabel({label:"Register"}) - }, - props: { - align: "center", - variant: "title", - style: { - color: "white" - } - } - } - } - ) - } - } - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/search_old.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/search_old.js deleted file mode 100644 index 82e310823c1..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-common/search_old.js +++ /dev/null @@ -1,222 +0,0 @@ -import { - getCommonCardWithHeader, - getLabel -} from "egov-ui-framework/ui-config/screens/specs/utils"; - -import { getCommonCard, getCommonContainer, getCommonHeader, getCommonParagraph, getCommonTitle, getStepperObject } from "egov-ui-framework/ui-config/screens/specs/utils"; - - -export const stepsData = [ - { labelName: "Trade Details", labelKey: "TL_COMMON_TR_DETAILS" }, - { labelName: "Owner Details", labelKey: "TL_COMMON_OWN_DETAILS" }, - { labelName: "Documents", labelKey: "TL_COMMON_DOCS" }, - { labelName: "Summary", labelKey: "TL_COMMON_SUMMARY" } -]; - -export const stepper = getStepperObject( - { props: { activeStep: 0 } }, - stepsData -); - -export const formwizardFirstStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form1" - }, - children: { - - } - }; - -export const formwizardSecondStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form2" - }, - children: { - - }, - visible: false -}; - -export const formwizardThirdStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form3" - }, - children: { - - }, - visible: false -}; - -export const formwizardFourthStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form4" - }, - children: { - - }, - visible: false -}; - -export const header = getCommonContainer({ - header: - getCommonHeader({ - labelName: 'Apply for New Trade License' , - labelKey: "APPLY" - }), - applicationNumber: { - uiFramework: "custom-atoms-local", - moduleName: "egov-tradelicence", - componentPath: "ApplicationNoContainer", - props: { - number: "NA" - }, - visible: false - } -}); - -const screenConfig = { - uiFramework: "material-ui", - name: "mihyLoginScreen", - components: { - mihyLoginGrid: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - mihyEmptyRow: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4 - } - }, - mihyLoginItem: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4, - xs: 12 - }, - children: { - - headerDiv: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - header: { - gridDefination: { - xs: 12, - sm: 10 - }, - ...header - } - } - }, - stepper, - formwizardFirstStep, - formwizardSecondStep, - formwizardThirdStep, - formwizardFourthStep, - //footer, - - mihyLoginCard: getCommonCardWithHeader( - { - mihyloginDiv: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "text-center" - }, - children: { - mihyLoginUsername: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Email", - margin: "normal", - fullWidth: true, - autoFocus: true, - required: true, - iconObj: { - position: "end", - iconName: "email" - } - }, - required: true, - jsonPath: "body.mihy.username", - pattern: "^([a-zA-Z0-9@.])+$" - }, - mihyLoginPassword: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Password", - type: "password", - margin: "normal", - fullWidth: true, - required: true, - iconObj: { position: "end", iconName: "lock" } - }, - jsonPath: "body.mihy.password", - required: true, - pattern: "^([a-zA-Z0-9!])+$" - }, - mihyBreakOne: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyBreakTwo: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyLoginButton: { - componentPath: "Button", - props: { - color: "primary", - fullWidth: true - }, - children: { - mihyLoginButtonText: getLabel({label:"Let's go"}) - } - // onClickDefination:{ - // action:"submit", - // method:"get", - // endPoint:"afbc.com", - // purpose:"authLogin", - // redirectionUrl:"/" - // } - } - } - } - }, - { - mihyLoginHeader: { - componentPath: "Typography", - children: { - mihyLoginHeaderText: getLabel({label:"Login"}) - }, - props: { - align: "center", - variant: "title", - style: { - color: "white" - } - } - } - } - ) - } - } - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/addHospitalDialog.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/addHospitalDialog.js deleted file mode 100644 index 35f783e9594..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/addHospitalDialog.js +++ /dev/null @@ -1,157 +0,0 @@ -import { - getCommonHeader, - getCommonContainer, - getLabel, - getTextField , -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { toggleSnackbar } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import get from "lodash/get"; -import {showHideAddHospitalDialog } from "./newRegistration"; -import {prepareFinalObject} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import {patterns} from "../utils/constants"; - -const addHospitalDataToDropDown = (state,dispatch) =>{ - - let newHospitalName = get(state.screenConfiguration.preparedFinalObject,"bnd.newHospitalName"); - let existingHospitals = get(state.screenConfiguration.preparedFinalObject,"bnd.allHospitals") || []; - - if(!newHospitalName || !(new RegExp(patterns["hospitalName"])).test(newHospitalName)) - { - dispatch(toggleSnackbar( - true, - { - labelName: "Invalid value", - labelKey: "CORE_COMMON_INVALID" - }, - "info" - )); - return; - } - - let hospitalExists = false; - for(var hospital in existingHospitals) - { - if(existingHospitals[hospital].name == newHospitalName) - { - dispatch(toggleSnackbar( - true, - { - labelName: "Please fill the required fields.", - labelKey: "BND_HOSPITAL_NAME_EXISTS" - }, - "info" - )); - hospitalExists = true; - break; - } - } - - if(!hospitalExists){ - existingHospitals.unshift({code:newHospitalName,name:newHospitalName}); - dispatch(toggleSnackbar( - true, - { - labelName: "Please fill the required fields.", - labelKey: "BND_NEW_HOSPITAL_ADDED" - }, - "success" - )); - dispatch(prepareFinalObject("bnd.allHospitals", existingHospitals)); - } -} - -export const addHospitalDialog = getCommonContainer({ - header: getCommonHeader({ - labelName: "Confirm Add", - labelKey: "BND_CONFIRM_ADD" - }, - { - style: { - fontSize: "20px" - } - }), - confirmationContents: getCommonContainer({ - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - style: { - width: "90%", - textAlign: "center" - } - }, - children: { - - hospitalName: getTextField({ - label: { - labelName: "", - labelKey: "BND_HOSPITALNAME_LABEL" - }, - placeholder: { - labelName: "", - labelKey: "BND_HOSPITALNAME_LABEL" - }, - required:false, - visible: true, - jsonPath: `bnd.newHospitalName`, - gridDefination: { - xs: 12, - sm: 12 - } - }), - - yesButton: { - componentPath: "Button", - props: { - variant: "contained", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "20px", - marginTop: "16px" - } - }, - children: { - previousButtonLabel: getLabel({ - labelName: "YES", - labelKey: "BND_DOWNLOAD_PROCEED" - }) - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - addHospitalDataToDropDown(state,dispatch); - showHideAddHospitalDialog(state, dispatch) - } - } - }, - cancelButton: { - componentPath: "Button", - props: { - variant: "outlined", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "4px", - marginTop: "16px" - } - }, - children: { - previousButtonLabel: getLabel({ - labelName: "NO", - labelKey: "CORE_COMMON_CANCEL" - }) - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - showHideAddHospitalDialog(state, dispatch) - } - } - } - } - } - }) -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/index.scss b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/index.scss deleted file mode 100644 index f244bd15e9d..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/index.scss +++ /dev/null @@ -1,21 +0,0 @@ -.confirm-bnd-popup{ - display:unset !important; - } - - .bnd-footer{ - .apply-wizard-footer{ - background: white; - - } - } - @media (max-width: 780px) { - - - .bnd-footer{ -.apply-wizard-footer{ - button{ - min-width: 50% !important; - } -} - } -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistration.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistration.js deleted file mode 100644 index 8d92bbc134d..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistration.js +++ /dev/null @@ -1,262 +0,0 @@ -import { getCommonHeader } from "egov-ui-framework/ui-config/screens/specs/utils"; -import { - handleScreenConfigurationFieldChange as handleField, - prepareFinalObject, -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; //returns action object -import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; -import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; -import get from "lodash/get"; -import { - convertEpochToDateCustom, - loadFullCertDetails, - loadHospitals, -} from "../utils"; -import { addHospitalDialog } from "./addHospitalDialog"; -import { newRegistrationForm } from "./newRegistrationCard"; -import { confirmationDialog } from "./newRegistrationConfirmDialog"; -import { footer } from "./newRegistrationFooter"; -import "./index.css"; -import { set } from "lodash"; - -const header = getCommonHeader({ - labelName: "Search Certificate", - labelKey: "ACTION_TEST_BIRTH_CERTIFICATE", -}); - -export const showHideConfirmationPopup = (state, dispatch) => { - let toggle = get( - state.screenConfiguration.screenConfig["newRegistration"], - "components.confirmationDialog.props.open", - false - ); - dispatch( - handleField( - "newRegistration", - "components.confirmationDialog", - "props.open", - !toggle - ) - ); -}; - -export const showHideAddHospitalDialog = (state, dispatch) => { - let toggle = get( - state.screenConfiguration.screenConfig["newRegistration"], - "components.hospitalDialog.props.open", - false - ); - dispatch( - handleField( - "newRegistration", - "components.hospitalDialog", - "props.open", - !toggle - ) - ); -}; - -const prepareEditScreenData = (action, state, dispatch, response) => { - setTimeout(() => { - if (response.BirthCertificate[0].dateofbirth) { - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.childInfo.children.cardContent.children.infoOfChild.children.dob", - "props.value", - convertEpochToDateCustom(response.BirthCertificate[0].dateofbirth) - ) - ); - } - if (response.BirthCertificate[0].dateofreport) { - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.registrationInfo.children.cardContent.children.registrationInfoCont.children.dateOfReporting", - "props.value", - convertEpochToDateCustom(response.BirthCertificate[0].dateofreport) - ) - ); - } - if (response.BirthCertificate[0].hospitalname) { - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.registrationInfo.children.cardContent.children.registrationInfoCont.children.hospitalName", - "props.value", - response.BirthCertificate[0].hospitalname - ) - ); - } - }, 1); -}; - -const newRegistration = { - uiFramework: "material-ui", - name: "newRegistration", - beforeInitScreen: (action, state, dispatch) => { - let userAction = getQueryArg(window.location.href, "action"); - let id = getQueryArg(window.location.href, "certificateId"); - let module = getQueryArg(window.location.href, "module"); - dispatch( - prepareFinalObject("bnd",{})); - loadHospitals(action, state, dispatch, "birth", getTenantId()).then( - (response) => { - if ( - response && - response.MdmsRes && - response.MdmsRes["birth-death-service"] && - response.MdmsRes["birth-death-service"].hospitalList - ) { - const hptList = response.MdmsRes["birth-death-service"].hospitalList; - const newList = [ - ...hptList.filter((hos) => hos.active), - { - hospitalName: "Others", - }, - ]; - for (let hospital of newList) { - hospital.code = hospital.hospitalName; - hospital.name = hospital.hospitalName; - } - dispatch(prepareFinalObject("bnd.allHospitals", newList)); - } else { - dispatch( - prepareFinalObject("bnd.allHospitals", [ - { code: "Others", name: "Others" }, - ]) - ); - } - - if (userAction == "EDIT" && id && module) { - set( - action.screenConfig, - "components.div2.children.details.children.cardContent.children.registrationInfo.children.cardContent.children.registrationInfoCont.children.hospitalName.props.isDisabled", - true - ); - set( - action.screenConfig, - "components.div2.children.details.children.cardContent.children.registrationInfo.children.cardContent.children.registrationInfoCont.children.registrationNo.props.disabled", - true - ); - loadFullCertDetails(action, state, dispatch, { - tenantId: getTenantId(), - id: id, - module: module, - }).then((response) => { - if ( - response && - response.BirthCertificate && - response.BirthCertificate.length > 0 - ) { - dispatch( - prepareFinalObject( - "bnd.birth.newRegistration", - response.BirthCertificate[0] - ) - ); - dispatch( - prepareFinalObject( - "bnd.birth.newRegistration.isLegacyRecord", - response.BirthCertificate[0].isLegacyRecord - ) - ); - prepareEditScreenData(action, state, dispatch, response); - } - }); - } else { - dispatch( - prepareFinalObject("bnd.birth.newRegistration", { - birthFatherInfo: {}, - birthMotherInfo: {}, - birthPresentaddr: {}, - birthPermaddr: {}, - }) - ); - } - } - ); - - return action; - }, - components: { - div2: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "common-div-css", - }, - children: { - headerDiv: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - header: { - gridDefination: { - xs: 12, - sm: 6, - }, - ...header, - }, - }, - }, - details: newRegistrationForm, - }, - }, - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "common-div-css bnd-footer", - }, - children: { - details: footer, - }, - }, - confirmationDialog: { - componentPath: "Dialog", - props: { - open: false, - maxWidth: "sm", - disableValidation: true, - }, - children: { - dialogContent: { - componentPath: "DialogContent", - props: { - classes: { - root: "city-picker-dialog-style", - }, - // style: { minHeight: "180px", minWidth: "365px" } - }, - children: { - popup: confirmationDialog, - }, - }, - }, - }, - hospitalDialog: { - componentPath: "Dialog", - props: { - open: false, - maxWidth: "sm", - disableValidation: true, - }, - children: { - dialogContent: { - componentPath: "DialogContent", - props: { - classes: { - root: "city-picker-dialog-style", - }, - // style: { minHeight: "180px", minWidth: "365px" } - }, - children: { - popup: addHospitalDialog, - }, - }, - }, - }, - }, -}; - -export default newRegistration; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistrationCard.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistrationCard.js deleted file mode 100644 index e1fe084631b..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistrationCard.js +++ /dev/null @@ -1,1039 +0,0 @@ -import { - getCommonCard, - getCommonContainer, - getCommonGrayCard, - getCommonParagraph, - getCommonSubHeader, - getCommonTitle, - getDateField, - getPattern, - getSelectField, - getTextField, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { - prepareFinalObject, - handleScreenConfigurationFieldChange as handleField, -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { getTodaysDateInYMD } from "egov-ui-framework/ui-utils/commons"; -import get from "lodash/get"; -import { patterns } from "../utils/constants"; -import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; - -export const getPersonDetailsForm = (type) => { - return getCommonContainer({ - firstName: getTextField({ - label: { - labelName: "First Name", - labelKey: "BND_FIRSTNAME_LABEL", - }, - placeholder: { - labelName: "First Name", - labelKey: "BND_FIRSTNAME_LABEL", - }, - required: true, - visible: true, - pattern: patterns["name"], - jsonPath: `bnd.birth.newRegistration.${type}.firstname`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - middlename: getTextField({ - label: { - labelName: "Middle Name", - labelKey: "BND_MIDDLENAME_LABEL", - }, - placeholder: { - labelName: "Middle Name", - labelKey: "BND_MIDDLENAME_LABEL", - }, - required: false, - visible: true, - pattern: patterns["name"], - jsonPath: `bnd.birth.newRegistration.${type}.middlename`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - lastname: getTextField({ - label: { - labelName: "Last Name", - labelKey: "BND_LASTNAME_LABEL", - }, - placeholder: { - labelName: "Last Name", - labelKey: "BND_LASTNAME_LABEL", - }, - required: true, - visible: true, - pattern: patterns["name"], - jsonPath: `bnd.birth.newRegistration.${type}.lastname`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - aadharNo: getTextField({ - label: { - labelName: "Aadhar No", - labelKey: "BND_AADHAR_NO", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "Aadhar No", - labelKey: "BND_AADHAR_NO", - }, - required: false, - pattern: getPattern("AadharNo"), - jsonPath: `bnd.birth.newRegistration.${type}.aadharno`, - // iconObj: { - // iconName: "search", - // position: "end", - // color: "#FE7A51", - // onClickDefination: { - // action: "condition", - // callBack: (state, dispatch, fieldInfo) => { - // alert("hey") - // //getDetailsForOwner(state, dispatch, fieldInfo); //useme - // } - // } - // }, - title: { - value: "Please search owner profile linked to the mobile no.", - key: "BND_AADHAR_NO", - }, - //infoIcon: "info_circle", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - emailId: getTextField({ - label: { - labelName: "emailId", - labelKey: "BND_EMAIL_ID", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "emailId", - labelKey: "BND_EMAIL_ID", - }, - required: false, - pattern: getPattern("Email"), - jsonPath: `bnd.birth.newRegistration.${type}.emailid`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - mobNo: getTextField({ - label: { - labelName: "Mobile No.", - labelKey: "CORE_COMMON_MOBILE_NUMBER", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "Enter Mobile No.", - labelKey: "CORE_COMMON_MOBILE_NUMBER", - }, - required: false, - pattern: getPattern("MobileNo"), - jsonPath: `bnd.birth.newRegistration.${type}.mobileno`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - education: getTextField({ - label: { - labelName: "Education", - labelKey: "BND_EDUCATION", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "Education", - labelKey: "BND_EDUCATION", - }, - required: false, - pattern: patterns["commonPattern"], - jsonPath: `bnd.birth.newRegistration.${type}.education`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - profession: getTextField({ - label: { - labelName: "Profession", - labelKey: "BND_PROFESSION", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "Profession", - labelKey: "BND_PROFESSION", - }, - required: false, - pattern: patterns["commonPattern"], - jsonPath: `bnd.birth.newRegistration.${type}.proffession`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - nationality: getTextField({ - label: { - labelName: "nationality", - labelKey: "BND_NATIONALITY", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "nationality", - labelKey: "BND_NATIONALITY", - }, - required: true, - pattern: patterns["commonPattern"], - jsonPath: `bnd.birth.newRegistration.${type}.nationality`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - religion: getTextField({ - label: { - labelName: "religion", - labelKey: "BND_RELIGION", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "religion", - labelKey: "BND_RELIGION", - }, - required: false, - pattern: patterns["commonPattern"], - jsonPath: `bnd.birth.newRegistration.${type}.religion`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - }); -}; - -export const getAddressForm = (type, mandatory = false) => { - return getCommonContainer({ - buildingNo: getTextField({ - label: { - labelName: "buildingno", - labelKey: "BND_BUILDINGNO_LABEL", - }, - placeholder: { - labelName: "buildingno", - labelKey: "BND_BUILDINGNO_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressBig"], - jsonPath: `bnd.birth.newRegistration.${type}.buildingno`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - houseNo: getTextField({ - label: { - labelName: "houseno", - labelKey: "BND_HOUSENO_LABEL", - }, - placeholder: { - labelName: "houseno", - labelKey: "BND_HOUSENO_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressBig"], - jsonPath: `bnd.birth.newRegistration.${type}.houseno`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - streetname: getTextField({ - label: { - labelName: "streetname", - labelKey: "BND_STREETNAME_LABEL", - }, - placeholder: { - labelName: "streetname", - labelKey: "BND_STREETNAME_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressBig"], - jsonPath: `bnd.birth.newRegistration.${type}.streetname`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - locality: getTextField({ - label: { - labelName: "locality", - labelKey: "BND_LOCALITY_LABEL", - }, - placeholder: { - labelName: "locality", - labelKey: "BND_LOCALITY_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressBig"], - jsonPath: `bnd.birth.newRegistration.${type}.locality`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - tehsil: getTextField({ - label: { - labelName: "tehsil", - labelKey: "BND_TEHSIL_LABEL", - }, - placeholder: { - labelName: "tehsil", - labelKey: "BND_TEHSIL_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressTehsil"], - jsonPath: `bnd.birth.newRegistration.${type}.tehsil`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - district: getTextField({ - label: { - labelName: "district", - labelKey: "BND_DISTRICT_LABEL", - }, - placeholder: { - labelName: "district", - labelKey: "BND_DISTRICT_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressSmall"], - jsonPath: `bnd.birth.newRegistration.${type}.district`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - city: getTextField({ - label: { - labelName: "city", - labelKey: "BND_CITY_LABEL", - }, - placeholder: { - labelName: "city", - labelKey: "BND_CITY_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressSmall"], - jsonPath: `bnd.birth.newRegistration.${type}.city`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - state: getTextField({ - label: { - labelName: "state", - labelKey: "BND_STATE_LABEL", - }, - placeholder: { - labelName: "city", - labelKey: "BND_STATE_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressSmall"], - jsonPath: `bnd.birth.newRegistration.${type}.state`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - pinno: getTextField({ - label: { - labelName: "pinno", - labelKey: "BND_PINNO_LABEL", - }, - placeholder: { - labelName: "pinno", - labelKey: "BND_PINNO_LABEL", - }, - required: mandatory, - visible: true, - pattern: getPattern("Pincode"), - jsonPath: `bnd.birth.newRegistration.${type}.pinno`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - country: getTextField({ - label: { - labelName: "country", - labelKey: "BND_COUNTRY_LABEL", - }, - placeholder: { - labelName: "country", - labelKey: "BND_COUNTRY_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressSmall"], - jsonPath: `bnd.birth.newRegistration.${type}.country`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - }); -}; -export const getcheckboxvalue = (state, dispatch) => { - let checkBoxState = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.checkboxforaddress" - ); - if (checkBoxState) { - let birthpresentmaddr = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.birthPresentaddr" - ); - for (var key in birthpresentmaddr) - dispatch( - prepareFinalObject( - `bnd.birth.newRegistration.birthPermaddr.${key}`, - get( - state.screenConfiguration.preparedFinalObject, - `bnd.birth.newRegistration.birthPresentaddr.${key}` - ) - ) - ); - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents", - "visible", - false - ) - ); - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.header", - "visible", - false - ) - ); - const presentAddrConfig = get( - state.screenConfiguration.screenConfig.newRegistration, - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children" - ); - for (var key in presentAddrConfig) { - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "required", - false - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "props.required", - false - ) - ); - } - const addrConfig = get( - state.screenConfiguration.screenConfig.newRegistration, - "components.div2.children.details.children.cardContent.children.addrTimeOfBirth.children.cardContent.children.addrTimeOfBirth.children" - ); - for (var key in addrConfig) { - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.addrTimeOfBirth.children.cardContent.children.addrTimeOfBirth.children.${key}`, - "required", - true - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.addrTimeOfBirth.children.cardContent.children.addrTimeOfBirth.children.${key}`, - "props.required", - true - ) - ); - } - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.addrTimeOfBirth.children.cardContent.children.header.children.key", - "props.labelKey", - "BND_BIRTH_ADDR_PERM" - ) - ); - } else { - let birthpermaddr = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.birthPermaddr" - ); - for (var key in birthpermaddr) - dispatch( - prepareFinalObject(`bnd.birth.newRegistration.birthPermaddr.${key}`, "") - ); - const presentAddrConfig = get( - state.screenConfiguration.screenConfig.newRegistration, - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children" - ); - for (var key in presentAddrConfig) { - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "required", - true - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "props.required", - true - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "props.value", - "" - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "props.error", - false - ) - ); - } - const addrConfig = get( - state.screenConfiguration.screenConfig.newRegistration, - "components.div2.children.details.children.cardContent.children.addrTimeOfBirth.children.cardContent.children.addrTimeOfBirth.children" - ); - for (var key in addrConfig) { - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.addrTimeOfBirth.children.cardContent.children.addrTimeOfBirth.children.${key}`, - "required", - false - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.addrTimeOfBirth.children.cardContent.children.addrTimeOfBirth.children.${key}`, - "props.required", - false - ) - ); - } - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents", - "visible", - true - ) - ); - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.header", - "visible", - true - ) - ); - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.addrTimeOfBirth.children.cardContent.children.header.children.key", - "props.labelKey", - "BND_PRESENT_ADDR_DURING_BIRTH" - ) - ); - } -}; - -export const newRegistrationForm = getCommonCard({ - header: getCommonTitle( - { - labelName: "New Registration", - labelKey: - getQueryArg(window.location.href, "action") === "EDIT" - ? "BND_EDIT_REGISTRATION" - : "BND_NEW_REGISTRATION", - }, - { - style: { - marginBottom: 18, - }, - } - ), - subText: getCommonParagraph({ - labelName: "(*) marked items are mandatory", - labelKey: "BND_NEW_REGISTRATION_SUBTEXT", - }), - checkBox: { - required: true, - uiFramework: "custom-atoms-local", - moduleName: "egov-bnd", - componentPath: "Checkbox", - props: { - label: { - labelKey: "BND_IS_LEGACY_RECORD", - labelName: "BND_IS_LEGACY_RECORD", - }, - jsonPath: "bnd.birth.newRegistration.isLegacyRecord", - }, - }, - registrationInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_REGISTRATION", - }, - { - style: { - marginBottom: 18, - }, - } - ), - registrationInfoCont: getCommonContainer({ - registrationNo: getTextField({ - label: { - labelName: "RegistrationNo", - labelKey: "BND_REG_NO_LABEL", - }, - placeholder: { - labelName: "Registration No", - labelKey: "BND_REG_NO_LABEL", - }, - required: true, - visible: true, - pattern: patterns["registrationNo"], - jsonPath: "bnd.birth.newRegistration.registrationno", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - hospitalName: { - uiFramework: "custom-containers-local", - moduleName: "egov-bnd", - componentPath: "AutosuggestContainer", - jsonPath: "bnd.birth.newRegistration.hospitalname", - sourceJsonPath: "bnd.allHospitals", - visible: true, - autoSelect: true, - props: { - autoSelect: true, - //isClearable:true, - className: "autocomplete-dropdown", - suggestions: [], - disabled: false, //getQueryArg(window.location.href, "action") === "EDITRENEWAL"? true:false, - label: { - labelName: "Select Hospital", - labelKey: "BND_HOSPITALNAME_LABEL", - }, - placeholder: { - labelName: "Select Hospital", - labelKey: "BND_HOSPITALNAME_LABEL_PLACEHOLDER", - }, - localePrefix: { - moduleName: "TENANT", - masterName: "TENANTS", - }, - labelsFromLocalisation: false, - required: false, - jsonPath: "bnd.birth.hosptialId", - sourceJsonPath: "bnd.allHospitals", - inputLabelProps: { - shrink: true, - }, - onClickHandler: (action, state, dispatch) => {}, - }, - gridDefination: { - xs: 12, - sm: 4, - }, - beforeFieldChange: (action, state, dispatch) => {}, - afterFieldChange: (action, state, dispatch) => {}, - }, - - dateOfReporting: getDateField({ - label: { labelName: "DOB", labelKey: "BND_DOR" }, - placeholder: { - labelName: "Date of Reporting", - labelKey: "BND_DOR_PLACEHOLDER", - }, - jsonPath: "bnd.birth.newRegistration.dateofreportepoch", - gridDefination: { - xs: 12, - sm: 4, - }, - pattern: getPattern("Date"), - errorMessage: "ERR_INVALID_DATE", - required: true, - props: { - inputProps: { - max: getTodaysDateInYMD(), - }, - }, - }), - }), - }), - childInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_INFO_OF_CHILD", - }, - { - style: { - marginBottom: 18, - }, - } - ), - infoOfChild: getCommonContainer({ - dob: getDateField({ - label: { labelName: "DOB", labelKey: "BND_BIRTH_DOB" }, - placeholder: { - labelName: "Date of Birth", - labelKey: "BND_BIRTH_DOB", - }, - jsonPath: "bnd.birth.newRegistration.dateofbirthepoch", - gridDefination: { - xs: 12, - sm: 4, - }, - pattern: getPattern("Date"), - errorMessage: "ERR_INVALID_DATE", - required: true, - props: { - inputProps: { - max: getTodaysDateInYMD(), - }, - }, - }), - gender: getSelectField({ - label: { - labelName: "Select Gender", - labelKey: "BND_GENDER", - }, - placeholder: { - labelName: "Select Gender", - labelKey: "BND_GENDER_PLACEHOLDER", - }, - required: true, - localePrefix: { - moduleName: "BIRTH", - masterName: "GENDER", - }, - data: [ - { - code: "Male", - label: "Male", - }, - { - code: "Female", - label: "Female", - }, - { - code: "Others", - label: "Others", - }, - ], - props: { - disabled: false, - }, - gridDefination: { - xs: 12, - sm: 4, - }, - jsonPath: "bnd.birth.newRegistration.genderStr", - autoSelect: true, - visible: true, - beforeFieldChange: (action, state, dispatch) => {}, - afterFieldChange: (action, state, dispatch) => {}, - }), - firstName: getTextField({ - label: { - labelName: "First Name", - labelKey: "BND_FIRSTNAME_LABEL", - }, - placeholder: { - labelName: "First Name", - labelKey: "BND_FIRSTNAME_LABEL", - }, - required: false, - visible: true, - pattern: patterns["name"], - jsonPath: "bnd.birth.newRegistration.firstname", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - middlename: getTextField({ - label: { - labelName: "Middle Name", - labelKey: "BND_MIDDLENAME_LABEL", - }, - placeholder: { - labelName: "Middle Name", - labelKey: "BND_MIDDLENAME_LABEL", - }, - required: false, - visible: true, - pattern: patterns["name"], - jsonPath: "bnd.birth.newRegistration.middlename", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - lastname: getTextField({ - label: { - labelName: "Last Name", - labelKey: "BND_LASTNAME_LABEL", - }, - placeholder: { - labelName: "Last Name", - labelKey: "BND_LASTNAME_LABEL", - }, - required: false, - visible: true, - pattern: patterns["name"], - jsonPath: "bnd.birth.newRegistration.lastname", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - }), - }), - placeInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_BIRTH_PLACE", - }, - { - style: { - marginBottom: 18, - }, - } - ), - placeOfBirth: getCommonContainer({ - firstName: getTextField({ - label: { - labelName: "Place of Birth", - labelKey: "BND_BIRTH_PLACE", - }, - placeholder: { - labelName: "Place of Birth", - labelKey: "BND_BIRTH_PLACE", - }, - required: true, - visible: true, - pattern: patterns["addressBig"], - jsonPath: "bnd.birth.newRegistration.placeofbirth", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - }), - }), - fathersInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_FATHERS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - fathersInfo: getPersonDetailsForm("birthFatherInfo"), - }), - mothersInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_MOTHERS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - mothersInfo: getPersonDetailsForm("birthMotherInfo"), - }), - addrTimeOfBirth: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_PRESENT_ADDR_DURING_BIRTH", - }, - { - style: { - marginBottom: 18, - }, - } - ), - addrTimeOfBirth: getAddressForm("birthPresentaddr"), - }), - - permAddressofParents: getCommonGrayCard({ - checkBoxforaddress: { - required: true, - uiFramework: "custom-atoms-local", - moduleName: "egov-bnd", - componentPath: "Checkbox", - props: { - label: { - labelKey: "PRESENT_TO_PERM_ADDR_SWITCH_BIRTH", - labelName: "PRESENT_TO_PERM_ADDR_SWITCH_BIRTH", - }, - jsonPath: "bnd.birth.newRegistration.checkboxforaddress", - callBack: (state, dispatch) => { - getcheckboxvalue(state, dispatch); - }, - }, - }, - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_BIRTH_ADDR_PERM", - }, - { - style: { - marginBottom: 18, - }, - } - ), - permAddressofParents: getAddressForm("birthPermaddr", true), - }), - informantsInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_INFORMANTS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - informantInfo: getCommonContainer({ - informantName: getTextField({ - label: { - labelName: "informants name", - labelKey: "CORE_COMMON_NAME", - }, - placeholder: { - labelName: "informants name", - labelKey: "CORE_COMMON_NAME", - }, - required: false, - visible: true, - pattern: patterns["name"], - jsonPath: "bnd.birth.newRegistration.informantsname", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - informantsAddress: getTextField({ - label: { - labelName: "informants address", - labelKey: "BND_ADDRESS", - }, - placeholder: { - labelName: "informants address", - labelKey: "BND_ADDRESS", - }, - required: false, - visible: true, - pattern: patterns["addressBig"], - jsonPath: "bnd.birth.newRegistration.informantsaddress", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - }), - }), - remarks: getTextField({ - label: { - labelName: "remarks", - labelKey: "BND_REMARKS_LABEL", - }, - placeholder: { - labelName: "remarks", - labelKey: "BND_REMARKS_LABEL", - }, - required: false, - visible: true, - pattern: patterns["remarks"], - jsonPath: "bnd.birth.newRegistration.remarks", - gridDefination: { - xs: 12, - sm: 4, - }, - }), -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistrationConfirmDialog.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistrationConfirmDialog.js deleted file mode 100644 index c961dc08b50..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistrationConfirmDialog.js +++ /dev/null @@ -1,120 +0,0 @@ -import { - getCommonContainer, - getCommonHeader, - getLabel, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { showHideConfirmationPopup } from "./newRegistration"; -import { postData } from "./newRegistrationFooter"; - -export const confirmationDialog = getCommonContainer( - { - closeButton: { - componentPath: "Button", - props: { - style: { - float: "right", - color: "rgba(0, 0, 0, 0.60)", - }, - }, - children: { - previousButtonIcon: { - uiFramework: "custom-atoms", - componentPath: "Icon", - props: { - iconName: "close", - }, - }, - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => - showHideConfirmationPopup(state, dispatch, "getCertificate"), - }, - }, - header: getCommonHeader( - { - labelName: "Confirm Download", - labelKey: "BND_CONFIRM_SUBMIT", - }, - { - style: { - fontSize: "20px", - }, - } - ), - confirmationContents: getCommonContainer( - { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - style: { - width: "100%", - textAlign: "center", - display: "flex", - flexDirection: "row-reverse", - }, - }, - children: { - yesButton: { - componentPath: "Button", - props: { - variant: "contained", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "20px", - marginTop: "16px", - boxShadow: "none", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "YES", - labelKey: "BND_DOWNLOAD_PROCEED", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - postData(state, dispatch); - showHideConfirmationPopup(state, dispatch, "newRegistration"); - }, - }, - }, - cancelButton: { - componentPath: "Button", - props: { - variant: "outlined", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "4px", - marginTop: "16px", - color: "gray", - border: "none", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "NO", - labelKey: "CORE_COMMON_CANCEL", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - showHideConfirmationPopup(state, dispatch, "newRegistration"); - }, - }, - }, - }, - }, - }, - { className: "confirm-bnd-popup" } - ), - }, - { className: "confirm-bnd-popup" } -); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistrationFooter.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistrationFooter.js deleted file mode 100644 index 403f30d4b7f..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/birth-employee/newRegistrationFooter.js +++ /dev/null @@ -1,354 +0,0 @@ -import { - convertDateToEpoch, - getLabel, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { - toggleSnackbar, - toggleSpinner, -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { httpRequest } from "egov-ui-framework/ui-utils/api"; -import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; -import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; -import _ from "lodash"; -import get from "lodash/get"; -import { validateFields, validateTimeZone } from "../utils"; -import { showHideConfirmationPopup } from "./newRegistration"; - -const checkIfFormIsValid = async (state, dispatch) => { - let isFormValid = true; - - const newRegistration = validateFields( - "components.div2.children.details.children.cardContent.children.registrationInfo.children.cardContent.children.registrationInfoCont.children", - state, - dispatch, - "newRegistration" - ); - - const placeOfBirth = validateFields( - "components.div2.children.details.children.cardContent.children.placeInfo.children.cardContent.children.placeOfBirth.children", - state, - dispatch, - "newRegistration" - ); - - const childsInfo = validateFields( - "components.div2.children.details.children.cardContent.children.childInfo.children.cardContent.children.infoOfChild.children", - state, - dispatch, - "newRegistration" - ); - - const fathersInfo = validateFields( - "components.div2.children.details.children.cardContent.children.fathersInfo.children.cardContent.children.fathersInfo.children", - state, - dispatch, - "newRegistration" - ); - - const mothersInfo = validateFields( - "components.div2.children.details.children.cardContent.children.mothersInfo.children.cardContent.children.mothersInfo.children", - state, - dispatch, - "newRegistration" - ); - - const permAddr = validateFields( - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children", - state, - dispatch, - "newRegistration" - ); - const addrField = validateFields( - "components.div2.children.details.children.cardContent.children.addrTimeOfBirth.children.cardContent.children.addrTimeOfBirth.children", - state, - dispatch, - "newRegistration" - ); - - const addrTimeOfBirth = validateFields( - "components.div2.children.details.children.cardContent.children.informantsInfo.children.cardContent.children.informantInfo.children", - state, - dispatch, - "newRegistration" - ); - - if (!validateTimeZone()) { - return; - } - - if ( - !( - newRegistration && - permAddr && - placeOfBirth && - childsInfo && - fathersInfo && - mothersInfo && - addrField && - addrTimeOfBirth - ) - ) { - isFormValid = false; - dispatch( - toggleSnackbar( - true, - { - labelName: "Please fill the required fields.", - labelKey: "BND_FILL_REQUIRED_FIELDS", - }, - "info" - ) - ); - return; - } - let dateofreport = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.dateofreportepoch" - ); - let dateofbirth = get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.dateofbirthepoch" - ); - if (dateofreport < dateofbirth) { - isFormValid = false; - dispatch( - toggleSnackbar( - true, - { - labelName: "", - labelKey: "BND_DOR_SHNT_ABOVE_DEATHDATE", - }, - "info" - ) - ); - return; - } - if ( - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.firstname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.middlename" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.lastname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.birthFatherInfo.firstname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.birthFatherInfo.middlename" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.birthFatherInfo.lastname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.birthMotherInfo.firstname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.birthMotherInfo.middlename" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration.birthMotherInfo.lastname" - ) - ) { - isFormValid = false; - dispatch( - toggleSnackbar( - true, - { - labelName: - "Please enter child's name or father's name or mother's name", - labelKey: "BND_ENTER_ANYONE_NAME", - }, - "info" - ) - ); - return; - } - - if (isFormValid) { - showHideConfirmationPopup(state, dispatch); - } -}; - -const callBackSubmit = async (state, dispatch) => { - checkIfFormIsValid(state, dispatch); -}; - -export const postData = async (state, dispatch) => { - try { - dispatch(toggleSpinner()); - - const newRegData = _.clone( - get( - state.screenConfiguration.preparedFinalObject, - "bnd.birth.newRegistration", - [] - ), - true - ); - if (newRegData["checkboxforaddress"]) { - newRegData["birthPermaddr"] = { ...newRegData["birthPresentaddr"] }; - } - newRegData["tenantid"] = getTenantId(); - newRegData["excelrowindex"] = -1; - newRegData["counter"] = newRegData["isLegacyRecord"] ? 1 : 0; - - if (newRegData["dateofreportepoch"] != null) - newRegData["dateofreportepoch"] = - convertDateToEpoch(newRegData["dateofreportepoch"]) / 1000; - if (newRegData["dateofbirthepoch"] != null) - newRegData["dateofbirthepoch"] = - convertDateToEpoch(newRegData["dateofbirthepoch"]) / 1000; - - let payload = { - birthCerts: [newRegData], - }; - let actionmode = - getQueryArg(window.location.href, "action") == "EDIT" - ? "updatebirthimport" - : "savebirthimport"; - payload = await httpRequest( - "post", - `birth-death-services/common/${actionmode}`, - `${actionmode}`, - [], - payload - ); - - if (payload) { - if (payload.errorRowMap && Object.keys(payload.errorRowMap).length > 0) { - let errorString = ""; - for (var key in payload.errorRowMap) { - errorString += key + " "; - } - dispatch( - toggleSnackbar( - true, - { - labelName: "API Error", - labelKey: payload.serviceError, - }, - "info" - ) - ); - } else { - dispatch( - toggleSnackbar( - true, - { - labelName: "", - labelKey: "BND_SUCCESS", - }, - "success" - ) - ); - let userAction = getQueryArg(window.location.href, "action"); - if (userAction == "EDIT") { - setTimeout( - () => - (window.location.href = "/employee/birth-common/getCertificate"), - 2000 - ); - } else { - setTimeout(() => location.reload(), 2000); - } - } - } else { - // dispatch( - // setRoute( - // `/lams-citizen/acknowledgement?applicationNumber=${applicationNumber}&status=${status}&purpose=${purpose}` - // ) - // ); - } - } catch (error) { - dispatch( - toggleSnackbar( - true, - { - labelName: "API Error", - labelKey: "BND_SESSION_EXPIRED", - }, - "info" - ) - ); - } - dispatch(toggleSpinner()); -}; - -const getCommonApplyFooter = (children) => { - return { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "apply-wizard-footer", - }, - children, - }; -}; - -export const footer = getCommonApplyFooter({ - resetButton: { - componentPath: "Button", - props: { - variant: "outlined", - color: "primary", - style: { - minWidth: "200px", - height: "48px", - marginRight: "16px", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "Previous Step", - labelKey: "BND_COMMON_NEW", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - location.reload(); - }, - }, - visible: getQueryArg(window.location.href, "action") != "EDIT", - }, - submitButton: { - componentPath: "Button", - props: { - variant: "contained", - color: "primary", - className: "submit-btn leaseApplicationSubmitButton", - style: { - minWidth: "180px", - height: "48px", - marginRight: "16px", - borderRadius: "inherit", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "Previous Step", - labelKey: - getQueryArg(window.location.href, "action") == "EDIT" - ? "CORE_COMMON_UPDATE" - : "CORE_COMMON_SUBMIT", - }), - }, - onClickDefination: { - action: "condition", - callBack: callBackSubmit, - }, - //visible: (getQueryArg(window.location.href, "action")!="VIEW"), - }, -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd-common/fullBirthCertDetailsCard.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd-common/fullBirthCertDetailsCard.js deleted file mode 100644 index a62392d0064..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd-common/fullBirthCertDetailsCard.js +++ /dev/null @@ -1,549 +0,0 @@ -import { - getCommonCard, - getCommonTitle, - getCommonSubHeader, - getCommonGrayCard, - getCommonContainer, - getLabelWithValue, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import get from "lodash/get"; -import { setRoute } from "egov-ui-framework/ui-redux/app/actions"; -import { - checkValueForNA, - getLabel, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { genderValues } from "./../../../../ui-utils/constants"; -import { convertEpochToDateWithTimeIST, ifUserRoleExists } from "../utils"; - -const addSpace = (data) => { - return "" + checkValueForNA(data); -}; - -const addMoneySuffix = (data) => { - data = checkValueForNA(data); - return data === "NA" ? data : data + " /-"; -}; - -const checkNoData = (data) => { - data = checkValueForNA(data); - return data === "NA" ? "-" : data; -}; - -const getGenderStr = (data) => { - data = checkValueForNA(data); - data = data != "NA" ? genderValues[data] : data; - return data; -}; - -export const getPersonDetailsForm = (type, inJsonPath) => { - return getCommonContainer({ - firstName: getLabelWithValue( - { - labelName: "BND_FIRSTNAME_LABEL", - labelKey: "BND_FIRSTNAME_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.firstname`, - callBack: checkNoData, - } - ), - middlename: getLabelWithValue( - { - labelName: "BND_MIDDLENAME_LABEL", - labelKey: "BND_MIDDLENAME_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.middlename`, - callBack: checkNoData, - } - ), - lastname: getLabelWithValue( - { - labelName: "BND_LASTNAME_LABEL", - labelKey: "BND_LASTNAME_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.lastname`, - callBack: checkNoData, - } - ), - aadharNo: getLabelWithValue( - { - labelName: "BND_AADHAR_NO", - labelKey: "BND_AADHAR_NO", - }, - { - jsonPath: inJsonPath + `.${type}.aadharno`, - callBack: checkNoData, - } - ), - emailId: getLabelWithValue( - { - labelName: "BND_EMAIL_ID", - labelKey: "BND_EMAIL_ID", - }, - { - jsonPath: inJsonPath + `.${type}.emailid`, - callBack: checkNoData, - } - ), - mobNo: getLabelWithValue( - { - labelName: "CORE_COMMON_MOBILE_NUMBER", - labelKey: "CORE_COMMON_MOBILE_NUMBER", - }, - { - jsonPath: inJsonPath + `.${type}.mobileno`, - callBack: checkNoData, - } - ), - education: getLabelWithValue( - { - labelName: "BND_EDUCATION", - labelKey: "BND_EDUCATION", - }, - { - jsonPath: inJsonPath + `.${type}.education`, - callBack: checkNoData, - } - ), - profession: getLabelWithValue( - { - labelName: "BND_PROFESSION", - labelKey: "BND_PROFESSION", - }, - { - jsonPath: inJsonPath + `.${type}.proffession`, - callBack: checkNoData, - } - ), - nationality: getLabelWithValue( - { - labelName: "BND_NATIONALITY", - labelKey: "BND_NATIONALITY", - }, - { - jsonPath: inJsonPath + `.${type}.nationality`, - callBack: checkNoData, - } - ), - religion: getLabelWithValue( - { - labelName: "BND_RELIGION", - labelKey: "BND_RELIGION", - }, - { - jsonPath: inJsonPath + `.${type}.religion`, - callBack: checkNoData, - } - ), - }); -}; - -export const getAddressForm = (type, inJsonPath) => { - return getCommonContainer({ - buildingNo: getLabelWithValue( - { - labelName: "BND_BUILDINGNO_LABEL", - labelKey: "BND_BUILDINGNO_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.buildingno`, - callBack: checkNoData, - } - ), - houseNo: getLabelWithValue( - { - labelName: "BND_HOUSENO_LABEL", - labelKey: "BND_HOUSENO_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.houseno`, - callBack: checkNoData, - } - ), - streetname: getLabelWithValue( - { - labelName: "BND_STREETNAME_LABEL", - labelKey: "BND_STREETNAME_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.streetname`, - callBack: checkNoData, - } - ), - locality: getLabelWithValue( - { - labelName: "BND_LOCALITY_LABEL", - labelKey: "BND_LOCALITY_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.locality`, - callBack: checkNoData, - } - ), - tehsil: getLabelWithValue( - { - labelName: "BND_TEHSIL_LABEL", - labelKey: "BND_TEHSIL_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.tehsil`, - callBack: checkNoData, - } - ), - district: getLabelWithValue( - { - labelName: "BND_DISTRICT_LABEL", - labelKey: "BND_DISTRICT_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.district`, - callBack: checkNoData, - } - ), - city: getLabelWithValue( - { - labelName: "BND_CITY_LABEL", - labelKey: "BND_CITY_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.city`, - callBack: checkNoData, - } - ), - state: getLabelWithValue( - { - labelName: "BND_STATE_LABEL", - labelKey: "BND_STATE_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.state`, - callBack: checkNoData, - } - ), - pinno: getLabelWithValue( - { - labelName: "BND_PINNO_LABEL", - labelKey: "BND_PINNO_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.pinno`, - callBack: checkNoData, - } - ), - country: getLabelWithValue( - { - labelName: "BND_COUNTRY_LABEL", - labelKey: "BND_COUNTRY_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.country`, - callBack: checkNoData, - } - ), - }); -}; -export const getFullBirthCertDetailsCard = (inJsonPath) => { - return getCommonCard({ - header: getCommonTitle( - { - labelName: "", - labelKey: "BND_REGISTRATION", - }, - { - style: { - marginBottom: 18, - }, - } - ), - editButton: { - componentPath: "Button", - props: { - variant: "contained", - color: "primary", - style: { - minWidth: "50px", - height: "30px", - float: "right", - borderRadius: "inherit", - }, - }, - visible: false, - children: { - previousButtonLabel: getLabel({ - labelName: "Previous Step", - labelKey: "CORE_COMMON_EDIT", - }), - }, - - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - const newRegData = _.clone( - get( - state.screenConfiguration.preparedFinalObject, - "bnd.viewFullCertDetails", - [] - ), - true - ); - let id = newRegData["id"]; - let applyUrl = `/birth-employee/newRegistration?action=EDIT&certificateId=${id}&module=birth`; - dispatch(setRoute(applyUrl)); - }, - }, - }, - registrationInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_REGISTRATION", - }, - { - style: { - marginBottom: 18, - }, - } - ), - registrationInfoCont: getCommonContainer({ - registrationNo: getLabelWithValue( - { - labelName: "BND_REG_NO_LABEL", - labelKey: "BND_REG_NO_LABEL", - }, - { - jsonPath: inJsonPath + ".registrationno", - callBack: checkNoData, - } - ), - hospitalName: getLabelWithValue( - { - labelName: "BND_HOSPITALNAME_LABEL", - labelKey: "BND_HOSPITALNAME_LABEL", - }, - { - jsonPath: inJsonPath + ".hospitalname", - callBack: checkNoData, - } - ), - dateOfRegistration: getLabelWithValue( - { - labelName: "BND_DOR", - labelKey: "BND_DOR", - }, - { - jsonPath: inJsonPath + ".dateofreport", - callBack: convertEpochToDateWithTimeIST, - } - ), - }), - }), - childInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_INFO_OF_CHILD", - }, - { - style: { - marginBottom: 18, - }, - } - ), - infoOfChild: getCommonContainer({ - dob: getLabelWithValue( - { - labelName: "BND_BIRTH_DOB", - labelKey: "BND_BIRTH_DOB", - }, - { - jsonPath: inJsonPath + ".dateofbirth", - callBack: convertEpochToDateWithTimeIST, - } - ), - gender: getLabelWithValue( - { - labelName: "BND_GENDER", - labelKey: "BND_GENDER", - }, - { - jsonPath: inJsonPath + ".genderStr", - callBack: checkNoData, - } - ), - firstName: getLabelWithValue( - { - labelName: "BND_FIRSTNAME_LABEL", - labelKey: "BND_FIRSTNAME_LABEL", - }, - { - jsonPath: inJsonPath + ".firstname", - callBack: checkNoData, - } - ), - middlename: getLabelWithValue( - { - labelName: "BND_MIDDLENAME_LABEL", - labelKey: "BND_MIDDLENAME_LABEL", - }, - { - jsonPath: inJsonPath + ".middlename", - callBack: checkNoData, - } - ), - lastname: getLabelWithValue( - { - labelName: "BND_LASTNAME_LABEL", - labelKey: "BND_LASTNAME_LABEL", - }, - { - jsonPath: inJsonPath + ".lastname", - callBack: checkNoData, - } - ), - }), - }), - placeInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_BIRTH_PLACE", - }, - { - style: { - marginBottom: 18, - }, - } - ), - placeOfBirth: getCommonContainer({ - firstName: getLabelWithValue( - { - labelName: "BND_BIRTH_PLACE", - labelKey: "BND_BIRTH_PLACE", - }, - { - jsonPath: inJsonPath + ".placeofbirth", - callBack: checkNoData, - } - ), - }), - }), - fathersInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_FATHERS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - fathersInfo: getPersonDetailsForm("birthFatherInfo", inJsonPath), - }), - mothersInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_MOTHERS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - mothersInfo: getPersonDetailsForm("birthMotherInfo", inJsonPath), - }), - addrTimeOfBirth: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_PRESENT_ADDR_DURING_BIRTH", - }, - { - style: { - marginBottom: 18, - }, - } - ), - addrTimeOfBirth: getAddressForm("birthPresentaddr", inJsonPath), - }), - permAddressofParents: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_BIRTH_ADDR_PERM", - }, - { - style: { - marginBottom: 18, - }, - } - ), - permAddressofParents: getAddressForm("birthPermaddr", inJsonPath), - }), - informantsInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_INFORMANTS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - informantInfo: getCommonContainer({ - informantName: getLabelWithValue( - { - labelName: "CORE_COMMON_NAME", - labelKey: "CORE_COMMON_NAME", - }, - { - jsonPath: inJsonPath + `.informantsname`, - callBack: checkNoData, - } - ), - informantsAddress: getLabelWithValue( - { - labelName: "BND_ADDRESS", - labelKey: "BND_ADDRESS", - }, - { - jsonPath: inJsonPath + `.informantsaddress`, - callBack: checkNoData, - } - ), - }), - }), - remarksInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_REMARKS_LABEL", - }, - { - style: { - marginBottom: 18, - }, - } - ), - informantInfo: getCommonContainer({ - remarks: getLabelWithValue( - { - labelName: "BND_REMARKS_LABEL", - labelKey: "BND_REMARKS_LABEL", - }, - { - jsonPath: inJsonPath + `.remarks`, - callBack: checkNoData, - } - ), - }), - }), - }); -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd-common/fullDeathCertDetailsCard.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd-common/fullDeathCertDetailsCard.js deleted file mode 100644 index 49761db0a89..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd-common/fullDeathCertDetailsCard.js +++ /dev/null @@ -1,574 +0,0 @@ -import { - getCommonCard, - getCommonTitle, - getCommonSubHeader, - getCommonGrayCard, - getCommonContainer, - getLabelWithValue, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import get from "lodash/get"; -import { setRoute } from "egov-ui-framework/ui-redux/app/actions"; -import { - checkValueForNA, - getLabel, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { genderValues } from "./../../../../ui-utils/constants"; -import { convertEpochToDateWithTimeIST, ifUserRoleExists } from "../utils"; - -const addSpace = (data) => { - return "" + checkValueForNA(data); -}; - -const addMoneySuffix = (data) => { - data = checkValueForNA(data); - return data === "NA" ? data : data + " /-"; -}; - -const checkNoData = (data) => { - data = checkValueForNA(data); - return data === "NA" ? "-" : data; -}; - -const getGenderStr = (data) => { - data = checkValueForNA(data); - data = data != "NA" ? genderValues[data] : data; - return data; -}; - -export const getPersonDetailsForm = (type, inJsonPath) => { - return getCommonContainer({ - firstName: getLabelWithValue( - { - labelName: "BND_FIRSTNAME_LABEL", - labelKey: "BND_FIRSTNAME_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.firstname`, - callBack: checkNoData, - } - ), - middlename: getLabelWithValue( - { - labelName: "BND_MIDDLENAME_LABEL", - labelKey: "BND_MIDDLENAME_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.middlename`, - callBack: checkNoData, - } - ), - lastname: getLabelWithValue( - { - labelName: "BND_LASTNAME_LABEL", - labelKey: "BND_LASTNAME_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.lastname`, - callBack: checkNoData, - } - ), - aadharNo: getLabelWithValue( - { - labelName: "BND_AADHAR_NO", - labelKey: "BND_AADHAR_NO", - }, - { - jsonPath: inJsonPath + `.${type}.aadharno`, - callBack: checkNoData, - } - ), - emailId: getLabelWithValue( - { - labelName: "BND_EMAIL_ID", - labelKey: "BND_EMAIL_ID", - }, - { - jsonPath: inJsonPath + `.${type}.emailid`, - callBack: checkNoData, - } - ), - mobNo: getLabelWithValue( - { - labelName: "CORE_COMMON_MOBILE_NUMBER", - labelKey: "CORE_COMMON_MOBILE_NUMBER", - }, - { - jsonPath: inJsonPath + `.${type}.mobileno`, - callBack: checkNoData, - } - ), - }); -}; - -export const getAddressForm = (type, inJsonPath) => { - return getCommonContainer({ - buildingNo: getLabelWithValue( - { - labelName: "BND_BUILDINGNO_LABEL", - labelKey: "BND_BUILDINGNO_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.buildingno`, - callBack: checkNoData, - } - ), - houseNo: getLabelWithValue( - { - labelName: "BND_HOUSENO_LABEL", - labelKey: "BND_HOUSENO_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.houseno`, - callBack: checkNoData, - } - ), - streetname: getLabelWithValue( - { - labelName: "BND_STREETNAME_LABEL", - labelKey: "BND_STREETNAME_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.streetname`, - callBack: checkNoData, - } - ), - locality: getLabelWithValue( - { - labelName: "BND_LOCALITY_LABEL", - labelKey: "BND_LOCALITY_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.locality`, - callBack: checkNoData, - } - ), - tehsil: getLabelWithValue( - { - labelName: "BND_TEHSIL_LABEL", - labelKey: "BND_TEHSIL_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.tehsil`, - callBack: checkNoData, - } - ), - district: getLabelWithValue( - { - labelName: "BND_DISTRICT_LABEL", - labelKey: "BND_DISTRICT_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.district`, - callBack: checkNoData, - } - ), - city: getLabelWithValue( - { - labelName: "BND_CITY_LABEL", - labelKey: "BND_CITY_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.city`, - callBack: checkNoData, - } - ), - state: getLabelWithValue( - { - labelName: "BND_STATE_LABEL", - labelKey: "BND_STATE_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.state`, - callBack: checkNoData, - } - ), - pinno: getLabelWithValue( - { - labelName: "BND_PINNO_LABEL", - labelKey: "BND_PINNO_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.pinno`, - callBack: checkNoData, - } - ), - country: getLabelWithValue( - { - labelName: "BND_COUNTRY_LABEL", - labelKey: "BND_COUNTRY_LABEL", - }, - { - jsonPath: inJsonPath + `.${type}.country`, - callBack: checkNoData, - } - ), - }); -}; - -export const getFullDeathCertDetailsCard = (inJsonPath) => { - return getCommonCard({ - header: getCommonTitle( - { - labelName: "", - labelKey: "BND_REGISTRATION", - }, - { - style: { - marginBottom: 18, - }, - } - ), - editButton: { - componentPath: "Button", - props: { - variant: "contained", - color: "primary", - style: { - minWidth: "50px", - height: "30px", - float: "right", - borderRadius: "inherit", - }, - }, - visible: false, - children: { - previousButtonLabel: getLabel({ - labelName: "Previous Step", - labelKey: "CORE_COMMON_EDIT", - }), - }, - - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - const newRegData = _.clone( - get( - state.screenConfiguration.preparedFinalObject, - "bnd.viewFullCertDetails", - [] - ), - true - ); - let id = newRegData["id"]; - let applyUrl = `/death-employee/newRegistration?action=EDIT&certificateId=${id}&module=death`; - dispatch(setRoute(applyUrl)); - }, - }, - }, - registrationInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_REGISTRATION", - }, - { - style: { - marginBottom: 18, - }, - } - ), - registrationInfoCont: getCommonContainer({ - registrationNo: getLabelWithValue( - { - labelName: "BND_REG_NO_LABEL", - labelKey: "BND_REG_NO_LABEL", - }, - { - jsonPath: inJsonPath + ".registrationno", - callBack: checkNoData, - } - ), - hospitalName: getLabelWithValue( - { - labelName: "BND_HOSPITALNAME_LABEL", - labelKey: "BND_HOSPITALNAME_LABEL", - }, - { - jsonPath: inJsonPath + ".hospitalname", - callBack: checkNoData, - } - ), - dateOfRegistration: getLabelWithValue( - { - labelName: "BND_DOR", - labelKey: "BND_DOR", - }, - { - jsonPath: inJsonPath + ".dateofreport", - callBack: convertEpochToDateWithTimeIST, - } - ), - }), - }), - childInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_INFO_OF_DECEASED", - }, - { - style: { - marginBottom: 18, - }, - } - ), - infoOfChild: getCommonContainer({ - dob: getLabelWithValue( - { - labelName: "BND_DEATH_DOB", - labelKey: "BND_DEATH_DOB", - }, - { - jsonPath: inJsonPath + ".dateofdeath", - callBack: convertEpochToDateWithTimeIST, - } - ), - gender: getLabelWithValue( - { - labelName: "BND_GENDER", - labelKey: "BND_GENDER", - }, - { - jsonPath: inJsonPath + ".genderStr", - callBack: checkNoData, - } - ), - firstName: getLabelWithValue( - { - labelName: "BND_FIRSTNAME_LABEL", - labelKey: "BND_FIRSTNAME_LABEL", - }, - { - jsonPath: inJsonPath + ".firstname", - callBack: checkNoData, - } - ), - middlename: getLabelWithValue( - { - labelName: "BND_MIDDLENAME_LABEL", - labelKey: "BND_MIDDLENAME_LABEL", - }, - { - jsonPath: inJsonPath + ".middlename", - callBack: checkNoData, - } - ), - lastname: getLabelWithValue( - { - labelName: "BND_LASTNAME_LABEL", - labelKey: "BND_LASTNAME_LABEL", - }, - { - jsonPath: inJsonPath + ".lastname", - callBack: checkNoData, - } - ), - eidNo: getLabelWithValue( - { - labelName: "BND_EIDNO", - labelKey: "BND_EIDNO", - }, - { - jsonPath: inJsonPath + ".eidno", - callBack: checkNoData, - } - ), - aadharNo: getLabelWithValue( - { - labelName: "BND_AADHAR_NO", - labelKey: "BND_AADHAR_NO", - }, - { - jsonPath: inJsonPath + ".aadharno", - callBack: checkNoData, - } - ), - nationality: getLabelWithValue( - { - labelName: "BND_NATIONALITY", - labelKey: "BND_NATIONALITY", - }, - { - jsonPath: inJsonPath + ".nationality", - callBack: checkNoData, - } - ), - religion: getLabelWithValue( - { - labelName: "BND_RELIGION", - labelKey: "BND_RELIGION", - }, - { - jsonPath: inJsonPath + ".religion", - callBack: checkNoData, - } - ), - }), - }), - placeInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_DEATH_PLACE", - }, - { - style: { - marginBottom: 18, - }, - } - ), - placeOfDeath: getCommonContainer({ - firstName: getLabelWithValue( - { - labelName: "BND_DEATH_PLACE", - labelKey: "BND_DEATH_PLACE", - }, - { - jsonPath: inJsonPath + ".placeofdeath", - callBack: checkNoData, - } - ), - icdCode: getLabelWithValue( - { - labelName: "BND_ICDCODE", - labelKey: "BND_ICDCODE", - }, - { - jsonPath: inJsonPath + ".icdcode", - callBack: checkNoData, - } - ), - }), - }), - spouseInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_SPOUSES_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - spouseInfo: getPersonDetailsForm("deathSpouseInfo", inJsonPath), - }), - fathersInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_FATHERS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - fathersInfo: getPersonDetailsForm("deathFatherInfo", inJsonPath), - }), - mothersInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_MOTHERS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - mothersInfo: getPersonDetailsForm("deathMotherInfo", inJsonPath), - }), - addrTimeOfDeath: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_PRESENT_ADDR_DURING_DEATH", - }, - { - style: { - marginBottom: 18, - }, - } - ), - addrTimeOfDeath: getAddressForm("deathPresentaddr", inJsonPath), - }), - permAddressofParents: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_DEATH_ADDR_PERM", - }, - { - style: { - marginBottom: 18, - }, - } - ), - permAddressofParents: getAddressForm("deathPermaddr", inJsonPath), - }), - informantsInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_INFORMANTS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - informantInfo: getCommonContainer({ - informantName: getLabelWithValue( - { - labelName: "CORE_COMMON_NAME", - labelKey: "CORE_COMMON_NAME", - }, - { - jsonPath: inJsonPath + `.informantsname`, - callBack: checkNoData, - } - ), - informantsAddress: getLabelWithValue( - { - labelName: "BND_ADDRESS", - labelKey: "BND_ADDRESS", - }, - { - jsonPath: inJsonPath + `.informantsaddress`, - callBack: checkNoData, - } - ), - }), - }), - remarksInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_REMARKS_LABEL", - }, - { - style: { - marginBottom: 18, - }, - } - ), - informantInfo: getCommonContainer({ - remarks: getLabelWithValue( - { - labelName: "BND_REMARKS_LABEL", - labelKey: "BND_REMARKS_LABEL", - }, - { - jsonPath: inJsonPath + `.remarks`, - callBack: checkNoData, - } - ), - }), - }), - }); -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd-common/fullViewCertificate.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd-common/fullViewCertificate.js deleted file mode 100644 index 798ced0e69c..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd-common/fullViewCertificate.js +++ /dev/null @@ -1,165 +0,0 @@ -import { - getCommonCardWithHeader, - getLabel, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { - prepareFinalObject, - handleScreenConfigurationFieldChange as handleField, -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; //returns action object -import { - getCommonCard, - getCommonContainer, - getCommonHeader, - getDivider, - getCommonCaption, - getCommonSubHeader, - getCommonParagraph, - getCommonTitle, - getStepperObject, - getBreak, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { ifUserRoleExists, loadFullCertDetails } from "./../utils"; -import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; -import { getFullBirthCertDetailsCard } from "./fullBirthCertDetailsCard"; -import { getFullDeathCertDetailsCard } from "./fullDeathCertDetailsCard"; -import { setRoute } from "egov-ui-framework/ui-redux/app/actions"; -import get from "lodash/get"; - -const getCommonApplyFooter = (children) => { - return { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "apply-wizard-footer", - }, - children, - }; -}; -export const footer = getCommonApplyFooter({ - submitButton: { - componentPath: "Button", - props: { - variant: "contained", - color: "primary", - className: "submit-btn leaseApplicationSubmitButton", - style: { - minWidth: "180px", - height: "48px", - marginRight: "16px", - borderRadius: "inherit", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "Previous Step", - labelKey: "CORE_COMMON_EDIT", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - let module = getQueryArg(window.location.href, "module"); - const newRegData = _.clone( - get( - state.screenConfiguration.preparedFinalObject, - "bnd.viewFullCertDetails", - [] - ), - true - ); - let id = newRegData["id"]; - let applyUrl = `/${module}-employee/newRegistration?action=EDIT&certificateId=${id}&module=${module}`; - dispatch(setRoute(applyUrl)); - }, - }, - visible: - ifUserRoleExists("BIRTH_APPLICATION_EDITOR") || - ifUserRoleExists("DEATH_APPLICATION_EDITOR"), - }, -}); - -const header = getCommonHeader({ - labelName: "Search Certificate", - labelKey: "BND_BIRTH_SEARCH_DOWNLOAD", -}); - -const fullViewCertificate = { - uiFramework: "material-ui", - name: "fullViewCertificate", - beforeInitScreen: (action, state, dispatch) => { - let tenantId = getQueryArg(window.location.href, "tenantId"); - let id = getQueryArg(window.location.href, "certificateId"); - let module = getQueryArg(window.location.href, "module"); - - let data = { tenantId: tenantId, id: id, module: module }; - - loadFullCertDetails(action, state, dispatch, data).then((response) => { - //response = {BirthCertificate:[{"birthFatherInfo":{"firstname":"TEst","middlename":"TEst","lastname":"TEst","aadharno":"111111111111","emailid":"test@test.com","mobileno":"9444444444","education":"TEst","profession":"TEst","nationality":"TEst","religion":"TEst"},"birthMotherInfo":{"firstname":"TEst","middlename":"TEst","lastname":"TEst","aadharno":"111111111111","emailid":"test@test.com","mobileno":"9444444444","education":"TEst","profession":"TEst","nationality":"TEst","religion":"TEst"},"birthPresentaddr":{"buildingno":"TEst","houseno":"TEst","streetname":"TEst","locality":"TEst","tehsil":"TEst","district":"TEst","city":"TEst","state":"TEst","pinno":"512465","country":"TEst"},"birthPermaddr":{"buildingno":"TEst","houseno":"TEst","streetname":"TEst","locality":"TEst","tehsil":"TEst","district":"TEst","city":"TEst","state":"TEst","pinno":"512465","country":"TEst"},"registrationno":"test","hospitalname":"VAIJAYANTI HOSPITAL","dateofreportepoch":"2021-03-16","dateofbirthepoch":"2021-03-11","genderStr":"Male","firstname":"TEst","middlename":"TEst","lastname":"TEst","placeofbirth":"TEst","informantsname":"TEst","informantsaddress":"TEst","remarks":"asdf"}]}; - //response = {DeathCertificate:[{"deathFatherInfo":{"firstname":"TEst","middlename":"TEst","lastname":"TEst","aadharno":"111111111111","emailid":"test@test.com","mobileno":"9444444444","education":"TEst","profession":"TEst","nationality":"TEst","religion":"TEst"},"deathMotherInfo":{"firstname":"TEst","middlename":"TEst","lastname":"TEst","aadharno":"111111111111","emailid":"test@test.com","mobileno":"9444444444","education":"TEst","profession":"TEst","nationality":"TEst","religion":"TEst"},"deathPresentaddr":{"buildingno":"TEst","houseno":"TEst","streetname":"TEst","locality":"TEst","tehsil":"TEst","district":"TEst","city":"TEst","state":"TEst","pinno":"512465","country":"TEst"},"deathPermaddr":{"buildingno":"TEst","houseno":"TEst","streetname":"TEst","locality":"TEst","tehsil":"TEst","district":"TEst","city":"TEst","state":"TEst","pinno":"512465","country":"TEst"},"registrationno":"test","hospitalname":"VAIJAYANTI HOSPITAL","dateofreportepoch":"2021-03-16","dateofdeathepoch":"2021-03-11","genderStr":"Male","firstname":"TEst","middlename":"TEst","lastname":"TEst","placeofdeath":"TEst","informantsname":"TEst","informantsaddress":"TEst","remarks":"asdf"}]}; - if ( - module == "birth" && - response && - response.BirthCertificate && - response.BirthCertificate.length > 0 - ) { - dispatch( - prepareFinalObject( - "bnd.viewFullCertDetails", - response.BirthCertificate[0] - ) - ); - } else if ( - module == "death" && - response && - response.DeathCertificate && - response.DeathCertificate.length > 0 - ) { - dispatch( - prepareFinalObject( - "bnd.viewFullCertDetails", - response.DeathCertificate[0] - ) - ); - } - }); - - return action; - }, - - components: { - div1: { - uiFramework: "custom-atoms", - componentPath: "Div", - visible: getQueryArg(window.location.href, "module") == "birth", - props: { - disableValidation: true, - }, - children: { - details: getFullBirthCertDetailsCard("bnd.viewFullCertDetails"), - }, - }, - div2: { - uiFramework: "custom-atoms", - componentPath: "Div", - visible: getQueryArg(window.location.href, "module") == "death", - props: { - disableValidation: true, - }, - children: { - details: getFullDeathCertDetailsCard("bnd.viewFullCertDetails"), - }, - }, - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "common-div-css", - }, - children: { - details: footer, - }, - }, - }, -}; - -export default fullViewCertificate; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd/birthCertDetailsCard.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd/birthCertDetailsCard.js deleted file mode 100644 index 9026fd86186..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd/birthCertDetailsCard.js +++ /dev/null @@ -1,227 +0,0 @@ -import { - getCommonContainer, - getDivider, - getCommonGrayCard, - getLabelWithValue, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { checkValueForNA } from "egov-ui-framework/ui-config/screens/specs/utils"; -import {genderValues} from "./../../../../ui-utils/constants"; -import {convertEpochToDateWithTimeIST} from "../utils"; - -const addSpace = data => { - return ""+checkValueForNA(data);; -}; - -const addMoneySuffix = data => { - data = checkValueForNA(data); - return data==="NA"? data: data+" /-"; -}; - -const checkNoData = data => { - data = checkValueForNA(data); - return data==="NA"? "-": data; -}; - -const getGenderStr = data => { - data = checkValueForNA(data); - data = data!="NA"?genderValues[data]:data; - return data; -}; - -export const getBirthCertDetailsCard = (inJsonPath) => { - - return getCommonGrayCard({ - - // value2: getCommonValue({ - // jsonPath: inJsonPath + ".detailsAndMutDate", - // callBack: addSpace - // }), - certDetailsContainer: getCommonContainer( - { - name: getLabelWithValue( - { - labelName: "Name", - labelKey: "BND_NAME_LABEL" - }, - { - jsonPath: inJsonPath + ".fullName", - callBack: checkNoData - } - ), - genderStr: getLabelWithValue( - { - labelName: "Gender", - labelKey: "BND_GENDER_LABEL" - }, - { - jsonPath: inJsonPath + ".genderStr", - //callBack: getGenderStr - } - ) - }), - //divider1: getDivider(), - certDetailsContainer2: getCommonContainer( - { - dob: getLabelWithValue( - { - labelName: "Date of Birth", - labelKey: "BND_DOB_LABEL" - }, - { - jsonPath: inJsonPath + ".dateofbirth", - callBack: convertEpochToDateWithTimeIST - } - ), - placeOfBirth: getLabelWithValue( - { - labelName: "Place of Birth", - labelKey: "BND_BIRTH_LABEL" - }, - { - jsonPath: inJsonPath + ".placeofbirth", - callBack: checkNoData - } - ) - }), - //divider2: getDivider(), - certDetailsContainer3: getCommonContainer( - { - nameOfMother: getLabelWithValue( - { - labelName: "Name of Mother", - labelKey: "BND_MOTHER_NAME_LABEL" - }, - { - jsonPath: inJsonPath + ".birthMotherInfo.fullName", - callBack: checkNoData - } - ), - nameOfFather: getLabelWithValue( - { - labelName: "Name of Father", - labelKey: "BND_FATHER_NAME_LABEL" - }, - { - jsonPath: inJsonPath + ".birthFatherInfo.fullName", - callBack: checkNoData - } - ), - }, - { - style: { - overflow: "visible" - } - } - ), - divider2: getDivider(), - // certDetailsContainer4: getCommonContainer( - // { - // mothersUid: getLabelWithValue( - // { - // labelName: "Mother's Aadhar No", - // labelKey: "Mother's Aadhar No" - // }, - // { - // jsonPath: inJsonPath + ".birthMotherInfo.aadharno", - // //callBack: checkNoData - // } - // ), - // fathersUid: getLabelWithValue( - // { - // labelName: "Father's Aadhar No", - // labelKey: "Father's Aadhar No" - // }, - // { - // jsonPath: inJsonPath + ".birthFatherInfo.aadharno", - // //callBack: checkNoData - // } - // ), - // }, - // { - // style: { - // overflow: "visible" - // } - // } - // ), - //divider4: getDivider(), - certDetailsContainer6: getCommonContainer( - { - presentAddr: getLabelWithValue( - { - labelName: "ADDRESS OF PARENTS AT THE TIME OF BIRTH OF THE CHILD", - labelKey: "BND_ADDRESS_OF_PARENTS_TIME_BIRTH" - }, - { - jsonPath: inJsonPath + ".birthPresentaddr.fullAddress", - callBack: checkNoData - } - ), - permenantAddr: getLabelWithValue( - { - labelName: "PERMANENT ADDRESS OF THE PARENTS", - labelKey: "BND_ADDRESS_OF_PARENTS" - }, - { - jsonPath: inJsonPath + ".birthPermaddr.fullAddress", - callBack: checkNoData - } - ), - }, - { - style: { - overflow: "visible" - } - } - ), - divider5: getDivider(), - certDetailsContainer7: getCommonContainer( - { - registrationNo: getLabelWithValue( - { - labelName: "Registration Number", - labelKey: "BND_REGISTRATION_NUMBER" - }, - { - jsonPath: inJsonPath + ".registrationno", - callBack: checkNoData - } - ), - dateOfRegistration: getLabelWithValue( - { - labelName: "Date of Registration", - labelKey: "BND_DATE_REGISTRATION" - }, - { - jsonPath: inJsonPath + ".dateofreport", - callBack: convertEpochToDateWithTimeIST - } - ), - }, - { - style: { - overflow: "visible" - } - } - ), - divider6: getDivider(), - certDetailsContainer8: getCommonContainer( - { - dateOfIssue: getLabelWithValue( - { - labelName: "Date of Issue", - labelKey: "BND_DATE_ISSUE" - }, - { - jsonPath: inJsonPath + ".dateofissue", - callBack: convertEpochToDateWithTimeIST - } - ), - }, - { - style: { - overflow: "visible" - } - } - ) - }); -} \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd/deathCertDetailsCard.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd/deathCertDetailsCard.js deleted file mode 100644 index 142152ca547..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd/deathCertDetailsCard.js +++ /dev/null @@ -1,237 +0,0 @@ -import { - getCommonContainer, - getDivider, - getCommonGrayCard, - getLabelWithValue, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { checkValueForNA } from "egov-ui-framework/ui-config/screens/specs/utils"; -import {genderValues} from "./../../../../ui-utils/constants"; -import {convertEpochToDateWithTimeIST} from "../utils"; - -const addSpace = data => { - return ""+checkValueForNA(data);; -}; - -const addMoneySuffix = data => { - data = checkValueForNA(data); - return data==="NA"? data: data+" /-"; -}; - -const checkNoData = data => { - data = checkValueForNA(data); - return data==="NA"? "-": data; -}; - -const getGenderStr = data => { - data = checkValueForNA(data); - data = data!="NA"?genderValues(data):data; - return data; -}; - -export const getDeathCertDetailsCard = (inJsonPath) => { - - return getCommonGrayCard({ - - // value2: getCommonValue({ - // jsonPath: inJsonPath + ".detailsAndMutDate", - // callBack: addSpace - // }), - certDetailsContainer: getCommonContainer( - { - name: getLabelWithValue( - { - labelName: "Name", - labelKey: "BND_NAME_LABEL" - }, - { - jsonPath: inJsonPath + ".fullName", - callBack: checkNoData - } - ), - genderStr: getLabelWithValue( - { - labelName: "Gender", - labelKey: "BND_GENDER_LABEL" - }, - { - jsonPath: inJsonPath + ".genderStr", - //callBack: getGenderStr - } - ), - age: getLabelWithValue( - { - labelName: "Age", - labelKey: "BND_AGE_LABEL" - }, - { - jsonPath: inJsonPath + ".age", - //callBack: getGenderStr - } - ), - }), - //divider1: getDivider(), - certDetailsContainer2: getCommonContainer( - { - dob: getLabelWithValue( - { - labelName: "Date of death", - labelKey: "BND_DATE_DEATH" - }, - { - jsonPath: inJsonPath + ".dateofdeath", - callBack: convertEpochToDateWithTimeIST - } - ), - placeOfDeath: getLabelWithValue( - { - labelName: "Place of Death", - labelKey: "BND_PLACE_DEATH" - }, - { - jsonPath: inJsonPath + ".placeofdeath", - callBack: checkNoData - } - ) - }), - //divider2: getDivider(), - certDetailsContainer3: getCommonContainer( - { - nameOfMother: getLabelWithValue( - { - labelName: "Name of Mother", - labelKey: "BND_NAME_MOTHER_LABEL" - }, - { - jsonPath: inJsonPath + ".deathMotherInfo.fullName", - callBack: checkNoData - } - ), - nameOfFather: getLabelWithValue( - { - labelName: "Name of Father", - labelKey: "BND_NAME_FATHER_LABEL" - }, - { - jsonPath: inJsonPath + ".deathFatherInfo.fullName", - callBack: checkNoData - } - ), - }, - { - style: { - overflow: "visible" - } - } - ), - divider2: getDivider(), - // certDetailsContainer4: getCommonContainer( - // { - // mothersUid: getLabelWithValue( - // { - // labelName: "Mother's Aadhar No", - // labelKey: "Mother's Aadhar No" - // }, - // { - // jsonPath: inJsonPath + ".deathMotherInfo.aadharno", - // //callBack: checkNoData - // } - // ), - // fathersUid: getLabelWithValue( - // { - // labelName: "Father's Aadhar No", - // labelKey: "Father's Aadhar No" - // }, - // { - // jsonPath: inJsonPath + ".deathFatherInfo.aadharno", - // //callBack: checkNoData - // } - // ), - // }, - // { - // style: { - // overflow: "visible" - // } - // } - // ), - //divider4: getDivider(), - certDetailsContainer6: getCommonContainer( - { - presentAddr: getLabelWithValue( - { - labelName: "", - labelKey: "BND_DEATH_DECEASED_ADDRESS" - }, - { - jsonPath: inJsonPath + ".deathPresentaddr.fullAddress", - callBack: checkNoData - } - ), - permenantAddr: getLabelWithValue( - { - labelName: "", - labelKey: "BND_DEATH_DECEASED_PERM_ADDRESS" - }, - { - jsonPath: inJsonPath + ".deathPermaddr.fullAddress", - callBack: checkNoData - } - ), - }, - { - style: { - overflow: "visible" - } - } - ), - divider5: getDivider(), - certDetailsContainer7: getCommonContainer( - { - registrationNo: getLabelWithValue( - { - labelName: "Registration Number", - labelKey: "BND_REGISTRATION_NUMBER" - }, - { - jsonPath: inJsonPath + ".registrationno", - callBack: checkNoData - } - ), - dateOfRegistration: getLabelWithValue( - { - labelName: "Date of Registration", - labelKey: "BND_DATE_REGISTRATION" - }, - { - jsonPath: inJsonPath + ".dateofreport", - callBack: convertEpochToDateWithTimeIST - } - ), - }, - { - style: { - overflow: "visible" - } - } - ), - divider6: getDivider(), - certDetailsContainer8: getCommonContainer( - { - dateOfIssue: getLabelWithValue( - { - labelName: "Date of Issue", - labelKey: "BND_DATE_ISSUE" - }, - { - jsonPath: inJsonPath + ".dateofissue", - callBack: convertEpochToDateWithTimeIST - } - ), - }, - { - style: { - overflow: "visible" - } - } - ) - }); -} \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd/viewCertificate.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd/viewCertificate.js deleted file mode 100644 index ae535ac0f1c..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/bnd/viewCertificate.js +++ /dev/null @@ -1,88 +0,0 @@ -import {getCommonCardWithHeader,getLabel} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { prepareFinalObject, handleScreenConfigurationFieldChange as handleField} - from "egov-ui-framework/ui-redux/screen-configuration/actions"; //returns action object -import { getCommonCard, getCommonContainer, getCommonHeader,getDivider,getCommonCaption, getCommonSubHeader,getCommonParagraph, getCommonTitle, getStepperObject, getBreak } from "egov-ui-framework/ui-config/screens/specs/utils"; -import {loadCertDetails} from "./../utils"; -import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; -import {getBirthCertDetailsCard} from "./birthCertDetailsCard"; -import {getDeathCertDetailsCard} from "./deathCertDetailsCard"; - - -const header = getCommonHeader({ - labelName: "Search Certificate", - labelKey: "BND_BIRTH_SEARCH_DOWNLOAD" -}); - -const viewCertificate = { - uiFramework: "material-ui", - name: "viewCertificate", - beforeInitScreen:(action, state, dispatch) => { - - let tenantId = getQueryArg(window.location.href, "tenantId"); - let id = getQueryArg(window.location.href, "id"); - let birthcertificateno = getQueryArg(window.location.href, "birthcertificateno"); - let deathcertificateno = getQueryArg(window.location.href, "deathcertificateno"); - let module = getQueryArg(window.location.href, "module"); - - let data = {tenantId:tenantId, id:id, birthcertificateno: birthcertificateno, deathcertificateno:deathcertificateno, module:module}; - - loadCertDetails(action, state, dispatch, data).then((response) => { - if (module=="birth" && response && response.BirthCertificate && response.BirthCertificate.length>0) { - dispatch(prepareFinalObject("bnd.viewCertDetails", response.BirthCertificate[0])); - } - else - if (module=="death" && response && response.DeathCertificate && response.DeathCertificate.length>0) { - dispatch(prepareFinalObject("bnd.viewCertDetails", response.DeathCertificate[0])); - } - }); - - return action; - - }, - - components:{ - mainDiv: getCommonCard({ - caption2: getCommonCaption({ - labelName: "NOTE", - labelKey: "BND_NOTE_VIEW_CERTIFICATE" - }), - divider1: getDivider(), - header: getCommonSubHeader( - { - labelName: "Certificate", - labelKey: "BND_CERTIFICATE_DETAILS" - }, - { - style: { - marginBottom: 18 - } - } - ), - div1: { - uiFramework: "custom-atoms", - componentPath: "Div", - visible:getQueryArg(window.location.href, "module")=="birth", - props: { - disableValidation: true, - }, - children: { - details: getBirthCertDetailsCard("bnd.viewCertDetails") - } - }, - div2: { - uiFramework: "custom-atoms", - componentPath: "Div", - visible:getQueryArg(window.location.href, "module")=="death", - props: { - disableValidation: true, - }, - children: { - details: getDeathCertDetailsCard("bnd.viewCertDetails") - } - } - }) - } - } - - -export default viewCertificate; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-citizen/home.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-citizen/home.js deleted file mode 100644 index f42a60c4c5b..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-citizen/home.js +++ /dev/null @@ -1,118 +0,0 @@ -import React from "react"; -import { getCommonHeader } from "egov-ui-framework/ui-config/screens/specs/utils"; -//import { cityPicker } from "./citypicker"; -import DeathIcon from "../../../../ui-atoms-local/Icons/DeathIcon"; -import GetCertIcon from "../../../../ui-atoms-local/Icons/GetCertIcon"; -import HelpIcon from "../../../../ui-atoms-local/Icons/HelpIcon"; -import "../utils/index.css"; -import { getRequiredDocData } from "egov-ui-framework/ui-utils/commons"; -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -const header = getCommonHeader( - { - labelName: "Lams", - labelKey: "BND_DEATH_COMMON" - }, - { - classes: { - root: "common-header-cont" - } - } -); - -const cardItems = [ - { - label: { - labelKey: "BND_DEATH_APPLY_CERT", - labelName: "Apply for Certificate" - }, - icon: , - route: "../death-common/getCertificate" - }, - { - label: { - labelKey: "BND_MY_REQUESTS", - labelName: "My Applications" - }, - icon: , - route: "../death-citizen/myApplications" - }, - // { - // label: { - // labelKey: "BND_HOW_IT_WORKS", - // labelName: "How It Works" - // }, - // icon: , - // route: "how-it-works-death" - // } - - -]; - -const tradeLicenseSearchAndResult = { - uiFramework: "material-ui", - name: "home", - beforeInitScreen: (action, state, dispatch) => { - return action; - }, - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - // props: { - // className: "common-div-css" - // }, - children: { - header: header, - applyCard: { - uiFramework: "custom-molecules", - componentPath: "LandingPage", - props: { - items: cardItems, - history: {} - } - } - // listCard: { - // uiFramework: "custom-molecules-local", - // moduleName: "egov-tradelicence", - // componentPath: "HowItWorks" - // } - } - }, - - // cityPickerDialog: { - // componentPath: "Dialog", - // props: { - // open: false, - // maxWidth: "md" - // }, - // children: { - // dialogContent: { - // componentPath: "DialogContent", - // props: { - // classes: { - // root: "city-picker-dialog-style" - // } - // // style: { minHeight: "180px", minWidth: "365px" } - // }, - // children: { - // popup: cityPicker - // } - // } - // } - // }, - // adhocDialog: { - // uiFramework: "custom-containers", - // componentPath: "DialogContainer", - // props: { - // open: false, - // maxWidth: false, - // screenKey: "home" - // }, - // children: { - // popup: {} - // } - // } - } -}; - -export default tradeLicenseSearchAndResult; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-citizen/how-it-works-death.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-citizen/how-it-works-death.js deleted file mode 100644 index bbf00f31135..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-citizen/how-it-works-death.js +++ /dev/null @@ -1,37 +0,0 @@ - -import { getCommonHeader } from "egov-ui-framework/ui-config/screens/specs/utils"; -const header = getCommonHeader( - { - labelName: "How It Works", - labelKey: "BND_HOW_IT_WORKS" - }, - { - classes: { - root: "common-header-cont" - } - } -); -const screenConfig = { - uiFramework: "material-ui", - name: "HowItWorks", - - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - children: { - header: header, - howitWoorksDiv:{ - uiFramework: "custom-molecules-local", - moduleName: "egov-bnd", - componentPath: "HowItWorks", - props: { - className: "common-div-css" - } - } - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-citizen/myApplications.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-citizen/myApplications.js deleted file mode 100644 index 9274cecec62..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-citizen/myApplications.js +++ /dev/null @@ -1,136 +0,0 @@ -import { - getCommonHeader, - getCommonCard, - getCommonTitle, -} from "egov-ui-framework/ui-config/screens/specs/utils"; - -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; //returns action object -import { - toggleSpinner, - toggleSnackbar, -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { httpRequest } from "egov-ui-framework/ui-utils/api"; -import { convertEpochToDate } from "egov-ui-framework/ui-config/screens/specs/utils"; -import { downloadReceipt } from "../utils"; -import { downloadReceiptFromFilestoreID } from "egov-common/ui-utils/commons"; - -const getMyApplications = async (action, state, dispatch) => { - try { - const queryParams = []; - let payload = null; - payload = await httpRequest( - "post", - "birth-death-services/death/_searchapplications", - "_search", - queryParams, - {} - ); - return payload; - } catch (e) { - toggleSnackbar( - true, - { - labelName: "Could not load lease Details", - labelKey: "ERR_API_ERROR", - }, - "error" - ); - } - return null; -}; - -const certificateDowloadHandler = (fileStoreId) => { - //Download Certificate by sending filestoreid and mode - downloadReceiptFromFilestoreID(fileStoreId, "download"); -}; - -const downloadReceiptHandler = async (consumerCode, tenantId) => { - downloadReceipt(consumerCode, tenantId); -}; - -const header = getCommonHeader( - { - labelName: "My Applications", - labelKey: "BND_CITIZEN_MY_APPLICATIONS", - }, - { - classes: { - root: "common-header-cont", - }, - } -); - -const myApplications = { - uiFramework: "material-ui", - name: "myApplications", - beforeInitScreen: (action, state, dispatch) => { - dispatch(toggleSpinner()); - getMyApplications().then((response) => { - dispatch(toggleSpinner()); - try { - dispatch(prepareFinalObject("searchResults", response.applications)); - } catch (e) { - toggleSnackbar( - true, - { - labelName: "Could not load lease Details", - labelKey: "ERR_API_ERROR", - }, - "error" - ); - } - }); - - - return action; - }, - - afterInitForm: (action, state, dispatch) => {}, - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - children: { - header: header, - applicationsCard: { - uiFramework: "custom-molecules-local", - moduleName: "egov-bnd", - componentPath: "SingleApplication", - visible: true, - props: { - contents: [ - { - label: "BND_APPL_DATE", - jsonPath: "applicationDate", - isDate: true, - }, - { - label: "BND_CERT_REG_NO", - jsonPath: "regNo", - }, - { - label: "BND_CERT_NAME", - jsonPath: "name", - }, - { - label: "BND_APPL_TYPE", - jsonPath: "applicationType", - prefix: "BND_", - }, - { - label: "BND_APPL_STATUS", - jsonPath: "status", - prefix: "BND_STATUS_", - }, - ], - moduleName: "DEATH", - homeURL: "/death-citizen/home", - certificateDowloadHandler: certificateDowloadHandler, - downloadReceiptHandler: downloadReceiptHandler, - }, - }, - }, - }, - }, -}; -export default myApplications; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/apply_old.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/apply_old.js deleted file mode 100644 index fd6cfa9a791..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/apply_old.js +++ /dev/null @@ -1,119 +0,0 @@ -import { - getCommonCardWithHeader, - getLabel -} from "egov-ui-framework/ui-config/screens/specs/utils"; - -import { getCommonCard, getCommonContainer, getCommonHeader, getCommonParagraph, getCommonTitle, getStepperObject } from "egov-ui-framework/ui-config/screens/specs/utils"; -import {billSearchCard} from "./deathSearchResources/deathSearchCard"; - -export const stepsData = [ - { labelName: "Search", labelKey: "BND_SEARCH" }, - { labelName: "Review Details", labelKey: "BND_DETAILS" }, - { labelName: "Pay", labelKey: "BND_PAY" }, -]; - -export const stepper = getStepperObject( - { props: { activeStep: 0 } }, - stepsData -); - -export const formwizardFirstStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form1" - }, - children: { - //searchForm - } - }; - -export const formwizardSecondStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form2" - }, - children: { - - }, - visible: false -}; - -export const formwizardThirdStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form3" - }, - children: { - - }, - visible: false -}; - -export const formwizardFourthStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form4" - }, - children: { - - }, - visible: false -}; - -export const header = getCommonContainer({ - header: - getCommonHeader({ - labelName: 'Apply for New Trade License' , - labelKey: "APPLY" - }), - applicationNumber: { - uiFramework: "custom-atoms-local", - moduleName: "egov-tradelicence", - componentPath: "ApplicationNoContainer", - props: { - number: "NA" - }, - visible: false - } -}); - -const screenConfig = { - uiFramework: "material-ui", - name: "mihyLoginScreen", - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "common-div-css" - }, - children: { - headerDiv: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - header: { - gridDefination: { - xs: 12, - sm: 10 - }, - ...header - } - } - }, - stepper, - formwizardFirstStep, - formwizardSecondStep, - formwizardThirdStep, - formwizardFourthStep, - //footer - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/deathSearchCard.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/deathSearchCard.js deleted file mode 100644 index a6e94943937..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/deathSearchCard.js +++ /dev/null @@ -1,677 +0,0 @@ -import { - getBreak, getCommonCaption, getCommonCard, - getCommonContainer, - getCommonHeader, getDateField, getDivider, getLabel, - getPattern, getSelectField, getTextField -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { - handleScreenConfigurationFieldChange as handleField, - prepareFinalObject -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { getTodaysDateInYMD } from "egov-ui-framework/ui-utils/commons"; -import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; -import get from "lodash/get"; -import { loadHospitals } from "./../../utils"; -import { disclaimerDialog } from "./disclaimerDialog"; -import { searchApiCall } from "./function"; -import "./index.css"; - -// const tenantId = process.env.REACT_APP_NAME === "Employee" ? getTenantId() : JSON.parse(getUserInfo()).permanentCity; -const resetFields = (state, dispatch) => { - //const tenantId = process.env.REACT_APP_NAME === "Employee" ? getTenantId() : JSON.parse(getUserInfo()).permanentCity; - - //Clear advanced Search - let componentPath = - "components.div.children.deathSearchCard.children.cardContent.children.searchContainer2.children.details.children"; - for (var child in get( - state, - "screenConfiguration.screenConfig.getCertificate." + componentPath - )) { - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.value", - "" - ) - ); - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.helperText", - "" - ) - ); - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.error", - false - ) - ); - } - - //Clear Mandatory Search Attributes - componentPath = - "components.div.children.deathSearchCard.children.cardContent.children.searchContainerCommon.children"; - for (var child in get( - state, - "screenConfiguration.screenConfig.getCertificate." + componentPath - )) { - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.value", - "" - ) - ); - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.helperText", - "" - ) - ); - dispatch( - handleField( - "getCertificate", - componentPath + "." + child, - "props.error", - false - ) - ); - } - if (!(process.env.REACT_APP_NAME === "Citizen")) { - let tenantId = getTenantId(); - dispatch(prepareFinalObject("bnd.death.tenantId", tenantId)); - } - dispatch( - prepareFinalObject("bnd.death.deathSearchResponse", []) - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.data", - [] - ) - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.tableData", - [] - ) - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.rows", - 0 - ) - ); - - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "visible", - false - ) - ); -}; - -const cbChanged = (action, state, dispatch) => { - let tenantId = get( - state.screenConfiguration.preparedFinalObject.bnd.death, - "tenantId" - ); - - loadHospitals(action, state, dispatch, "death", tenantId).then((response) => { - if(response && response.MdmsRes && response.MdmsRes["birth-death-service"] && response.MdmsRes["birth-death-service"].hospitalList) - { - const hptList= response.MdmsRes["birth-death-service"].hospitalList; - const newList=[...hptList.filter(hos=>hos.active), { - hospitalName : "Others" }] - for (let hospital of newList) { - hospital.code = hospital.hospitalName; - hospital.name = hospital.hospitalName; - } - dispatch(prepareFinalObject("bnd.allHospitals", newList)); - }else{ - dispatch(prepareFinalObject("bnd.allHospitals", [{code:"Others",name:"Others"}])); - } - }); -}; - -const setVisibilityOptionsSet1 = (state, dispatch, visible) => { - dispatch( - handleField( - "getCertificate", - "components.div.children.deathSearchCard.children.cardContent.children.searchContainer1", - "visible", - visible - ) - ); -}; - -const setVisibilityOptionsSet2 = (state, dispatch, visible) => { - dispatch( - handleField( - "getCertificate", - "components.div.children.deathSearchCard.children.cardContent.children.searchContainer2", - "visible", - visible - ) - ); -}; - -export const showHideConfirmationPopup = (state, dispatch) => { - let toggle = get( - state.screenConfiguration.screenConfig["getCertificate"], - "components.div.children.deathSearchCard.children.cardContent.children.disclaimerDialog.props.open", - false - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.deathSearchCard.children.cardContent.children.disclaimerDialog", - "props.open", - !toggle - ) - ); -}; - -export const searchSetCommon = getCommonContainer({ - cantonmentSelect: { - uiFramework: "custom-containers-local", - moduleName: "egov-bnd", - componentPath: "AutosuggestContainer", - jsonPath: "bnd.death.tenantId", - sourceJsonPath: "bnd.allTenants", - visible: true, - autoSelect: false, - props: { - autoSelect: false, - isDisabled: false, - isClearable: true, - className: "autocomplete-dropdown", - suggestions: [], - disabled: false, //getQueryArg(window.location.href, "action") === "EDITRENEWAL"? true:false, - label: { - labelName: "Select Cantonment", - labelKey: "BND_APPL_CANT", - }, - placeholder: { - labelName: "Select Cantonment", - labelKey: "BND_APPL_CANT_PLACEHOLDER", - }, - localePrefix: { - moduleName: "TENANT", - masterName: "TENANTS", - }, - labelsFromLocalisation: true, - required: true, - jsonPath: "bnd.death.tenantId", - sourceJsonPath: "bnd.allTenants", - inputLabelProps: { - shrink: true, - }, - onClickHandler: (action, state, dispatch) => { - }, - }, - gridDefination: { - xs: 12, - sm: 4, - }, - required: true, - beforeFieldChange: (action, state, dispatch) => {}, - afterFieldChange: (action, state, dispatch) => { - cbChanged(action, state, dispatch); - }, - }, - dob: getDateField({ - label: { labelName: "DOB", labelKey: "BND_DEATH_DOB" }, - placeholder: { - labelName: "Date of Death", - labelKey: "BND_DEATH_DOB_PLACEHOLDER", - }, - jsonPath: "bnd.death.dob", - gridDefination: { - xs: 12, - sm: 4, - }, - pattern: getPattern("Date"), - errorMessage: "ERR_INVALID_DATE", - required: true, - props: { - inputProps: { - max: getTodaysDateInYMD(), - }, - }, - visible: process.env.REACT_APP_NAME === "Citizen" ? true : false, - }), - fromdate: getDateField({ - label: { labelName: "DOD", labelKey: "BND_FROM_DATE" }, - placeholder: { - labelName: "FromDate of Search", - labelKey: "BND_DEATH_DOB_PLACEHOLDER", - }, - jsonPath: "bnd.death.fromdate", - gridDefination: { - xs: 12, - sm: 4, - }, - pattern: getPattern("Date"), - errorMessage: "ERR_INVALID_DATE", - required: true, - props: { - inputProps: { - max: getTodaysDateInYMD(), - }, - }, - visible: process.env.REACT_APP_NAME === "Employee" ? true : false, - }), - todate: getDateField({ - label: { labelName: "DOD", labelKey: "BND_TO_DATE" }, - placeholder: { - labelName: "ToDate of Search", - labelKey: "BND_DEATH_DOB_PLACEHOLDER", - }, - jsonPath: "bnd.death.todate", - gridDefination: { - xs: 12, - sm: 4, - }, - pattern: getPattern("Date"), - errorMessage: "ERR_INVALID_DATE", - required: true, - props: { - inputProps: { - max: getTodaysDateInYMD(), - }, - }, - visible: process.env.REACT_APP_NAME === "Employee" ? true : false, - }), - gender: getSelectField({ - label: { - labelName: "Select Gender", - labelKey: "BND_GENDER", - }, - placeholder: { - labelName: "Select Gender", - labelKey: "BND_GENDER_PLACEHOLDER", - }, - required: true, - localePrefix: { - moduleName: "BND", - masterName: "GENDER", - }, - data: [ - { - code: "1", - label: "MALE", - }, - { - code: "2", - label: "FEMALE", - }, - { - code: "3", - label: "TRANSGENDER", - }, - ], - props: { - disabled: false, - }, - gridDefination: { - xs: 12, - sm: 4, - }, - jsonPath: "bnd.death.gender", - autoSelect: true, - visible: true, - beforeFieldChange: (action, state, dispatch) => {}, - afterFieldChange: (action, state, dispatch) => {}, - }) -}); - -export const searchSet1 = getCommonContainer({ - // registrationNo: getTextField({ - // label: { - // labelName: "Registration No", - // labelKey: "BND_REG_NO_LABEL" - // }, - // placeholder: { - // labelName: "Registration No", - // labelKey: "BND_REG_NO_LABEL" - // }, - // required:true, - // visible: true, - // jsonPath: "bnd.death.registrationNo", - // gridDefination: { - // xs: 12, - // sm: 4 - // } - // }), - clickHereLink: { - uiFramework: "custom-atoms-local", - moduleName: "egov-bnd", - componentPath: "LinkButton", - props: { - disableValidation: true, - url: "teat", - labelKey: "BND_DONT_KNOW_REGNO_MSG", - onClickDefination: { - callBack: (state, dispatch) => { - setVisibilityOptionsSet1(state, dispatch, false); - setVisibilityOptionsSet2(state, dispatch, true); - }, - }, - }, - gridDefination: { xs: 12, sm: 4, md: 4 }, - }, -}); - -export const searchSet2 = getCommonContainer({ - nameOfPerson: getTextField({ - label: { - labelName: "Name", - labelKey: "BND_PERSON_NAME_LABEL", - }, - placeholder: { - labelName: "Name", - labelKey: "BND_PERSON_NAME_PLACEHOLDER", - }, - required: false, - visible: true, - jsonPath: "bnd.death.name", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - spouseName: getTextField({ - label: { - labelName: "Spouse Name", - labelKey: "BND_SPOUSE_NAME_LABEL", - }, - placeholder: { - labelName: "Name", - labelKey: "BND_SPOUSE_NAME_PLACEHOLDER", - }, - required: false, - visible: true, - jsonPath: "bnd.death.spouseName", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - hospital: { - uiFramework: "custom-containers-local", - moduleName: "egov-bnd", - componentPath: "AutosuggestContainer", - jsonPath: "bnd.death.hosptialId", - sourceJsonPath: "bnd.allHospitals", - visible: true, - autoSelect: true, - props: { - autoSelect: true, - //isClearable:true, - className: "autocomplete-dropdown", - suggestions: [], - disabled: false, //getQueryArg(window.location.href, "action") === "EDITRENEWAL"? true:false, - label: { - labelName: "Select Hospital", - labelKey: "BND_DEATH_APPL_HOSP", - }, - placeholder: { - labelName: "Select Hospital", - labelKey: "BND_DEATH_APPL_HOSP_PLACEHOLDER", - }, - localePrefix: { - moduleName: "TENANT", - masterName: "TENANTS", - }, - labelsFromLocalisation: false, - required: false, - jsonPath: "bnd.death.hosptialId", - sourceJsonPath: "bnd.allHospitals", - inputLabelProps: { - shrink: true, - }, - onClickHandler: (action, state, dispatch) => { - }, - }, - gridDefination: { - xs: 12, - sm: 4, - }, - beforeFieldChange: (action, state, dispatch) => {}, - afterFieldChange: (action, state, dispatch) => {}, - }, - registrationNo: getTextField({ - label: { - labelName: "Registration No", - labelKey: "BND_REG_NO_LABEL", - }, - placeholder: { - labelName: "Registration No", - labelKey: "BND_REG_NO_LABEL", - }, - required: false, - visible: true, - jsonPath: "bnd.death.registrationNo", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - fathersName: getTextField({ - label: { - labelName: "Father's Name", - labelKey: "BND_FATHERS_NAME_LABEL", - }, - placeholder: { - labelName: "Father's Name", - labelKey: "BND_FATHERS_NAME_PLACEHOLDER", - }, - required: false, - visible: true, - jsonPath: "bnd.death.fathersName", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - mothersName: getTextField({ - label: { - labelName: "Mother's Name", - labelKey: "BND_MOTHERS_NAME_LABEL", - }, - placeholder: { - labelName: "Mother's Name", - labelKey: "BND_MOTHERS_NAME_PLACEHOLDER", - }, - required: false, - visible: true, - jsonPath: "bnd.death.mothersName", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - // clickHereLink: { - // uiFramework: "custom-atoms-local", - // moduleName: "egov-bnd", - // componentPath: "LinkButton", - // props: { - // disableValidation:true, - // url: "teat" , - // labelKey:"BND_DONT_KNOW_DETAILS_MSG", - // onClickDefination: { - // callBack: (state, dispatch) => { - // setVisibilityOptionsSet1(state,dispatch,true); - // setVisibilityOptionsSet2(state,dispatch,false); - // } - // }, - // }, - // gridDefination: { xs: 12, sm: 4, md: 4 } - // }, -}); - -export const buttonContainer = getCommonContainer({ - firstCont: { - uiFramework: "custom-atoms", - componentPath: "Div", - gridDefination: { - xs: 12, - sm: 3, - }, - }, - resetButton: { - componentPath: "Button", - gridDefination: { - xs: 12, - sm: 3, - // align: "center" - }, - props: { - variant: "outlined", - style: { - color: "#696969", - // backgroundColor: "#FE7A51", - border: "#696969 solid 1px", - borderRadius: "2px", - width: window.innerWidth > 480 ? "80%" : "100%", - height: "48px", - }, - }, - children: { - buttonLabel: getLabel({ - labelName: "RESET", - labelKey: "BND_RESET_BUTTON", - }), - }, - onClickDefination: { - action: "condition", - callBack: resetFields, - }, - }, - searchButton: { - componentPath: "Button", - gridDefination: { - xs: 12, - sm: 3, - // align: "center" - }, - props: { - variant: "contained", - style: { - color: "white", - backgroundColor: "#696969", - borderRadius: "2px", - width: window.innerWidth > 480 ? "80%" : "100%", - height: "48px", - }, - }, - children: { - buttonLabel: getLabel({ - labelName: "SEARCH", - labelKey: "BND_SEARCH_BUTTON", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - searchApiCall(state, dispatch); - }, - }, - }, - lastCont: { - uiFramework: "custom-atoms", - componentPath: "Div", - gridDefination: { - xs: 12, - sm: 3, - }, - }, -}); - -export const deathSearchCard = getCommonCard({ - header: getCommonHeader({ - labelName: "Search Bill", - labelKey: "BND_SEARCH_REGISTRY", - }), - // subheader: getCommonSubHeader({ - // labelName: "Provide at least one parameter to search for an application", - // labelKey: "ABG_SEARCH_BILL_COMMON_SUB_HEADER" - // }), - - break1: getBreak(), - searchContainerCommon: searchSetCommon, - //break1: getBreak(), - divider1: getDivider(), - searchContainer1: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: {}, - children: { - details: searchSet1, - }, - visible: false, - }, - importantNote2: getCommonCaption( - { - labelName: "Imp Note", - labelKey: "BND_SELECTION_NOTE", - }, - { - disableValidation: true, - style: { - color: "#ff8100", - fontSize: "16px", - }, - } - ), - break2: getBreak(), - searchContainer2: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: {}, - children: { - details: searchSet2, - }, - visible: true, - }, - buttonContainer: buttonContainer, - disclaimerDialog: { - componentPath: "Dialog", - props: { - open: false, - maxWidth: "sm", - disableValidation: true, - }, - children: { - dialogContent: { - componentPath: "DialogContent", - props: { - classes: { - root: "city-picker-dialog-style", - }, - // style: { minHeight: "180px", minWidth: "365px" } - }, - children: { - popup: disclaimerDialog, - }, - }, - }, - }, -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/disclaimerDialog.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/disclaimerDialog.js deleted file mode 100644 index 10d80ee5243..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/disclaimerDialog.js +++ /dev/null @@ -1,173 +0,0 @@ -import { - getBreak, - getCommonCaption, - getCommonContainer, - getCommonGrayCard, - getCommonHeader, - getDivider, - getLabel -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { toggleSnackbar } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import get from "lodash/get"; -import { triggerDownload } from "../../utils"; -import { showHideConfirmationPopup } from "./deathSearchCard"; - -const dSignAgreePath = "bnd.death.iAgree"; -export const disclaimerDialog = getCommonContainer({ - header: getCommonHeader( - { - labelName: "Confirm Download", - labelKey: "BND_IMPORTANT", - }, - { - style: { - fontSize: "20px", - }, - } - ), - divider1: getDivider(), - downloadNote: getCommonContainer({ - value0: getCommonCaption( - { - labelName: "", - labelKey: "BND_DOWNLOAD_NOTE", - }, - { - style: { - fontSize: "14px", - }, - } - ), - break1: getBreak(), - }), - confirmationContents: getCommonContainer({ - header: getCommonHeader( - { - labelName: "Confirm Download", - labelKey: "BND_DOWNLOAD_TERMS", - }, - { - style: { - fontSize: "20px", - }, - } - ), - termsContainer: getCommonGrayCard({ - value0: getCommonCaption( - { - labelName: - "Important : The application form is to be signed by the original lessee or his/her successors/heir. Otherwise considered invalid.", - labelKey: "BND_DOWNLOAD_TERMS_CONTENT1", - }, - { - style: { - fontSize: "14px", - }, - } - ), - break2: getBreak(), - }), - }), - - break2: getBreak, - checkBox: { - required: true, - uiFramework: "custom-atoms-local", - moduleName: "egov-bnd", - componentPath: "Checkbox", - props: { - label: { - labelKey: "BND_DOWNLOAD_IAGREE", - labelName: "I agree and wish to continue", - }, - jsonPath: dSignAgreePath, - }, - }, - - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - style: { - width: "100%", - textAlign: "center", - display: "flex", - flexDirection: "row-reverse", - }, - }, - children: { - yesButton: { - componentPath: "Button", - props: { - variant: "contained", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "20px", - marginTop: "16px", - boxShadow: "none", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "YES", - labelKey: "BND_DOWNLOAD_PROCEED", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - let iAgree = get( - state.screenConfiguration.preparedFinalObject, - dSignAgreePath - ); - if (iAgree) { - triggerDownload("death"); - showHideConfirmationPopup(state, dispatch, "getCertificate"); - } else { - dispatch( - toggleSnackbar( - true, - { - labelName: - "You have to agree to terms and conditions before you proceed.", - labelKey: "ERR_BND_DOWNLOAD_IAGREE", - }, - "error" - ) - ); - } - }, - }, - }, - cancelButton: { - componentPath: "Button", - props: { - variant: "outlined", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "4px", - marginTop: "16px", - color: "gray", - border: "none", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "NO", - labelKey: "BND_CANCEL_DOWNLOAD_IAGREE", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - showHideConfirmationPopup(state, dispatch, "getCertificate"); - }, - }, - }, - }, - }, -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/function.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/function.js deleted file mode 100644 index bcda45bc95d..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/function.js +++ /dev/null @@ -1,256 +0,0 @@ -import { - handleScreenConfigurationFieldChange as handleField, - prepareFinalObject, - toggleSnackbar -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { getLocaleLabels } from "egov-ui-framework/ui-utils/commons"; -import get from "lodash/get"; -import { searchForDeath } from "../../../../../ui-utils/commons"; -import { genderValues } from "../../../../../ui-utils/constants"; -import { convertDateToEpoch, convertEpochToDate, convertEpochToDateWithTimeIST, validateFields } from "../../utils"; - -export const searchApiCall = async (state, dispatch) => { - showHideTable(false, dispatch); - - let queryParams = [ - //{ key: "limit", value: "10" } - ]; - - let tenantId = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.tenantId" - ); - if (tenantId) queryParams.push({ key: "tenantId", value: tenantId }); - - let dateOfDeath = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.dob" - ); - let fromdate = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.fromdate" - ); - let todate = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.todate" - ); - if (dateOfDeath) { - queryParams.push({ - key: "dateOfDeath", - value: convertEpochToDate(convertDateToEpoch(dateOfDeath)).replaceAll( - "/", - "-" - ), - }); - } - if (fromdate) { - queryParams.push({ - key: "fromDate", - value: convertEpochToDate(convertDateToEpoch(fromdate)).replaceAll( - "/", - "-" - ), - }); - } - if (todate) { - queryParams.push({ - key: "toDate", - value: convertEpochToDate(convertDateToEpoch(todate)).replaceAll( - "/", - "-" - ), - }); - } - let gender = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.gender" - ); - if (gender) queryParams.push({ key: "gender", value: gender }); - - let registrationNo = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.registrationNo" - ); - if (registrationNo) - queryParams.push({ key: "registrationNo", value: registrationNo }); - - let hospitalId = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.hosptialId" - ); - if (hospitalId) queryParams.push({ key: "hospitalId", value: hospitalId }); - - let mothersName = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.mothersName" - ); - if (mothersName) queryParams.push({ key: "motherName", value: mothersName }); - - let fathersName = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.fathersName" - ); - if (fathersName) queryParams.push({ key: "fatherName", value: fathersName }); - - let spouseName = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.spouseName" - ); - if (spouseName) queryParams.push({ key: "spouseName", value: spouseName }); - - let name = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.name" - ); - if (name) queryParams.push({ key: "name", value: name }); - - let searchSet1Visible = get( - state.screenConfiguration, - "screenConfig.getCertificate.components.div.children.deathSearchCard.children.cardContent.children.searchContainer1.visible", - {} - ); - - const isSearchSet1Valid = validateFields( - "components.div.children.deathSearchCard.children.cardContent.children.searchContainer1.children.details.children", - state, - dispatch, - "getCertificate" - ); - const isSearchSet2Valid = validateFields( - "components.div.children.deathSearchCard.children.cardContent.children.searchContainer2.children.details.children", - state, - dispatch, - "getCertificate" - ); - const isSearchSetCommonValid = validateFields( - "components.div.children.deathSearchCard.children.cardContent.children.searchContainerCommon.children", - state, - dispatch, - "getCertificate" - ); - - if (!isSearchSetCommonValid) { - dispatch( - toggleSnackbar( - true, - { - labelName: "Please fill the required fields to search.", - labelKey: "BND_COMMON_REQ_FIELDS_ERR", - }, - "warning" - ) - ); - return; - } - if (fromdate && todate) { - let fromdateofsearch = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.fromdate" - ); - let todateepochofsearch = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.todate" - ); - if (fromdateofsearch > todateepochofsearch) { - dispatch( - toggleSnackbar( - true, - { - labelName: "", - labelKey: "From Date should not be before To Date ", - }, - "warning" - ) - ); - return; - } - } - - const responseFromAPI = await searchForDeath(dispatch, queryParams); - const deaths = (responseFromAPI && responseFromAPI.deathCerts) || []; - - const deathTableData = deaths.map((item) => { - return { - id: get(item, "id"), - registrationNo: get(item, "registrationno"), - nameOfChild: get(item, "fullName"), - dateOfdeath: get(item, "dateofdeath"), - gender: getLocaleLabels( - `BND_GENDER_${get(item, "gender")}`, - `BND_GENDER_${get(item, "gender")}` - ), - mothersName: get(item, "deathMotherInfo.fullName"), - fathersName: get(item, "deathFatherInfo.fullName"), - spouseName: get(item, "deathSpouseInfo.fullName"), - action: getActionItem(get(item, "counter")), - tenantId: get(item, "tenantid"), - payRequired: get(item, "payRequired"), - }; - }); - dispatch(prepareFinalObject("bnd.death.deathSearchResponse", deaths)); - - try { - let data = deathTableData.map((item) => ({ - ["BND_COMMON_TABLE_ID"]: item.id || "-", - ["BND_COMMON_TABLE_REGNO"]: item.registrationNo || "-", - ["BND_COMMON_NAME"]: item.nameOfChild || "-", - ["BND_DEATH_DATE"]: convertEpochToDateWithTimeIST(item.dateOfdeath), - ["BND_COMMON_GENDER"]: item.gender || "-", - ["BND_COMMON_MOTHERSNAME"]: item.mothersName || "-", - ["BND_COMMON_FATHERSNAME"]: item.fathersName || "-", - ["BND_SPOUSE_NAME_LABEL"]: item.spouseName || "-", - ["BND_COMMON_TABLE_ACTION"]: item.action || "-", - ["BUSINESS_SERVICE"]: "DEATH_CERT", - ["TENANT_ID"]: item.tenantId, - ["BND_VIEW_CERTIFICATE"]: "BND_VIEW_CERTIFICATE", - })); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.data", - data - ) - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.tableData", - deathTableData - ) - ); - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "props.rows", - deathTableData.length - ) - ); - - showHideTable(true, dispatch); - } catch (error) { - dispatch(toggleSnackbar(true, error.message, "error")); - } -}; - -const showHideTable = (booleanHideOrShow, dispatch) => { - dispatch( - handleField( - "getCertificate", - "components.div.children.searchResults", - "visible", - booleanHideOrShow - ) - ); -}; - -const getActionItem = (counter) => { - if (counter < 1) return "FREE_DOWNLOAD"; - else return "PAY_AND_DOWNLOAD"; -}; - -const getGenderValue = (genderCode) => { - return genderValues[genderCode]; -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/index.scss b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/index.scss deleted file mode 100644 index ee432d87f65..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/index.scss +++ /dev/null @@ -1,31 +0,0 @@ - .autocomplete-dropdown { - min-width: 80%; - position: absolute; - z-index: 1900; - max-height: 150px; - overflow: hidden; - } - .autocomplete-dropdown div { - min-width: 80%; - max-height: 150px; - overflow: auto; - } - @media only screen and (max-width: 768px) { - - .bd-search-header{ - #custom-atoms-headerDiv{ - flex-flow:inherit; - } - } - .bd-btn-hiw{ - flex-basis: unset; - align-self: self-end; - div{ - max-width:unset; - flex-basis: unset; - button{ - min-width: unset!important; - } - } - } - } \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/searchResults.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/searchResults.js deleted file mode 100644 index 7a49b84704a..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/deathSearchResources/searchResults.js +++ /dev/null @@ -1,246 +0,0 @@ -import React from "react"; -import { - sortByEpoch, - getEpochForDate, - getTextToLocalMapping, -} from "../../utils"; -import { - download, - downloadReceiptFromFilestoreID, - downloadChallan, -} from "egov-common/ui-utils/commons"; -import { getLocaleLabels } from "egov-ui-framework/ui-utils/commons"; -import { downloadCert } from "../../utils"; -import store from "ui-redux/store"; -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { showHideConfirmationPopup } from "./deathSearchCard"; - -export const searchResults = { - uiFramework: "custom-molecules", - componentPath: "Table", - visible: false, - props: { - columns: [ - // { - // labelName: "Bill No.", - // labelKey: "ABG_COMMON_TABLE_COL_BILL_NO", - // options: { - // filter: false, - // customBodyRender: (value, tableMeta, updateValue) => ( - // { - // const receiptQueryString = [ - // { - // key: 'challanNo', - // value: tableMeta.rowData[1] - // }, - // { key: 'tenantId', value: tableMeta.rowData[10] }]; - // downloadChallan(receiptQueryString,"download"); - // // downloadBill(tableMeta.rowData[1], tableMeta.rowData[10], tableMeta.rowData[9],tableMeta.rowData[12]); - // }} - // > - // {value} - // - // ) - // } - // }, - { - labelName: "Id", - labelKey: "BND_COMMON_TABLE_ID", - options: { - display: false, - viewColumns: false, - }, - }, - { - labelName: "Registration Number", - labelKey: "BND_COMMON_TABLE_REGNO", - }, - { - labelName: "Name", - labelKey: "BND_COMMON_NAME", - }, - { - labelName: "Death Date", - labelKey: "BND_DEATH_DATE", - }, - { - labelName: "Gender", - labelKey: "BND_COMMON_GENDER", - }, - { - labelName: "Mother's Name", - labelKey: "BND_COMMON_MOTHERSNAME", - }, - { - labelName: "Father's Name", - labelKey: "BND_COMMON_FATHERSNAME", - }, - { - labelName: "Spouse's Name", - labelKey: "BND_SPOUSE_NAME_LABEL", - }, - { - labelName: "Action", - labelKey: "BND_COMMON_TABLE_ACTION", - options: { - display: process.env.REACT_APP_NAME === "Citizen", - viewColumns: process.env.REACT_APP_NAME === "Citizen", - filter: false, - customBodyRender: (value, tableMeta) => - value === "PAY AND DOWNLOAD" - ? tableMeta.rowData[4] > 0 - ? getActionButton(value, tableMeta) - : tableMeta.rowData[4] <= 0 && tableMeta.rowData[13] - ? getActionButton(value, tableMeta) - : "" - : getActionButton(value, tableMeta), - }, - }, - // { - // labelName: "Status", - // labelKey: "ABG_COMMON_TABLE_COL_STATUS", - // options:{ - // filter: false, - // customBodyRender: value => ( - // - // {getLocaleLabels(value.toUpperCase(),value.toUpperCase())} - // - // ) - // } - // }, - // { - // labelName: "Action", - // labelKey: "ABG_COMMON_TABLE_COL_ACTION", - // options: { - // filter: false, - // customBodyRender: (value, tableMeta) => value === "PAY" ? (tableMeta.rowData[4] > 0 ? getActionButton(value, tableMeta):(tableMeta.rowData[4] <= 0 && tableMeta.rowData[13] ? getActionButton(value, tableMeta) : "")) : getActionButton(value, tableMeta) - // } - // }, - { - labelName: "Tenant Id", - labelKey: "TENANT_ID", - options: { - display: false, - viewColumns: false, - }, - }, - { - labelName: "Business Service", - labelKey: "BUSINESS_SERVICE", - options: { - display: false, - viewColumns: false, - }, - }, - { - labelName: "BND_VIEW_CERTIFICATE", - labelKey: "BND_VIEW_CERTIFICATE", - options: { - display: process.env.REACT_APP_NAME === "Employee", - viewColumns: process.env.REACT_APP_NAME === "Employee", - customBodyRender: (value, tableMeta) => - getViewButton(value, tableMeta), - }, - }, - // { - // labelName: "Pay Required", - // labelKey: "PAYREQUIRED", - // options: { - // display: false, - // viewColumns :false - // } - // } - ], - title: { - labelName: "Search Results for Death", - labelKey: "BND_SEARCH_TABLE_HEADER", - }, - rows: "", - options: { - filter: false, - download: false, - responsive: "stacked", - selectableRows: false, - hover: true, - ignoreFirstColumnHover: true, - rowsPerPageOptions: [10, 15, 20], - }, - customSortColumn: { - column: "Death Date", - sortingFn: (data, i, sortDateOrder) => { - const epochDates = data.reduce((acc, curr) => { - acc.push([...curr, getEpochForDate(curr[4], "dayend")]); - return acc; - }, []); - const order = sortDateOrder === "asc" ? true : false; - const finalData = sortByEpoch(epochDates, !order).map((item) => { - item.pop(); - return item; - }); - return { data: finalData, currentOrder: !order ? "asc" : "desc" }; - }, - }, - }, -}; - -const getActionButton = (value, tableMeta) => { - return ( - { - let tenantId = tableMeta.rowData[9]; - let id = tableMeta.rowData[0]; - let action = tableMeta.rowData[8]; - let businessService = tableMeta.rowData[10]; - - store.dispatch( - prepareFinalObject("bnd.death.download.certificateId", id) - ); - store.dispatch( - prepareFinalObject("bnd.death.download.tenantId", tenantId) - ); - store.dispatch( - prepareFinalObject( - "bnd.death.download.businessService", - businessService - ) - ); - - showHideConfirmationPopup( - store.getState(), - store.dispatch, - "getCertificate" - ); - - //} - }} - > - {getLocaleLabels(value, value)} - - ); -}; - -const getViewButton = (value, tableMeta) => { - return ( - { - let id = tableMeta.rowData[0]; - let tenantId = tableMeta.rowData[9]; - let url = `/employee/bnd-common/fullViewCertificate?tenantId=${tenantId}&certificateId=${id}&module=death`; - document.location.href = `${document.location.origin}${url}`; - }} - > - {getLocaleLabels(value, value)} - - ); -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/getCertificate.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/getCertificate.js deleted file mode 100644 index 786d39d5113..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/getCertificate.js +++ /dev/null @@ -1,201 +0,0 @@ -import { - getBreak, - getCommonHeader, - getLabel, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; //returns action object -import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; -import jp from "jsonpath"; -import { get, set } from "lodash"; -import { ifUserRoleExists, loadHospitals, loadMdmsData } from "./../utils"; -import { deathSearchCard } from "./deathSearchResources/deathSearchCard"; -import { searchResults } from "./deathSearchResources/searchResults"; -import "./deathSearchResources/index.css"; - -const header = getCommonHeader({ - labelName: "Search Certificate", - labelKey: "BND_DEATH_SEARCH_DOWNLOAD", -}); - -const getCertificate = { - uiFramework: "material-ui", - name: "getCertificate", - beforeInitScreen: (action, state, dispatch) => { - loadMdmsData(action, state, dispatch).then((response) => { - const tenants = get(response, "MdmsRes.tenant.tenants"); - //Requires City Module Updations of MDMS? tobechanged - let jpFilter = "$[?(@.code != 'pb')]"; - let onlyCBs = jp.query(tenants, jpFilter); - if (!(process.env.REACT_APP_NAME === "Citizen")) { - let tenantId = getTenantId(); - let currentCbFilter = "$[?(@.code == '" + tenantId + "')]"; - onlyCBs = jp.query(onlyCBs, currentCbFilter); - - dispatch(prepareFinalObject("bnd.death.tenantId", tenantId)); - set( - action.screenConfig, - "components.div.children.deathSearchCard.children.cardContent.children.searchContainerCommon.children.cantonmentSelect.props.isDisabled", - true - ); - set( - action.screenConfig, - "components.div.children.deathSearchCard.children.cardContent.children.searchContainerCommon.children.gender.props.required", - false - ); - set( - action.screenConfig, - "components.div.children.deathSearchCard.children.cardContent.children.searchContainerCommon.children.gender.required", - false - ); - loadHospitals(action, state, dispatch, "death", tenantId).then( - (response) => { - if ( - response && - response.MdmsRes && - response.MdmsRes["birth-death-service"] && - response.MdmsRes["birth-death-service"].hospitalList - ) { - const hptList = - response.MdmsRes["birth-death-service"].hospitalList; - const newList = [ - ...hptList.filter((hos) => hos.active), - { - hospitalName: "Others", - }, - ]; - for (let hospital of newList) { - hospital.code = hospital.hospitalName; - hospital.name = hospital.hospitalName; - } - dispatch(prepareFinalObject("bnd.allHospitals", newList)); - } else { - dispatch( - prepareFinalObject("bnd.allHospitals", [ - { code: "Others", name: "Others" }, - ]) - ); - } - } - ); - } - onlyCBs.sort((a, b) => (a.code > b.code ? 1 : -1)); - dispatch(prepareFinalObject("bnd.allTenants", onlyCBs)); - }); - - return action; - }, - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - className: "common-div-css bd-search-header", - id: "bndDeathSearch", - }, - children: { - headerDiv: { - uiFramework: "custom-atoms", - componentPath: "Container", - props: { - className: "bd-btn-hiw", - }, - - children: { - header: { - gridDefination: { - xs: 12, - sm: 6, - }, - ...header, - }, - groupBillButton: { - componentPath: "Button", - gridDefination: { - xs: 12, - sm: 6, - align: "right", - }, - visible: - process.env.REACT_APP_NAME !== "Citizen" && - ifUserRoleExists("DEATH_APPLICATION_CREATOR"), - props: { - variant: "contained", - color: "primary", - style: { - color: "white", - borderRadius: "2px", - width: "250px", - height: "48px", - }, - }, - children: { - plusIconInsideButton: { - uiFramework: "custom-atoms", - componentPath: "Icon", - props: { - iconName: "add", - style: { - fontSize: "24px", - }, - }, - }, - ButtonLabel: getLabel({ - labelName: "Group Bills", - labelKey: "ACTION_TEST_DEATH_NEW_REGISTRATION", - }), - }, - onClickDefination: { - action: "page_change", - path: - process.env.REACT_APP_SELF_RUNNING === "true" - ? `/egov-ui-framework/death-employee/newRegistration` - : `/death-employee/newRegistration`, - }, - }, - howitWorksButton: { - componentPath: "Button", - gridDefination: { - xs: 12, - sm: 6, - align: "right", - }, - visible: false, - props: { - //variant: "outlined", - color: "primary", - style: { - minWidth: "180px", - height: "48px", - marginRight: "45", - borderRadius: "inherit", - }, - }, - onClickDefination: { - action: "page_change", - path: `/death-common/how-it-works-death`, - }, - children: { - helpButtonIcon: { - uiFramework: "custom-atoms", - componentPath: "Icon", - props: { - iconName: "help-circle", - }, - }, - helpButtonLabel: getLabel({ - labelName: "Death How it Works", - labelKey: "BND_HELP", - }), - }, - }, - }, - }, - deathSearchCard, - breakAfterSearch: getBreak(), - searchResults, - }, - }, - }, -}; - -export default getCertificate; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/how-it-works-birth.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/how-it-works-birth.js deleted file mode 100644 index e4f8146eb48..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/how-it-works-birth.js +++ /dev/null @@ -1,36 +0,0 @@ -import { getCommonHeader } from "egov-ui-framework/ui-config/screens/specs/utils"; -const header = getCommonHeader( - { - labelName: "How It Works", - labelKey: "BND_HELP" - }, - { - classes: { - root: "common-header-cont" - } - } -); -const screenConfig = { - uiFramework: "material-ui", - name: "HowItWorks", - - components: { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - children: { - header: header, - howitWoorksDiv:{ - uiFramework: "custom-molecules-local", - moduleName: "egov-bnd", - componentPath: "HowItWorks", - props: { - className: "common-div-css" - } - } - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/login_old.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/login_old.js deleted file mode 100644 index 82e310823c1..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/login_old.js +++ /dev/null @@ -1,222 +0,0 @@ -import { - getCommonCardWithHeader, - getLabel -} from "egov-ui-framework/ui-config/screens/specs/utils"; - -import { getCommonCard, getCommonContainer, getCommonHeader, getCommonParagraph, getCommonTitle, getStepperObject } from "egov-ui-framework/ui-config/screens/specs/utils"; - - -export const stepsData = [ - { labelName: "Trade Details", labelKey: "TL_COMMON_TR_DETAILS" }, - { labelName: "Owner Details", labelKey: "TL_COMMON_OWN_DETAILS" }, - { labelName: "Documents", labelKey: "TL_COMMON_DOCS" }, - { labelName: "Summary", labelKey: "TL_COMMON_SUMMARY" } -]; - -export const stepper = getStepperObject( - { props: { activeStep: 0 } }, - stepsData -); - -export const formwizardFirstStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form1" - }, - children: { - - } - }; - -export const formwizardSecondStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form2" - }, - children: { - - }, - visible: false -}; - -export const formwizardThirdStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form3" - }, - children: { - - }, - visible: false -}; - -export const formwizardFourthStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form4" - }, - children: { - - }, - visible: false -}; - -export const header = getCommonContainer({ - header: - getCommonHeader({ - labelName: 'Apply for New Trade License' , - labelKey: "APPLY" - }), - applicationNumber: { - uiFramework: "custom-atoms-local", - moduleName: "egov-tradelicence", - componentPath: "ApplicationNoContainer", - props: { - number: "NA" - }, - visible: false - } -}); - -const screenConfig = { - uiFramework: "material-ui", - name: "mihyLoginScreen", - components: { - mihyLoginGrid: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - mihyEmptyRow: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4 - } - }, - mihyLoginItem: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4, - xs: 12 - }, - children: { - - headerDiv: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - header: { - gridDefination: { - xs: 12, - sm: 10 - }, - ...header - } - } - }, - stepper, - formwizardFirstStep, - formwizardSecondStep, - formwizardThirdStep, - formwizardFourthStep, - //footer, - - mihyLoginCard: getCommonCardWithHeader( - { - mihyloginDiv: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "text-center" - }, - children: { - mihyLoginUsername: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Email", - margin: "normal", - fullWidth: true, - autoFocus: true, - required: true, - iconObj: { - position: "end", - iconName: "email" - } - }, - required: true, - jsonPath: "body.mihy.username", - pattern: "^([a-zA-Z0-9@.])+$" - }, - mihyLoginPassword: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Password", - type: "password", - margin: "normal", - fullWidth: true, - required: true, - iconObj: { position: "end", iconName: "lock" } - }, - jsonPath: "body.mihy.password", - required: true, - pattern: "^([a-zA-Z0-9!])+$" - }, - mihyBreakOne: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyBreakTwo: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyLoginButton: { - componentPath: "Button", - props: { - color: "primary", - fullWidth: true - }, - children: { - mihyLoginButtonText: getLabel({label:"Let's go"}) - } - // onClickDefination:{ - // action:"submit", - // method:"get", - // endPoint:"afbc.com", - // purpose:"authLogin", - // redirectionUrl:"/" - // } - } - } - } - }, - { - mihyLoginHeader: { - componentPath: "Typography", - children: { - mihyLoginHeaderText: getLabel({label:"Login"}) - }, - props: { - align: "center", - variant: "title", - style: { - color: "white" - } - } - } - } - ) - } - } - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/register_old.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/register_old.js deleted file mode 100644 index 6934c8d95f0..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/register_old.js +++ /dev/null @@ -1,137 +0,0 @@ -import { - getCommonCardWithHeader, - getLabel -} from "egov-ui-framework/ui-config/screens/specs/utils"; - -const screenConfig = { - uiFramework: "material-ui", - name: "mihyRegisterScreen", - components: { - mihyRegisterGrid: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - mihyEmptyRow: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4 - } - }, - mihyRegisterItem: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4, - xs: 12 - }, - children: { - mihyRegisterCard: getCommonCardWithHeader( - { - mihyloginDiv: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "text-center" - }, - children: { - mihyRegisterUsername: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Email", - margin: "normal", - fullWidth: true, - autoFocus: true, - required: true, - iconObj: { - position: "end", - iconName: "email" - } - }, - required: true, - jsonPath: "body.mihy.username", - pattern: "^([a-zA-Z0-9@.])+$" - }, - mihyRegisterPassword: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Password", - type: "password", - margin: "normal", - fullWidth: true, - required: true, - iconObj: { position: "end", iconName: "lock" } - }, - jsonPath: "body.mihy.password", - required: true, - pattern: "^([a-zA-Z0-9!])+$" - }, - mihyRegisterConfirmPassword: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Confirm password", - type: "password", - margin: "normal", - fullWidth: true, - required: true, - iconObj: { position: "end", iconName: "confirmation_number" } - }, - jsonPath: "body.mihy.password", - required: true, - pattern: "^([a-zA-Z0-9!])+$" - }, - mihyBreakOne: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyBreakTwo: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyRegisterButton: { - componentPath: "Button", - props: { - color: "primary", - fullWidth: true - }, - children: { - mihyRegisterButtonText: getLabel({label:"Let's go"}) - } - // onClickDefination:{ - // action:"submit", - // method:"get", - // endPoint:"afbc.com", - // purpose:"authRegister", - // redirectionUrl:"/" - // } - } - } - } - }, - { - mihyRegisterHeader: { - componentPath: "Typography", - children: { - mihyRegisterHeaderText: getLabel({label:"Register"}) - }, - props: { - align: "center", - variant: "title", - style: { - color: "white" - } - } - } - } - ) - } - } - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/search_old.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/search_old.js deleted file mode 100644 index 82e310823c1..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-common/search_old.js +++ /dev/null @@ -1,222 +0,0 @@ -import { - getCommonCardWithHeader, - getLabel -} from "egov-ui-framework/ui-config/screens/specs/utils"; - -import { getCommonCard, getCommonContainer, getCommonHeader, getCommonParagraph, getCommonTitle, getStepperObject } from "egov-ui-framework/ui-config/screens/specs/utils"; - - -export const stepsData = [ - { labelName: "Trade Details", labelKey: "TL_COMMON_TR_DETAILS" }, - { labelName: "Owner Details", labelKey: "TL_COMMON_OWN_DETAILS" }, - { labelName: "Documents", labelKey: "TL_COMMON_DOCS" }, - { labelName: "Summary", labelKey: "TL_COMMON_SUMMARY" } -]; - -export const stepper = getStepperObject( - { props: { activeStep: 0 } }, - stepsData -); - -export const formwizardFirstStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form1" - }, - children: { - - } - }; - -export const formwizardSecondStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form2" - }, - children: { - - }, - visible: false -}; - -export const formwizardThirdStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form3" - }, - children: { - - }, - visible: false -}; - -export const formwizardFourthStep = { - uiFramework: "custom-atoms", - componentPath: "Form", - props: { - id: "apply_form4" - }, - children: { - - }, - visible: false -}; - -export const header = getCommonContainer({ - header: - getCommonHeader({ - labelName: 'Apply for New Trade License' , - labelKey: "APPLY" - }), - applicationNumber: { - uiFramework: "custom-atoms-local", - moduleName: "egov-tradelicence", - componentPath: "ApplicationNoContainer", - props: { - number: "NA" - }, - visible: false - } -}); - -const screenConfig = { - uiFramework: "material-ui", - name: "mihyLoginScreen", - components: { - mihyLoginGrid: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - mihyEmptyRow: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4 - } - }, - mihyLoginItem: { - uiFramework: "custom-atoms", - componentPath: "Item", - props: { - sm: 4, - xs: 12 - }, - children: { - - headerDiv: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - header: { - gridDefination: { - xs: 12, - sm: 10 - }, - ...header - } - } - }, - stepper, - formwizardFirstStep, - formwizardSecondStep, - formwizardThirdStep, - formwizardFourthStep, - //footer, - - mihyLoginCard: getCommonCardWithHeader( - { - mihyloginDiv: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "text-center" - }, - children: { - mihyLoginUsername: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Email", - margin: "normal", - fullWidth: true, - autoFocus: true, - required: true, - iconObj: { - position: "end", - iconName: "email" - } - }, - required: true, - jsonPath: "body.mihy.username", - pattern: "^([a-zA-Z0-9@.])+$" - }, - mihyLoginPassword: { - uiFramework: "custom-molecules", - componentPath: "TextfieldWithIcon", - props: { - label: "Password", - type: "password", - margin: "normal", - fullWidth: true, - required: true, - iconObj: { position: "end", iconName: "lock" } - }, - jsonPath: "body.mihy.password", - required: true, - pattern: "^([a-zA-Z0-9!])+$" - }, - mihyBreakOne: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyBreakTwo: { - uiFramework: "custom-atoms", - componentPath: "Break" - }, - mihyLoginButton: { - componentPath: "Button", - props: { - color: "primary", - fullWidth: true - }, - children: { - mihyLoginButtonText: getLabel({label:"Let's go"}) - } - // onClickDefination:{ - // action:"submit", - // method:"get", - // endPoint:"afbc.com", - // purpose:"authLogin", - // redirectionUrl:"/" - // } - } - } - } - }, - { - mihyLoginHeader: { - componentPath: "Typography", - children: { - mihyLoginHeaderText: getLabel({label:"Login"}) - }, - props: { - align: "center", - variant: "title", - style: { - color: "white" - } - } - } - } - ) - } - } - } - } - } -}; - -export default screenConfig; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/addHospitalDialog.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/addHospitalDialog.js deleted file mode 100644 index 35f783e9594..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/addHospitalDialog.js +++ /dev/null @@ -1,157 +0,0 @@ -import { - getCommonHeader, - getCommonContainer, - getLabel, - getTextField , -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { toggleSnackbar } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import get from "lodash/get"; -import {showHideAddHospitalDialog } from "./newRegistration"; -import {prepareFinalObject} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import {patterns} from "../utils/constants"; - -const addHospitalDataToDropDown = (state,dispatch) =>{ - - let newHospitalName = get(state.screenConfiguration.preparedFinalObject,"bnd.newHospitalName"); - let existingHospitals = get(state.screenConfiguration.preparedFinalObject,"bnd.allHospitals") || []; - - if(!newHospitalName || !(new RegExp(patterns["hospitalName"])).test(newHospitalName)) - { - dispatch(toggleSnackbar( - true, - { - labelName: "Invalid value", - labelKey: "CORE_COMMON_INVALID" - }, - "info" - )); - return; - } - - let hospitalExists = false; - for(var hospital in existingHospitals) - { - if(existingHospitals[hospital].name == newHospitalName) - { - dispatch(toggleSnackbar( - true, - { - labelName: "Please fill the required fields.", - labelKey: "BND_HOSPITAL_NAME_EXISTS" - }, - "info" - )); - hospitalExists = true; - break; - } - } - - if(!hospitalExists){ - existingHospitals.unshift({code:newHospitalName,name:newHospitalName}); - dispatch(toggleSnackbar( - true, - { - labelName: "Please fill the required fields.", - labelKey: "BND_NEW_HOSPITAL_ADDED" - }, - "success" - )); - dispatch(prepareFinalObject("bnd.allHospitals", existingHospitals)); - } -} - -export const addHospitalDialog = getCommonContainer({ - header: getCommonHeader({ - labelName: "Confirm Add", - labelKey: "BND_CONFIRM_ADD" - }, - { - style: { - fontSize: "20px" - } - }), - confirmationContents: getCommonContainer({ - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - style: { - width: "90%", - textAlign: "center" - } - }, - children: { - - hospitalName: getTextField({ - label: { - labelName: "", - labelKey: "BND_HOSPITALNAME_LABEL" - }, - placeholder: { - labelName: "", - labelKey: "BND_HOSPITALNAME_LABEL" - }, - required:false, - visible: true, - jsonPath: `bnd.newHospitalName`, - gridDefination: { - xs: 12, - sm: 12 - } - }), - - yesButton: { - componentPath: "Button", - props: { - variant: "contained", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "20px", - marginTop: "16px" - } - }, - children: { - previousButtonLabel: getLabel({ - labelName: "YES", - labelKey: "BND_DOWNLOAD_PROCEED" - }) - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - addHospitalDataToDropDown(state,dispatch); - showHideAddHospitalDialog(state, dispatch) - } - } - }, - cancelButton: { - componentPath: "Button", - props: { - variant: "outlined", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "4px", - marginTop: "16px" - } - }, - children: { - previousButtonLabel: getLabel({ - labelName: "NO", - labelKey: "CORE_COMMON_CANCEL" - }) - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - showHideAddHospitalDialog(state, dispatch) - } - } - } - } - } - }) -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/index.scss b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/index.scss deleted file mode 100644 index 8728436cd7c..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/index.scss +++ /dev/null @@ -1,22 +0,0 @@ -.confirm-bnd-popup{ - display:unset !important; - } - - - .bnd-footer{ - .apply-wizard-footer{ - background: white; - - } - } - @media (max-width: 780px) { - - - .bnd-footer{ -.apply-wizard-footer{ - button{ - min-width: 50% !important; - } -} - } -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistration.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistration.js deleted file mode 100644 index 926a1d49b50..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistration.js +++ /dev/null @@ -1,262 +0,0 @@ -import { getCommonHeader } from "egov-ui-framework/ui-config/screens/specs/utils"; -import { - handleScreenConfigurationFieldChange as handleField, - prepareFinalObject, -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; //returns action object -import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; -import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; -import get from "lodash/get"; -import { - convertEpochToDateCustom, - loadFullCertDetails, - loadHospitals, -} from "../utils"; -import { addHospitalDialog } from "./addHospitalDialog"; -import { newRegistrationForm } from "./newRegistrationCard"; -import { confirmationDialog } from "./newRegistrationConfirmDialog"; -import { footer } from "./newRegistrationFooter"; -import "./index.css"; -import { set } from "lodash"; - -const header = getCommonHeader({ - labelName: "Search Certificate", - labelKey: "ACTION_TEST_DEATH_CERTIFICATE", -}); - -export const showHideConfirmationPopup = (state, dispatch) => { - let toggle = get( - state.screenConfiguration.screenConfig["newRegistration"], - "components.confirmationDialog.props.open", - false - ); - dispatch( - handleField( - "newRegistration", - "components.confirmationDialog", - "props.open", - !toggle - ) - ); -}; - -export const showHideAddHospitalDialog = (state, dispatch) => { - let toggle = get( - state.screenConfiguration.screenConfig["newRegistration"], - "components.hospitalDialog.props.open", - false - ); - dispatch( - handleField( - "newRegistration", - "components.hospitalDialog", - "props.open", - !toggle - ) - ); -}; - -const prepareEditScreenData = (action, state, dispatch, response) => { - setTimeout(() => { - if (response.DeathCertificate[0].dateofdeath) { - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.deceasedInfo.children.cardContent.children.infoOfDeceased.children.dob", - "props.value", - convertEpochToDateCustom(response.DeathCertificate[0].dateofdeath) - ) - ); - } - if (response.DeathCertificate[0].dateofreport) { - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.registrationInfo.children.cardContent.children.registrationInfoCont.children.dateOfReporting", - "props.value", - convertEpochToDateCustom(response.DeathCertificate[0].dateofreport) - ) - ); - } - if (response.DeathCertificate[0].hospitalname) { - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.registrationInfo.children.cardContent.children.registrationInfoCont.children.hospitalName", - "props.value", - response.DeathCertificate[0].hospitalname - ) - ); - } - }, 1); -}; -const newRegistration = { - uiFramework: "material-ui", - name: "newRegistration", - beforeInitScreen: (action, state, dispatch) => { - let userAction = getQueryArg(window.location.href, "action"); - let id = getQueryArg(window.location.href, "certificateId"); - let module = getQueryArg(window.location.href, "module"); - dispatch( - prepareFinalObject("bnd",{})); - loadHospitals(action, state, dispatch, "death", getTenantId()).then( - (response) => { - if ( - response && - response.MdmsRes && - response.MdmsRes["birth-death-service"] && - response.MdmsRes["birth-death-service"].hospitalList - ) { - const hptList = response.MdmsRes["birth-death-service"].hospitalList; - const newList = [ - ...hptList.filter((hos) => hos.active), - { - hospitalName: "Others", - }, - ]; - for (let hospital of newList) { - hospital.code = hospital.hospitalName; - hospital.name = hospital.hospitalName; - } - dispatch(prepareFinalObject("bnd.allHospitals", newList)); - } else { - dispatch( - prepareFinalObject("bnd.allHospitals", [ - { code: "Others", name: "Others" }, - ]) - ); - } - if (userAction == "EDIT" && id && module) { - set( - action.screenConfig, - "components.div2.children.details.children.cardContent.children.registrationInfo.children.cardContent.children.registrationInfoCont.children.hospitalName.props.isDisabled", - true - ); - set( - action.screenConfig, - "components.div2.children.details.children.cardContent.children.registrationInfo.children.cardContent.children.registrationInfoCont.children.registrationNo.props.disabled", - true - ); - loadFullCertDetails(action, state, dispatch, { - tenantId: getTenantId(), - id: id, - module: module, - }).then((response) => { - if ( - response && - response.DeathCertificate && - response.DeathCertificate.length > 0 - ) { - dispatch( - prepareFinalObject( - "bnd.death.newRegistration", - response.DeathCertificate[0] - ) - ); - dispatch( - prepareFinalObject( - "bnd.death.newRegistration.isLegacyRecord", - response.DeathCertificate[0].isLegacyRecord - ) - ); - prepareEditScreenData(action, state, dispatch, response); - } - }); - } else { - dispatch( - prepareFinalObject("bnd.death.newRegistration", { - deathSpouseInfo: {}, - deathFatherInfo: {}, - deathMotherInfo: {}, - deathPresentaddr: {}, - deathPermaddr: {}, - }) - ); - } - } - ); - - return action; - }, - components: { - div2: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "common-div-css", - }, - children: { - headerDiv: { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - header: { - gridDefination: { - xs: 12, - sm: 6, - }, - ...header, - }, - }, - }, - details: newRegistrationForm, - }, - //visible: process.env.REACT_APP_NAME === "Employee" ? true: false - }, - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "common-div-css bnd-footer", - }, - children: { - details: footer, - }, - }, - confirmationDialog: { - componentPath: "Dialog", - props: { - open: false, - maxWidth: "sm", - disableValidation: true, - }, - children: { - dialogContent: { - componentPath: "DialogContent", - props: { - classes: { - root: "city-picker-dialog-style", - }, - // style: { minHeight: "180px", minWidth: "365px" } - }, - children: { - popup: confirmationDialog, - }, - }, - }, - }, - hospitalDialog: { - componentPath: "Dialog", - props: { - open: false, - maxWidth: "sm", - disableValidation: true, - }, - children: { - dialogContent: { - componentPath: "DialogContent", - props: { - classes: { - root: "city-picker-dialog-style", - }, - // style: { minHeight: "180px", minWidth: "365px" } - }, - children: { - popup: addHospitalDialog, - }, - }, - }, - }, - }, -}; - -export default newRegistration; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistrationCard.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistrationCard.js deleted file mode 100644 index f6ee46f9fba..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistrationCard.js +++ /dev/null @@ -1,1096 +0,0 @@ -import { - getCommonCard, - getCommonTitle, - getSelectField, - getCommonParagraph, - getPattern, - getTextField, - getDateField, - getCommonCaption, - getCommonSubHeader, - getCommonGrayCard, - getCommonContainer, - getLabel, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { - prepareFinalObject, - handleScreenConfigurationFieldChange as handleField, -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import get from "lodash/get"; -import { getTodaysDateInYMD } from "egov-ui-framework/ui-utils/commons"; -import { patterns } from "../utils/constants"; -import { showHideAddHospitalDialog } from "./newRegistration"; -import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; - -export const getPersonDetailsForm = (type) => { - return getCommonContainer({ - firstName: getTextField({ - label: { - labelName: "First Name", - labelKey: "BND_FIRSTNAME_LABEL", - }, - placeholder: { - labelName: "First Name", - labelKey: "BND_FIRSTNAME_LABEL", - }, - required: true, - visible: true, - pattern: patterns["name"], - jsonPath: `bnd.death.newRegistration.${type}.firstname`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - middlename: getTextField({ - label: { - labelName: "Middle Name", - labelKey: "BND_MIDDLENAME_LABEL", - }, - placeholder: { - labelName: "Middle Name", - labelKey: "BND_MIDDLENAME_LABEL", - }, - required: false, - visible: true, - pattern: patterns["name"], - jsonPath: `bnd.death.newRegistration.${type}.middlename`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - lastname: getTextField({ - label: { - labelName: "Last Name", - labelKey: "BND_LASTNAME_LABEL", - }, - placeholder: { - labelName: "Last Name", - labelKey: "BND_LASTNAME_LABEL", - }, - required: true, - visible: true, - pattern: patterns["name"], - jsonPath: `bnd.death.newRegistration.${type}.lastname`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - aadharNo: getTextField({ - label: { - labelName: "Aadhar No", - labelKey: "BND_AADHAR_NO", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "Aadhar No", - labelKey: "BND_AADHAR_NO", - }, - required: false, - pattern: getPattern("AadharNo"), - jsonPath: `bnd.death.newRegistration.${type}.aadharno`, - // iconObj: { - // iconName: "search", - // position: "end", - // color: "#FE7A51", - // onClickDefination: { - // action: "condition", - // callBack: (state, dispatch, fieldInfo) => { - // alert("hey") - // //getDetailsForOwner(state, dispatch, fieldInfo); //useme - // } - // } - // }, - title: { - value: "Please search owner profile linked to the mobile no.", - key: "BND_AADHAR_NO", - }, - //infoIcon: "info_circle", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - emailId: getTextField({ - label: { - labelName: "emailId", - labelKey: "BND_EMAIL_ID", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "emailId", - labelKey: "BND_EMAIL_ID", - }, - required: false, - pattern: getPattern("Email"), - jsonPath: `bnd.death.newRegistration.${type}.emailid`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - mobNo: getTextField({ - label: { - labelName: "Mobile No.", - labelKey: "CORE_COMMON_MOBILE_NUMBER", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "Enter Mobile No.", - labelKey: "CORE_COMMON_MOBILE_NUMBER", - }, - required: false, - pattern: getPattern("MobileNo"), - jsonPath: `bnd.death.newRegistration.${type}.mobileno`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - }); -}; - -export const getAddressForm = (type, mandatory = false) => { - return getCommonContainer({ - buildingNo: getTextField({ - label: { - labelName: "buildingno", - labelKey: "BND_BUILDINGNO_LABEL", - }, - placeholder: { - labelName: "buildingno", - labelKey: "BND_BUILDINGNO_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressBig"], - jsonPath: `bnd.death.newRegistration.${type}.buildingno`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - houseNo: getTextField({ - label: { - labelName: "houseno", - labelKey: "BND_HOUSENO_LABEL", - }, - placeholder: { - labelName: "houseno", - labelKey: "BND_HOUSENO_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressBig"], - jsonPath: `bnd.death.newRegistration.${type}.houseno`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - streetname: getTextField({ - label: { - labelName: "streetname", - labelKey: "BND_STREETNAME_LABEL", - }, - placeholder: { - labelName: "streetname", - labelKey: "BND_STREETNAME_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressBig"], - jsonPath: `bnd.death.newRegistration.${type}.streetname`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - locality: getTextField({ - label: { - labelName: "locality", - labelKey: "BND_LOCALITY_LABEL", - }, - placeholder: { - labelName: "locality", - labelKey: "BND_LOCALITY_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressBig"], - jsonPath: `bnd.death.newRegistration.${type}.locality`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - tehsil: getTextField({ - label: { - labelName: "tehsil", - labelKey: "BND_TEHSIL_LABEL", - }, - placeholder: { - labelName: "tehsil", - labelKey: "BND_TEHSIL_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressTehsil"], - jsonPath: `bnd.death.newRegistration.${type}.tehsil`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - district: getTextField({ - label: { - labelName: "district", - labelKey: "BND_DISTRICT_LABEL", - }, - placeholder: { - labelName: "district", - labelKey: "BND_DISTRICT_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressSmall"], - jsonPath: `bnd.death.newRegistration.${type}.district`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - city: getTextField({ - label: { - labelName: "city", - labelKey: "BND_CITY_LABEL", - }, - placeholder: { - labelName: "city", - labelKey: "BND_CITY_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressSmall"], - jsonPath: `bnd.death.newRegistration.${type}.city`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - state: getTextField({ - label: { - labelName: "state", - labelKey: "BND_STATE_LABEL", - }, - placeholder: { - labelName: "city", - labelKey: "BND_STATE_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressSmall"], - jsonPath: `bnd.death.newRegistration.${type}.state`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - pinno: getTextField({ - label: { - labelName: "pinno", - labelKey: "BND_PINNO_LABEL", - }, - placeholder: { - labelName: "pinno", - labelKey: "BND_PINNO_LABEL", - }, - required: mandatory, - visible: true, - pattern: getPattern("Pincode"), - jsonPath: `bnd.death.newRegistration.${type}.pinno`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - country: getTextField({ - label: { - labelName: "country", - labelKey: "BND_COUNTRY_LABEL", - }, - placeholder: { - labelName: "country", - labelKey: "BND_COUNTRY_LABEL", - }, - required: mandatory, - visible: true, - pattern: patterns["addressSmall"], - jsonPath: `bnd.death.newRegistration.${type}.country`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - }); -}; - -export const getcheckboxvalue = (state, dispatch) => { - let checkBoxState = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.checkboxforaddress" - ); - if (checkBoxState) { - let deathpresentmaddr = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.deathPresentaddr" - ); - for (var key in deathpresentmaddr) - dispatch( - prepareFinalObject( - `bnd.death.newRegistration.deathPermaddr.${key}`, - get( - state.screenConfiguration.preparedFinalObject, - `bnd.death.newRegistration.deathPresentaddr.${key}` - ) - ) - ); - - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents", - "visible", - false - ) - ); - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.header", - "visible", - false - ) - ); - const presentAddrConfig = get( - state.screenConfiguration.screenConfig.newRegistration, - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children" - ); - for (var key in presentAddrConfig) { - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "required", - false - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "props.required", - false - ) - ); - } - const addrConfig = get( - state.screenConfiguration.screenConfig.newRegistration, - "components.div2.children.details.children.cardContent.children.addrTimeOfdeath.children.cardContent.children.addrTimeOfdeath.children" - ); - for (var key in addrConfig) { - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.addrTimeOfdeath.children.cardContent.children.addrTimeOfdeath.children.${key}`, - "required", - true - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.addrTimeOfdeath.children.cardContent.children.addrTimeOfdeath.children.${key}`, - "props.required", - true - ) - ); - } - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.addrTimeOfdeath.children.cardContent.children.header.children.key", - "props.labelKey", - "BND_DEATH_ADDR_PERM" - ) - ); - } else { - let deathpermaddr = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.deathPermaddr" - ); - for (var key in deathpermaddr) - dispatch( - prepareFinalObject(`bnd.death.newRegistration.deathPermaddr.${key}`, "") - ); - const presentAddrConfig = get( - state.screenConfiguration.screenConfig.newRegistration, - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children" - ); - for (var key in presentAddrConfig) { - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "required", - true - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "props.required", - true - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "props.value", - "" - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children.${key}`, - "props.error", - false - ) - ); - } - const addrConfig = get( - state.screenConfiguration.screenConfig.newRegistration, - "components.div2.children.details.children.cardContent.children.addrTimeOfdeath.children.cardContent.children.addrTimeOfdeath.children" - ); - for (var key in addrConfig) { - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.addrTimeOfdeath.children.cardContent.children.addrTimeOfdeath.children.${key}`, - "required", - false - ) - ); - dispatch( - handleField( - "newRegistration", - `components.div2.children.details.children.cardContent.children.addrTimeOfdeath.children.cardContent.children.addrTimeOfdeath.children.${key}`, - "props.required", - false - ) - ); - } - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents", - "visible", - true - ) - ); - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.header", - "visible", - true - ) - ); - dispatch( - handleField( - "newRegistration", - "components.div2.children.details.children.cardContent.children.addrTimeOfdeath.children.cardContent.children.header.children.key", - "props.labelKey", - "BND_PRESENT_ADDR_DURING_DEATH" - ) - ); - } -}; - -export const newRegistrationForm = getCommonCard({ - header: getCommonTitle( - { - labelName: "New Registration", - labelKey: - getQueryArg(window.location.href, "action") === "EDIT" - ? "BND_EDIT_REGISTRATION" - : "BND_NEW_REGISTRATION", - }, - { - style: { - marginBottom: 18, - }, - } - ), - subText: getCommonParagraph({ - labelName: "(*) marked items are mandatory", - labelKey: "BND_NEW_REGISTRATION_SUBTEXT", - }), - checkBox: { - required: true, - uiFramework: "custom-atoms-local", - moduleName: "egov-bnd", - componentPath: "Checkbox", - props: { - label: { - labelKey: "BND_IS_LEGACY_RECORD", - labelName: "BND_IS_LEGACY_RECORD", - }, - jsonPath: "bnd.death.newRegistration.isLegacyRecord", - }, - }, - registrationInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_REGISTRATION", - }, - { - style: { - marginBottom: 18, - }, - } - ), - registrationInfoCont: getCommonContainer({ - registrationNo: getTextField({ - label: { - labelName: "RegistrationNo", - labelKey: "BND_REG_NO_LABEL", - }, - placeholder: { - labelName: "Registration No", - labelKey: "BND_REG_NO_LABEL", - }, - required: true, - visible: true, - pattern: patterns["registrationNo"], - jsonPath: "bnd.death.newRegistration.registrationno", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - hospitalName: { - uiFramework: "custom-containers-local", - moduleName: "egov-bnd", - componentPath: "AutosuggestContainer", - jsonPath: "bnd.death.newRegistration.hospitalname", - sourceJsonPath: "bnd.allHospitals", - visible: true, - autoSelect: true, - props: { - autoSelect: true, - //isClearable:true, - className: "autocomplete-dropdown", - suggestions: [], - disabled: false, //getQueryArg(window.location.href, "action") === "EDITRENEWAL"? true:false, - label: { - labelName: "Select Hospital", - labelKey: "BND_HOSPITALNAME_LABEL", - }, - placeholder: { - labelName: "Select Hospital", - labelKey: "BND_HOSPITALNAME_LABEL_PLACEHOLDER", - }, - localePrefix: { - moduleName: "TENANT", - masterName: "TENANTS", - }, - labelsFromLocalisation: false, - required: false, - jsonPath: "bnd.death.hosptialId", - sourceJsonPath: "bnd.allHospitals", - inputLabelProps: { - shrink: true, - }, - onClickHandler: (action, state, dispatch) => {}, - }, - gridDefination: { - xs: 12, - sm: 4, - }, - beforeFieldChange: (action, state, dispatch) => {}, - afterFieldChange: (action, state, dispatch) => {}, - }, - dateOfReporting: getDateField({ - label: { labelName: "DOB", labelKey: "BND_DEATH_DOR" }, - placeholder: { - labelName: "Date of Reporting", - labelKey: "BND_DEATH_DOR_PLACEHOLDER", - }, - jsonPath: "bnd.death.newRegistration.dateofreportepoch", - gridDefination: { - xs: 12, - sm: 4, - }, - pattern: getPattern("Date"), - errorMessage: "ERR_INVALID_DATE", - required: true, - props: { - inputProps: { - max: getTodaysDateInYMD(), - }, - }, - }), - }), - }), - deceasedInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_INFO_OF_DECEASED", - }, - { - style: { - marginBottom: 18, - }, - } - ), - infoOfDeceased: getCommonContainer({ - dob: getDateField({ - label: { labelName: "DOB", labelKey: "BND_DEATH_DOB" }, - placeholder: { - labelName: "Date of Death", - labelKey: "BND_DEATH_DOB", - }, - jsonPath: "bnd.death.newRegistration.dateofdeathepoch", - gridDefination: { - xs: 12, - sm: 4, - }, - pattern: getPattern("Date"), - errorMessage: "ERR_INVALID_DATE", - required: true, - props: { - inputProps: { - max: getTodaysDateInYMD(), - }, - }, - }), - gender: getSelectField({ - label: { - labelName: "Select Gender", - labelKey: "BND_GENDER", - }, - placeholder: { - labelName: "Select Gender", - labelKey: "BND_GENDER_PLACEHOLDER", - }, - required: true, - localePrefix: { - moduleName: "COMMON", - masterName: "GENDER", - }, - data: [ - { - code: "Male", - label: "Male", - }, - { - code: "Female", - label: "Female", - }, - { - code: "Transgender", - label: "Transgender", - }, - ], - props: { - disabled: false, - }, - gridDefination: { - xs: 12, - sm: 4, - }, - jsonPath: "bnd.death.newRegistration.genderStr", - autoSelect: true, - visible: true, - beforeFieldChange: (action, state, dispatch) => {}, - afterFieldChange: (action, state, dispatch) => {}, - }), - age: getTextField({ - label: { - labelName: "Age", - labelKey: "BND_AGE", - }, - placeholder: { - labelName: "Age", - labelKey: "BND_AGE_PLACEHOLDER", - }, - required: true, - visible: true, - pattern: patterns["age"], - jsonPath: "bnd.death.newRegistration.age", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - firstName: getTextField({ - label: { - labelName: "First Name", - labelKey: "BND_FIRSTNAME_LABEL", - }, - placeholder: { - labelName: "First Name", - labelKey: "BND_FIRSTNAME_LABEL", - }, - required: true, - visible: true, - pattern: patterns["name"], - jsonPath: "bnd.death.newRegistration.firstname", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - middlename: getTextField({ - label: { - labelName: "Middle Name", - labelKey: "BND_MIDDLENAME_LABEL", - }, - placeholder: { - labelName: "Middle Name", - labelKey: "BND_MIDDLENAME_LABEL", - }, - required: false, - visible: true, - pattern: patterns["name"], - jsonPath: "bnd.death.newRegistration.middlename", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - lastname: getTextField({ - label: { - labelName: "Last Name", - labelKey: "BND_LASTNAME_LABEL", - }, - placeholder: { - labelName: "Last Name", - labelKey: "BND_LASTNAME_LABEL", - }, - required: true, - visible: true, - pattern: patterns["name"], - jsonPath: "bnd.death.newRegistration.lastname", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - eidNo: getTextField({ - label: { - labelName: "Eid No", - labelKey: "BND_EIDNO", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "Eid No", - labelKey: "BND_EIDNO", - }, - required: false, - pattern: patterns["eidno"], - jsonPath: `bnd.death.newRegistration.eidno`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - aadharNo: getTextField({ - label: { - labelName: "Aadhar No", - labelKey: "BND_AADHAR_NO", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "Aadhar No", - labelKey: "BND_AADHAR_NO", - }, - required: false, - pattern: getPattern("AadharNo"), - jsonPath: `bnd.death.newRegistration.aadharno`, - title: { - value: "Please search owner profile linked to the mobile no.", - key: "BND_AADHAR_NO", - }, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - nationality: getTextField({ - label: { - labelName: "nationality", - labelKey: "BND_NATIONALITY", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "nationality", - labelKey: "BND_NATIONALITY", - }, - required: true, - pattern: patterns["commonPattern"], - jsonPath: `bnd.death.newRegistration.nationality`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - religion: getTextField({ - label: { - labelName: "religion", - labelKey: "BND_RELIGION", - }, - props: { - className: "applicant-details-error", - }, - placeholder: { - labelName: "religion", - labelKey: "BND_RELIGION", - }, - required: false, - pattern: patterns["commonPattern"], - jsonPath: `bnd.death.newRegistration.religion`, - gridDefination: { - xs: 12, - sm: 4, - }, - }), - }), - }), - placeInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_DEATH_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - deathInfo: getCommonContainer({ - placeOfdeath: getTextField({ - label: { - labelName: "Place of Death", - labelKey: "BND_DEATH_PLACE", - }, - placeholder: { - labelName: "Place of Death", - labelKey: "BND_DEATH_PLACE", - }, - required: true, - visible: true, - pattern: patterns["addressBig"], - jsonPath: "bnd.death.newRegistration.placeofdeath", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - icdCode: getTextField({ - label: { - labelName: "", - labelKey: "BND_ICDCODE", - }, - placeholder: { - labelName: "", - labelKey: "BND_ICDCODE", - }, - required: false, - visible: true, - pattern: patterns["icdcode"], - jsonPath: "bnd.death.newRegistration.icdcode", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - }), - }), - spouseInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_SPOUSES_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - spouseInfo: getPersonDetailsForm("deathSpouseInfo"), - }), - fathersInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_FATHERS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - fathersInfo: getPersonDetailsForm("deathFatherInfo"), - }), - mothersInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_MOTHERS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - mothersInfo: getPersonDetailsForm("deathMotherInfo"), - }), - addrTimeOfdeath: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_PRESENT_ADDR_DURING_DEATH", - }, - { - style: { - marginBottom: 18, - }, - } - ), - addrTimeOfdeath: getAddressForm("deathPresentaddr"), - }), - permAddressofParents: getCommonGrayCard({ - checkBoxforaddress: { - required: true, - uiFramework: "custom-atoms-local", - moduleName: "egov-bnd", - componentPath: "Checkbox", - props: { - label: { - labelKey: "PRESENT_TO_PERM_ADDR_SWITCH_DEATH", - labelName: "PRESENT_TO_PERM_ADDR_SWITCH_DEATH", - }, - jsonPath: "bnd.death.newRegistration.checkboxforaddress", - callBack: (state, dispatch) => { - getcheckboxvalue(state, dispatch); - }, - }, - }, - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_DEATH_ADDR_PERM", - }, - { - style: { - marginBottom: 18, - }, - } - ), - permAddressofParents: getAddressForm("deathPermaddr", true), - }), - informantsInfo: getCommonGrayCard({ - header: getCommonSubHeader( - { - labelName: "", - labelKey: "BND_INFORMANTS_INFO", - }, - { - style: { - marginBottom: 18, - }, - } - ), - informantInfo: getCommonContainer({ - informantName: getTextField({ - label: { - labelName: "informants name", - labelKey: "CORE_COMMON_NAME", - }, - placeholder: { - labelName: "informants name", - labelKey: "CORE_COMMON_NAME", - }, - required: false, - visible: true, - pattern: patterns["name"], - jsonPath: "bnd.death.newRegistration.informantsname", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - informantsAddress: getTextField({ - label: { - labelName: "informants address", - labelKey: "BND_ADDRESS", - }, - placeholder: { - labelName: "informants address", - labelKey: "BND_ADDRESS", - }, - required: false, - visible: true, - pattern: patterns["addressBig"], - jsonPath: "bnd.death.newRegistration.informantsaddress", - gridDefination: { - xs: 12, - sm: 4, - }, - }), - }), - }), - remarks: getTextField({ - label: { - labelName: "remarks", - labelKey: "BND_REMARKS_LABEL", - }, - placeholder: { - labelName: "remarks", - labelKey: "BND_REMARKS_LABEL", - }, - required: false, - visible: true, - pattern: patterns["remarks"], - jsonPath: "bnd.death.newRegistration.remarks", - gridDefination: { - xs: 12, - sm: 4, - }, - }), -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistrationConfirmDialog.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistrationConfirmDialog.js deleted file mode 100644 index 8e4f347768e..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistrationConfirmDialog.js +++ /dev/null @@ -1,118 +0,0 @@ -import { - getCommonContainer, getCommonHeader, getLabel -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { showHideConfirmationPopup } from "./newRegistration"; -import { postData } from "./newRegistrationFooter"; - -export const confirmationDialog = getCommonContainer( - { - closeButton: { - componentPath: "Button", - props: { - style: { - float: "right", - color: "rgba(0, 0, 0, 0.60)", - }, - }, - children: { - previousButtonIcon: { - uiFramework: "custom-atoms", - componentPath: "Icon", - props: { - iconName: "close", - }, - }, - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => - showHideConfirmationPopup(state, dispatch, "newRegistration"), - }, - }, - header: getCommonHeader( - { - labelName: "Confirm Download", - labelKey: "BND_CONFIRM_SUBMIT", - }, - { - style: { - fontSize: "20px", - }, - } - ), - confirmationContents: getCommonContainer( - { - div: { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - style: { - width: "100%", - textAlign: "center", - display: "flex", - flexDirection: "row-reverse", - }, - }, - children: { - yesButton: { - componentPath: "Button", - props: { - variant: "contained", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "20px", - marginTop: "16px", - boxShadow: "none", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "YES", - labelKey: "BND_DOWNLOAD_PROCEED", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - postData(state, dispatch); - showHideConfirmationPopup(state, dispatch, "newRegistration"); - }, - }, - }, - cancelButton: { - componentPath: "Button", - props: { - variant: "outlined", - color: "primary", - style: { - minWidth: "100px", - height: "20px", - marginRight: "4px", - marginTop: "16px", - color: "gray", - border: "none", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "NO", - labelKey: "CORE_COMMON_CANCEL", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - showHideConfirmationPopup(state, dispatch, "newRegistration"); - }, - }, - }, - }, - }, - }, - { className: "confirm-bnd-popup" } - ), - }, - { className: "confirm-bnd-popup" } -); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistrationFooter.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistrationFooter.js deleted file mode 100644 index 73f9ebe25fb..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/death-employee/newRegistrationFooter.js +++ /dev/null @@ -1,382 +0,0 @@ -import { - convertDateToEpoch, - getLabel, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { - toggleSnackbar, - toggleSpinner, -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { httpRequest } from "egov-ui-framework/ui-utils/api"; -import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; -import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; -import _ from "lodash"; -import get from "lodash/get"; -import { validateFields, validateTimeZone } from "../utils"; -import { showHideConfirmationPopup } from "./newRegistration"; - -const checkIfFormIsValid = async (state, dispatch) => { - let isFormValid = true; - - const newRegistration = validateFields( - "components.div2.children.details.children.cardContent.children.registrationInfo.children.cardContent.children.registrationInfoCont.children", - state, - dispatch, - "newRegistration" - ); - - const placeOfdeath = validateFields( - "components.div2.children.details.children.cardContent.children.placeInfo.children.cardContent.children.placeOfdeath.children", - state, - dispatch, - "newRegistration" - ); - - const childsInfo = validateFields( - "components.div2.children.details.children.cardContent.children.deceasedInfo.children.cardContent.children.infoOfDeceased.children", - state, - dispatch, - "newRegistration" - ); - - const spouseInfo = validateFields( - "components.div2.children.details.children.cardContent.children.spouseInfo.children.cardContent.children.spouseInfo.children", - state, - dispatch, - "newRegistration" - ); - - const fathersInfo = validateFields( - "components.div2.children.details.children.cardContent.children.fathersInfo.children.cardContent.children.fathersInfo.children", - state, - dispatch, - "newRegistration" - ); - - const mothersInfo = validateFields( - "components.div2.children.details.children.cardContent.children.mothersInfo.children.cardContent.children.mothersInfo.children", - state, - dispatch, - "newRegistration" - ); - - const permAddr = validateFields( - "components.div2.children.details.children.cardContent.children.permAddressofParents.children.cardContent.children.permAddressofParents.children", - state, - dispatch, - "newRegistration" - ); - const placeInfo = validateFields( - "components.div2.children.details.children.cardContent.children.placeInfo.children.cardContent.children.deathInfo.children", - state, - dispatch, - "newRegistration" - ); - const addrTimeOfdeath = validateFields( - "components.div2.children.details.children.cardContent.children.addrTimeOfdeath.children.cardContent.children.addrTimeOfdeath.children", - state, - dispatch, - "newRegistration" - ); - const informantsInfo = validateFields( - "components.div2.children.details.children.cardContent.children.informantsInfo.children.cardContent.children.informantInfo.children", - state, - dispatch, - "newRegistration" - ); - - if (!validateTimeZone()) { - return; - } - - if ( - !( - newRegistration && - permAddr && - placeInfo && - placeOfdeath && - spouseInfo && - childsInfo && - fathersInfo && - mothersInfo && - addrTimeOfdeath - ) - ) { - isFormValid = false; - dispatch( - toggleSnackbar( - true, - { - labelName: - "Please fill all mandatory fields / Invalid field values !", - labelKey: "BND_MANDATORY_DETAILS_REQUIRED", - }, - "info" - ) - ); - return; - } - let dateofreport = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.dateofreportepoch" - ); - let dateofdeath = get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.dateofdeathepoch" - ); - if (dateofreport < dateofdeath) { - isFormValid = false; - dispatch( - toggleSnackbar( - true, - { - labelName: "Date of Registration should not be before Date of Death", - labelKey: "BND_ERROR_DOBINVALID", - }, - "info" - ) - ); - return; - } - - if ( - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.firstname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.middlename" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.lastname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.deathFatherInfo.firstname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.deathFatherInfo.middlename" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.deathFatherInfo.lastname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.deathMotherInfo.firstname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.deathMotherInfo.middlename" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.deathMotherInfo.lastname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.deathSpouseInfo.firstname" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.deathSpouseInfo.middlename" - ) && - !get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration.deathSpouseInfo.lastname" - ) - ) { - isFormValid = false; - dispatch( - toggleSnackbar( - true, - { - labelName: - "Please enter deceased's name or father's name or mother's name or spouse's name", - labelKey: "ERR_FATHER_MOTHER_DECEASED_NAME", - }, - "info" - ) - ); - return; - } - - if (isFormValid) { - showHideConfirmationPopup(state, dispatch); - } -}; - -const callBackSubmit = async (state, dispatch) => { - checkIfFormIsValid(state, dispatch); -}; - -export const postData = async (state, dispatch) => { - try { - dispatch(toggleSpinner()); - - const newRegData = _.clone( - get( - state.screenConfiguration.preparedFinalObject, - "bnd.death.newRegistration", - [] - ), - true - ); - if (newRegData["checkboxforaddress"]) { - newRegData["deathPermaddr"] = { ...newRegData["deathPresentaddr"] }; - } - newRegData["tenantid"] = getTenantId(); - newRegData["excelrowindex"] = -1; - newRegData["counter"] = newRegData["isLegacyRecord"] ? 1 : 0; - - if (newRegData["dateofreportepoch"] != null) - newRegData["dateofreportepoch"] = - convertDateToEpoch(newRegData["dateofreportepoch"]) / 1000; - if (newRegData["dateofdeathepoch"] != null) - newRegData["dateofdeathepoch"] = - convertDateToEpoch(newRegData["dateofdeathepoch"]) / 1000; - - let payload = { - deathCerts: [newRegData], - }; - let actionmode = - getQueryArg(window.location.href, "action") == "EDIT" - ? "updatedeathimport" - : "savedeathimport"; - payload = await httpRequest( - "post", - `birth-death-services/common/${actionmode}`, - `${actionmode}`, - [], - payload - ); - - if (payload) { - if (payload.errorRowMap && Object.keys(payload.errorRowMap).length > 0) { - let errorString = ""; - for (var key in payload.errorRowMap) { - errorString += key + " "; - } - dispatch( - toggleSnackbar( - true, - { - labelName: "API Error", - labelKey: payload.serviceError, - }, - "info" - ) - ); - } else { - dispatch( - toggleSnackbar( - true, - { - labelName: "", - labelKey: "BND_SUCCESS", - }, - "success" - ) - ); - let userAction = getQueryArg(window.location.href, "action"); - if (userAction == "EDIT") { - setTimeout( - () => - (window.location.href = "/employee/death-common/getCertificate"), - 2000 - ); - } else { - setTimeout(() => location.reload(), 2000); - } - } - } else { - // dispatch( - // setRoute( - // `/lams-citizen/acknowledgement?applicationNumber=${applicationNumber}&status=${status}&purpose=${purpose}` - // ) - // ); - } - } catch (error) { - dispatch( - toggleSnackbar( - true, - { - labelName: "API Error", - labelKey: "BND_SESSION_EXPIRED", - }, - "info" - ) - ); - } - dispatch(toggleSpinner()); -}; - -const getCommonApplyFooter = (children) => { - return { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "apply-wizard-footer", - }, - children, - }; -}; - -export const footer = getCommonApplyFooter({ - resetButton: { - componentPath: "Button", - props: { - variant: "outlined", - color: "primary", - style: { - minWidth: "200px", - height: "48px", - backgroundColor: "white", - marginRight: "16px", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "Previous Step", - labelKey: "BND_COMMON_NEW", - }), - }, - onClickDefination: { - action: "condition", - callBack: (state, dispatch) => { - location.reload(); - }, - }, - visible: getQueryArg(window.location.href, "action") != "EDIT", - }, - submitButton: { - componentPath: "Button", - props: { - variant: "contained", - color: "primary", - className: "submit-btn leaseApplicationSubmitButton", - style: { - minWidth: "180px", - height: "48px", - marginRight: "16px", - borderRadius: "inherit", - }, - }, - children: { - previousButtonLabel: getLabel({ - labelName: "Previous Step", - labelKey: - getQueryArg(window.location.href, "action") == "EDIT" - ? "CORE_COMMON_UPDATE" - : "CORE_COMMON_SUBMIT", - }), - }, - onClickDefination: { - action: "condition", - callBack: callBackSubmit, - }, - //visible: (getQueryArg(window.location.href, "action")!="VIEW"), - }, -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/constants.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/constants.js deleted file mode 100644 index 2bc08428de5..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/constants.js +++ /dev/null @@ -1,15 +0,0 @@ -// Below mentioned patters are converted to ES2015 pattern using https://mothereff.in/regexpu#input=var+regex+%3D+/%5Cp%7BL%7D/u%3B&unicodePropertyEscape=1 -export const patterns = { - hospitalName : /^(?:[ ,._()\-/0-9A-Za-z\xA0\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2000-\u200A\u202F\u205F\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3000\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC7F-\uDCBA\uDCD0-\uDCE8\uDD00-\uDD34\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE80-\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDEE0-\uDEF6\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD4E\uDEC0-\uDEEF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]){1,500}$/, - registrationNo : /^(?:[ _:\-/()0-9a-zA-Z]){1,64}$/, - eidno : /^[a-zA-Z0-9]{0,100}$/, - name : /^(?:[ '\-/()A-Za-z\xA0\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2000-\u200A\u202F\u205F\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3000\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC7F-\uDCBA\uDCD0-\uDCE8\uDD00-\uDD34\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE80-\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDEE0-\uDEF6\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD4E\uDEC0-\uDEEF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]){1,200}$/, - addressBig : /^(?:[ ,._()\-/0-9A-Za-z\xA0\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2000-\u200A\u202F\u205F\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3000\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC7F-\uDCBA\uDCD0-\uDCE8\uDD00-\uDD34\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE80-\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDEE0-\uDEF6\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD4E\uDEC0-\uDEEF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]){1,1000}$/, - icdcode : /^(?:[ ,._()\-/0-9A-Za-z\xA0\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2000-\u200A\u202F\u205F\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3000\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC7F-\uDCBA\uDCD0-\uDCE8\uDD00-\uDD34\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE80-\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDEE0-\uDEF6\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD4E\uDEC0-\uDEEF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]){1,200}$/, - remarks : /^(?:[ ,._()\-/0-9A-Za-z\xA0\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2000-\u200A\u202F\u205F\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3000\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC7F-\uDCBA\uDCD0-\uDCE8\uDD00-\uDD34\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE80-\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDEE0-\uDEF6\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD4E\uDEC0-\uDEEF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]){1,1000}$/, - addressSmall : /^(?:[ A-Za-z\xA0\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2000-\u200A\u202F\u205F\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3000\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC7F-\uDCBA\uDCD0-\uDCE8\uDD00-\uDD34\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE80-\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDEE0-\uDEF6\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD4E\uDEC0-\uDEEF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]){1,100}$/, - commonPattern : /^(?:[ A-Za-z\xA0\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2000-\u200A\u202F\u205F\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3000\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC7F-\uDCBA\uDCD0-\uDCE8\uDD00-\uDD34\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE80-\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDEE0-\uDEF6\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD4E\uDEC0-\uDEEF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]){1,100}$/, - addressTehsil : /^(?:[ A-Za-z\xA0\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2000-\u200A\u202F\u205F\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3000\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC7F-\uDCBA\uDCD0-\uDCE8\uDD00-\uDD34\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE80-\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDEE0-\uDEF6\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD4E\uDEC0-\uDEEF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]){1,1000}$/, - age: /^(?:[ -.A-Za-z0-9\xA0\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2000-\u200A\u202F\u205F\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3000\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC7F-\uDCBA\uDCD0-\uDCE8\uDD00-\uDD34\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE80-\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDEE0-\uDEF6\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD4E\uDEC0-\uDEEF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]){1,50}$/, -} - diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/index.js deleted file mode 100644 index 2a376cac923..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/index.js +++ /dev/null @@ -1,869 +0,0 @@ -import commonConfig from "config/common.js"; -import { - getCommonCaption, - getCommonCard, -} from "egov-ui-framework/ui-config/screens/specs/utils"; -import { setRoute } from "egov-ui-framework/ui-redux/app/actions"; -import { - handleScreenConfigurationFieldChange as handleField, - hideSpinner, - prepareFinalObject, - toggleSnackbar, - toggleSpinner, -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { validate } from "egov-ui-framework/ui-redux/screen-configuration/utils"; -import { - captureSource, - getFileUrlFromAPI, - getLocaleLabels, - getQueryArg, - getTransformedLocalStorgaeLabels, -} from "egov-ui-framework/ui-utils/commons"; -import { openPdf, printPdf } from "egov-ui-kit/utils/commons"; -import { getUserInfo } from "egov-ui-kit/utils/localStorageUtils"; -import get from "lodash/get"; -import store from "ui-redux/store"; -import { downloadConReceipt } from "egov-common/ui-utils/commons"; -import { downloadReceiptFromFilestoreID } from "egov-common/ui-utils/commons"; - -import { httpRequest } from "../../../../ui-utils"; - -// sms("sms"), -// email("email"), -// ivr("ivr"), -// mobileapp("mobileapp"), -// whatsapp("whatsapp"), -// csc("csc"), -// web("web"); - -export const downloadPdf = (link, openIn = "_blank") => { - var win = window.open(link, openIn); - if (win) { - win.focus(); - } else { - toggleSnackbar( - true, - { - labelName: - "Looks like your browser is blocking pop-ups. Allow pop-ups in your browser to download certificate.", - labelKey: "BND_BROWSER_WARN_BROWSER_BLOCKED", - }, - "error" - ); - } -}; - - -export const convertEpochToDateCustom = (dateEpoch) => { - // Returning null in else case because new Date(null) returns initial date from calender - if (dateEpoch) { - const dateFromApi = new Date(dateEpoch); - let month = dateFromApi.getMonth() + 1; - let day = dateFromApi.getDate(); - let year = dateFromApi.getFullYear(); - month = (month > 9 ? "" : "0") + month; - day = (day > 9 ? "" : "0") + day; - return `${year}-${month}-${day}`; - } else { - return null; - } -}; - -export const validateTimeZone = () => { - try { - const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; - if (tz != "Asia/Calcutta" && tz != "Asia/Kolkata") { - alert( - "Looks like your system's time zone is not correct! \nChange your system's time zone to Indian Standard Time (UTC+5:30 Chennai,Kolkata,Mumbai,NewDelhi)\nand try again." - ); - return false; - } - } catch (e) { - alert( - "Looks like this browser is very old. Please update your browser and continue" - ); - return false; - } - return true; -}; - -export const getCommonApplyFooter = (children) => { - return { - uiFramework: "custom-atoms", - componentPath: "Div", - props: { - className: "apply-wizard-footer", - }, - children, - }; -}; - -export const transformById = (payload, id) => { - return ( - payload && - payload.reduce((result, item) => { - result[item[id]] = { - ...item, - }; - - return result; - }, {}) - ); -}; - -export const getMdmsData = async (requestBody) => { - try { - const response = await httpRequest( - "post", - "egov-mdms-service/v1/_search", - "_search", - [], - requestBody - ); - - return response; - } catch (error) { - return {}; - } -}; - -export const getTranslatedLabel = (labelKey, localizationLabels) => { - let translatedLabel = null; - if (localizationLabels && localizationLabels.hasOwnProperty(labelKey)) { - translatedLabel = localizationLabels[labelKey]; - if ( - translatedLabel && - typeof translatedLabel === "object" && - translatedLabel.hasOwnProperty("message") - ) - translatedLabel = translatedLabel.message; - } - return translatedLabel || labelKey; -}; - -export const validateFields = ( - objectJsonPath, - state, - dispatch, - screen = "apply" -) => { - const fields = get( - state.screenConfiguration.screenConfig[screen], - objectJsonPath, - {} - ); - let isFormValid = true; - for (var variable in fields) { - if (fields.hasOwnProperty(variable)) { - if ( - fields[variable] && - fields[variable].props && - (fields[variable].props.disabled === undefined || - !fields[variable].props.disabled) && - (fields[variable].props.disableValidation === undefined || - !fields[variable].props.disableValidation) && - !validate( - screen, - { - ...fields[variable], - value: get( - state.screenConfiguration.preparedFinalObject, - fields[variable].jsonPath - ), - }, - dispatch, - true - ) - ) { - isFormValid = false; - } - } - } - return isFormValid; -}; - -export const convertDateToEpoch = (dateString, dayStartOrEnd = "dayend") => { - //example input format : "2018-10-02" - try { - const parts = dateString.match(/(\d{4})-(\d{1,2})-(\d{1,2})/); - const DateObj = new Date(Date.UTC(parts[1], parts[2] - 1, parts[3])); - DateObj.setMinutes(DateObj.getMinutes() + DateObj.getTimezoneOffset()); - if (dayStartOrEnd === "dayend") { - DateObj.setHours(DateObj.getHours() + 24); - DateObj.setSeconds(DateObj.getSeconds() - 1); - } - return DateObj.getTime(); - } catch (e) { - return dateString; - } -}; - -//Convert IST epoch to IST Date. -export const convertEpochToDateWithTimeIST = (dateEpoch) => { - let ist; - try { - ist = new Date(dateEpoch) - .toLocaleString("en-IN", { timeZone: "Asia/Kolkata" }) - .split(",")[0]; - return ist; - } catch (e) { - return "Use latest browser."; - //alert("Catching error"); - // var now = new Date(dateEpoch); - // var utc = new Date(now.getTime() + now.getTimezoneOffset() * 60000); - // ist = new Date(dateEpoch.getTime() + (5.5 * 60 * 60000)) - // return `${ist.getDate()}/${ist.getMonth()+1}/${ist.getFullYear()}`; - } -}; - -export const getEpochForDate = (date) => { - const dateSplit = date.split("/"); - return new Date(dateSplit[2], dateSplit[1] - 1, dateSplit[0]).getTime(); -}; - -export const sortByEpoch = (data, order) => { - if (order) { - return data.sort((a, b) => { - return a[a.length - 1] - b[b.length - 1]; - }); - } else { - return data.sort((a, b) => { - return b[b.length - 1] - a[a.length - 1]; - }); - } -}; - -export const ifUserRoleExists = (role) => { - let userInfo = JSON.parse(getUserInfo()); - const roles = get(userInfo, "roles"); - const roleCodes = roles ? roles.map((role) => role.code) : []; - if (roleCodes.indexOf(role) > -1) { - return true; - } else return false; -}; - -export const convertEpochToDate = (dateEpoch) => { - const dateFromApi = new Date(dateEpoch); - let month = dateFromApi.getMonth() + 1; - let day = dateFromApi.getDate(); - let year = dateFromApi.getFullYear(); - month = (month > 9 ? "" : "0") + month; - day = (day > 9 ? "" : "0") + day; - return `${day}/${month}/${year}`; -}; - -export const getCurrentFinancialYear = () => { - var today = new Date(); - var curMonth = today.getMonth(); - var fiscalYr = ""; - if (curMonth > 3) { - var nextYr1 = (today.getFullYear() + 1).toString(); - fiscalYr = today.getFullYear().toString() + "-" + nextYr1; - } else { - var nextYr2 = today.getFullYear().toString(); - fiscalYr = (today.getFullYear() - 1).toString() + "-" + nextYr2; - } - return fiscalYr; -}; - -export const getFinancialYearDates = (format, et) => { - /** Return the starting date and ending date (1st April to 31st March) - * of the financial year of the given date in ET. If no ET given then - * return the dates for the current financial year */ - var date = !et ? new Date() : new Date(et); - var curMonth = date.getMonth(); - var financialDates = { startDate: "NA", endDate: "NA" }; - if (curMonth > 3) { - switch (format) { - case "dd/mm/yyyy": - financialDates.startDate = `01/04/${date.getFullYear().toString()}`; - financialDates.endDate = `31/03/${(date.getFullYear() + 1).toString()}`; - break; - case "yyyy-mm-dd": - financialDates.startDate = `${date.getFullYear().toString()}-04-01`; - financialDates.endDate = `${(date.getFullYear() + 1).toString()}-03-31`; - break; - } - } else { - switch (format) { - case "dd/mm/yyyy": - financialDates.startDate = `01/04/${( - date.getFullYear() - 1 - ).toString()}`; - financialDates.endDate = `31/03/${date.getFullYear().toString()}`; - break; - case "yyyy-mm-dd": - financialDates.startDate = `${( - date.getFullYear() - 1 - ).toString()}-04-01`; - financialDates.endDate = `${date.getFullYear().toString()}-03-31`; - break; - } - } - return financialDates; -}; - -export const gotoApplyWithStep = (state, dispatch, step) => { - const applicationNumber = getQueryArg( - window.location.href, - "applicationNumber" - ); - const applicationNumberQueryString = applicationNumber - ? `&applicationNumber=${applicationNumber}` - : ``; - const applyUrl = - process.env.REACT_APP_SELF_RUNNING === "true" - ? `/egov-ui-framework/abg/apply?step=${step}${applicationNumberQueryString}` - : `/abg/apply?step=${step}${applicationNumberQueryString}`; - dispatch(setRoute(applyUrl)); -}; - -export const showHideAdhocPopup = (state, dispatch) => { - let toggle = get( - state.screenConfiguration.screenConfig["search"], - "components.adhocDialog.props.open", - false - ); - dispatch( - handleField("search", "components.adhocDialog", "props.open", !toggle) - ); -}; - -export const getCommonGrayCard = (children) => { - return { - uiFramework: "custom-atoms", - componentPath: "Container", - children: { - body: { - uiFramework: "custom-atoms", - componentPath: "Div", - children: { - ch1: getCommonCard(children, { - style: { - backgroundColor: "rgb(242, 242, 242)", - boxShadow: "none", - borderRadius: 0, - overflow: "visible", - }, - }), - }, - gridDefination: { - xs: 12, - }, - }, - }, - gridDefination: { - xs: 12, - }, - }; -}; - -export const getLabelOnlyValue = (value, props = {}) => { - return { - uiFramework: "custom-atoms", - componentPath: "Div", - gridDefination: { - xs: 6, - sm: 4, - }, - props: { - style: { - marginBottom: "16px", - }, - ...props, - }, - children: { - value: getCommonCaption(value), - }, - }; -}; - -export const onActionClick = (rowData) => { - switch (rowData[8]) { - case "PAY": - return ""; - case "DOWNLOAD RECEIPT": - ""; - case "GENERATE NEW RECEIPT": - ""; - } -}; - -export const getTextToLocalMapping = (label) => { - const localisationLabels = getTransformedLocalStorgaeLabels(); - switch (label) { - case "Bill No.": - return getLocaleLabels( - "Bill No.", - "ABG_COMMON_TABLE_COL_BILL_NO", - localisationLabels - ); - - case "Consumer Name": - return getLocaleLabels( - "Consumer Name", - "ABG_COMMON_TABLE_COL_CONSUMER_NAME", - localisationLabels - ); - - case "Service Category": - return getLocaleLabels( - "Service Category", - "ABG_COMMON_TABLE_COL_SERVICE_CATEGORY", - localisationLabels - ); - case "Bill Date": - return getLocaleLabels( - "Bill Date", - "ABG_COMMON_TABLE_COL_BILL_DATE", - localisationLabels - ); - - case "Bill Amount(Rs)": - return getLocaleLabels( - "Bill Amount(Rs)", - "ABG_COMMON_TABLE_COL_BILL_AMOUNT", - localisationLabels - ); - - case "Status": - return getLocaleLabels( - "Status", - "ABG_COMMON_TABLE_COL_STATUS", - localisationLabels - ); - case "Action": - return getLocaleLabels( - "Action", - "ABG_COMMON_TABLE_COL_ACTION", - localisationLabels - ); - - case "Consumer ID": - return getLocaleLabels( - "Consumer ID", - "ABG_COMMON_TABLE_COL_CONSUMER_ID", - localisationLabels - ); - - case "Owner Name": - return getLocaleLabels( - "Owner Name", - "ABG_COMMON_TABLE_COL_OWN_NAME", - localisationLabels - ); - - case "Download": - return getLocaleLabels( - "Download", - "ABG_COMMON_TABLE_COL_DOWNLOAD_BUTTON" - ); - - case "View button": - return getLocaleLabels( - "Action", - "ABG_COMMON_TABLE_COL_VIEW_BUTTON", - localisationLabels - ); - - case "ACTIVE": - return getLocaleLabels( - "Pending", - "BILL_GENIE_ACTIVE_LABEL", - localisationLabels - ); - - case "CANCELLED": - return getLocaleLabels( - "Cancelled", - "BILL_GENIE_CANCELLED_LABEL", - localisationLabels - ); - - case "PAID": - return getLocaleLabels( - "Paid", - "BILL_GENIE_PAID_LABEL", - localisationLabels - ); - case "PAY": - case "PARTIALLY PAID": - return getLocaleLabels("PAY", "BILL_GENIE_PAY", localisationLabels); - case "EXPIRED": - return getLocaleLabels( - "Expired", - "BILL_GENIE_EXPIRED", - localisationLabels - ); - case "GENERATE NEW BILL": - return getLocaleLabels( - "GENERATE NEW BILL", - "BILL_GENIE_GENERATE_NEW_BILL", - localisationLabels - ); - - case "DOWNLOAD RECEIPT": - return getLocaleLabels( - "DOWNLOAD RECEIPT", - "BILL_GENIE_DOWNLOAD_RECEIPT", - localisationLabels - ); - case "Search Results for Bill": - return getLocaleLabels( - "Search Results for Bill", - "BILL_GENIE_SEARCH_TABLE_HEADER", - localisationLabels - ); - case "PARTIALLY_PAID": - case "PARTIALLY PAID": - return getLocaleLabels( - "Partially Paid", - "BILL_GENIE_PARTIALLY_PAID", - localisationLabels - ); - case "BILL_GENIE_GROUP_SEARCH_HEADER": - return getLocaleLabels( - "Search Results for Group Bills", - "BILL_GENIE_GROUP_SEARCH_HEADER", - localisationLabels - ); - } -}; - -export const loadCertDetails = async (action, state, dispatch, data) => { - let requestBody = {}; - const queryParams = [ - { key: "tenantId", value: data.tenantId }, - { key: "id", value: data.id }, - ]; - - if (data.birthcertificateno) - queryParams.push({ - key: "birthcertificateno", - value: data.birthcertificateno, - }); - else if (data.deathcertificateno) - queryParams.push({ - key: "deathcertificateno", - value: data.deathcertificateno, - }); - - try { - let payload = null; - payload = await httpRequest( - "post", - `/birth-death-services/${data.module}/_viewcertdata`, - "_viewcertdata", - queryParams, - requestBody - ); - return payload; - } catch (e) { - toggleSnackbar( - true, - { - labelName: "Api Error", - labelKey: "ERR_API_ERROR", - }, - "error" - ); - //return {"RequestInfo":{"apiId":"Mihy","ver":".01","ts":null,"resMsgId":"uief87324","msgId":"20170310130900|en_IN","status":"successful"},"BirthCertificate":[{"id":"1","createdby":null,"createdtime":null,"dateofbirth":1614063655148,"dateofreport":1614063655148,"firstname":"san","gender":1,"hospitalname":null,"informantsaddress":null,"informantsname":null,"lastname":null,"middlename":null,"placeofbirth":"Bangalore","registrationno":"2021-1","remarks":null,"lastmodifiedby":null,"lastmodifiedtime":null,"counter":0,"tenantid":null,"fullname":"SRI V S","birthFatherInfo":{"id":null,"aadharno":null,"createdby":null,"createdtime":null,"education":null,"emailid":null,"firstname":"abc","lastname":null,"middlename":null,"mobileno":null,"nationality":null,"proffession":null,"religion":null,"lastmodifiedby":null,"lastmodifiedtime":null,"fullname":"R S H"},"birthMotherInfo":{"id":null,"aadharno":null,"createdby":null,"createdtime":null,"education":null,"emailid":null,"firstname":"abc1","lastname":null,"middlename":null,"mobileno":null,"nationality":null,"proffession":null,"religion":null,"lastmodifiedby":null,"lastmodifiedtime":null,"fullname":"S V H"},"birthPermaddr":{"fullAddress":"100 112 CROSS 108 Church Servant Qtr. Jalapahar"},"birthPresentaddr":{"fullAddress":"100 112 CROSS 108 Church Servant Qtr. Jalapahar"}}]}; - } -}; - -export const loadFullCertDetails = async (action, state, dispatch, data) => { - let requestBody = {}; - const queryParams = [ - { key: "tenantId", value: data.tenantId }, - { key: "id", value: data.id }, - ]; - - let payload = null; - try { - payload = await httpRequest( - "post", - `/birth-death-services/${data.module}/_viewfullcertdata`, - "_viewcertdata", - queryParams, - requestBody - ); - return payload; - } catch (e) { - toggleSnackbar( - true, - { - labelName: "Api Error", - labelKey: "ERR_API_ERROR", - }, - "error" - ); - return payload; - //return {"RequestInfo":{"apiId":"Mihy","ver":".01","ts":null,"resMsgId":"uief87324","msgId":"20170310130900|en_IN","status":"successful"},"BirthCertificate":[{"id":"1","createdby":null,"createdtime":null,"dateofbirth":1614063655148,"dateofreport":1614063655148,"firstname":"san","gender":1,"hospitalname":null,"informantsaddress":null,"informantsname":null,"lastname":null,"middlename":null,"placeofbirth":"Bangalore","registrationno":"2021-1","remarks":null,"lastmodifiedby":null,"lastmodifiedtime":null,"counter":0,"tenantid":null,"fullname":"SRI V S","birthFatherInfo":{"id":null,"aadharno":null,"createdby":null,"createdtime":null,"education":null,"emailid":null,"firstname":"abc","lastname":null,"middlename":null,"mobileno":null,"nationality":null,"proffession":null,"religion":null,"lastmodifiedby":null,"lastmodifiedtime":null,"fullname":"R S H"},"birthMotherInfo":{"id":null,"aadharno":null,"createdby":null,"createdtime":null,"education":null,"emailid":null,"firstname":"abc1","lastname":null,"middlename":null,"mobileno":null,"nationality":null,"proffession":null,"religion":null,"lastmodifiedby":null,"lastmodifiedtime":null,"fullname":"S V H"},"birthPermaddr":{"fullAddress":"100 112 CROSS 108 Church Servant Qtr. Jalapahar"},"birthPresentaddr":{"fullAddress":"100 112 CROSS 108 Church Servant Qtr. Jalapahar"}}]}; - } -}; - -export const loadMdmsData = async (action, state, dispatch) => { - let requestBody = { - MdmsCriteria: { - tenantId: commonConfig.tenantId, - moduleDetails: [ - { - moduleName: "tenant", - masterDetails: [ - { - name: "tenants", - }, - { name: "citymodule" }, - ], - }, - { - moduleName: "common-masters", - masterDetails: [{ name: "Help" }], - }, - ], - }, - }; - - try { - let payload = null; - payload = await httpRequest( - "post", - "/egov-mdms-service/v1/_search", - "_search", - [], - requestBody - ); - if (payload) { - dispatch(prepareFinalObject("applyScreenMdmsData", payload.MdmsRes)); - const citymodule = get(payload, "MdmsRes.tenant.citymodule"); - const liveTenants = - citymodule && citymodule.filter((item) => item.code === "UC"); - dispatch( - prepareFinalObject( - "applyScreenMdmsData.tenant.citiesByModule", - get(liveTenants[0], "tenants") - ) - ); - } - return payload; - } catch (e) {} -}; - -export const loadHospitals = async ( - action, - state, - dispatch, - module, - tenantId -) => { - let requestBody = { - MdmsCriteria: { - tenantId: tenantId, - moduleDetails: [ - { - moduleName: "birth-death-service", - masterDetails: [ - { - name: "hospitalList", - }, - ], - }, - ], - }, - }; - let payload = null; - - const queryParams = [{ key: "tenantId", value: tenantId }]; - - try { - payload = await httpRequest( - "post", - "egov-mdms-service/v1/_search", - "_search", - queryParams, - requestBody - ); - } catch (e) { - toggleSnackbar( - true, - { - labelName: "", - labelKey: "ERR_API_ERROR", - }, - "error" - ); - } - return payload; -}; - -export const downloadCert = async (tenantId, id, module) => { - let requestBody = {}; - let payload = null; - - const queryParams = [ - { key: "tenantId", value: tenantId }, - { key: "id", value: id }, - { key: "source", value: captureSource() }, - // { key: "source" , value: "web" } - ]; - try { - payload = await httpRequest( - "post", - `/birth-death-services/${module}/_download`, - "_download", - queryParams, - requestBody - ); - } catch (e) { - store.dispatch( - toggleSnackbar( - true, - { labelName: e.message, labelCode: e.message }, - "error" - ) - ); - // store.dispatch( - // toggleSnackbar( - // true, - // { - // labelName: "Could not initiate download", - // labelKey: "ERR_API_ERROR" - // }, - // "error" - // ) - // ); - //toBeRemoved - //payload = {consumerCode:"CH-CB-AGRA-2020-001504", filestoreId:"4f0d9299-7fa0-4af6-9077-389ebf2367c4", tenantId: "pb.agra"}; - } - - return payload; -}; - -export const postPaymentSuccess = async (data) => { - store.dispatch(toggleSpinner()); - setTimeout(() => { - postPaymentActivity(data); - store.dispatch(toggleSpinner()); - }, 4000); //Give 2 sec gap so that the screen is loaded correctly -}; - -export const postPaymentActivity = async ( - data, - doDownloadCertificate = true -) => { - try { - if (data.tenantId && data.consumerCode) { - store.dispatch(toggleSpinner()); - let queryParams = [ - { key: "tenantId", value: data.tenantId }, - { key: "consumerCode", value: data.consumerCode }, - ]; - let module = data.businessService == "BIRTH_CERT" ? "birth" : "death"; - const response = await httpRequest( - "post", - `birth-death-services/${module}/_getfilestoreid`, - "getfilestoreid", - queryParams, - {} //{ searchCriteria: queryObject } - ); - store.dispatch(toggleSpinner()); - if (doDownloadCertificate && response && response.filestoreId) { - let mode = "download"; - downloadReceiptFromFilestoreID(response.filestoreId, mode); - - store.dispatch(hideSpinner()); - /* - Redirection removed - setTimeout(() => { - // store.dispatch(toggleSpinner()); - store.dispatch(setRoute(`/${module}-citizen/myApplications`)); - }, 5000); //Give 5 sec gap redirect to my applications page. - */ - } - return response; - } - } catch (error) { - store.dispatch(toggleSpinner()); - store.dispatch( - toggleSnackbar( - true, - { labelName: error.message, labelCode: error.message }, - "error" - ) - ); - } -}; - -export const triggerDownload = (module) => { - const state = store.getState(); - const certificateId = get( - state, - `screenConfiguration.preparedFinalObject.bnd.${module}.download.certificateId` - ); - const tenantId = get( - state, - `screenConfiguration.preparedFinalObject.bnd.${module}.download.tenantId` - ); - const businessService = get( - state, - `screenConfiguration.preparedFinalObject.bnd.${module}.download.businessService` - ); - - downloadCert(tenantId, certificateId, module).then((response) => { - if (response && response.consumerCode) { - // Redirect to payment page - const appName = - process.env.REACT_APP_NAME === "Citizen" ? "citizen" : "employee"; - - const url = - process.env.NODE_ENV === "development" - ? `/egov-common/pay?consumerCode=${response.consumerCode}&tenantId=${tenantId}&businessService=${businessService}` - : `/${appName}/egov-common/pay?consumerCode=${response.consumerCode}&tenantId=${tenantId}&businessService=${businessService}`; - document.location.href = `${document.location.origin}${url}`; - } else if (response && response.filestoreId) { - downloadReceiptFromFilestoreID(response.filestoreId, "download"); - } - }); -}; - -export const downloadReceipt = async (consumerCode, tenantId) => { - const state = store.getState(); - - store.dispatch(toggleSpinner()); - let queryParams = [ - { key: "tenantId", value: tenantId }, - { key: "consumerCodes", value: consumerCode }, - ]; - const response = await httpRequest( - "post", - "collection-services/payments/_search", - "_search", - queryParams, - {} //{ searchCriteria: queryObject } - ); - store.dispatch(toggleSpinner()); - if (response && response.Payments && response.Payments.length > 0) { - if (response.Payments[0].fileStoreId) { - let mode = "download"; - downloadReceiptFromFilestoreID(response.Payments[0].fileStoreId, mode); - } else { - const receiptQueryString = [ - { key: "consumerCode", value: consumerCode }, - { key: "tenantId", value: tenantId }, - { - key: "bussinessService", - value: response.Payments[0].paymentDetails[0].businessService, - }, - ]; - downloadConReceipt( - receiptQueryString, - "consolidatedreceipt", - "PAYMENT", - `RECEIPT-${consumerCode}.pdf` - ); - } - } else { - store.dispatch(setRoute(`/uc-citizen/search`)); - } - return response; -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/index.scss b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/index.scss deleted file mode 100644 index 1e8767e102b..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/index.scss +++ /dev/null @@ -1,23 +0,0 @@ -.radio-button-group { - padding: 0; -} - -.checkbox-root { - width: 16px; - margin-right: 11px; -} - -.fontSize12 { - font-size: 12px; -} - -.city-picker-dialog-style { - min-height: 180px; - min-width: 365px; -} - -@media only screen and (max-width: 768px) { - .city-picker-dialog-style { - min-width: 250px; - } -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/receiptPdf.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/receiptPdf.js deleted file mode 100644 index 5b1081b58e5..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/receiptPdf.js +++ /dev/null @@ -1,788 +0,0 @@ -import { downloadMultipleBill } from "egov-common/ui-utils/commons"; -import { toggleSpinner } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import get from "lodash/get"; -import isEmpty from "lodash/isEmpty"; -import pdfMake from "pdfmake/build/pdfmake"; -import pdfFonts from "pdfmake/build/vfs_fonts"; -import store from "../../../../ui-redux/store"; -import { - loadMdmsData, loadPtBillData, - loadUlbLogo -} from "./receiptTransformer"; - -pdfMake.vfs = pdfFonts.pdfMake.vfs; - -const billTableWidthForConsumeDetails = ["*", "*", "*", "*"]; -// const billTableWidthForBillDetails = ["*", "*", "*", "*", "*", "*"]; -const stylesForBills = { - "noc-head": { - margin: [-25, -30, 0, 1] - }, - "receipt-logo-header": { - color: "#000000", - fontFamily: "Roboto", - fontSize: 14, - bold: true, - letterSpacing: 0.74, - margin: [0, -10, 0, 5] - }, - "receipt-logo-sub-header": { - color: "#484848", - fontFamily: "Roboto", - fontSize: 13, - letterSpacing: 0.6 - }, - "noc-table": { - fontSize: 12, - color: "#484848", - margin: [-25, 15, -8, -8] - }, - "noc-table2": { - fontSize: 12, - color: "#484848", - margin: [-25, 18, -8, -8] - }, - "noc-table3": { - fontSize: 12, - color: "#484848", - margin: [-25, 18, -8, -8] - }, - "noc-table4": { - fontSize: 12, - color: "#484848", - margin: [-25, 5, -8, -8] - }, - "noc-table5": { - fontSize: 12, - color: "#484848", - margin: [-25, 12, -8, -8] - }, - "receipt-table-value": { - color: "#000000", - bold: true, - fontSize: 12, - fontWeight: 500, - margin: [8, 5, 0, 0] - }, - "receipt-table-value2": { - color: "#000000", - fontSize: 11, - fontWeight: 400, - margin: [3, 5, 0, 0] - }, - "receipt-table": { - color: "#484848", - fontSize: 12, - fontWeight: 400, - margin: [-30, 5, 0, 0] - }, - "receipt-address": { - color: "#484848", - fontSize: 12, - margin: [0, -2, 0, 5], - minWidth: 10 - }, - "receipt-table2": { - color: "#484848", - fontSize: 12, - fontWeight: 400, - margin: [3, 8, 0, 10] - }, - "right-receipt-table": { - color: "#000000", - bold: true, - fontSize: 12, - fontWeight: 500, - margin: [8, -10, 0, 10] - }, - "right-receipt-table2": { - color: "#000000", - bold: true, - fontSize: 12, - fontWeight: 500, - margin: [-30, -10, 0, 0] - }, - "receipt-approver": { - fontSize: 12, - bold: true, - margin: [-27, 50, -10, 0], - color: "#484848" - }, - "no-signature": { - fontSize: 12, - margin: [-27, 35, -10, 0], - color: "#484848" - }, - "amount-due": { - fontSize: 30, - color: "#FC8019", - fontWeight: 700 - }, - "pt-disclaimer": { - fontSize: 12, - margin: [-27, 30, -10, 0], - color: "#484848" - }, - "pt-disclaimer-value": { - fontSize: 12, - margin: [0, 5, 0, 0], - color: "#484848" - }, - "qr-text": { - fontSize: 12, - margin: [40, 0, 0, 0], - color: "#484848", - alignment: "left" - }, - "qr-image": { - margin: [-40, -1, -3, 0], - color: "#484848", - alignment: "right" - }, - "footer-header": { - margin: [0, 5, 0, -10], - color: "#000000", - bold: true, - alignment: "center" - }, - footer: { - margin: [0, 25, 0, 0], - color: "#000000", - bold: true, - alignment: "right" - } -}; - -// For mutliple bills -const getMutlipleBillsData = transformedDataArray => { - let multipleBillData = transformedDataArray.map((transformedData, index) => { - return getPdfContent(transformedData, transformedDataArray.length, index); - - }); - let finalMultipleBillData = { - content: multipleBillData, - styles: stylesForBills - }; - return finalMultipleBillData; -}; -//generateMutlipleBills PDF -export const generateMultipleBill = async (state, dispatch, type) => { - dispatch(toggleSpinner()); - let allBills = get( - state.screenConfiguration, - "preparedFinalObject.searchScreenMdmsData.billSearchResponse", - [] - ); - const commonPayDetails = get( - state.screenConfiguration, - "preparedFinalObject.searchScreenMdmsData.common-masters.uiCommonPay", - [] - ); - const businessService = get( - state.screenConfiguration, - "preparedFinalObject.searchCriteria.businesService", - '' - ); - - let billkey = '' - const index = commonPayDetails && commonPayDetails.findIndex((item) => { - return item.code == businessService; - }); - if (index > -1) { - billkey = get(commonPayDetails[index], 'billKey', ''); - } else { - const details = commonPayDetails && commonPayDetails.filter(item => item.code === "DEFAULT"); - billkey = get(details, 'billKey', ''); - } - allBills = allBills.filter(bill => bill.status === 'ACTIVE'); - allBills && allBills.length > 0 && await downloadMultipleBill(allBills, billkey); - /* - To Download Files based on Filestoreid logic - - let filestoreids=[]; - let bills=[]; - allBills.map(bill=>{ - if(bill.status==='ACTIVE'){ - if(bill.fileStoreId==null){ - bills.push(bill); - }else{ - filestoreids.push(bill.fileStoreId) - } - } - }) - bills&&bills.length>0&&await downloadMultipleBill(bills,billkey); - filestoreids&&filestoreids.length>0&&downloadMultipleFileFromFilestoreIds(filestoreids,'download'); */ - dispatch(toggleSpinner()); -}; -/* await loadMdmsData(tenant); -// data1 is for ULB logo from loadUlbLogo -let data1 = get( - state.screenConfiguration.preparedFinalObject, - "base64UlbLogo", - {} -); - -// data2 is for corporation Name from loadMdmsData -let data2 = get( - state.screenConfiguration.preparedFinalObject, - "mdmsDataForReceipt", - {} -); -let transformedData = allBills.map(item => { - const billData = loadPtBillData(item); - return { - ...billData, - ulbLogo: data1, - ...data2 - }; -}); -const multipleBills = getMutlipleBillsData(transformedData); -pdfMake.createPdf(multipleBills).open(); -dispatch(toggleSpinner()); -}; */ - -/************************************************SingleBill***********************************************************************/ - -//For single bill - -const getSingleBillData = transformedData => { - let singleBillData = { - content: getPdfContent(transformedData, 1, 0), - styles: stylesForBills - }; - return singleBillData; -}; - -export const generateSingleBill = async billNo => { - const state = store.getState(); - const allBills = get( - state.screenConfiguration, - "preparedFinalObject.searchScreenMdmsData.billSearchResponse", - [] - ); - let billData = {}; - const data = allBills.find( - item => get(item, "billNumber", "") === billNo - ); - if (isEmpty(data)) { - alert("Bill not found !"); - return; - } - const tenant = get(data, "tenantId"); - loadUlbLogo(tenant); - let transformedData = await loadPtBillData(data); - await loadMdmsData(tenant); - - // data1 is for ULB logo from loadUlbLogo - let data1 = get( - state.screenConfiguration.preparedFinalObject, - "base64UlbLogo", - {} - ); - - // data2 is for corporation Name from loadMdmsData - let data2 = get( - state.screenConfiguration.preparedFinalObject, - "mdmsDataForReceipt", - {} - ); - getTaxHeadtable(transformedData.taxHeads); - billData = { - ...transformedData, - ulbLogo: data1, - ...data2 - }; - const singleBillData = getSingleBillData(billData); - pdfMake.createPdf(singleBillData).open(); -}; - -//Tranformed data is to be given from the row data bill response and then fed to the billdata and then generate PDF using that bill data - -export const getTaxHeadtable = taxHeads => { - const taxtableData = taxHeads.reduce( - (acc, item) => { - acc.taxTableTitles.push({ - text: item.taxHeadCode, - border: [true, true, true, true, true, true, true], - style: "receipt-table-key", - alignment: "center" - }); - acc.taxTableAmounts.push({ - text: item.amount, - border: [true, true, true, true, true, true, true], - style: "receipt-table-value", - alignment: "center" - }); - return acc; - }, - { - taxTableTitles: [], - taxTableAmounts: [] - } - ); - taxtableData.count = taxHeads.length; - taxtableData.billTableWidthForBillDetails = taxHeads.map(item => "*"); - return taxtableData; -}; - -const getTaxHeadHeaders = (taxHeads) => { - const headers = Object.keys(taxHeads).map((item, index) => { - return { - text: item, - border: [false, false, false, false], - style: "receipt-table-value2" - }; - }) - return headers -} - -const getTaxHeadValues = (taxHeads) => { - const values = Object.values(taxHeads).map((item, index) => { - return { - text: item, - border: [false, false, false, false], - style: "receipt-table2" - }; - }) - return values -} - - -const getPdfContent = (transformedData, length, index) => { - return [ - { - style: "noc-head", - table: { - widths: [60, "*", 120], - body: [ - [ - { - image: transformedData.ulbLogo, - width: 50, - height: 61.25 - }, - { - stack: [ - { - text: transformedData.corporationName, - style: "receipt-logo-header" - }, - { - stack: [ - { - text: transformedData.corporationAddress, - style: "receipt-address" - }, - { - text: `Tel. +91 ${transformedData.corporationContact}`, - style: "receipt-address" - }, - { - text: `website: ${transformedData.corporationWebsite}`, - style: "receipt-address" - }, - { - text: `Email: ${transformedData.corporationEmail}`, - style: "receipt-address" - } - ] - } - ], - alignment: "left", - margin: [0, 10, 0, 0] - }, - { - stack: [ - { - text: "Total Amount due" - }, - { - text: `₹ ${transformedData.amountDue}`, - style: "amount-due" - } - // { - // table: { - // widths: [ - // "*", - // "*", - // ], - // body: [ - // [ - // { - // image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABkAAAAZAAQMAAAAbwhzkAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAGUExURQAAAP7+/soH9D0AAAYwSURBVHja7dyxcYNAEAVQPA4UugRKoTRcGqW4BIcKNMKBcABzXu8JhIXn/UwSJ/Zt/Oea8Z+kAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAXkiyGdTn77iaHt79nLHa1oQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEJA9IC+ZVvolhHS3b88hpE+130FAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQP4AMmQK7vNpruVme80OppxAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQECOCeluH1PdeBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQkGND4pvaQUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBADgYJE0OG+TTh0TggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7QqqSgpS78TUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQF5LGRF4h2MjwoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMhGkPI0izvTP6Ju/IosLnk/b1/yBwEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB+RVyz1+mdjDlEu6gW4wKAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB6Scc1hp76MdjCGk3I0f5jsAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQHZBRJ348PhYkhNrb6rWTIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMi2kB8yPfTRJFKepnz07fbjdX40tT4QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEJCtICuSqtWndjDllHotCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjIRpDPpj797B+umSOv08PvGcj0sQUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAdkD8pJppV/mkMXRYT5VuRtf3kFXU8kHAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQF5DGQoltbbImQxzYpMkMVN7SAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAeDnMZEype8p46CgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA8AeSem9pr0oKAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOwJSU0zh3ynW7yvOM17ceRurAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMi2kKr00dFTZgdTrjU7AAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB2RhyvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArMkXJlylJdANIpEAAAAASUVORK5CYII=", - // width: 40, - // height: 40, - // border: [ - // false, - // false, - // false, - // false - // ], - // style:"qr-image", - // }, - // { - // stack:[ - // { - // text: "Scan Code to pay", - // style:"qr-text" - // }, - // { - // text: "Use any Bank/UPI App", - // style:"qr-text" - // }, - - // ], - // border: [ - // false, - // false, - // false, - // false - // ] - // } - // ] - // ], - // alignment: "right", - // margin: [ - // 0, - // 10, - // 0, - // 0 - // ] - // } - // } - ], - alignment: "right", - color: "#484848", - margin: [-150, 2, -20, 0] - } - ] - ] - }, - layout: "noBorders" - }, - { - style: "noc-table", - table: { - widths: [130, 130, -2, 130, 130], - body: [ - [ - { - text: "Payer Name", - border: [true, true, false, false], - - style: "receipt-table-value" - }, - { - text: transformedData.payerName, - border: [false, true, true, false], - - style: "receipt-table" - }, - { - text: "", - border: [false, false, false, false] - }, - { - text: "Bill No.", - border: [true, true, false, false], - style: "receipt-table-value" - }, - { - text: transformedData.billNumber, - border: [false, true, true, false], - style: "receipt-table" - } - ], - [ - { - text: "Mobile No.", - border: [true, false, false, false], - style: "receipt-table-value" - }, - { - text: transformedData.mobileNumber, - border: [false, false, true, false], - style: "receipt-table" - }, - { - text: "", - border: [false, false, false, false] - }, - { - text: "Bill Period", - border: [true, false, false, false], - - style: "receipt-table-value" - }, - { - text: transformedData.billPeriod, - border: [false, false, true, false], - style: "receipt-table" - } - ], - [ - { - text: "Payer Address", - border: [true, false, false, false], - style: "receipt-table-value" - }, - { - text: transformedData.payerAddress, - border: [false, false, true, false], - style: "receipt-table" - }, - { - text: "", - border: [false, false, false, false] - }, - { - text: "Bill Issue Date", - border: [true, false, false, false], - style: "receipt-table-value" - }, - { - text: transformedData.billDate, - border: [false, false, true, false], - style: "receipt-table" - } - ], - [ - { - text: "Property ID", - border: [true, false, false, true], - style: "receipt-table-value" - }, - { - text: transformedData.propertyId, - border: [false, false, true, true], - style: "receipt-table" - }, - { - text: "", - border: [false, false, false, false], - }, - { - text: "Bill Due Date", - border: [true, false, false, true], - style: "receipt-table-value" - }, - { - text: transformedData.dueDate, - border: [false, false, true, true], - style: "receipt-table" - } - ] - ] - }, - layout: {} - }, - - { - style: "noc-table2", - table: { - widths: ["103%"], - body: [ - [ - { - text: "Billing Summary - Property Tax", - border: [true, true, true, false], - style: "receipt-table-value" - } - ], - [ - { - table: { - widths: ["10%", "14%", "13%", "14%", "10%", "9%", "9%", "10%", "12%"], - body: [ - getTaxHeadHeaders(transformedData.taxHeads), - getTaxHeadValues(transformedData.taxHeads) - ] - }, - border: [true, false, true, true] - } - ] - ] - }, - layout: {} - }, - { - style: "noc-table3", - table: { - widths: ["103%"], - body: [ - [ - { - text: "Important Message", - border: [true, true, true, false], - margin: [9, 10, 0, 5], - style: "receipt-table-value" - } - ], - [ - { - ol: [ - { - text: - "5% rebate will be given if tax is paid for both half years at a time before 30th April of current financial year.", - margin: [8, 0, 0, 5] - }, - { - text: - "Property tax can be paid through: Cash or Cheque at eSeva, Mee Seva centres or Municipal Office or Online through Credit Card/Debitcard/Net Banking.", - margin: [8, 0, 0, 5] - }, - { - text: - "Due dates for payment of property tax without interest for current financial year: First half year 30th June, Second half year: 31st December.", - margin: [8, 0, 0, 5] - }, - { - text: - "A simple interest @ 2% per month will be charged in case of failure to pay property tax by due dates as above.", - margin: [8, 0, 0, 5] - }, - { - text: - "If the tax payers fail to pay the property tax within 15 days from the date of receipt of this Demand Bill, the same amount can be collected by issuing a distraint warrant u/s Section-269 of Municipal Corporations Act, 1955 (formerly GHMC Act, 1955).", - margin: [8, 0, 0, 5] - }, - { - text: - "Please bring this bill while paying at Office counter or eSeva or Mee Seva centers. ", - margin: [8, 0, 0, 10] - } - ], - border: [true, false, true, true], - alignment: "left" - } - ] - ] - }, - layout: {} - }, - { - canvas: [ - { - type: "line", - x1: -40, - y1: 20, - x2: 700, - y2: 20, - dash: { length: 10, space: 5 } - } - ] - }, - { - image: - "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AABB1klEQVR42u2dC5Ad1Xnn78ztvt23p2nNjAR6AV4hCctJ1gIJIcmGRdlKAU6lwmLHVFIma2LsIJJaHpX1GuMt7yaOg2yweSUYFDsVZ+3yg4cecQAnsARiEsurMiGmsmtvvKlNFQJbyQosCFL08H6NzhkOSNN95s69c885/btVXxlr7v3N3K+//v5fv/6n1eLFixcvXrx48Zrp62d+ZtOIxKgRI/DgwYMHDx48v3gz/eXtNwY8ePDgwYMHzy/eTKeOSCI2Iup1+oAHDx48ePDgzT2vl19e/sKOEfEsvww8ePDgwYMHbw55vfzyRCI1Ipnll4EHDx48ePDgzSGvl19e/sKuEeksvww8ePDgwYMHbw55mmn7xvLuwkxizIjy/4/2+IvhwYMHDx48eHPPG1E3DY7a/vLyF+ZGjM3yy8CDBw8ePHjw5panbyCsHwCMX14Ykc/yy+Tw4MGDBw8evDnljRhPDVQPAOrNmfEHzFP/O5svoznz4MGDBw8ePHhzwtM3EHaMAWCk6s2pceqhINnw4MGDBw+elzz91MDUAFA3KXTfcO2BZMODBw8ePHh+8TLjqYFyAIjqrhGkxgAwRrLhwYMHDx4873haw/UAEFed+o/UhKAHgIxkw4MHDx48eN7xzKcGupWmQeqmgNgYAFKSDQ8ePHjw4HnJK4wBIK276c8cAGZjV8jGgwcPHjx48IbL0wNAVqnn6kNt4xlBxB8ePHjw4MHzl1dY3cNnDAAR4g8PHjx48OB5z7N7es8YABB/ePDgwYMHrym8Wa4oRLLhwYMHDx48z3kkBx48ePDgwUP8SQ48ePDgwYOH+JNsePDgwYMHD/En2fDgwYMHDx7iDw8ePHjw4MFD/OHBgwcPHjx4Loq/9dN/JBsePHjw4MELgqet/61NgnKSDQ8ePHjw4Hkv/pHVAGCsJ1yQbHjw4MGDB89r8dfr/VQPAOrNmTr6L0g2PHjw4MGD5634J2q137jS+l+9OVVH/7mxtjDJhgcPHjx48PzipSqmBoC6SaFrDAA5yYYHDx48ePC842VKz/UAENVdI0iNAWCMZMODBw8ePHje8bSG6wEgrjr1H6kJQQ8AGcmGBw8ePHjwvOPps/d6AEiqxL+tpoOOcb2AZMODBw8ePHj+8QpjAEjrbvozB4DE2iWIZMODBw8ePHiu8fQAkFXqufpQ23hGEPGHBw8ePHjw/OUVVvfwGQNAhPjDgwcPHjx43vPsnt4zBgDEHx48ePDgwWsKr1fhJ9nw4MGDBw9eGDySAw8ePHjw4CH+JAcePHjw4MFD/Ek2PHjw4MGDh/iTbHjw4MGDBw/xhwcPHjx48OAh/vDgwYMHDx48F8Xf+uk/kg0PHjx48OAFwdPW/9YmQTnJhgcPHjx48LwX/8hqADDWEy5INjx48ODBg+e1+Ov1fqoHAPXmTB39FyQbHjx48ODB81b8E7Xab1xp/a/enKqj/9xYW5hk+8GLJVZJXCJxrcRNElsl7pX4+sjIyF/EcbQ7juOnVMh/R0/Kv/+pes9W9ZlrFWOVYrI94MGDB88/XqpiagComxS6xgCQk2wneaUob5C4UuKTEjslvitxSOLHJwoR+R9HUVsiMqL96r9P9xkVhxR7p/pd5e/ccPLJ8xO2Bzx48OA5y8uUnusBIKq7RpAaA8AYyXaDd/75GyfmzSsuELH+kPz4YYmXakS7X+JfwYte7nTiR9I0/ej4+LxN5523YZztCw8ePHhO8LSG6wEgrjr1H6kJQQ8AGckeLm/RooU/2e2mHxKRfVDE9oXZiXW/xf+EvH3y8x0S10icyvaFBw8evKHw9Nl7PQAkVeLfVtNBx7heQLKHwMuyrBDRv1quzT8uwnpkgGI9aN4RiUcl3iuRs33hwYMHb854hTEApHU3/ZkDQGLtEkSy+8Urb8q4SET0iyKo/zwEsR4072WJL5TfUX1X6gUePHjwBsfTA0BWqefqQ23jGUHEf+54hcSHJZ51SKwHzXu2/M7dbneceoEHDx68gfAKq3v4jAEgQvznjDdf4mMS+xwX60HeQPhCmiafeNObTl9GvcCDBw9eX3l2T+8ZAwDiP3jeYolbWsYd/M0U/9fxXup0OnfIjY5LqBd48ODBm0Ner8JPsmfEm5S4U+KA52I9SN4rKkeT1As8ePDgzS2P5PSfVw5X75PYG5hYD5K3V+VshPqDBw8ePMTfR95qiScDF+tB8srcvZX6gwcPHjzE3xdeeWf/bRKHEf9Z88oc3ipxEvUHDx48eIi/y7wLJfY0VKwHyStzeiH1Bw8ePHiIv2u80tzmdySOItYD4x1Nks4tGzeeO0n9wYMHDx7i7wKvfHztCcR6bnhikfzkkiWLV1F/8ODBg9ezpo+QnNnzSmvbHyLWc82L9o6Ojl5M/cGDBw/ezIRf+f5YmwTlJPs4Xvn/P151yh+xHjjvqNoGo+zs8ODBg2cl/pHVAGCsJ1yQ7Ne9OhJfRayd4X1FbRN2dnjw4MGbXvz1ej/VA4B6c6aO/guSPfUqH/F7FLF2jvdIy3hUkJ0dHjx48F6n54la7TeutP5Xb07V0X9urC3c9GQvlPg2Yu0s79tqG9E84MGDB+81XqpiagComxS6xgCQk+zWconvI9bO8/5ObSuaBzx48OAdO5PfNQaAqO4aQWoMAGMk+1VL3x8grt7wni+3Gc0DHjx4DedpDdcDQFx16j9SE4IeADKS3VqB+HvJe37BgvmraR7w4MFrKE+fvdcDQFIl/m01HXSM6wVNT/YiTvv7y4vj6O9PPXXpSpoHPHjwGsgrjAEgrbvpzxwAEmuXoHCTXd7t/xTi6jdPXAP/ZvnyZUtpHvDgwWsYTw8AWaWeqw+1jWcEmy7+icRjiGswvMfUNqV5wIMHrym8wuoePmMAiBD/V13l7kNcg+Pd18IxEB48eM3h2T29ZwwAIyS7tQVxDZa3heYBDx48eK8H9CT8ASbnZ1t4+4fMK7ftO2ge8ODBgzfLV2DJWSqxF3ENnrdXbWuaBzx48OCRnFZpi/gE4toY3hNqm9M84MGDh/g3PDkfR1wbx/ttmgc8ePAQ/2Yn58JWxXV/xDVY3pFy29M84MGDh/g3Mzml2c+ewMXwoMQzEtskbpe4UWKzxOUSl6ko/3uzfO4jnU7nM51O/DUx0PmfwjsY+DCxZ8WKM5bQPODBg4f4Ny85twUo/vvk59slrm0dW8Qo7jV/a9eeNdlut89WrJK5L7QzCUmS3EXzgAcPXtPE3/rpv0CTU4rj4UDE/zk5cr9DxPrc1gzMbnrIX/n/10ncEtCZk8OTkxNvp3nAg9fqSGyR/eNzchbw89JT/ui1iD9f/rv8/LMzjcB4PxdAvWjrf2uToDyw4i8nnyc9F69DUqj3nXRS/s4NG9ZNDGF7lHfRXyTxJYlDPp85kUWD/mr16p9qIw7wGi7+O7inqJJ3r0QUgPhHVgOAsZ5wEVjxv8/fYo0OJEnnD0455eS3OrQ9lkncLX/fAY939l9BHOAh/oh/4OKv1/upHgDUmzN19F8EVPyTrRMY/nhQrEfkiP+zS5YsXuVqM1q0aOGZMpx8Vr7rEQ939r2qNhAHeIg/4h+i+Cdqtd+40vpfvTlVR/+5sbZwCMV/p4fFumvevOJ8X5rR+Pi8C+S0+m4Pd/Y7EAd4iD/iH5j4jyo9T80BoG5S6BoDQB5I8S+WOOBRse6Xz20+77wN4741o+XLl5U7Tfm44X6PdvZXJBYhDvAQf8Q/IPHPlJ7rASCqu0aQGgPAWEDFf4tHxfq0fHZVAM3ozeV38ah53Iw4wEP8Ef9AxF9ruB4A4qpT/5GaEPQAkAVU/PMlXvKkWO+WU/5ZQM0olbjHk+ax/0T3AiA28BB/xN+zetFn7/UAkFSJf1tNBx3jekFIxf8xD4q19CW4KuBmdFXrmAWv683jtxAbeIg/4u95vRTGAJDW3fRnDgCJtUuQH8kpLX/3OV6s5b0JlzagGb3TvA/D0e2xT9UMYgMP8Uf8fa0XPQBklXquPtQ2nhEcCaz4P+x4sb4ocUGDmtEF5Xd2vHncgNjAQ/wRf4/rpbC6h88YAKIAxb983OFZh4v1lYaJ/6uv0dHRf1uaGjncPJ718ekLePAQf8Rfhd3Te8YAMBLgznSR40vSXtrU5jY2Nna5y6ZBYrN8KWIDD/FH/IOul16F34fkyEb/osPFelXTm1u3273e1eYhzotfQWzgIf6IP0sEe/hlsiwrpAD+2dFivYfmdown+ft9R5vHyytXLl+M2MBD/BF/xN+z5HS76dWOFutfB/ac/2x5pU/A0y42j9HRkSsQG3iIP+KP+HuWnDiOH3fR3jcQh79+80rHwP0ONo9HEBt4iD/ij/h7lBxZme4nHb3B7Gqa27S8zQ42j/JGzVMRG3iIP+KP+HuSHDn9/yEXV/Xj0bJKXvnv33KweVyD2MBD/BF/xN+T5HQ68YOOFesRn5b0HSJvbcs9u+DtiA08xB/xD0n8rZ/+8y05GzeeOykF8aJLxSqPlH2W5mbNu8uxZrRPnZ2gecBD/BF/3+tPW/9bmwTlPiVHjrQvcKtYowNLlixeRXOzfi2VOOhYM1pL84CH+CP+AYh/ZDUAGOsJF549V/4hl4o1STp/QHOb8esex5rRB2ke8BB/xN9z8dfr/VQPAOrNmTr6LzxLzsMOFeuhU045+a00t5m9JG8rJH+HHWpGDyFe8BB/xN9j8U/Uar9xpfW/enOqjv5zY21hH5ITS7zUcsdO9j6aW288yd39DjWj/aq2EC94iD/i7xsvVTE1ANRNCl1jAMg9Ss4Gl4pVFpR5J82tN57k7l2ONaP1iBc8xB/x94yXKT3XA0BUd40gNQaAMc+Sc6VDxfrchg3rJmhuvfHU0xzPO9SMrkS84CH+iL9HPK3hegCIq079R2pC0ANA5mFyPulKscop7DtobrPjSV4/3XLnUc5bES94iD/i7wlPn73XA0BSJf5tNR10jOsFPiZnpyvF2m63z6W5zZq3zpVmVJpLsT3gIf6Ivye8whgA0rqb/swBILF2CXIvOd91pFj/X6vCPIZiteaV/7vPhWYUx9H32B7wEH/E3xOeHgCySj1XH2obzwj6Kv7lXdqHHCnW7TS3vvF2ONKM/mXdujXc0wEP8Uf8feAVVvfwGQNA5LH4l69VDhXrtTS3vvGuc6UZSbyF7QEP8Uf8PeDZPb1nDAAjnifnEoeKdTXNrW+8sxxqRj/P9oCH+CP+wfB6FX4Hv8y1jhTrQXU5guLqDy9WOeXMDjzEH/GnXgbE8/3L3ORIsT5DcfWd94wjzegmtge8PvNixB/xR/xnz9vqSLFuo7j6ztvmSDPayvaAh/gj/oi/e1/mXkeK/3aKq++82x1qRmwPeIg/4o/4O/Zlvu5I8d9IcfWdd6Mjze1htgc8xB/xR/wd+zJSRH/hSPFvprj6ztvsSHN7gu0BD/FH/BF/x5IjTm27HSn+yynW/vJGR0d+2ZHmtovtAQ/xR/x9F3/rp/98SU4cx085UvyXUaz95WVZ972ONLfdbA94iD/i7zFPW/9bmwTlPiTntQFg6MV/GcXaX97YWHaFI81tN9sDHuKP+Hss/pHVAGCsJ1z4kBwZAHY7UvyXU6z95WVZ9quONLddbA94iD/i76n46/V+qgcA9eZMHf0XPiRH7gF40pHi30yx9pfX7Xavd6S5Pc72gIf495V3H+I/J+KfqNV+40rrf/XmVB3958bawk4nR4rrTx0p/o9QrP3lJUnym440t4fYHvAQf8TfM16qYmoAqJsUusYAkHuSnHtdKP5Op/MZirXvw90djjS3r7I94CH+iL9HvEzpuR4AorprBKkxAIx5lJytLhR/pxN/jWLtO2+bI8Pd59ge8BB/xN8TntZwPQDEVaf+IzUh6AEg8yw5N7lQ/HIz4t9SrH3nfceF5pamySfYHvAQf8TfA54+e68HgKRK/NtqOugY1wt8S861jhT/wXXr1kxQrH3jlc3ioAvNrbwZke0BD/FH/D3gFcYAkNbd9GcOAIm1S5BbybnEleJvt9tnU6x94612pbnlef5utgc8xB/x94CnB4CsUs/Vh9rGM4IjniZnlUPFfw3FGtyZnR9PTIyvZ3vAQ/wRfw94hdU9fMYAEHks/npHPORI8W+nWPvG2+FIczua52M52wMe4o/4e8Cze3rPGABGAkjOdx0p/n0SoxTrrHmjKpcuNLd/YHvAQ/wR/6B4vQq/o8nZ6VDxn0Oxzpq3zqHm9iDbAx7ij/izRLC7X+aTDu1Mt1Bcs+Z9yqHmtoXtAQ/xR/wRf3e/zJUO7Ux7JNoUV8+8MnfPOdTcLqN5IP6IP+KP+Lv7ZTY4tjNdRLH2zLvYsea2jOaB+CP+iD/i7+iXOfnk+YkU6MsO7Uxfolh75n3Zoeb2HNsD8Uf8EX/E3/HkiBf/Iw7tTIf0kSPFOiPeGRKHHWpuX6B5IP6IP+KP+DuenDRNP+rYznQ3xTpj3j2ONctfpHkg/og/4h+K+Fs//edbcsbH521ybGc6sGjRwjMpVmve0pbh/e9AsyzP4ozTPBB/xB/xD4Cnrf+tTYJyn5KzYcO6CSnWfS7tTEnS+SzFav26y7Fm+RjNA/FH/BH/QMQ/shoAjPWECw+Ts8OxnemI+Mj/G4q19rVW4ohjzfI3aB6IP+KP+Acg/nq9n+oBQL05U0f/hYfJuca1nSmOo93Lly+LKNZpX+V7v+Vgs3wzzQPxR/wRf8/FP1Gr/caV1v/qzak6+s+NtYV9Ss5p+kjSsZ1pM8U67Wuzg83yezQPxB/xR/w956UqpgaAukmhawwAuafJedTBnWm/xJkU63Gv8ih7v4PN8tM0D8Qf8Uf8PeZlSs/1ABDVXSNIjQFgzOPkXOHozvS0REqxTr3KXDztaLPcSDNC/BF/xN9TntZwPQDEVaf+IzUh6AEg8zw5J0m87OjOeQ/FOvXa6mizfIpm1Ajx3474I/4B8vTZez0AJFXi31bTQce4XhBCcr7o8M55FcXa2uxws/wAzQjxR/wRf095hTEApHU3/ZkDQGLtEuR+ci52eOcsb1J8Z4OL9V2SpyOONssXJDKaEeKP+FMvnvL0AJBV6rn6UNt4RnAkoOSUdzvucXjnPCBxQQOLdVPpkOhws7ydZoT4I/7Ui8e8wuoePmMAiAITf/36iOM754ujo6M/3TDxf9Hh7XFUPvsWmhHij/hTfx7z7J7eMwaAEMW/1e2mE1LwL7q9c0YHxsbGLm/Iaf8DjjfLR2keiD/iT/01gter8PuUnCRJbvZg5zzS7XavC/yGvyOuN8ssy95D80D8EX/qjyWCA0nOm950+jIp/pc92Tm3tix8AjzaHuV3uceXZtnpxH98zjlnL6B5IP6IP/WH+AeSnE6nc6dHO2dpFvTmALbHSom/9q1ZlkPA2rVnTdI8EH/En/pD/ANIThzH5TrzBzzaOUvb4NIff9TD7VFeViqfo/+Rx81ymxIQmgfij/hTf4h/AMm508OdfZfEGo+2R/m3fjOQZvnATIYAmhHij/jDQ/zd5U1K7PVwZy9Ng+6SWOrw9liq/sYjgTVLqyGAZoT4I/7wEH/3eVd6vLMflLhHPr/coe1xRuvY2gYHA22WtUMAzQjxR/zh+ST+1k//BZic8ov/pec7+yG5qfH+k07K37Vx47mTQ9gepcNiabP8ZYnDATfL2iGAZoT4I/7wPOJp639rk6A8wOSc9Ubh8ndnj56Xfy/XrV/XqrlhcJb5G1W/41MSzzWgWdYOATQjxB/xh+eZ+EdWA4CxnnARaHJuD3Bn3yexQ+I6NeTM5rR1rBjXKea+BjXL2iGAZoT4I/7wPBN/vd5P9QCg3pypo/8i0OQU+kg24OZRXpd/RmKbGng+LLF5dHTkl7Os+96xsewKcb77VXEgvF7cEv+r8O5Q733GvKbfsGZpw9umfAJoRog/4g/PB/FP1Gq/caX1v3pzqo7+c2Nt4RCT8w7ZaY7SPODNlIdjIOKP+MPzhJeqmBoA6iaFrjEA5CEnJ0k6n6Z5wOuFh2Mg4u8w737EH546k981BoCo7hpBagwAY6Ene/36tfPFJfCbNA94PfJwDET8EX94LvK0husBIK469R+pCUEPAFlTkr148aKfkB3qn2ge8Hrk4RiI+CP+8Fzi6bP3egBIqsS/raaDjnG9oFHJHh0d/Tn58VHEEF6PPBwDEX/EH54rvMIYANK6m/7MASCxdgkKL9lbEEN4s+DhGIj4I/7wXODpASCr1HP1obbxjOBIg5Nd/vd9iCE8HAMRf8Qfnse8wuoePmMAiBou/vqVSDyGGMLDMRDxR/zhecqze3rPGAAQ/9depUnQU4ghPBwDEX/EH16wvF6FvwHJWSTxfcQQHo6BiD/iD48lgpuXnBUSP0AM4fXKwzEQ8Uf84SH+/vJWy074PM0IXq88HAMRf8QfHuLvKW/Bgvmr4zj6e5oRvFnwcAxE/BF/eIi/j7xTT126UiyDn6YZwZsFD8dAxB/xh4f4+8hbseKMJbJz/neaEbxZ8HAMRPwRf3iIv6e8jsRXEUN4s+DhGIj4I/7whib+1k//kexpHQM/3rJYO4DmBm8mQ0DDxH8b9YL4w5tTnrb+tzYJykn2tLyLJH6IGMLDMRDxR/zheSD+kdUAYKwnXJDsytcSiccRQ3g4BiL+iD88h8Vfr/dTPQCoN2fq6L8g2bWvtnlJgOYGb4a8pjgGIv6IP7zhiH+iVvuNK63/1ZtTdfSfG2sLk+z614WyU++hucGbKa8BjoGIP+IPbzi8VMXUAFA3KXSNASAn2fa85cuXLU2S5C7Z0Q/T3ODNhBewYyDij/jDGw4vU3quB4Co7hpBagwAYyS7N97ExPjbxT3wmzQ3eDPkheYYiPgj/vCGw9MargeAuOrUf6QmBD0AZCR7drzVq3+qPNXyKxJ7EUN4M+CF4hiI+CP+8IbD02fv9QCQVIl/W00HHeN6AcnuH29S4g6JVxBDeA1xDET8EX94w+MVxgCQ1t30Zw4AibVLEMmeKW+RxM0S+xFDeAE7BiL+iD+84fL0AJBV6rn6UNt4RhDxHzyvPCPwWxL7GiqGR+Vzfzo2lv1ip9PZjjgE5RiI+CP+8IbPK6zu4TMGgAjxn3NeIXGDNIlnG9Isy4HnVvn8m3X+1q9fO1+GgB2IQxCOgYg/4g/PDZ7d03vGAID4D4l33nkbxk86Kb9UhPAr0jxeDrBZPiXxAYnsRPlbt27NhPDuRxy8dgxE/BF/eL7xehV+kj0Y3sqVyxePjo5cIT9+ROKIx83y78qjfYm3WeavbIz3If5eOgYi/og/PM95JMc93qkS10hsN+8XcLRZHpL4c4n/KLGqx+9rPQTgGIj4I/7w4CH+TeGVP1sr8UGJh1rGkwRDbG7PSXxR4pckJvr0fWuHABwDnXEMRPwRf3iIP8keUvNdL03nSrl34FYRhQfFefB70owODaC5lXft/4P8/EGJLRKXSSwb4PeddghAbJxxDET8EX94iD/JdolX3lAnDekt8uOfl7hW4iaJrRL3Sjws8YTELondKsr/Lpczfkia2FdlmPhcmiaf6Ha71+d5/m6xNF6f52P5EL7vcUMAYuOMYyDij/jDQ/xJNryB8qaGAMTGGcdAxB/xh4f4k2x4c8KLykcEERsnHAMRf8QfXgDib/30H8mGN2xeeVnjmFkQYtManmMg4o/4w/Ofp63/rU2CcpINb9g8HAOH6hiI+CP+8MIQ/8hqADDWEy5INjwXeDgGDsUxEPFH/OGFIf56vZ/qAUC9OVNH/wXJhucQD8fAuXMMRPwRf3hhiH+iVvuNK63/1ZtTdfSfG2sLk2x4rvBwDBy8YyDij/jDC4OXqpgaAOomha4xAOQkG56DvEg1YMS//46BiD/iDy8MXqb0XA8AUd01gtQYAMZINjyHedMOAYhXz46BiD/iDy8MntZwPQDEVaf+IzUh6AEgI9nwPOAdNwQgXj07BiL+duIfs//Cc5ynz97rASCpEv+2mg46xvUCkg3PF97UEIB49ewYiPgj/vDC4RXGAJDW3fRnDgCJtUsQyYbnlmPgA4hXT46BiD/iDy8snh4Asko9Vx9qG88IIv7wvOQpx8CdiNeMHAMRf8QfXni8wuoePmMAiBB/eL7zlGPgTsTLaghA/BF/eGHy7J7eMwYAxB9eEDzlGPgA4lU7BCD+iD+8JvN6FX6SDc9xXq1PQItHB+Eh/vDgkRx4QfKshwDEEB7iDw/xJznwcAxEDBF/9jd4iD/JhodjIOKK+LO/wUP8STY8X3k4BsJD/OHBIznwGsrDMRAe4g8P8Sc58BrKwzEQHuIPr9Hib/30H8mGFxqvXCIXx0B4iD+8BvK09b+1SVBOsuGFxjvnnLMX4BiI+LN/wGuY+EdWA4CxnnBBsuGFyCvPBOAYiPizf8BriPjr9X6qBwD15kwd/RckG17AvLiFYyDiz/4BL2zxT9Rqv3Gl9b96c6qO/nNjbWGSDS9UnvUQgLgi/uxv8DzjpSqmBoC6SaFrDAA5yYbXAF7tEIC4Iv7sb/A842VKz/UAENVdI0iNAWCMZMNrEG/aIQBxRfzZP+B5xtMargeAuOrUf6QmBD0AZCQbXgN5xw0BiCviz/4BzzOePnuvB4CkSvzbajroGNcLSDa8pvKmhgDEFfFn/4DnIa8wBoC07qY/cwBIrF2CSDa8cHkxjoGIP/sHPE95egDIKvVcfahtPCOI+MODh2Mg4s/+Ac9fXmF1D58xAESIPzx4OAYi/uwf8Lzn2T29ZwwAiD88eDgGIv7sH/CawutV+Ek2vIbxcAxE/OHBY4lgkg2vobxSYKzOBCDWiD88eIg/PHjhOQY+gFgj/vDgIf4kG17zeNMOAYg14g8PHuIPD174joEPINaIPzx4iD88eM3jTQ0BiDXiDw8e4g8PXvMcA7ch1og/PHi+iL/1038kGx68at4xx8D4jxFrxB8ePMd52vrf2iQoJ9nw4FXzjjkGlkMAYo34w4PnrPhHVgOAsZ5wQbLhwavnKcfAbYg14g8PnoPir9f7qR4A1JszdfRfkGx48Kx51mZBiD/iDw/eHIl/olb7jSut/9WbU3X0nxtrC5NsePBwDET84cHzi5eqmBoA6iaFrjEA5CQbHjwcAxF/ePC842VKz/UAENVdI0iNAWCMZMODh2Mg4g8Pnnc8reF6AIirTv1HakLQA0BGsuHBwzEQ8YcHzzuePnuvB4CkSvzbajroGNcLSDY8eDgGziXvAcQfHry+8ApjAEjrbvozB4DE2iWIZMODZz0AIP61vMoBgPqDB8+apweArFLP1YfaxjOCiD88eIj/sHgnvARA/cGDNyNeYXUPnzEARIg/PHiIvwO81w0B1B88eDPm2T29ZwwAiD88eIi/K7xXhwDqDx68AfJ6FX6SDQ8e4j9g3gOlvTL1Bw/e4HkkBx48xN8pXqfT2VkutET9wYOH+MODh/g3jFcOAepMAPUHDx7iDw8e4t8wXq1HAPUMDx7iDw8e4h8mr9YlkHqGBw/xhwcP8Q+TZzUEUM/w4CH+8OAh/uHxKocA6hkevFrmCMmBBw/xxzGQeobXHJ62/rc2CcpJNjx4iD+OgfDgeS/+kdUAYKwnXJBsePAQfxwD4cHzWvz1ej/VA4B6c6aO/guSDQ8e4o9jIDx43op/olb7jSut/9WbU3X0nxtrC5NseE0X//sRaxwD4cHzjJeqmBoA6iaFrjEA5CQbHuKP+OMYCA+ed7xM6bkeAKK6awSpMQCMkWx4iD/ij2MgPHje8bSG6wEgrjr1H6kJQQ8AGcmGh/gj/jgGsn/A846nz97rASCpEv+2mg46xvUCkg0P8UdccQxk/4DnH68wBoC07qY/cwBIrF2CSDY8xB+xxjEQHjzXeHoAyCr1XH2obTwjiPjDQ/wRVxwD2T/g+csrrO7hMwaACPGHh/gj/jgGsn/A855n9/SeMQAg/vAQf8QVx0D2D3hN4fUq/CQbHuKPuLZwDGR/gxcEj+TAQ/wRVxwD2T/gIf4kBx7ij7jiGMj+Bg/xJ9nwEH/EFcdA9jd4iD/Jhof4I644BrK/wUP84cHzhRch/vBaOAbCQ/xJDjzEHzHEMbCFYyC8Bom/9dN/JBse4o+4tnAMZH+DFwJPW/9bmwTlJBse4o+44hjI/gbPe/GPrAYAYz3hgmTDQ/wRVxwD2d/geS3+er2f6gFAvTlTR/8FyYaH+COuOAayv8HzVvwTtdpvXGn9r96cqqP/3FhbmGTDQ/zh4RjI/gbPL16qYmoAqJsUusYAkJNseIh/cGJYGuFsQ/xxDIQXNC9Teq4HgKjuGkFqDABjJBse4h+k+McqtiH+OAbCC5KnNVwPAHHVqf9ITQh6AMhINjzEP1jx16/jhgDyh2MgPO95+uy9HgCSKvFvq+mgY1wvINnwEP+wxf+4IYD84RgILwheYQwAad1Nf+YAkFi7BJFseIi/7+I/NQTI57aTPxwD4QXB0wNAVqnn6kNt4xlBxB8e4t8s8X91e5Q3vHU68dfIH46B8LznFVb38BkDQIT4w0P8myn+enuUj74dGwLIX80QELH/wnOYZ/f0njEAIP7wEP8Gi7+O8kxAeTmA/NUPAey/8Lzm9Sr8JBse4h+e+BvbY9pHBBH/1xwD161bM8H+Cy8EHsmB54v434f4D1T89ct6CGiyY+D69Wvns//CQ/xJNjzEPxTxtx4CcAzs7FRnAth/4SH+8OAh/kGIf+0QwPZ4nWNgxP4LD/GHBw/xD0X8px0C2B4ndAyM2H/hIf7w4CH+oYj/cUMA26PSMTBi/4WH+MODh/gPmrdtjsR/agjAMdDKMTBi/4XnqvhbP/1Hsr3jlWKwSuISiWslbpLYKnGvxNclnpDYJbG7DGliu+I4+oaYv/yZ3Mz0QJJ0PiexRf79avn5z0r8lESG+CP+modjoLVjYES/gucYT1v/W5sE5STbPV7p2DZvXvEz3W7669KMbpYf75T4rsShATS3oxL/V+JBiS0Sl0n8K8S/eeKPYyCOgfC8Fv/IagAw1hMuSPbwecuXL4tE8C9I0/Sj0ngfkWb0sgPN8jmJL0j8kvxdk4h/M8Qfx0AcA+F5Kf56vZ/qAUC9OVNH/wXJHhrvNIlrpOnslAb0guPN8lAcx9+QQeA/L1gwfx3iH7b44xiIYyA8r8Q/Uav9xpXW/+rNqTr6z421hUn23PByiSskHpU44nGz/N/y81slNiL+wYp/y7jvBMdAHAPhuclLVUwNAHWTQtcYAHKSPXBeuUEuUqfTXw6wWT4l8f7W9DcTIv7+ir/1EIBjII6B8Oaclyk91wNAVHeNIDUGgDGSPVBeIfFhiWcb0iz3qbMCKxH/oMS/dghg++IYCG/OeVrD9QAQV536j9SEoAeAjGQPjDdf4mNKEJvYLMunCspHEi9B/IMR/2mHALYvjoHw5pynz97rASCpEv+2mg46xvUCkt1/3mKJWyRe4jQpvADF/7ghgO2LYyC8ofAKYwBI6276MweAxNoliGTb8iYl7pQ4gBjCC1z8p4YAHANxDIQ3NJ4eALJKPVcfahvPCCL+/eOVuXyfxF7EEF6DxB/HQBwD4Q2XV1jdw2cMABHi31feaoknEUN4TRR/HANxDIQ3VJ7d03vGAID494dX3tl/m8Rhmhu8Jos/joE4BsJznNer8JPsE/IulNhDc4OH+OMY2AMPx0B4Q+ORnN55pZHP77SOPd5Gc4OH+OMYiGMgPMS/AbwlrWNL7CKG8HrhbW+I+FsPATgG4hgID/H3gVfa9/4QMYSH+OMY2GcejoHwEH8XeeXSvPLjj8/klD/NDR7iXz0EUC84BsJD/J3mTU5OpPLjryKG8BB/HANxDISH+DeE1+12x1vHlulFDOEh/v1zDNxBveAYCG/uxN/66T+SfYwnN+aUPv7fphnBQ/wH4hj4J9QLjoHwBs7T1v/WJkF505MtO2m5fO33aUbwEP+BOgb+CfWCYyC8gYp/ZDUAGOsJF01OdrvdPlt+/AOaETzEf04cA3dQLzgGwhuI+Ov1fqoHAPXmTB39Fw0+8j8T8YeH+M+5Y+B26g/HQHh9Ff9ErfYbV1r/qzen6ug/N9YWbtg1/3gJp/3hIf5DcwzcTv3hGAivL7xUxdQAUDcpdI0BIG/o3f5PIYbwEP+hOgZup/5wDIQ3K16m9FwPAFHdNYLUGADGmpbs8fF5XfnxY4ghPMTfCcfA7dQfjoHweuJpDdcDQFx16j9SE4IeALKGOvzdhxjCQ/ydcgzcTv3hGAhvRjx99l4PAEmV+LfVdNAxrhc0MdlbEEN4iL+TjoHbqT8cA+FZ8wpjAEjrbvozB4DE2iUorGT/bAtvf3iIP46BOAZSf/7z9ACQVeq5+lDbeEawieK/VGIvYgivR94OxH/wPBwDcQyEZ80rrO7hMwaAqKHiXz4S8QTNAx7ij2NgIDwcA+HZPb1nDAAjDU32x2ke8BB/HAMD4+EYCM8K0JPwB5KcC2dy3R8xhIf4O8PDMRDHQHgsEdwzr5DYE3bziA7Iv39Hfl4+K3ybxA0SV0m8R+IXVLxH/dsN6j3le78jnzuA+CP+jvNwDKx3DNyBYyA8xP943m0BitcL5fXRbje9QQyN3rZo0cJOr/krjxwmJsbfXrLUjVcvIP6Iv4M8HAPrHQN34BgID/F/7bVa4nAgO/se2cHvEMHfdP75GycGbJK0TuKW8M+cIP6e8XAMrOfNyCyI+kP8Q01Oec/Dk57v7IckvjQ6OvqODRvWDeMaX/nkxEXl36D+FsSfZoRjoPu8+1o4BsJreHLe5/HOfkDibollDm2PZepvOoD404xwDHSeZzUEUH+If4jJmWxZGP44uLOXlyt+T2KJw9tjifobDyP+NKMh8nAMrOdVDgHUX/jib/30X2DJudPDnf2vJM72ZXu02+21cRz9D8SfZjQsHo6BVrwTDgHUX/A8bf1vbRKUB5KcxW88Te34zv4jiferexa8KtZNm84bz7Luf5Dvux/xpxkNg4djoBXjdUMA9dcI8Y+sBgBjPeEikOTc4tHO+ZTECt+Ldf78ybPl+z6F+NOMhsHDMdB+CKBeGiH+er2f6gFAvTlTR/9FAMmZL/GSJzvnZySSgIo1bR27SRDxhzcMHo6B9bz7cQwMXvwTtdpvXGn9r96cqqP/3Fhb2OfkfMyDnbO80e+qgIu1/G5HPGiWl9I8guPhGIhjYJN5qYqpAaBuUugaA0DueXJKy999ju+cB04kPAEW6zur7sNwZHv8Gc0jSB6OgTgGNpGXKT3XA0BUd40gNQaAsQCS82HHd84XJS5oULFeoL6zq9ujXBzqTJoHjoE4BlJ/nvO0husBIK469R+pCUEPAFkAySlPdTzr8M75SsPEX782mWcCHGyWt9E8cAzEMZB68Zinz97rASCpEv+2mg46xvWCEJJzkcM755GGnPZvVVwOOOJosywvGWU0IxwDWzgGUi9+8gpjAEjrbvozB4DE2iXI/eR8weGd86qmF6vk6WqHm+X7aUY4BrZwDMQx0E+eHgCySj1XH2obzwiGIv65xMuO7pz3UKzHeEnS+UNHm+W3aUY4BrZ4dBDHQD95hdU9fMYAEAUk/uXrCkd3zr9uHXs2nmIVzlvf+pML4zh+xsVmOW+e/Ik0o6B5OAbiGBgoz+7pPWMAGAksOY86uDPtb73hDnOKddO8ycmJtZK//a41yyRJfo9mFD5POQbuRPxxDGwcr1fhdzw5p7XcvMFsM8U6LW+za81SFjX6O5pHY3jljYE7EH8cA5vKC+nLXOPgzrRLYpRinZZX/u+3XGuWEm+heTSGZz0E4BhIvSD+7t5dvtOxnal85G8NxVrLW9tyzy74N2gejeLVDgE4BuIYiPg7+mVOO21pLEX6omM7010UqzXvLsea5WM0j8bxph0C8A3AMRDxdzg5cuf2BY7tTKXj3RKK1Zq3VOKgQ83ykMQ4zaNxvOOGAMQfx0DE3/HkpGn6Ucd2prsp1hnz7nGsWf4izaORvKkhAPHHMRDx9yA58kzvIw7tTOXR4zKKdca8M1rHlkd2pVl+gebRWF7s4D1FOAbCm5X4Wz/955uphxTryw7tTF+iWHvmfdmhZvkc26O5POUY+CDij2NgADxt/W9tEpT7kpzSuc2lnWl0dPQdFGvPvIsda5bLaB6Ndwx8EPHHMdBz8Y+sBgBjPeHCl+R0u+mvO7Qz7dmwYR2mGbN7muN5h5rbZTQjHANxDMQx0GPx1+v9VA8A6s2ZOvovfEmOFOvNruxM8qzsHRTrbBcKSn7Xoea2hWYEr4VjII6Bfop/olb7jSut/9WbU3X0nxtrC/uQnJ2u7Ezj4/M2Uayz40kOf9qh5vYgzQieeuEYiGOgT7xUxdQAUDcpdI0BIPcoOd91ZGfad/75Gyco1tnxyhxKLl9wpLn9A80I3kyGABwDcQx0gJcpPdcDQFR3jSA1BoAxj5JT7pCHXCj+cnlRirVvl3VcueZ6dNWqMxfSjODZDAH4BuAY6ABPa7geAOKqU/+RmhD0AJB5lpxVrhS/3Ix4A8XaN951rjQ3WbZ4I9sDXt0QgPjjGOgAT5+91wNAUiX+bTUddIzrBb4l5xJXil+uXb+NYu0b7yxXmlue5+9me8CrGgIQfxwDHeEVxgCQ1t30Zw4AibVLkFvJudaN4o8OLlq0sEOx9o1XNo2DbpzZ6V7P9oA33RCAYyCOgQ7x9ACQVeq5+lDbeEZwxNPk3ORI8X+HYu077xkXmluSdLawPeBNx8MxEMdAh3iF1T18xgAQeSz+5WurI8W/jWLtO2+bI83tbrYHvCoejoE4BjrCs3t6zxgARjxPzr2OFP/tFGvfebc70ty+wvaAV8fDMRDHQG94vQq/g1/m644U/40UV995NzrS3B5ie8Cz5OEYiGOgVzzfv8wTjhT/Zoqr77zNjjS3x9ke8GbAwzEQx0DEf454uxwp/ssprr7zLnekue1ie8DDMRDHQMTfvS+z25Hiv4zi6jvvMkea2262BzwcAwfCm5FZEPWH+B83ADhS/JdRXH3nXeZIc9vN9oCHY+DAePe2cAxE/HvhSRHtcqT4L6e4+s673JHmtovtAQ/HwIHyrIYA6g/xfx0vjqMnHSn+zRRr34e7qx1pbk+wPeDhGDhwXuUQQP3NXvytn/7zJTlxHD/qSPHfSLH2l5ckyW860tweZnvAwzFwTngnHAKov1nztPW/tUlQ7kNy5E7S7Y4U/+0Ua395YsF7tyPN7V62BzwcA+d0f8MxsL/iH1kNAMZ6woUPyRGR+ENHin8bxdrv4S7+miPNbSvbA16/eDgG2g8B1EtfxF+v91M9AKg3Z+rov/AhOTIAfMqR4v8Oxdpfnlze+VtHmtFNbA94febhGFjPuw/HwFmLf6JW+40rrf/Vm1N19J8baws7nRwpkuscKdaDFGv/eKVLWLnEsiPN6FrEC94AeDgG1jsGbscxsGdeqmJqAKibFLrGAJB7kpxLXCnWiYnxt9Pc+sMbH5/3Nlea0ejo6CWIF7wB8TotHAPrHAO34xg4Y16m9FwPAFHdNYLUGADGPErOKleKtdtNP0RzC+7Mzo8nJyfWIl7wBsibdgjANwDHwB54WsP1ABBXnfqP1ISgB4DMw9Noh9yYVOM/obn1jbfDkWb0L8YpSMQL3qB4xw0BiD+OgT3w9Nl7PQAkVeLfVtNBx7he4GNyvutGsUYvLF++LKK5zZpXxj4XmpEYTX2P7QFvjnhTQwDij2Ngj7zCGADSupv+zAEgsXYJci85Ox0q1nNobrPmrXOlGZXPbLM94M0hr4NjII6Bs+DpASCr1HP1obbxjOCIx8n5pEPFegvNbda8T7nSjMSN8Da2B7y55J111r+ej2MgjoE98gqre/iMASDyXPzL15UOFeseiTbNrWdembvnXGlGcmPnryFe8Oaat2bN6pNxDMQxsAee3dN7xgAwEkByNjhWrBfR3HrmXexSM2q3RzciXvCGwSvPBOAYiGPgQHi9Cr+jySmfBHjJoWL9Es2tZ96XHWpG+1Vt0TzgDYtX6xPQ4tFBHANZIvjVFdtcKdbyscRlFNeMeWdIHHaoGT1E84DnAM96CMAxkHppoviXr//kWLHeTXObMe8ex5rRB2ke8Bzh4RiIYyDiP92r3W6f61ixHpBYQnOz5i2VOOhYM1pL84DnEA/HQBwDEf8T8TZsWDdRGvE4Vqx30dyseXc51oxKI6JRmgc8HANxDET8/Vg//kHHivWInJk4h+ZWyyuPtI841oy20zzg4RiIYyDi70lyysV4XCtWsZLdff75GydobtO+yp99y8FmdA3NAx6OgTgGhiT+1k//+ZichQtPfosUwxHXirXb7V5Pc5v2tdnB5lHW0KmIDTwcA3EMDKRetPW/tUlQ7mlyHnWwWF+aP39yDc3tuNebJfY72DweQWzg4RiIY2BA4h9ZDQDGesKFp8m5wtFifVp+ntLcpl5lLp52tHm8F7GBh2MgjoGBiL9e76d6AFBvztTRf+Fpck6SeNnRYr2H5jb12upo8yhrJ0ds4OEYiGNgAOKfqNV+40rrf/XmVB3958bawj4m54sOF+tVNLfjr/s71Dy+gNjAwzEQx8AA6iVVMTUA1E0KXWMAyD1OzsUOF2t5g9k7G9zc3tV6wyN/jjWPixAbeDgG4hjoeb1kSs/1ABDVXSNIjQFgzPPklJPOHoeLtXQJvKCBzW2T+u6uNo/jlnJGbOB5yMMxsNmOgVrD9QAQV536j9SEoAeALJCd6SOOF+uLbxwCAm9uF6jv7HLzuBGxgYdjII6BHteLPnuvB4CkSvzbajroGNcLQtmZ5km84HixviLx7xrQjC51/MhfW/8WiA28gHg4BjbPMbAwBoC07qY/cwBIrF2C/EnOb3tQrIflcx8IuBm9v/WGJX4d3R4fQ2zgBcjDMbBZjoF6AMgq9Vx9qG08IzgSYPGXz8e+5EOxJknn9+V53lMCakZJ6wQL/DjaPF4qawWxgRciD8fARjkGFlb38BkDQBSo+L/Kkzs+7/SlWOM4flocA88KoBmtkPi2R83jFsQGXsg8HAMb4xho9/SeMQCMhFz8S5cufrMUwgGPivVH6rT5iIfbo/ybPyDxI4+aR3kfxiLEBl7oPBwDcQx83T0ArR5fviVHTq/f42GxflNijUfbY436m31rHncgDvAaxMMxEMfA3l8+Fv/pp5/2Jtmoez0s1iPqOvpSh7fHUvU3HvFwZ9+bJMkCxAFew3g4BuIY2Ljiv9LjYj3YOraOwDKHtscZ6m866PHOfiXiAK+hPBwDG+4Y2LTiLy95/KXnxXpI4ssSF5922tJ4CNujdMm7WP0Nhz3f2Z/ctOm8eYgDvAbzcAxsqGNgU4v/rDrh8qdYo+fl9PXvjo/P++nzz984McD8lbFO4lMSzwWysx+WvL0NcYAH79UhYIvEZ3XI/vE5eWLg83IE/EevRfz58t/N99lGALyfQ/zDKf7bw5tUoxfU3b3XSaxuzcLesrzuVYqj8K5XRwf7Qpv0ZQe/C3GABw9e03gk55jd63OBn/YqbXe/I/GAxG0SN7SOLUP8HolfUPEe+dxmOYvwX+Qpic/IxPvH4kPwt+Ujk2Gf5oueX7nyjFNpHvDgwWua+Fs//Rd4ct4hcZRrXo3jHT3ppPxdNA948OA1jKet/61NgvLAk7MFcW0WT852fJrmAQ8evAaKf2Q1ABjrCReBJ6e8Tv4NxLUZPLm88VcbN547SfOABw9ew8Rfr/dTPQCoN2fq6L8IPTkiCqeLwPwT4ho87x8XL170EzQPePDgNUz8E7Xab1xp/a/enKqj/9xYWzjoZOd5/m4RiKOIa7C8o7KNf4HmAQ8evIbxUhVTA0DdpNA1BoC8KcmWa8O3Iq5h8sptS/OABw9ew3iZ0nM9AER11whSYwAYa1Kyzztvw7iIxv2Ia1i80spzwCZJ8ODBg+caT2u4HgDiqlP/kZoQ9ACQNTTZicRjiGsYPLm/4wlZ/vQUmgc8ePAaxNNn7/UAkFSJf1tNBx3jekGTk12aBD2FuHov/n+jzH5oHvDgwWsSrzAGgLTupj9zAEisXYLCTvYiie8jrr6Kf/T3p566dCXNAx48eA3k6QEgq9Rz9aG28Ywg4v/aa4XEDxBX73g/OOWUBWfRPODBg9dQXmF1D58xAESI/wlf5aI6zyOu/oj/xMT422ke8ODBazDP7uk9YwBA/Kd/LdeXAxBrp0/7/x+O/OHBgwfPkter8Dcw2QtFbL6NWDt7w9/TXPOHBw8ePJYIHghvxYozlojQPI5YOyf+f37mmSu42x8ePHjwEP/B8dasWX2yGMtsQ6ydMfl5oNwm7Ozw4MGDh/jPlWPg78iPjyLWw/P2F3vfW3D4gwcPHjzEfxi8iyR+iFjPOW/vSSfll1J/8ODBg4f4D5O3ROJxxHpueHK9/xtLlixeRf3BgwcPHuLvAq9cXvHj010SQPz7wjsip/xv3rjx3EnqDx48ePB6F3/rp/9I9ox4F0rsQaz7zYueM075U3/w4MGD16PwK98fa5OgnGTPiFcuJHSrxGHEf9a8Q3KX/++qR/yoP3jw4MGbnfhHVgOAsZ5wQbJn/mq322eLM903Ef+eed8YH5+3kZ0dHjx48Poi/nq9n+oBQL05U0f/Bcnujbdp03njWdb9NRHDf0T8reOH8rn3Se7msbPDgwcPXl/EP1Gr/caV1v/qzak6+s+NtYVJdo+8008/7U0ianfKj19B/KeNMjd3yI1+C9jZ4cGDB69vvFTF1ABQNyl0jQEgJ9l94y2SuFliP+I/FftVThZRL/DgwYPXV16m9FwPAFHdNYLUGADGSPZAeJMSvyWxr8HiX37331S5oF7gwYMHr788reF6AIirTv1HakLQA0BGsgfOK58YuEHi2QaJ/7PqOxfUCzx48OANhKfP3usBIKkS/7aaDjrG9QKSPXe88r2lh8B/ExF9KUDxf6n8buo7jlIv8ODBgzdQXmEMAGndTX/mAJBYuwSR7L7zVq5cvlieHLi6XOJWxPWIx+J/ROIRiX8vkbN94cGDB2/OeHoAyCr1XH2obTwjiPg7wlu48JRVIq7Xyo+3tyruF3BI/Pepv/UaiVPZvvDgwYM3FF5hdQ+fMQBEiL/TvPK/10p8UOKhVsWTBHMo/vvV3/JB9beNsn3hwYMHb+g8u6f3jAEA8feLF0usl3ifxCckdkj8r9I+dwDif0hcDb/X6cQPynP6t3W76a+126Mb1d/A9oAHDx48H3m9Cj/JdpO3bt2aiQUL5p+T52O/JEJ9Q5J0PiUi/vvy43slHpZ4QmKXxG4Vu9S/Pazes1XiJolrR0dHL5mcnFi7fv3a+WwPePDgwWOJYJINDx48ePDgIf4kGx48ePDgwUP84cGDBw8ePHiIPzx48ODBgwcP8YcHDx48ePDgIf7w4MGDBw8evLkUf+un/0g2PHjw4MGDFwRPW/9bmwTlJBsePHjw4MHzXvwjqwHAWE+4INnw4MGDBw+e1+Kv1/upHgDUmzN19F+QbHjw4MGDB89b8U/Uar9xpfW/enOqjv5zY21hkg0PHjx48OD5xUtVTA0AdZNC1xgAcpINDx48ePDgecfLlJ7rASCqu0aQGgPAGMmGBw8ePHjwvONpDdcDQFx16j9SE4IeADKSDQ8ePHjw4HnH02fv9QCQVIl/W00HHeN6AcmGBw8ePHjw/OMVxgCQ1t30Zw4AibVLEMmGBw8ePHjwXOPpASCr1HP1obbxjCDiDw8ePHjw4PnLK6zu4TMGgAjxhwcPHjx48Lzn2T29ZwwAiD88ePDgwYPXFF6vwk+y4cGDBw8evDB4JAcePHjw4MFD/EkOPHjw4MGDh/iTbHjw4MGDBw/xJ9nw4MGDBw8e4g8PHjx48ODBQ/zhwYMHDx48eC6Kv/XTfyQbHjx48ODBC4Knrf+tTYJykg0PHjx48OB5L/6R1QBgrCdckGx48ODBgwfPa/HX6/1UDwDqzZk6+i9INjx48ODBg+et+Cdqtd+40vpfvTlVR/+5sbYwyYYHDx48ePD84qUqpgaAukmhawwAOcmGBw8ePHjwvONlSs/1ABDVXSNIjQFgjGTDgwcPHjx43vG0husBIK469R+pCUEPABnJhgcPHjx48Lzj6bP3egBIqsS/raaDjnG9gGTDgwcPHjx4/vEKYwBI6276MweAxNoliGTDgwcPHjx4rvH0AJBV6rn6UNt4RhDxhwcPHjx48PzlFVb38BkDQIT4w4MHDx48eN7z7J7eMwYAxB8ePHjw4MFrCq9X4SfZ8ODBgwcPXhg8kgMPHjx48OAh/iQHHjx48ODBQ/xf/8vNNQKKPtgFw4MHDx48ePDmkNfLLzfXCMj7YBcMDx48ePDgwZtDXi+/PDP8hcf6YBcMDx48ePDgwZtD3kx/+YixRkDXWFxgBB48ePDgwYPnB08zZ/LLE2ONgHSWdsHw4MGDBw8evOHw2rYmQSPGGgE64ln+cnjw4MGDBw/e3PMiqwHAeHNsRNSHXw4PHjx48ODBGw7PagBovzFas3jBgwcPHjx48JzgjdRNC6NGjMzyl8ODBw8ePHjwHOH9f7HwDjU05EBUAAAAAElFTkSuQmCC", - width: 14, - height: 14, - margin: [-30, -7, 0, 0] - }, - { - text: "Acknowledgement( For Official use only)", - style: "footer-header" - }, - { - style: "noc-table5", - table: { - widths: ["*", "*", "*", "*"], - body: [ - [ - { - text: "Date", - border: [false, false, false, false], - - style: "receipt-table-value" - }, - { - text: transformedData.billDate, - border: [false, false, false, false], - - style: "receipt-table" - }, - { - text: "Consumer ID", - border: [false, false, false, false], - - style: "receipt-table-value" - }, - { - text: transformedData.propertyId, - border: [false, false, false, false], - - style: "receipt-table" - } - // { - // text: "", - // border: [false, false, false, false], - - // style: "receipt-table-value" - // }, - // { - // text: "", - // border: [false, false, false, false], - - // style: "receipt-table" - // } - ], - [ - - { - text: "Bill No.", - border: [false, false, false, false], - - style: "receipt-table-value" - }, - { - text: transformedData.billNumber, - border: [false, false, false, false], - - style: "receipt-table" - }, - { - text: "Total Payment", - border: [false, false, false, false], - - style: "receipt-table-value" - }, - { - text: transformedData.totalAmount, - border: [false, false, false, false], - - style: "receipt-table" - } - ], - ] - } - }, - { - style: "noc-table4", - table: { - widths: ["25%", "75%"], - body: [ - [ - { - text: "Name & Address", - border: [false, false, false, false], - - style: "receipt-table-value" - }, - { - text: transformedData.payerAddress, - border: [false, false, false, false], - - style: "receipt-table" - } - ] - ] - } - }, - { - text: "Receiver’s Signature & Mobile No. ", - style: "footer", - pageBreak: index === length - 1 ? "" : "after", - - } - ] -} \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/receiptTransformer.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/receiptTransformer.js deleted file mode 100644 index ace4f04583a..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/screens/specs/utils/receiptTransformer.js +++ /dev/null @@ -1,142 +0,0 @@ -import get from "lodash/get"; -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import store from "../../../../ui-redux/store"; -import { getMdmsData } from "../utils"; -import orderBy from "lodash/orderBy"; -import { - getTransformedLocalStorgaeLabels, - getLocaleLabels -} from "egov-ui-framework/ui-utils/commons"; -import commonConfig from "config/common.js"; -import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; - -const ifNotNull = value => { - return !["", "NA", "null", null].includes(value); -}; - -const nullToNa = value => { - return ["", "NA", "null", null].includes(value) ? "NA" : value; -}; - -const epochToDate = et => { - if (!et) return null; - var date = new Date(Math.round(Number(et))); - var formattedDate = - date.getDate() + "/" + (date.getMonth() + 1) + "/" + date.getFullYear(); - return formattedDate; -}; - -export const loadUlbLogo = tenantid => { - var img = new Image(); - img.crossOrigin = "Anonymous"; - img.onload = function() { - var canvas = document.createElement("CANVAS"); - var ctx = canvas.getContext("2d"); - canvas.height = this.height; - canvas.width = this.width; - ctx.drawImage(this, 0, 0); - store.dispatch(prepareFinalObject("base64UlbLogo", canvas.toDataURL())); - canvas = null; - }; - img.src = `/${commonConfig.tenantId}-egov-assets/${tenantid}/logo.png`; -}; - -export const loadPtBillData = response => { - // const ulbData = loadMdmsData(getTenantId()) - let data = {}; - let orderedResponse = orderBy( - response.billDetails, - "fromPeriod", - "desc"); - - let taxHeads = orderedResponse[0].billAccountDetails.reduce((acc,item,index) =>{ - if(index<9){ - acc[getLocaleLabels( - "", - item.taxHeadCode, - getTransformedLocalStorgaeLabels() - )] = item.amount - } - return acc - },[]) - const fromDate = epochToDate(get(response, "billDetails[0].fromPeriod")); - const toDate = epochToDate(get(response, "billDetails[0].toPeriod")); - data.header = get(store.getState() , "") - data.billPeriod = `${fromDate} - ${toDate}`; - data.billDate = epochToDate(get(response, "billDate")); - data.dueDate = epochToDate(get(response, "billDetails[0].expiryDate")); - data.billNumber = nullToNa(get(response, "billNumber")); - data.payerName = nullToNa(get(response, "payerName")); - data.mobileNumber = nullToNa(get(response, "mobileNumber")); - data.amountPaid = get(response, "billDetails[0].amountPaid", 0); - data.totalAmount = get(response, "totalAmount", 0); - data.amountDue = data.totalAmount - data.amountPaid; - data.payerAddress = get(response, "payerAddress"); - data.propertyId = get(response, "consumerCode").split(":")[0]; - data.g8ReceiptNo = nullToNa( - get(response, "billDetails[0].manualReceiptNumber", "None") - ); - data.taxHeads = taxHeads - return data; - - // store.dispatch(prepareFinalObject("receiptDataForReceipt", data)); -}; - -export const loadMdmsData = async tenantid => { - let data = {}; - let mdmsBody = { - MdmsCriteria: { - tenantId: tenantid, - moduleDetails: [ - { - moduleName: "tenant", - masterDetails: [{ name: "tenants" }] - } - ] - } - }; - let response = await getMdmsData(mdmsBody); - - if ( - response && - response.MdmsRes && - response.MdmsRes.tenant.tenants.length > 0 - ) { - let ulbData = response.MdmsRes.tenant.tenants.find(item => { - return item.code == tenantid; - }); - - /** START Corporation name generation logic */ - let ulbGrade = get(ulbData, "city.ulbGrade", "NA"); - let name = get(ulbData, "city.name", "NA"); - if (ulbGrade) { - if (ulbGrade === "NP") { - data.corporationName = `${name.toUpperCase()} NAGAR PANCHAYAT`; - } else if (ulbGrade === "Municipal Corporation") { - data.corporationName = `${name.toUpperCase()} MUNICIPAL CORPORATION`; - } else if (ulbGrade.includes("MC Class")) { - data.corporationName = `${name.toUpperCase()} MUNICIPAL COUNCIL`; - } else { - data.corporationName = `${name.toUpperCase()} MUNICIPAL CORPORATION`; - } - } else { - data.corporationName = `${name.toUpperCase()} MUNICIPAL CORPORATION`; - } - /** END */ - data.corporationAddress = get(ulbData, "address", "NA"); - data.corporationContact = get(ulbData, "contactNumber", "NA"); - data.corporationWebsite = get(ulbData, "domainUrl", "NA"); - data.corporationEmail = get(ulbData, "emailId", "NA"); - } - - store.dispatch(prepareFinalObject("mdmsDataForReceipt", data)); - return data; -}; - -/** Data used for creation of receipt is generated and stored in local storage here */ -// export const loadReceiptGenerationData = (applicationNumber, tenant) => { -// /** Logo loaded and stored in local storage in base64 */ -// // loadApplicationData(applicationNumber, tenant); //PB-TL-2018-09-27-000004 -// loadBillData(applicationNumber, tenant); //PT-107-001330:AS-2018-08-29-001426 //PT consumerCode -// loadMdmsData(tenant); -// }; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/themes/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/themes/index.js deleted file mode 100644 index 2434a1ef797..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-config/themes/index.js +++ /dev/null @@ -1,90 +0,0 @@ -const themeObject = { - palette: { - primary: { - main: "#FE7A51", - dark: "#DB6844", - contrastText: "#fff" - }, - secondary: { - main: "#fff", - contrastText: "#000" - }, - background: { - default: "#F4F7FB" - } - }, - overrides: { - MuiDivider: { - root: { - marginBottom: "24px", - marginTop: "8px" - } - }, - MuiStepper: { - root: { - paddingBottom: "0px" - } - }, - MuiCard: { - root: { - marginTop: "24px" - } - }, - MuiFormControl: { - root: { - paddingBottom: "16px", - marginTop: "8px" - }, - fullWidth: { - width: window.innerWidth > 480 ? "80%" : "100%" - } - }, - MuiSnackbarContent: { - root: { - flexWrap: "inherit" - } - }, - MuiTableCell: { - body: { - fontSize: "14px" - } - }, - - MuiTypography: { - title: { - color: "rgba(0, 0, 0, 0.87)", - fontFamily: "Roboto", - fontSize: "20px", - fontWeight: 400, - letterSpacing: "0.83px", - lineHeight: "24px" - }, - body1: { - color: "rgba(0, 0, 0, 0.60)", - fontFamily: "Roboto", - fontSize: "14px", - fontWeight: 400, - lineHeight: "20px", - marginBottom: "12px" - }, - body2: { - color: "rgba(0, 0, 0, 0.87)", - fontFamily: "Roboto", - fontSize: "16px", - fontWeight: 400, - letterSpacing: "0.67px", - lineHeight: "19px" - }, - subheading: { - color: "rgba(0, 0, 0, 0.87)", - fontFamily: "Roboto", - fontSize: "18px", - letterSpacing: "0.75px", - fontWeight: 400, - lineHeight: "20px" - } - } - } -}; - -export default themeObject; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-containers-local/AutosuggestContainer/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-containers-local/AutosuggestContainer/index.js deleted file mode 100644 index c783d3893cb..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-containers-local/AutosuggestContainer/index.js +++ /dev/null @@ -1,161 +0,0 @@ -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { - appendModulePrefix, getLocaleLabels, sortDropdownNames -} from "egov-ui-framework/ui-utils/commons"; -import get from "lodash/get"; -import isEmpty from "lodash/isEmpty"; -import React, { Component } from "react"; -import { connect } from "react-redux"; -import { AutoSuggest } from "../../ui-atoms-local"; -import { findItemInArrayOfObject } from "../../ui-utils/commons"; - -// const localizationLabels = JSON.parse(getLocalization("localization_en_IN")); -// const transfomedKeys = transformById(localizationLabels, "code"); -class AutoSuggestor extends Component { - onSelect = value => { - const { onChange } = this.props; - //Storing multiSelect values not handled yet - onChange({ target: { value: value ? value.value : null } }); - }; - shouldComponentUpdate = (nextProps, nextState) => { - let { - value, - suggestions = [], - disabled = false, - locale, - required, - localizationLabels={} - } = this.props; - let { - value: valueNew, - suggestions: suggestionsNew = [], - disabled: disabledNew = false, - locale: localeNew, - required: requiredNew, - localizationLabels:localizationLabelsNew={} - } = nextProps; - if (locale != localeNew || - value != valueNew || - disabled != disabledNew || - required != requiredNew || - Array.isArray(suggestionsNew) != Array.isArray(suggestions) || - suggestions.length != suggestionsNew.length|| - Object.keys(localizationLabels).length!=Object.keys(localizationLabelsNew).length) { - // return true - } - // return false - return true - } - - render() { - let { - value, - preparedFinalObject, - label, - placeholder, - suggestions, - className, - localizationLabels, - labelsFromLocalisation, - localePrefix, - ...rest - } = this.props; - let translatedLabel = getLocaleLabels( - label.labelName, - label.labelKey, - localizationLabels - ); - let translatedPlaceholder = getLocaleLabels( - placeholder.labelName, - placeholder.labelKey, - localizationLabels - ); - //For multiSelect to be enabled, pass isMultiSelect=true in props. - - //To fetch corresponding labels from localisation for the suggestions, if needed. - if (labelsFromLocalisation) { - suggestions = getLocalisedSuggestions( - JSON.parse(JSON.stringify(suggestions)), - localePrefix, - localizationLabels - ); - } - //To find correct option object as per the value (for showing the selected value). - const selectedItem = findItemInArrayOfObject(suggestions, item => { - if (item.code === value) { - return true; - } else return false; - }); - //Make value object as the Autosuggest expects. - if (selectedItem && selectedItem.name) { - value = { label: selectedItem.name, value: selectedItem.code }; - } - - - - return ( -
- -
- ); - } -} - -const getLocalisedSuggestions = (suggestions, localePrefix, transfomedKeys) => { - return ( - suggestions && - Array.isArray(suggestions) && - suggestions.length > 0 && - suggestions.map((option, key) => { - option.name = getLocaleLabels( - option.code, - localePrefix && !isEmpty(localePrefix) - ? appendModulePrefix(option.code, localePrefix) - : option.name, - transfomedKeys - ); - return option; - }).sort(sortDropdownNames) - ); -}; - -const mapStateToProps = (state, ownprops) => { - const { localizationLabels, locale } = state.app; - let { - jsonPath, - value, - sourceJsonPath, - labelsFromLocalisation, - data, - localePrefix - } = ownprops; - let suggestions = - data && data.length > 0 - ? data - : get(state.screenConfiguration.preparedFinalObject, sourceJsonPath, []); - value = value - ? value - : get(state.screenConfiguration.preparedFinalObject, jsonPath); - - return { value, jsonPath, suggestions, localizationLabels, locale }; -}; - -const mapDispatchToProps = dispatch => { - return { - prepareFinalObject: (path, value) => - dispatch(prepareFinalObject(path, value)) - }; -}; - -export default connect( - mapStateToProps, - mapDispatchToProps -)(AutoSuggestor); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-containers-local/TestContainer/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-containers-local/TestContainer/index.js deleted file mode 100644 index 2f65819c07b..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-containers-local/TestContainer/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; - -export default ()=>{ - return
Test container
-} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-containers-local/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-containers-local/index.js deleted file mode 100644 index 2bcd14f14be..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-containers-local/index.js +++ /dev/null @@ -1,21 +0,0 @@ -import React from "react"; -import Loadable from "react-loadable"; -import LinearProgress from "egov-ui-framework/ui-atoms/LinearSpinner"; - -const Loading = () => ; - - -const TestContainer = Loadable({ - loader: () => import("./TestContainer"), - loading: () => -}); - -const AutosuggestContainer = Loadable({ - loader: () => import("./AutosuggestContainer"), - loading: () => -}); - -export { - TestContainer, - AutosuggestContainer -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/AutosuggestContainer/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/AutosuggestContainer/index.js deleted file mode 100644 index 32b03779ee8..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/AutosuggestContainer/index.js +++ /dev/null @@ -1,123 +0,0 @@ -import React, { Component } from "react"; -import { connect } from "react-redux"; -import { AutoSuggest } from "../../ui-atoms-local"; -import { findItemInArrayOfObject } from "../../ui-utils/commons"; -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { - getLocaleLabels, - appendModulePrefix -} from "egov-ui-framework/ui-utils/commons"; -import get from "lodash/get"; -import isEmpty from "lodash/isEmpty"; - -class AutoSuggestor extends Component { - onSelect = value => { - const { onChange } = this.props; - //Storing multiSelect values not handled yet - onChange({ target: { value: value ? value.value: null } }); - }; - - render() { - const { - value, - preparedFinalObject, - label, - placeholder, - suggestions, - className, - localizationLabels, - ...rest - } = this.props; - let translatedLabel = getLocaleLabels( - label.labelName, - label.labelKey, - localizationLabels - ); - let translatedPlaceholder = getLocaleLabels( - placeholder.labelName, - placeholder.labelKey, - localizationLabels - ); - //For multiSelect to be enabled, pass isMultiSelect=true in props. - return ( -
- -
- ); - } -} - -const getLocalisedSuggestions = (suggestions, localePrefix, transfomedKeys) => { - return ( - suggestions && - suggestions.length > 0 && - suggestions.map((option, key) => { - option.name = getLocaleLabels( - option.code, - localePrefix && !isEmpty(localePrefix) - ? appendModulePrefix(option.code, localePrefix) - : option.name, - transfomedKeys - ); - return option; - }) - ); -}; - -const mapStateToProps = (state, ownprops) => { - const { localizationLabels } = state.app; - let { - jsonPath, - value, - sourceJsonPath, - labelsFromLocalisation, - data, - localePrefix - } = ownprops; - let suggestions = - data && data.length > 0 - ? data - : get(state.screenConfiguration.preparedFinalObject, sourceJsonPath, []); - value = value - ? value - : get(state.screenConfiguration.preparedFinalObject, jsonPath); - //To fetch corresponding labels from localisation for the suggestions, if needed. - if (labelsFromLocalisation) { - suggestions = getLocalisedSuggestions( - JSON.parse(JSON.stringify(suggestions)), - localePrefix, - localizationLabels - ); - } - //To find correct option object as per the value (for showing the selected value). - const selectedItem = findItemInArrayOfObject(suggestions, item => { - if (item.code === value) { - return true; - } else return false; - }); - //Make value object as the Autosuggest expects. - if (selectedItem && selectedItem.name) { - value = { label: selectedItem.name, value: selectedItem.code }; - } - return { value, jsonPath, suggestions, localizationLabels }; -}; - -const mapDispatchToProps = dispatch => { - return { - prepareFinalObject: (path, value) => - dispatch(prepareFinalObject(path, value)) - }; -}; - -export default connect( - mapStateToProps, - mapDispatchToProps -)(AutoSuggestor); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/HowItWorks/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/HowItWorks/index.js deleted file mode 100644 index d23c6d60ee2..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/HowItWorks/index.js +++ /dev/null @@ -1,79 +0,0 @@ -import React from "react"; -import Hidden from "@material-ui/core/Hidden"; -import commonConfig from "config/common"; -import { getLocaleLabels } from "egov-ui-framework/ui-utils/commons"; -import { - downloadPdf -} from "egov-ui-kit/utils/commons"; - -const gethelpURL = () => { - let hostname = window.location.hostname; - if (hostname === "localhost") - hostname = "https://s3.ap-south-1.amazonaws.com"; - else hostname = window.location.origin; - const url = new URL( - hostname + `/${commonConfig.S3BUCKET}/BDUserManual_Citizen.pdf` - ); - return url; -}; -//hostname="https://13.71.65.215.nip.io"; -// src="https://belegovgithub.github.io/webaccess/pdf/BillGenieUserManual_Citizen.pdf#view=FitH&embedded=true.pdf" -// src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/pb/TL_UserManual_Citizen.pdf#view=FitH&embedded=true" - -const HowItWorks = (props) => { - const helpURL = gethelpURL(); - return ( -
- - - - - {/* - Alternate solution to show pdf but it gets blocked by infra policy - - - - */} - -

- {getLocaleLabels( - "Your web browser doesn't have a PDF plugin. Instead you can ", - "BND_BROWSER_PLUGIN_ISSUE" - )} - downloadPdf(helpURL)} - > - {getLocaleLabels( - "click here to download the PDF file.", - "BND_DOWNLOAD_FILE" - )} - -

-
-
- ); -}; - -export default HowItWorks; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/SingleApplication/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/SingleApplication/index.js deleted file mode 100644 index 88c8e91d219..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/SingleApplication/index.js +++ /dev/null @@ -1,407 +0,0 @@ -import Button from "@material-ui/core/Button"; -import Card from "@material-ui/core/Card"; -import CardContent from "@material-ui/core/CardContent"; -import Grid from "@material-ui/core/Grid"; -import { withStyles } from "@material-ui/core/styles"; -import { convertEpochToDate } from "egov-ui-framework/ui-config/screens/specs/utils"; -import { setRoute } from "egov-ui-framework/ui-redux/app/actions"; -import { toggleSnackbar } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { httpRequest } from "egov-ui-framework/ui-utils/api"; -import { epochToDate, getApplicationType } from "egov-ui-kit/utils/commons"; -import { localStorageSet } from "egov-ui-kit/utils/localStorageUtils"; -import get from "lodash/get"; -import orderBy from "lodash/orderBy"; -import React from "react"; -import { connect } from "react-redux"; -import { checkValueForNA } from "egov-ui-framework/ui-config/screens/specs/utils"; -import Label from "egov-ui-framework/ui-containers/LabelContainer"; -import "./index.css"; -import { getUserInfo } from "egov-ui-kit/utils/localStorageUtils"; -import {postPaymentActivity} from "../../ui-config/screens/specs/utils" -const styles = { - card: { - marginLeft: 8, - marginRight: 8, - borderRadius: "inherit" - } -}; - -class SingleApplication extends React.Component { - - componentDidMount = () => { - - }; - - setBusinessServiceDataToLocalStorage = async (queryObject) => { - const { toggleSnackbar } = this.props; - try { - const payload = await httpRequest("post", "egov-workflow-v2/egov-wf/businessservice/_search", "_search", queryObject); - localStorageSet("businessServiceData", JSON.stringify(get(payload, "BusinessServices"))); - return get(payload, "BusinessServices"); - } catch (e) { - toggleSnackbar( - true, - { - labelName: "Not authorized to access Business Service!", - labelKey: "ERR_NOT_AUTHORISED_BUSINESS_SERVICE", - }, - "error" - ); - } - }; - - onCardClick = async (item) => { - const { moduleName, toggleSnackbar, setRoute } = this.props; - if(moduleName === "BIRTH") - { - if(item.status == "PAID_DOWNLOAD" || item.status == "PAID") - setRoute(`/uc-citizen/search?applicationNumber=${item.applicationNumber}`); - } - else - if(moduleName === "LAMS") - { - switch(item.status) - { - case "APPLIED": - case "APPROVED": - case "REJECTED": - case "CEO-EXAMINATION": - case "DEO-EXAMINATION": - case "PDDE-EXAMINATION": - case "DGDE-EXAMINATION": - case "MOD-EXAMINATION": - case "CITIZEN-REVIEW": - default: - setRoute(`/lams-common/search-preview?applicationNumber=${item.applicationNumber}&tenantId=${item.tenantId}`); - break; - } - } - else //Rest of the modules can be removed. - if (moduleName === "TL") { - const wfCode = get(item, "workflowCode"); - const businessServiceQueryObject = [ - { key: "tenantId", value: get(item, "tenantId") }, - { - key: "businessServices", - value: wfCode - } - ]; - this.setBusinessServiceDataToLocalStorage(businessServiceQueryObject); - switch (item.status) { - case "INITIATED": - setRoute(`/tradelicense-citizen/apply?applicationNumber=${item.applicationNumber}&tenantId=${item.tenantId}`); - default: - setRoute(`/tradelicence/search-preview?applicationNumber=${item.applicationNumber}&tenantId=${item.tenantId}`); - } - } else if (moduleName === "FIRENOC") { - switch (item.fireNOCDetails.status) { - case "INITIATED": - setRoute(`/fire-noc/apply?applicationNumber=${item.fireNOCDetails.applicationNumber}&tenantId=${item.tenantId}`); - default: - setRoute(`/fire-noc/search-preview?applicationNumber=${item.fireNOCDetails.applicationNumber}&tenantId=${item.tenantId}`); - } - } else if (moduleName === "BPAREG") { - const userInfo = JSON.parse(getUserInfo()); - const roles = get(userInfo, "roles"); - if (item.serviceType === "BPAREG") { - switch (item.status) { - case "INITIATED": - setRoute(`/bpastakeholder-citizen/apply?applicationNumber=${item.applicationNumber}&tenantId=${item.tenantId}`); - break; - default: - setRoute(`/bpastakeholder/search-preview?applicationNumber=${item.applicationNumber}&tenantId=${item.tenantId}`); - } - } else if(item.serviceType === "BPA_OC") { - switch (item.appStatus) { - case "INITIATED": - if(roles && roles.length == 1 && roles[0].code == "CITIZEN") { - setRoute(`/oc-bpa/search-preview?applicationNumber=${item.applicationNumber}&tenantId=${item.tenantId}&type=${item.type}`); - } else { - setRoute(`/oc-bpa/apply?applicationNumber=${item.applicationNumber}&tenantId=${item.tenantId}`); - } - break; - default: - setRoute(`/oc-bpa/search-preview?applicationNumber=${item.applicationNumber}&tenantId=${item.tenantId}&type=${item.type}`); - } - } else { - switch (item.appStatus) { - case "INITIATED": - if(roles && roles.length == 1 && roles[0].code == "CITIZEN") { - setRoute(`/egov-bpa/search-preview?applicationNumber=${item.applicationNumber}&tenantId=${item.tenantId}&type=${item.type}`); - } else { - setRoute(`/egov-bpa/apply?applicationNumber=${item.applicationNumber}&tenantId=${item.tenantId}`); - } - break; - default: - setRoute(`/egov-bpa/search-preview?applicationNumber=${item.applicationNumber}&tenantId=${item.tenantId}&type=${item.type}`); - } - } - } else if (moduleName === "PT-MUTATION") { - if (item.acknowldgementNumber) { - const businessService = await getApplicationType(item.acknowldgementNumber, item.tenantId, item.creationReason) - if (businessService) { - // navigateToApplication(businessService, this.props.history, item.acknowldgementNumber, item.tenantId, item.propertyId); - if (businessService == 'PT.MUTATION') { - setRoute("/pt-mutation/search-preview?applicationNumber=" + item.acknowldgementNumber + "&propertyId=" + item.propertyId + "&tenantId=" + item.tenantId); - } else if (businessService == 'PT.CREATE') { - setRoute("/property-tax/application-preview?propertyId=" + item.propertyId + "&applicationNumber=" + item.acknowldgementNumber + "&tenantId=" + item.tenantId + "&type=property"); - } else { - } - } else { - toggleSnackbar( - true, - { - labelName: "Business service returns empty response!", - labelKey: "BND_NO_BUSINESS_SERVICE", - }, - "error" - ); - } - } - } - }; - - onButtonCLick = () => { - const { setRoute, homeURL } = this.props; - setRoute(homeURL); - }; - generatevalidity = (item) => { - const validFrom = item.validFrom ? convertEpochToDate(get(item, "validFrom")) : "NA"; - const validTo = item.validTo ? convertEpochToDate(get(item, "validTo")) : "NA"; - const validity = validFrom + " - " + validTo; - return validity; - } - generateLabelKey = (content, item) => { - let LabelKey = ""; - if (content.prefix && content.suffix) { - LabelKey = `${content.prefix}${get(item, content.jsonPath, "").replace( - /[._:-\s\/]/g, - "_" - )}${content.suffix}`; - } else if (content.prefix) { - LabelKey = `${content.prefix}${get(item, content.jsonPath, "").replace( - /[._:-\s\/]/g, - "_" - )}`; - } else if (content.suffix) { - LabelKey = `${get(item, content.jsonPath, "").replace(/[._:-\s\/]/g, "_")}${ - content.suffix - }`; - } else { - LabelKey = content.label === "PT_MUTATION_CREATION_DATE" ? `${epochToDate(get(item, content.jsonPath, ""))}` : `${get(item, content.jsonPath, "")}`; - } - if(content.isDate) - { - LabelKey = `${epochToDate(get(item, content.jsonPath, ""))}`; - } - return LabelKey; - }; - - onDownloadCertClicked = (item, callPostPaymentActivity = true) =>{ - const {certificateDowloadHandler} = this.props; - certificateDowloadHandler(item.fileStoreId); - if(callPostPaymentActivity) - postPaymentActivity({consumerCode:item.applicationNumber, tenantId:item.tenantId, businessService: item.applicationCategory == "Birth" ? "BIRTH_CERT" : "DEATH_CERT"} - , false); - } - - onDownloadReceiptClicked = (item) =>{ - const {downloadReceiptHandler} = this.props; - downloadReceiptHandler(item.applicationNumber, item.tenantId); - } - - render() { - const { searchResults, classes, contents, moduleName, setRoute } = this.props; - return ( -
- {searchResults && searchResults.length > 0 ? ( - searchResults.map(item => { - return ( - - -
- {contents.map(content => { - return ( - - - - - - - ); - })} - {moduleName === "TL" && -
- - - - - - -
- } - { -
- { (item.status == "FREE_DOWNLOAD") && - item.fileStoreId && item.fileStoreId!="EXPIRED" && /* */ -
-
{ - this.onDownloadCertClicked(item, false); - }}> -
- -
- } - { (item.status == "PAID" || item.status == "PAID_DOWNLOAD" || item.status == "PAID_PDF_GENERATED") && - item.fileStoreId && item.fileStoreId!="EXPIRED" && /* */ -
-
{ - this.onDownloadCertClicked(item); - }}> -
- -
- } - { (item.status == "PAID" || item.status == "PAID_DOWNLOAD" || item.status == "PAID_PDF_GENERATED") && - !item.fileStoreId && /* */ -
{ - location.reload(); - }}> -
} - { (item.status == "PAID" || item.status == "PAID_DOWNLOAD" || item.status == "PAID_PDF_GENERATED" ) && /* */ -
{ - const url = this.onDownloadReceiptClicked(item); - // setRoute(url); - }}> -
} -
- } - {/* */} -
-
-
- ); - }) - ) : ( -
-
- )} -
- ); - } -} - -const mapStateToProps = state => { - const searchResultsRaw = get( - state.screenConfiguration.preparedFinalObject, - "searchResults", - [] - ); - let searchResults = orderBy( - searchResultsRaw, - ["auditDetails.lastModifiedTime"], - ["desc"]); - searchResults = searchResults ? searchResults : searchResultsRaw; - const screenConfig = get(state.screenConfiguration, "screenConfig"); - return { screenConfig, searchResults }; -}; - -const mapDispatchToProps = dispatch => { - return { - setRoute: path => dispatch(setRoute(path)), - toggleSnackbar: (open, message, type) => dispatch(toggleSnackbar(open, message, type)) - }; -}; - -export default withStyles(styles)( - connect( - mapStateToProps, - mapDispatchToProps - )(SingleApplication) -); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/SingleApplication/index.scss b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/SingleApplication/index.scss deleted file mode 100644 index 8b181a35b59..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/SingleApplication/index.scss +++ /dev/null @@ -1,20 +0,0 @@ -.pt-application-card { - min-height: 204px; -} - -.application-card { - margin-top: 80px; - position: relative; -} - -@media only screen and (min-width: 768px) { - .application-card { - margin-top: 0px !important; - } -} - -@media only screen and (max-width: 768px) { - .application-card { - margin-top: 0px; - } -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/TestMolecules/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/TestMolecules/index.js deleted file mode 100644 index 46a031c44d0..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/TestMolecules/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; - -const TestMolecules=()=>(
Test Molecules
) - -export default TestMolecules; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/UploadSingleFile/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/UploadSingleFile/index.js deleted file mode 100644 index 0c8b35e0f2d..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/UploadSingleFile/index.js +++ /dev/null @@ -1,49 +0,0 @@ -import React from "react"; -import { UploadedDocument } from "egov-ui-framework/ui-atoms"; -import {UploadFile} from "../../ui-atoms-local"; - -const UploadSingleFile = ({ - uploaded, - classes, - handleFileUpload, - documents, - removeDocument, - onButtonClick, - inputProps, - buttonLabel -}) => { - return ( -
- {!uploaded && ( - - )} - {uploaded && ( -
- {documents && - documents.map((document, documentIndex) => { - return ( -
- -
- ); - })} -
- )} -
- ); -}; - -export default UploadSingleFile; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/index.js deleted file mode 100644 index e0efa69d922..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-molecules-local/index.js +++ /dev/null @@ -1,37 +0,0 @@ -import React from "react"; -import Loadable from "react-loadable"; -import LinearProgress from "egov-ui-framework/ui-atoms/LinearSpinner"; - -const Loading = () => ; -const TestMolecules = Loadable({ - loader: () => import("./TestMolecules"), - loading: () => -}); - -const HowItWorks = Loadable({ - loader: () => import("./HowItWorks"), - loading: () => -}); - -const SingleApplication = Loadable({ - loader: () => import("./SingleApplication"), - loading: () => -}); - -const AutosuggestContainer = Loadable({ - loader: () => import("./AutosuggestContainer"), - loading: () => -}); - -const UploadSingleFile = Loadable({ - loader: () => import("./UploadSingleFile"), - loading: () => -}); - -export { - TestMolecules, - HowItWorks, - AutosuggestContainer, - SingleApplication, - UploadSingleFile -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/store/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/store/index.js deleted file mode 100644 index 937b3312e75..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/store/index.js +++ /dev/null @@ -1,25 +0,0 @@ -import rootReducer from "./reducer"; -import { createStore, applyMiddleware,combineReducers,compose } from "redux"; -import thunk from "redux-thunk"; -import screenConfigurationMiddleware from "egov-ui-framework/ui-redux/screen-configuration/middlewares"; -import authMiddleware from "egov-ui-framework/ui-redux/auth/middlewares"; - -let middlewares = []; - -middlewares = middlewares.concat(authMiddleware); -middlewares = middlewares.concat(screenConfigurationMiddleware); -middlewares = middlewares.concat(thunk); - -if (process.env.NODE_ENV === "development") { - const { logger } = require("redux-logger"); - middlewares = middlewares.concat(logger); -} - -const store = createStore(combineReducers({ - ...rootReducer -}),compose( - applyMiddleware(...middlewares), - window.devToolsExtension ? window.devToolsExtension() : f => f - )) - -export default store diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/store/reducer.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/store/reducer.js deleted file mode 100644 index 1547f3b0830..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/store/reducer.js +++ /dev/null @@ -1,11 +0,0 @@ -import app from "egov-ui-framework/ui-redux/app/reducer"; -import auth from "egov-ui-framework/ui-redux/auth/reducer"; -import screenConfiguration from "egov-ui-framework/ui-redux/screen-configuration/reducer"; - -const rootReducer = { - app, - auth, - screenConfiguration -}; - -export default rootReducer; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/workflow/actionTypes.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/workflow/actionTypes.js deleted file mode 100644 index 14793339265..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/workflow/actionTypes.js +++ /dev/null @@ -1 +0,0 @@ -export const GET_WORK_FLOW = "GET_WORK_FLOW"; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/workflow/actions.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/workflow/actions.js deleted file mode 100644 index 06181c1ec53..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/workflow/actions.js +++ /dev/null @@ -1,24 +0,0 @@ -import * as actionTypes from "./actionTypes"; -import { httpRequest } from "ui-utils/api"; - -export const setProcessInstances = payload => { - return { - type: actionTypes.GET_WORK_FLOW, - payload - }; -}; - -export const getWorkFlowData = queryObject => { - return async (dispatch, getState) => { - try { - const payload = await httpRequest( - "post", - "egov-workflow-v2/egov-wf/process/_search", - "", - queryObject - ); - dispatch(setProcessInstances(payload)); - } catch (error) { - } - }; -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/workflow/reducer.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/workflow/reducer.js deleted file mode 100644 index fea3f327f53..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-redux/workflow/reducer.js +++ /dev/null @@ -1,23 +0,0 @@ -import * as actionTypes from "./actionTypes"; -import get from "lodash/get"; -import orderBy from "lodash/orderBy"; - -const initialState = { - ProcessInstances: [] -}; - -const appReducer = (state = initialState, action) => { - switch (action.type) { - case actionTypes.GET_WORK_FLOW: - return { - ...state, - ProcessInstances: get(action.payload, "ProcessInstances") - ? get(action.payload, "ProcessInstances") - : action.payload - }; - - default: - return state; - } -}; -export default appReducer; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-routes/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-routes/index.js deleted file mode 100644 index 6a5895a7fc9..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-routes/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import React from "react"; -import RenderRoutes from "egov-ui-framework/ui-molecules/RenderRoutes"; -import { appRoutes } from "../ui-config"; - -const MainRoutes = childProps => { - return ( -
- -
- ); -}; - -export default MainRoutes; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-routes/index.scss b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-routes/index.scss deleted file mode 100644 index 425ba8eefdc..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-routes/index.scss +++ /dev/null @@ -1,4 +0,0 @@ -.main-route { - /* z-index: 10000; */ - position: relative; -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/api.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/api.js deleted file mode 100644 index be0dc3f19d8..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/api.js +++ /dev/null @@ -1,143 +0,0 @@ -import axios from "axios"; -import { - fetchFromLocalStorage, - addQueryArg, -} from "egov-ui-framework/ui-utils/commons"; -import commonConfig from "config/common.js"; -import store from "ui-redux/store"; -import { toggleSpinner } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { - getAccessToken, - getTenantId, -} from "egov-ui-kit/utils/localStorageUtils"; -import some from "lodash/some"; - -const instance = axios.create({ - baseURL: window.location.origin, - headers: { - "Content-Type": "application/json", - }, -}); - -const wrapRequestBody = (requestBody, action, customRequestInfo) => { - const authToken = getAccessToken(); - let RequestInfo = { - apiId: "Rainmaker", - ver: ".01", - // ts: getDateInEpoch(), - action: action, - did: "1", - key: "", - msgId: "20170310130900|en_IN", - requesterId: "", - authToken, - }; - RequestInfo = { ...RequestInfo, ...customRequestInfo }; - return Object.assign( - {}, - { - RequestInfo, - }, - requestBody - ); -}; - -export const httpRequest = async ( - method = "get", - endPoint, - action, - queryObject = [], - requestBody = {}, - headers = [], - customRequestInfo = {} -) => { - store.dispatch(toggleSpinner()); - let apiError = "Api Error"; - - if (headers) - instance.defaults = Object.assign(instance.defaults, { - headers, - }); - /* Fix for central instance to send tenantID in all query params */ - const tenantId = - process.env.REACT_APP_NAME === "Citizen" - ? commonConfig.tenantId - : endPoint && endPoint.includes("mdms") - ? commonConfig.tenantId - : getTenantId() || commonConfig.tenantId; - if (!some(queryObject, ["key", "tenantId"]) && commonConfig.singleInstance) { - endPoint && - !endPoint.includes("tenantId") && - queryObject && - queryObject.push({ - key: "tenantId", - value: tenantId, - }); - } - endPoint = addQueryArg(endPoint, queryObject); - var response; - try { - switch (method) { - case "post": - response = await instance.post( - endPoint, - wrapRequestBody(requestBody, action, customRequestInfo) - ); - break; - default: - response = await instance.get(endPoint); - } - const responseStatus = parseInt(response.status, 10); - store.dispatch(toggleSpinner()); - if (responseStatus === 200 || responseStatus === 201) { - return response.data; - } - } catch (error) { - const { data, status } = error.response; - if (status === 400 && data === "") { - apiError = "INVALID_TOKEN"; - } else { - apiError = - (data.hasOwnProperty("Errors") && - data.Errors && - data.Errors.length && - data.Errors[0].message) || - (data.hasOwnProperty("error") && - data.error.fields && - data.error.fields.length && - data.error.fields[0].message) || - (data.hasOwnProperty("error_description") && data.error_description) || - apiError; - } - store.dispatch(toggleSpinner()); - } - // unhandled error - throw new Error(apiError); -}; - -export const loginRequest = async (username = null, password = null) => { - let apiError = "Api Error"; - try { - // api call for login - alert("Logged in"); - return; - } catch (e) { - apiError = e.message; - // alert(e.message); - } - - throw new Error(apiError); -}; - -export const logoutRequest = async () => { - let apiError = "Api Error"; - try { - alert("Logged out"); - return; - } catch (e) { - apiError = e.message; - // alert(e.message); - } - - throw new Error(apiError); -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/commons.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/commons.js deleted file mode 100644 index c10d634e0c9..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/commons.js +++ /dev/null @@ -1,247 +0,0 @@ -import { convertDateToEpoch } from "egov-ui-framework/ui-config/screens/specs/utils"; -import { - handleScreenConfigurationFieldChange as handleField, - prepareFinalObject, - toggleSnackbar, - toggleSpinner -} from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { httpRequest } from "egov-ui-framework/ui-utils/api"; -import { getTransformedLocale } from "egov-ui-framework/ui-utils/commons"; -import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; -import jp from "jsonpath"; -import get from "lodash/get"; -import set from "lodash/set"; -import store from "ui-redux/store"; -import axios from "axios"; - -import { - getFileUrl, - getFileUrlFromAPI, getMultiUnits, getQueryArg, setBusinessServiceDataToLocalStorage, -} from "egov-ui-framework/ui-utils/commons"; - -export const acceptedFiles = acceptedExt => { - const splitExtByName = acceptedExt.split(","); - const acceptedFileTypes = splitExtByName.reduce((result, curr) => { - if (curr.includes("image")) { - result.push("image"); - } else { - result.push(curr.split(".")[1]); - } - return result; - }, []); - return acceptedFileTypes; -}; -export const findItemInArrayOfObject = (arr, conditionCheckerFn) => { - for (let i = 0; i < arr.length; i++) { - if (conditionCheckerFn(arr[i])) { - return arr[i]; - } - } -}; - -export const getFileSize = file => { - const size = parseFloat(file.size / 1024).toFixed(2); - return size; -}; - -export const isFileValid = (file, acceptedFiles) => { - const mimeType = file["type"]; - //alert("mimeType of file is ",mimeType); - return ( - (mimeType && - acceptedFiles && - acceptedFiles.indexOf(mimeType.split("/")[1]) > -1) || - false - ); -}; - -export const msToTime = (duration) =>{ - var milliseconds = Math.floor((duration % 1000) / 100), - seconds = Math.floor((duration / 1000) % 60), - minutes = Math.floor((duration / (1000 * 60)) % 60), - hours = Math.floor((duration / (1000 * 60 * 60)) % 24); - - hours = (hours < 10) ? "0" + hours : hours; - minutes = (minutes < 10) ? "0" + minutes : minutes; - seconds = (seconds < 10) ? "0" + seconds : seconds; - - return hours + " Hours " + minutes + " Min " + seconds + " Seconds" ; -} - -export const handleFileUpload = (event, handleDocument, props,module) => { - const { maxFileSize, formatProps, moduleName } = props; - const input = event.target; - if (input.files && input.files.length > 0) { - const files = input.files; - Object.keys(files).forEach(async (key, index) => { - const file = files[key]; - const fileValid = isFileValid(file, acceptedFiles(formatProps.accept)); - const fileSize = getFileSize(file); - const isSizeValid = fileSize <= maxFileSize; - alert(`Size of the excel is ${Math.round(fileSize )} KB \nEstimated Time to upload is : ${msToTime(Math.round(fileSize)*1000/8.5)} `); - handleDocument(file); - }); - } -}; - -export const prepareForm = params => { - let formData = new FormData(); - for (var k in params) { - formData.append(k, params[k]); - } - return formData; -}; - -export const uploadFile = async (endPoint, module, file) => { - // Bad idea to fetch from local storage, change as feasible - store.dispatch(toggleSpinner()); - const tenantId = getTenantId(); - - const uploadInstance = axios.create({ - baseURL: window.location.origin, - headers: { - "Content-Type": "multipart/form-data" - } - }); - - const requestParams = { - tenantId, - module, - file - }; - const requestBody = prepareForm(requestParams); - - try { - const response = await uploadInstance.post(endPoint, requestBody); - const responseStatus = parseInt(response.status, 10); - let fileStoreIds = []; - store.dispatch(toggleSpinner()); - if (responseStatus === 200) { - return response; - } - else - { - return "Service Error. Try again by logging in."; - } - } catch (error) { - store.dispatch(toggleSpinner()); - throw new Error(error); - } -}; - -export const postXlsxFile = async (state, dispatch, module, file) => { - - try{ - let tenantId = getTenantId(); - const resp = await uploadFile( - `birth-death-services/upload/_${module}?tenantid=${tenantId}`, - `${module}`, - file - ); - return resp; - } - catch(e){ - store.dispatch( - toggleSnackbar( - true, - { labelName: "ERR_API_ERROR", labelKey: "ERR_API_ERROR" }, - "error" - ) - ); - } -} - -export const deleteAllRecords = async (state, dispatch, module) => { - - store.dispatch(toggleSpinner()); - - let requestBody = {}; - let payload = null; - - let tenantId = getTenantId(); - - const queryParams = [ - { key: "tenantId", value: tenantId } - ]; - - let endPoint = (module == "birth")?"Birth":"Death"; - try - { - payload = await httpRequest( - "post", - 'birth-death-services/common/delete'+endPoint+'Import', - 'delete'+endPoint+'Import', - queryParams, - requestBody - ); - store.dispatch(toggleSpinner()); - store.dispatch( - toggleSnackbar( - true, - { labelName: "", labelKey: payload }, - "success" - ) - ); - } - catch(e) - { - store.dispatch(toggleSpinner()); - store.dispatch( - toggleSnackbar( - true, - { labelName: "ERR_API_ERROR", labelKey: "ERR_API_ERROR" }, - "error" - ) - ); - } - return payload; -} - -export const searchForBirth = async (dispatch,queryParams,queryObject) => { - try { - dispatch(toggleSpinner()); - const response = await httpRequest( - "post", - "birth-death-services/birth/_search", - "_search", - queryParams, - {}//{ searchCriteria: queryObject } - ); - dispatch(toggleSpinner()); - return response; - } catch (error) { - dispatch(toggleSpinner()); - store.dispatch( - toggleSnackbar( - true, - { labelName: error.message, labelCode: error.message }, - "error" - ) - ); - } -}; - -export const searchForDeath = async (dispatch,queryParams,queryObject) => { - try { - dispatch(toggleSpinner()); - const response = await httpRequest( - "post", - "birth-death-services/death/_search", - "_search", - queryParams, - {}//{ searchCriteria: queryObject } - ); - dispatch(toggleSpinner()); - return response; - } catch (error) { - dispatch(toggleSpinner()); - store.dispatch( - toggleSnackbar( - true, - { labelName: error.message, labelCode: error.message }, - "error" - ) - ); - } -}; - diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/constants.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/constants.js deleted file mode 100644 index 8f8b37127bb..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/constants.js +++ /dev/null @@ -1,6 +0,0 @@ -export const genderValues = -{ - "1":"Male", - "2":"Female", - "3":"Transgender" -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/index.js deleted file mode 100644 index e4dcb8de3ea..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import {addComponentJsonpath} from "./commons"; -import {httpRequest,loginRequest,logoutRequest} from "./api"; - -export { - addComponentJsonpath, - httpRequest, - loginRequest, - logoutRequest -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/sampleResponses.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/sampleResponses.js deleted file mode 100644 index d2bce0f91b9..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-utils/sampleResponses.js +++ /dev/null @@ -1,885 +0,0 @@ -export const sampleSearch = () => { - let res = { - ResponseInfo: { - apiId: "Rainmaker", - ver: ".01", - ts: null, - resMsgId: "uief87324", - msgId: "20170310130900|en_IN", - status: "successful" - }, - FireNOCs: [ - { - fid: "101", - tenantId: "pb.amritsar", - firenocnumber: "", - dateofapplied: "1556649000000", - firenocdetailsid: "201", - action: "INITIATE", - applicationnumber: "PB-NOC-201", - firenoctype: "New", - applicationdate: 1556649000000, - financialyear: "2018-19", - issueddate: "1557154107155", - validfrom: "1546300800", - validto: "1577836800", - channel: "web", - buildingid: "B1", - name: "Building 1", - nooffloors: "1", - noofbasements: "1", - ownerid: "301", - ownertype: "SINGLE", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - relationship: "FATHER", - status: "INITIATED", - fireNOCDetails: { - id: "201", - applicationStatus: "INITIATED", - fireNOCType: "New", - firestationId: "", - applicationDate: "1556649000000", - financialYear: "2018-19", - issuedDate: "1557154107155", - validFrom: "1546300800", - validTo: "1577836800", - action: "INITIATE", - channel: "web", - noOfBuildings: "MULTIPLE", - buildings: [ - { - id: "B1", - name: "DSRRH", - noOfFloors: "1", - noOfBasements: "1", - applicationDocuments: [] - }, - { - id: "B3", - noOfFloors: "1", - noOfBasements: "1", - applicationDocuments: [] - } - ], - propertyDetails: {}, - applicantDetails: { - owners: [ - { - id: "301", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - ownerType: "SINGLE", - relationship: "FATHER", - fatherOrHusbandName: "", - password: "", - salutation: "", - name: "Shreya NayaK", - gender: "FEMALE", - mobileNumber: "9686987977", - emailId: "", - altContactNumber: "", - pan: "", - dob: "1992-11-11", - aadhaarNumber: null, - permanentAddress: "new Street", - permanentCity: "pb.amritsar", - permanentPincode: null, - correspondenceCity: null, - correspondenceAddress: null - }, - { - id: "305", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - ownerType: "SINGLE", - relationship: "FATHER", - fatherOrHusbandName: "", - password: "", - salutation: "", - name: "Shreya NayaK", - gender: "FEMALE", - mobileNumber: "9686987977", - emailId: "", - altContactNumber: "", - pan: "", - dob: "1992-11-11", - aadhaarNumber: null, - permanentAddress: "new Street", - permanentCity: "pb.amritsar", - permanentPincode: null, - correspondenceCity: null, - correspondenceAddress: null - } - ], - additionalDetail: {} - }, - additionalDetail: {}, - auditDetails: {} - } - }, - { - fid: "102", - tenantId: "pb.amritsar", - firenocnumber: "", - dateofapplied: "1556649000000", - firenocdetailsid: "202", - action: "INITIATE", - applicationnumber: "PB-NOC-202", - firenoctype: "New", - applicationdate: 1556649000000, - financialyear: "2018-19", - issueddate: "1557154107156", - validfrom: "1546300800", - validto: "1577836800", - channel: "web", - buildingid: "B2", - name: "Building 2", - nooffloors: "1", - noofbasements: "1", - ownerid: "302", - ownertype: "SINGLE", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - relationship: "FATHER", - status: "INITIATED", - fireNOCDetails: { - id: "202", - applicationStatus: "INITIATED", - fireNOCType: "New", - firestationId: "", - applicationDate: "1556649000000", - financialYear: "2018-19", - issuedDate: "1557154107156", - validFrom: "1546300800", - validTo: "1577836800", - action: "INITIATE", - channel: "web", - noOfBuildings: "", - buildings: [ - { - id: "B2", - noOfFloors: "1", - noOfBasements: "1", - applicationDocuments: [] - } - ], - propertyDetails: {}, - applicantDetails: { - owners: [ - { - id: "302", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - ownerType: "SINGLE", - relationship: "FATHER", - fatherOrHusbandName: "", - password: "", - salutation: "", - name: "Shreya NayaK", - gender: "FEMALE", - mobileNumber: "9686987977", - emailId: "", - altContactNumber: "", - pan: "", - dob: "1992-11-11", - aadhaarNumber: null, - permanentAddress: "new Street", - permanentCity: "pb.amritsar", - permanentPincode: null, - correspondenceCity: null, - correspondenceAddress: null - }, - { - id: "306", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - ownerType: "SINGLE", - relationship: "FATHER", - fatherOrHusbandName: "", - password: "", - salutation: "", - name: "Shreya NayaK", - gender: "FEMALE", - mobileNumber: "9686987977", - emailId: "", - altContactNumber: "", - pan: "", - dob: "1992-11-11", - aadhaarNumber: null, - permanentAddress: "new Street", - permanentCity: "pb.amritsar", - permanentPincode: null, - correspondenceCity: null, - correspondenceAddress: null - } - ], - additionalDetail: {} - }, - additionalDetail: {}, - auditDetails: {} - } - }, - { - fid: "105", - tenantId: "pb.amritsar", - firenocnumber: "", - dateofapplied: "1556649000000", - firenocdetailsid: "205", - action: "INITIATE", - applicationnumber: "PB-NOC-205", - firenoctype: "New", - applicationdate: 1556649000000, - financialyear: "2018-19", - issueddate: "1556649000000", - validfrom: "1556649000000", - validto: "1556649000000", - channel: "Web", - buildingid: "B5", - name: "Building 5", - nooffloors: "2", - noofbasements: "1", - ownerid: "o5", - ownertype: "", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - relationship: "FATHER", - status: "INITIATED", - fireNOCDetails: { - id: "205", - applicationStatus: "INITIATED", - fireNOCType: "New", - firestationId: "", - applicationDate: "1556649000000", - financialYear: "2018-19", - issuedDate: "1556649000000", - validFrom: "1556649000000", - validTo: "1556649000000", - action: "INITIATE", - channel: "Web", - noOfBuildings: "", - buildings: [ - { - id: "B5", - noOfFloors: "2", - noOfBasements: "1", - applicationDocuments: [] - } - ], - propertyDetails: {}, - applicantDetails: { - owners: [ - { - id: "o5", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - ownerType: "", - relationship: "FATHER", - fatherOrHusbandName: "", - password: "", - salutation: "", - name: "Shreya NayaK", - gender: "FEMALE", - mobileNumber: "9686987977", - emailId: "", - altContactNumber: "", - pan: "", - dob: "1992-11-11", - aadhaarNumber: null, - permanentAddress: "new Street", - permanentCity: "pb.amritsar", - permanentPincode: null, - correspondenceCity: null, - correspondenceAddress: null - } - ], - additionalDetail: {} - }, - additionalDetail: {}, - auditDetails: {} - } - }, - { - fid: "106", - tenantId: "pb.amritsar", - firenocnumber: "", - dateofapplied: "1556821800000", - firenocdetailsid: "206", - action: "INITIATE", - applicationnumber: "PB-NOC-20", - firenoctype: "New", - applicationdate: 1556821800000, - financialyear: "2018-19", - issueddate: "1556821800000", - validfrom: "1556821800000", - validto: "1556821800000", - channel: "Web", - buildingid: "B6", - name: "Building 6", - nooffloors: "2", - noofbasements: "1", - ownerid: "o6", - ownertype: "", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - relationship: "FATHER", - status: "INITIATED", - fireNOCDetails: { - id: "206", - applicationStatus: "INITIATED", - fireNOCType: "New", - firestationId: "", - applicationDate: "1556821800000", - financialYear: "2018-19", - issuedDate: "1556821800000", - validFrom: "1556821800000", - validTo: "1556821800000", - action: "INITIATE", - channel: "Web", - noOfBuildings: "", - buildings: [ - { - id: "B6", - noOfFloors: "2", - noOfBasements: "1", - applicationDocuments: [] - } - ], - propertyDetails: {}, - applicantDetails: { - owners: [ - { - id: "o6", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - ownerType: "", - relationship: "FATHER", - fatherOrHusbandName: "", - password: "", - salutation: "", - name: "Shreya NayaK", - gender: "FEMALE", - mobileNumber: "9686987977", - emailId: "", - altContactNumber: "", - pan: "", - dob: "1992-11-11", - aadhaarNumber: null, - permanentAddress: "new Street", - permanentCity: "pb.amritsar", - permanentPincode: null, - correspondenceCity: null, - correspondenceAddress: null - } - ], - additionalDetail: {} - }, - additionalDetail: {}, - auditDetails: {} - } - }, - { - fid: "107", - tenantId: "pb.amritsar", - firenocnumber: "", - dateofapplied: "1556908200000", - firenocdetailsid: "207", - action: "INITIATE", - applicationnumber: "PB-NOC-207", - firenoctype: "New", - applicationdate: 1556908200000, - financialyear: "2018-19", - issueddate: "1556908200000", - validfrom: "1556908200000", - validto: "1556908200000", - channel: "Web", - buildingid: "B7", - name: "Building 7", - nooffloors: "2", - noofbasements: "1", - ownerid: "o7", - ownertype: "", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - relationship: "FATHER", - status: "INITIATED", - fireNOCDetails: { - id: "207", - applicationStatus: "INITIATED", - fireNOCType: "New", - firestationId: "", - applicationDate: "1556908200000", - financialYear: "2018-19", - issuedDate: "1556908200000", - validFrom: "1556908200000", - validTo: "1556908200000", - action: "INITIATE", - channel: "Web", - noOfBuildings: "", - buildings: [ - { - id: "B7", - noOfFloors: "2", - noOfBasements: "1", - applicationDocuments: [] - } - ], - propertyDetails: {}, - applicantDetails: { - owners: [ - { - id: "o7", - useruuid: "5417dbb7-14b9-4be2-ac46-ce2decb30444", - ownerType: "", - relationship: "FATHER", - fatherOrHusbandName: "", - password: "", - salutation: "", - name: "Shreya NayaK", - gender: "FEMALE", - mobileNumber: "9686987977", - emailId: "", - altContactNumber: "", - pan: "", - dob: "1992-11-11", - aadhaarNumber: null, - permanentAddress: "new Street", - permanentCity: "pb.amritsar", - permanentPincode: null, - correspondenceCity: null, - correspondenceAddress: null - } - ], - additionalDetail: {} - }, - additionalDetail: {}, - auditDetails: {} - } - }, - { - fid: "6a80fcb4-3767-4bd4-b01b-7177107a334a", - tenantId: "pb.amritsar", - firenocnumber: null, - dateofapplied: null, - firenocdetailsid: "03d2cae0-b608-4a13-9974-56b7eb73c129", - action: "INITIATE", - applicationnumber: "PB-NOC-100", - firenoctype: "string", - applicationdate: 12131238, - financialyear: "string", - issueddate: null, - validfrom: "0", - validto: "0", - channel: "COUNTER", - buildingid: "ab011f2c-58ca-4b6c-9231-e36b8aad7a61", - name: "string", - nooffloors: "0", - noofbasements: "0", - ownerid: "f71c0468-0f1f-458d-bfb5-0cad82011287", - ownertype: "string", - useruuid: null, - relationship: "FATHER", - status: "INITIATED", - fireNOCDetails: { - id: "03d2cae0-b608-4a13-9974-56b7eb73c129", - applicationStatus: "INITIATED", - fireNOCType: "string", - firestationId: "", - applicationDate: "12131238", - financialYear: "string", - issuedDate: null, - validFrom: "0", - validTo: "0", - action: "INITIATE", - channel: "COUNTER", - noOfBuildings: "", - buildings: [ - { - id: "ab011f2c-58ca-4b6c-9231-e36b8aad7a61", - noOfFloors: "0", - noOfBasements: "0", - applicationDocuments: [] - } - ], - propertyDetails: {}, - applicantDetails: { owners: [null], additionalDetail: {} }, - additionalDetail: {}, - auditDetails: {} - } - } - ] - }; - return res; -}; - -export const sampleSingleSearch = () => { - return { - ResponseInfo: { - apiId: "Mihy", - ver: ".01", - ts: null, - resMsgId: "uief87324", - msgId: "20170310130900|en_IN", - status: "successful" - }, - FireNOCs: [ - { - id: "af82e49e-c966-40ab-993f-9ead126b3583", - tenantId: "pb.amritsar", - fireNOCNumber: null, - provisionFireNOCNumber: null, - oldFireNOCNumber: null, - dateOfApplied: null, - fireNOCDetails: { - id: "951ab026-0c77-4368-a944-10cf07287b86", - applicationNumber: "PB-FN-2019-06-07-002024", - status: "INITIATED", - fireNOCType: "PROVISIONAL", - applicationDate: null, - financialYear: null, - issuedDate: null, - validFrom: null, - validTo: null, - action: "INITIATE", - channel: null, - noOfBuildings: "MULTIPLE", - buildings: [ - { - id: "5427ad45-2bf7-428b-bcc8-3c52c7747925", - tenantId: "pb.amritsar", - name: "dsrrh violet", - usageType: "GROUP_A_RESIDENTIAL.SUBDIVISIONA-1", - uoms: [ - { - code: "NO_OF_FLOORS", - value: 7, - isActiveUom: true, - active: true - }, - { - code: "NO_OF_BASEMENTS", - value: 2, - isActiveUom: true, - active: true - }, - { - code: "HEIGHT_OF_BUILDING", - value: 4500, - isActiveUom: true, - active: true - } - ], - applicationDocuments: [ - { - tenantId: "pb.amritsar", - documentType: "BUILDING.BUILDING_PLAN.SITE_PLAN", - fileStoreId: "bcc598cf-04bf-45c8-bbf5-b1d3619b2d78" - } - ], - usageTypeMajor: "GROUP_A_RESIDENTIAL" - }, - { - id: "c53ca061-4fe8-48c0-aec7-1eff3621d72a", - tenantId: "pb.amritsar", - name: "Dsrrh Indigo", - usageType: "GROUP_A_RESIDENTIAL.SUBDIVISIONA-2", - uoms: [ - { - code: "NO_OF_FLOORS", - value: 8, - isActiveUom: true, - active: true - }, - { - code: "NO_OF_BASEMENTS", - value: 1, - isActiveUom: true, - active: true - }, - { - code: "HEIGHT_OF_BUILDING", - value: 5000, - isActiveUom: true, - active: true - } - ], - applicationDocuments: [], - usageTypeMajor: "GROUP_A_RESIDENTIAL" - } - ], - propertyDetails: { - id: "968e8152-5d8f-4dd4-b5e6-1d750ee04313", - propertyId: null, - address: { - tenantId: "pb.amritsar", - doorNo: null, - latitude: null, - longitude: null, - buildingName: null, - city: "pb.amritsar", - locality: { - code: "SUN04" - }, - pincode: "560102", - street: null - } - }, - applicantDetails: { - ownerShipType: "INDIVIDUAL.SINGLEOWNER", - owners: [ - { - id: 23442, - userName: "9167765477", - salutation: null, - name: "Avijeet", - gender: "MALE", - mobileNumber: "9167765477", - emailId: "avi7@gm.com", - altContactNumber: null, - pan: "bnhpp5432k", - aadhaarNumber: null, - permanentAddress: "Some correspondance address", - permanentCity: null, - permanentPinCode: null, - correspondenceAddress: "Corresponding address", - correspondenceCity: null, - correspondencePinCode: null, - addresses: [ - { - pinCode: null, - city: null, - address: "Corresponding address", - type: "CORRESPONDENCE", - id: 52741, - tenantId: "pb", - userId: 23442, - addressType: "CORRESPONDENCE", - lastModifiedBy: null, - lastModifiedDate: null - }, - { - pinCode: null, - city: null, - address: "Some correspondance address", - type: "PERMANENT", - id: 48685, - tenantId: "pb", - userId: 23442, - addressType: "PERMANENT", - lastModifiedBy: null, - lastModifiedDate: null - } - ], - active: true, - locale: null, - type: "CITIZEN", - accountLocked: false, - accountLockedDate: 0, - fatherOrHusbandName: "A", - signature: null, - bloodGroup: null, - photo: null, - identificationMark: null, - createdBy: 0, - lastModifiedBy: 1, - tenantId: "pb", - roles: [ - { - code: "CITIZEN", - name: "Citizen", - tenantId: "pb" - } - ], - uuid: "d9fb76e8-3c65-4e11-9f5f-2998c0f8b8a6", - createdDate: 1532962200000, - lastModifiedDate: 1560171420000, - dob: "1991-06-28", - pwdExpiryDate: 1541470800000 - } - ], - additionalDetail: { - documents: [ - { - tenantId: "pb.amritsar", - documentType: "OWNER.IDENTITYPROOF", - fileStoreId: "89fe5959-79e1-4201-b8ca-bcbc4c23c828" - } - ] - }, - ownerShipMajorType: "INDIVIDUAL" - }, - additionalDetail: { - documents: [] - }, - auditDetails: { - createdBy: "52bb4f29-922a-4ba1-b3f1-33cfff16cd7e", - lastModifiedBy: "", - createdTime: "1559897605727", - lastModifiedTime: "0" - } - }, - auditDetails: { - createdBy: "52bb4f29-922a-4ba1-b3f1-33cfff16cd7e", - lastModifiedBy: "", - createdTime: "1559897605727", - lastModifiedTime: "0" - } - } - ] - }; -}; - -export const sampleDocUpload = () => { - return { - "0": { - documentType: "OWNER", - documentCode: "OWNER.IDENTITYPROOF", - documents: [ - { - fileName: "preview-PB-TL-2018-12-02-001113 (1).pdf", - fileStoreId: "89fe5959-79e1-4201-b8ca-bcbc4c23c828" - } - ], - dropdown: { - value: "OWNER.IDENTITYPROOF.AADHAAR" - } - }, - "1": { - documentType: "OWNER", - documentCode: "OWNER.ADDRESSPROOF" - }, - "2": { - documentType: "BUILDING", - documentCode: "Dsrrh Indigo", - documentSubCode: "BUILDING.BUILDING_PLAN.SITE_PLAN" - }, - "3": { - documentType: "BUILDING", - documentCode: "Dsrrh Indigo", - documentSubCode: "BUILDING.BUILDING_PLAN.GROUND_FLOOR_PLAN" - }, - "4": { - documentType: "BUILDING", - documentCode: "Dsrrh Indigo", - documentSubCode: "BUILDING.BUILDING_PLAN.SECTION_PLAN" - }, - "5": { - documentType: "BUILDING", - documentCode: "Dsrrh Indigo", - documentSubCode: "BUILDING.BUILDING_PLAN.ELEVATION_PLAN" - }, - "6": { - documentType: "BUILDING", - documentCode: "Dsrrh Indigo", - documentSubCode: "BUILDING.BUILDING_PLAN.BUILTUP_AREA_STATEMENT" - }, - "7": { - documentType: "BUILDING", - documentCode: "dsrrh violet", - documentSubCode: "BUILDING.BUILDING_PLAN.SITE_PLAN", - documents: [ - { - fileName: "preview-PB-TL-2018-12-02-001113 (2).pdf", - fileStoreId: "bcc598cf-04bf-45c8-bbf5-b1d3619b2d78" - } - ] - }, - "8": { - documentType: "BUILDING", - documentCode: "dsrrh violet", - documentSubCode: "BUILDING.BUILDING_PLAN.GROUND_FLOOR_PLAN" - }, - "9": { - documentType: "BUILDING", - documentCode: "dsrrh violet", - documentSubCode: "BUILDING.BUILDING_PLAN.SECTION_PLAN" - }, - "10": { - documentType: "BUILDING", - documentCode: "dsrrh violet", - documentSubCode: "BUILDING.BUILDING_PLAN.ELEVATION_PLAN" - }, - "11": { - documentType: "BUILDING", - documentCode: "dsrrh violet", - documentSubCode: "BUILDING.BUILDING_PLAN.BUILTUP_AREA_STATEMENT" - }, - "12": { - documentType: "BUILDING", - documentCode: "BUILDING.FIRE_FIGHTING_PLAN" - }, - "13": { - documentType: "BUILDING", - documentCode: "BUILDING.OWNERS_CHECKLIST" - } - }; -}; - -export const sampleGetBill = () => { - return { - ResposneInfo: null, - Bill: [ - { - id: "b8378732-c1d0-4910-8d65-f3b027c48d8c", - mobileNumber: null, - payerName: null, - payerAddress: null, - payerEmail: null, - isActive: true, - isCancelled: null, - additionalDetails: null, - taxAndPayments: [ - { - businessService: "FIRENOC", - taxAmount: 16500, - amountPaid: null - } - ], - billDetails: [ - { - id: "31dd68b0-ded3-45de-b241-de96d73b487c", - tenantId: "pb.amritsar", - demandId: "02f07856-978f-4a6b-acb9-8ad635699c4f", - bill: "b8378732-c1d0-4910-8d65-f3b027c48d8c", - businessService: "FIRENOC", - billNumber: null, - billDate: 1560258084110, - consumerCode: "PB-FN-1234", - consumerType: "FIRENOC", - expiryDate: 1560258084110, - minimumAmount: null, - totalAmount: 16500, - fromPeriod: 1554076799000, - toPeriod: 1585679399000, - collectedAmount: 0, - collectionModesNotAllowed: ["DD"], - partPaymentAllowed: false, - isAdvanceAllowed: false, - additionalDetails: null, - billAccountDetails: [ - { - id: "48417f1e-f8ac-4469-8e31-b801731884db", - tenantId: "pb.amritsar", - billDetail: "31dd68b0-ded3-45de-b241-de96d73b487c", - demandDetailId: "b15dcc8b-3748-4835-97fa-a9e42e632ecc", - order: 3, - amount: 16500, - adjustedAmount: 0, - isActualDemand: true, - glcode: null, - taxHeadCode: "FIRENOC_FEES", - additionalDetails: null, - purpose: "CURRENT" - } - ], - status: null - } - ], - tenantId: "pb.amritsar", - auditDetails: { - createdBy: "ed8cebbc-750c-4e03-98b5-488d6e506395", - lastModifiedBy: "ed8cebbc-750c-4e03-98b5-488d6e506395", - createdTime: 1560258084110, - lastModifiedTime: 1560258084110 - } - } - ], - ResponseInfo: { - apiId: "string", - ver: "string", - ts: null, - resMsgId: "uief87324", - msgId: "string", - status: "successful" - } - }; -}; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/App/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/App/index.js deleted file mode 100644 index 8ed9db3c14b..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/App/index.js +++ /dev/null @@ -1,58 +0,0 @@ -import React from "react"; -import { withRouter } from "react-router-dom"; -import { connect } from "react-redux"; -import { compose } from "recompose"; -import MainRoutes from "ui-routes"; -//import LoadingIndicator from "egov-ui-framework/ui-molecules/LoadingIndicator"; -import Div from "egov-ui-framework/ui-atoms/HtmlElements/Div"; -import { setRoute } from "egov-ui-framework/ui-redux/app/actions"; -import "./index.scss"; - -class App extends React.Component { - componentWillReceiveProps(nextProps) { - const { route: nextRoute } = nextProps; - const { route: currentRoute, history, setRoute } = this.props; - if (nextRoute && currentRoute !== nextRoute) { - history.push(nextRoute); - setRoute(""); - window.parent.postMessage(`/employee-tradelicence${nextRoute}`, "*"); - } - } - - render() { - const { authenticated } = this.props; - const childProps = { - isAuthenticated: authenticated - }; - return ( -
- - {/* {spinner && } */} -
- ); - } -} - -const mapStateToProps = ({ app, auth }) => { - const { route, spinner } = app; - const { authenticated } = auth; - return { - route, - spinner, - authenticated - }; -}; - -const mapDispatchToProps = dispatch => { - return { - setRoute: route => dispatch(setRoute(route)) - }; -}; - -export default compose( - withRouter, - connect( - mapStateToProps, - mapDispatchToProps - ) -)(App); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/App/index.test.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/App/index.test.js deleted file mode 100644 index 68c9e34f745..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/App/index.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './index'; - -it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(, div); - ReactDOM.unmountComponentAtNode(div); -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Landing/css.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Landing/css.js deleted file mode 100644 index 8c3fc8ba6f2..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Landing/css.js +++ /dev/null @@ -1,45 +0,0 @@ -const drawerWidth = 240; - -const styles = theme => ({ - root: { - flexGrow: 1, - height: "100%", - zIndex: 1, - overflow: "hidden", - position: "relative", - display: "flex", - width: "100%" - }, - appBar: { - position: "absolute", - [theme.breakpoints.up("md")]: { - // marginLeft: drawerWidth, - // width: `calc(100% - ${drawerWidth}px)`, - zIndex: 10000 - }, - background: "#ffffff", - color: "rgba(0, 0, 0, 0.8700000047683716)" - }, - navIconHide: { - [theme.breakpoints.up("md")]: { - display: "none" - } - }, - toolbar: theme.mixins.toolbar, - drawerPaper: { - width: drawerWidth, - [theme.breakpoints.up("md")]: { - position: "relative" - } - }, - content: { - flexGrow: 1, - backgroundColor: theme.palette.background.default, - padding: theme.spacing.unit, - [theme.breakpoints.up("md")]: { - paddingLeft: drawerWidth + 10 - } - } -}); - -export default styles; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Landing/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Landing/index.js deleted file mode 100644 index 9bf4704ff2c..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Landing/index.js +++ /dev/null @@ -1,134 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { withStyles } from "@material-ui/core/styles"; -import { - AppBar, - Drawer, - Div, - Toolbar, - List, - ListItem, - ListItemText, - Typegraphy, - Icon, - Main -} from "egov-ui-framework/ui-atoms"; -import IconButton from "@material-ui/core/IconButton"; -import Hidden from "@material-ui/core/Hidden"; -import RenderRoutes from "egov-ui-framework/ui-molecules/RenderRoutes"; -import appRoutes from "../../ui-config/routes/mihy"; -import styles from "./css"; -import { compose } from "recompose"; -import { connect } from "react-redux"; -import { logout } from "egov-ui-framework/ui-redux/auth/actions"; - -class Landing extends React.Component { - state = { - mobileOpen: false - }; - - handleDrawerToggle = () => { - this.setState(state => ({ mobileOpen: !state.mobileOpen })); - }; - - logout = async () => {}; - - render() { - const { classes, theme, match, logout } = this.props; - - const drawer = ( -
-
- - - - - - - - - - - - { - logout(); - }} - > - - - -
- ); - return ( -
- - - - - - - Rainmaker - - - - - - {drawer} - - - - - {drawer} - - -
-
- -
-
- ); - } -} - -Landing.propTypes = { - classes: PropTypes.object.isRequired, - theme: PropTypes.object.isRequired -}; - -const mapDispatchToProps = dispatch => { - return { - logout: () => dispatch(logout()) - }; -}; - -export default compose( - connect( - null, - mapDispatchToProps - ), - withStyles(styles, { withTheme: true }) -)(Landing); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Playground/css.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Playground/css.js deleted file mode 100644 index 247a29ae673..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Playground/css.js +++ /dev/null @@ -1,43 +0,0 @@ -const drawerWidth = 350; - -const styles = theme => ({ - root: { - flexGrow: 1, - height: "100vh", - zIndex: 1, - overflow: "hidden", - position: "relative", - display: "flex", - width: "100%" - }, - appBar: { - position: "absolute", - [theme.breakpoints.up("md")]: { - marginLeft: drawerWidth, - width: `calc(100% - ${drawerWidth}px)` - }, - background: "#2e73ab" - }, - navIconHide: { - [theme.breakpoints.up("md")]: { - display: "none" - } - }, - toolbar: theme.mixins.toolbar, - drawerPaper: { - width: drawerWidth, - [theme.breakpoints.up("md")]: { - position: "relative" - } - }, - content: { - flexGrow: 1, - backgroundColor: theme.palette.background.default, - padding: theme.spacing.unit - // [theme.breakpoints.up('md')]: { - // paddingLeft: drawerWidth+10, - // } - } -}); - -export default styles; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Playground/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Playground/index.js deleted file mode 100644 index 83bb1dec2dc..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/Playground/index.js +++ /dev/null @@ -1,141 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import { withStyles } from "@material-ui/core/styles"; -import { - AppBar, - Drawer, - Div, - Toolbar, - Typegraphy, - Icon -} from "egov-ui-framework/ui-atoms"; -import IconButton from "@material-ui/core/IconButton"; -import Hidden from "@material-ui/core/Hidden"; -import styles from "./css"; -import { compose } from "recompose"; -import ReactJson from "react-json-view"; -import { screenHoc } from "egov-ui-framework/ui-hocs"; -import CommonView from "egov-ui-framework/ui-molecules/CommonView"; -import defaultScreenConfig from "../../ui-config/screens/specs/egov-bnd/login"; - -const initScreenConfig = defaultScreenConfig; - -class Playground extends React.Component { - state = { - mobileOpen: false, - screenConfig: initScreenConfig, - view: null - }; - - handleDrawerToggle = () => { - this.setState(state => ({ mobileOpen: !state.mobileOpen })); - }; - - componentDidMount() { - const { screenConfig } = this.state; - this.initScreen(screenConfig); - } - - initScreen = screenConfig => { - const hasOwnConfig = true; - this.setState({ - view: screenHoc({ hasOwnConfig, screenConfig })(CommonView) - }); - }; - - updateScreen = (jsonStatus, action) => { - this.initScreen(jsonStatus.updated_src); - }; - - render() { - const { updateScreen } = this; - const { classes, theme } = this.props; - const { view: View, screenConfig } = this.state; - - const drawer = ( -
- - - - Screen configuration - - - -
- { - updateScreen(add, "add"); - }} - onDelete={del => { - updateScreen(del, "del"); - }} - onEdit={edit => { - updateScreen(edit, "edit"); - }} - onSelect={select => { - }} - /> -
- ); - return ( -
- - - - - - - Mihy Playground - - - - - - {drawer} - - - - - {drawer} - - -
-
- {View && } -
-
- ); - } -} - -Playground.propTypes = { - classes: PropTypes.object.isRequired, - theme: PropTypes.object.isRequired -}; - -export default compose(withStyles(styles, { withTheme: true }))(Playground); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/ScreenInterface/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/ScreenInterface/index.js deleted file mode 100644 index c40616769a0..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bnd-dev/src/ui-views/ScreenInterface/index.js +++ /dev/null @@ -1,43 +0,0 @@ -import React from "react"; -import { screenHoc } from "egov-ui-framework/ui-hocs"; -import CommonView from "egov-ui-framework/ui-molecules/CommonView"; - -class ScreenInterface extends React.Component { - constructor(props) { - super(props); - this.state = { view: null }; - } - componentDidMount() { - this.initInterface(this.props); - } - - initInterface = props => { - const { match} = props; - const { params } = match; - const { path, screenKey, hasRemoteConfig } = params; - if (path && screenKey) { - this.setState({ - view: screenHoc({ path, screenKey, hasRemoteConfig })(CommonView) - }); - } - }; - - componentWillReceiveProps(nextProps) { - const { match:nextMatch } = nextProps; - const { match:currentMatch } = this.props; - const { params:nextParams } = nextMatch; - const { params:currentParams } = currentMatch; - const { path:nextPath, screenKey:nextScreenKey } = nextParams; - const { path:currentPath, screenKey:currentScreenKey} = currentParams; - if ((nextPath!==currentPath)||(nextScreenKey!==currentScreenKey)) { - this.initInterface(nextProps); - } - } - - render() { - const { view: View } = this.state; // Assigning to new variable names @see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment - return View && ; - } -} - -export default ScreenInterface; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/offline-package.json b/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/offline-package.json deleted file mode 100644 index 8aecabc7970..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/offline-package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "egov-boilerplate-dev", - "version": "0.0.2", - "license": "egov", - "private": true, - "homepage": "https://egov-micro-dev.egovernments.org/employee-noc/", - "proxy": "https://egov-micro-dev.egovernments.org/", - "dependencies": { - "@babel/runtime": "^7.3.1", - "@material-ui/core": "^1.4.1", - "@material-ui/icons": "^2.0.3", - "autoselector": "^1.1.0", - "autosuggest-highlight": "^3.1.1", - "axios": "^0.18.0", - "babel-polyfill": "^6.26.0", - "egov-ui-framework": "0.1.41", - "egov-ui-kit": "^0.0.1", - "egov-workflow":"1.2.0", - "html2canvas": "^1.0.0-alpha.12", - "jquery": "^3.3.1", - "jsonpath": "^1.0.2", - "jspdf": "^1.5.3", - "lodash": "^4.17.10", - "marker-animate-unobtrusive": "^0.2.8", - "mui-datatables": "^2.0.0-beta.58", - "node-sass-chokidar": "^1.2.2", - "pdfmake": "^0.1.40", - "prop-types": "^15.6.2", - "qrcode": "^1.3.3", - "react": "^16.7.0", - "react-autosuggest": "^9.4.3", - "react-dom": "^16.7.0", - "react-google-maps": "^9.4.5", - "react-json-view": "^1.19.1", - "react-loadable": "^5.4.0", - "react-redux": "^5.1.1", - "react-responsive-carousel": "^3.1.45", - "react-router-dom": "^4.3.1", - "react-scripts": "^1.1.4", - "react-select": "^2.3.0", - "react-swipeable-views": "^0.13.1", - "react-text-mask": "^5.4.2", - "recompose": "^0.27.1", - "redux": "^4.0.1", - "redux-logger": "^3.0.6", - "redux-thunk": "^2.3.0", - "url-search-params-polyfill": "^5.0.0" - }, - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-loader": "^7.1.5", - "babel-preset-env": "^1.7.0", - "babel-preset-react": "^6.24.1", - "css-loader": "^1.0.0", - "html-webpack-plugin": "^3.2.0", - "style-loader": "^0.21.0" - }, - "scripts": { - "start": "react-scripts start", - "build-css": "node-sass-chokidar src/ -o src/", - "transpile": "npm run build-css && babel src -d ../../packages/egov-fire-noc --copy-files", - "build": "react-scripts build", - "test": "react-scripts test --env=jsdom", - "eject": "react-scripts eject" - } -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/package.json b/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/package.json index ecea087686c..1390a860e8a 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/package.json +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/package.json @@ -1,8 +1,67 @@ { "name": "egov-boilerplate-dev", - "version": "0.0.1", + "version": "0.0.2", "license": "egov", "private": true, - "dependencies": {}, - "scripts": {} + "homepage": "https://egov-micro-dev.egovernments.org/employee-noc/", + "proxy": "https://egov-micro-dev.egovernments.org/", + "dependencies": { + "@babel/runtime": "^7.3.1", + "@material-ui/core": "^1.4.1", + "@material-ui/icons": "^2.0.3", + "autoselector": "^1.1.0", + "autosuggest-highlight": "^3.1.1", + "axios": "^0.18.0", + "babel-polyfill": "^6.26.0", + "egov-ui-framework": "0.1.41", + "egov-ui-kit": "^0.0.1", + "egov-workflow":"1.2.0", + "html2canvas": "^1.0.0-alpha.12", + "jquery": "^3.3.1", + "jsonpath": "^1.0.2", + "jspdf": "^1.5.3", + "lodash": "^4.17.10", + "marker-animate-unobtrusive": "^0.2.8", + "mui-datatables": "^2.0.0-beta.58", + "node-sass-chokidar": "^1.2.2", + "pdfmake": "^0.1.40", + "prop-types": "^15.6.2", + "qrcode": "1.3.3", + "react": "^16.7.0", + "react-autosuggest": "^9.4.3", + "react-dom": "^16.7.0", + "react-google-maps": "^9.4.5", + "react-json-view": "^1.19.1", + "react-loadable": "^5.4.0", + "react-redux": "^5.1.1", + "react-responsive-carousel": "^3.1.45", + "react-router-dom": "^4.3.1", + "react-scripts": "^1.1.4", + "react-select": "^2.3.0", + "react-swipeable-views": "^0.13.1", + "react-text-mask": "^5.4.2", + "recompose": "^0.27.1", + "redux": "^4.0.1", + "redux-logger": "^3.0.6", + "redux-thunk": "^2.3.0", + "url-search-params-polyfill": "^5.0.0" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", + "babel-loader": "^7.1.5", + "babel-preset-env": "^1.7.0", + "babel-preset-react": "^6.24.1", + "css-loader": "^1.0.0", + "html-webpack-plugin": "^3.2.0", + "style-loader": "^0.21.0" + }, + "scripts": { + "start": "react-scripts start", + "build-css": "node-sass-chokidar src/ -o src/", + "transpile": "npm run build-css && babel src -d ../../packages/egov-fire-noc --copy-files", + "build": "react-scripts build", + "test": "react-scripts test --env=jsdom", + "eject": "react-scripts eject" + } } diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/config/common.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/config/common.js index 2ed50dc7503..8f9684c4406 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/config/common.js +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/config/common.js @@ -1,8 +1,6 @@ const commonConfig = { - MAP_API_KEY: "AIzaSyCH9PmCbk_mcpgijAAlTeltC4deOxC5wEM", - tenantId: process.env.REACT_APP_DEFAULT_TENANT_ID, - singleInstance: false, - + MAP_API_KEY: "AIzaSyDjSk-Bw1OuiOE-5K7jsP6KGN2rbcN7iBk", + tenantId: process.env.REACT_APP_DEFAULT_TENANT_ID // forgotPasswordTenant: "pb.amritsar", }; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-redux/workflow/actions.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-redux/workflow/actions.js index 06181c1ec53..393fd6c985d 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-redux/workflow/actions.js +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-redux/workflow/actions.js @@ -19,6 +19,7 @@ export const getWorkFlowData = queryObject => { ); dispatch(setProcessInstances(payload)); } catch (error) { + console.log(error); } }; }; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-views/App/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-views/App/index.js index 12a8c1f29e2..8ed9db3c14b 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-views/App/index.js +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-views/App/index.js @@ -15,7 +15,7 @@ class App extends React.Component { if (nextRoute && currentRoute !== nextRoute) { history.push(nextRoute); setRoute(""); - // window.parent.postMessage(`/employee-tradelicence${nextRoute}`, "*"); + window.parent.postMessage(`/employee-tradelicence${nextRoute}`, "*"); } } diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-views/Playground/index.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-views/Playground/index.js index 85e3306a427..750d9fd0b11 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-views/Playground/index.js +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-boilerplate-dev/src/ui-views/Playground/index.js @@ -76,6 +76,7 @@ class Playground extends React.Component { updateScreen(edit, "edit"); }} onSelect={select => { + console.log(select); }} />
diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/README.md b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/README.md index fab6254390a..479d632a5f0 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/README.md +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/README.md @@ -653,6 +653,7 @@ Here is an example: import React from 'react'; import logo from './logo.png'; // Tell Webpack this JS file uses this image +console.log(logo); // /logo.84287d09.png function Header() { // Import result is the URL of your image diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/offline-package.json b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/offline-package.json deleted file mode 100644 index de8b33e10e4..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/offline-package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "egov-bpa-stakeholderreg-core", - "version": "0.0.2", - "license": "egov", - "private": true, - "homepage": "https://egov-micro-dev.egovernments.org/employee-tradelicence/", - "proxy": "https://egov-micro-dev.egovernments.org/", - "dependencies": { - "@babel/runtime": "^7.3.1", - "@material-ui/core": "^1.4.1", - "@material-ui/icons": "^2.0.0", - "autoselector": "^1.1.0", - "autosuggest-highlight": "^3.1.1", - "axios": "^0.18.0", - "babel-polyfill": "^6.26.0", - "egov-ui-framework": "0.1.41", - "egov-ui-kit": "^0.0.1", - "jsonpath": "^1.0.2", - "qrcode": "^1.3.3", - "egov-workflow": "1.3.0", - "egov-noc": "1.3.0", - "html2canvas": "^1.0.0-alpha.12", - "jquery": "^3.3.1", - "jspdf": "^1.5.3", - "lodash": "^4.17.10", - "marker-animate-unobtrusive": "^0.2.8", - "node-sass-chokidar": "^1.2.2", - "mui-datatables": "^2.0.0-beta-52", - "pdfmake": "^0.1.40", - "prop-types": "^15.6.2", - "react": "^16.7.0", - "react-autosuggest": "^9.4.3", - "react-dom": "^16.7.0", - "react-google-maps": "^9.4.5", - "react-json-view": "^1.19.1", - "react-loadable": "^5.4.0", - "react-redux": "^5.1.1", - "react-responsive-carousel": "^3.1.45", - "react-router-dom": "^4.3.1", - "react-scripts": "^1.1.4", - "react-select": "^2.3.0", - "react-swipeable-views": "^0.13.1", - "react-text-mask": "^5.4.2", - "recompose": "^0.27.1", - "redux": "^4.0.1", - "redux-logger": "^3.0.6", - "redux-thunk": "^2.3.0", - "url-search-params-polyfill": "^5.0.0" - }, - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-loader": "^7.1.5", - "babel-preset-env": "^1.7.0", - "babel-preset-react": "^6.24.1", - "css-loader": "^1.0.0", - "html-webpack-plugin": "^3.2.0", - "style-loader": "^0.21.0" - }, - "scripts": { - "start": "react-scripts start", - "build-css": "node-sass-chokidar src/ -o src/", - "transpile": "npm run build-css && babel src -d ../../packages/egov-bpa --copy-files", - "build": "react-scripts build", - "test": "react-scripts test --env=jsdom", - "eject": "react-scripts eject" - } -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/package.json b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/package.json index 9aea183a51b..f0921db3e0b 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/package.json +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/package.json @@ -1,8 +1,68 @@ { - "name": "egov-bpa-dev", - "version": "0.0.1", + "name": "egov-bpa-stakeholderreg-core", + "version": "0.0.2", "license": "egov", "private": true, - "dependencies": {}, - "scripts": {} + "homepage": "https://egov-micro-dev.egovernments.org/employee-tradelicence/", + "proxy": "https://egov-micro-dev.egovernments.org/", + "dependencies": { + "@babel/runtime": "^7.3.1", + "@material-ui/core": "^1.4.1", + "@material-ui/icons": "^2.0.0", + "autoselector": "^1.1.0", + "autosuggest-highlight": "^3.1.1", + "axios": "^0.18.0", + "babel-polyfill": "^6.26.0", + "egov-ui-framework": "0.1.41", + "egov-ui-kit": "^0.0.1", + "jsonpath": "^1.0.2", + "qrcode": "1.3.3", + "egov-workflow": "1.3.0", + "egov-noc": "1.3.0", + "html2canvas": "^1.0.0-alpha.12", + "jquery": "^3.3.1", + "jspdf": "^1.5.3", + "lodash": "^4.17.10", + "marker-animate-unobtrusive": "^0.2.8", + "node-sass-chokidar": "^1.2.2", + "mui-datatables": "^2.0.0-beta-52", + "pdfmake": "^0.1.40", + "prop-types": "^15.6.2", + "react": "^16.7.0", + "react-autosuggest": "^9.4.3", + "react-dom": "^16.7.0", + "react-google-maps": "^9.4.5", + "react-json-view": "^1.19.1", + "react-loadable": "^5.4.0", + "react-redux": "^5.1.1", + "react-responsive-carousel": "^3.1.45", + "react-router-dom": "^4.3.1", + "react-scripts": "^1.1.4", + "react-select": "^2.3.0", + "react-swipeable-views": "^0.13.1", + "react-text-mask": "^5.4.2", + "recompose": "^0.27.1", + "redux": "^4.0.1", + "redux-logger": "^3.0.6", + "redux-thunk": "^2.3.0", + "url-search-params-polyfill": "^5.0.0" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", + "babel-loader": "^7.1.5", + "babel-preset-env": "^1.7.0", + "babel-preset-react": "^6.24.1", + "css-loader": "^1.0.0", + "html-webpack-plugin": "^3.2.0", + "style-loader": "^0.21.0" + }, + "scripts": { + "start": "react-scripts start", + "build-css": "node-sass-chokidar src/ -o src/", + "transpile": "npm run build-css && babel src -d ../../packages/egov-bpa --copy-files", + "build": "react-scripts build", + "test": "react-scripts test --env=jsdom", + "eject": "react-scripts eject" + } } diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/public/index.html b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/public/index.html index e386b139730..4dcd156af54 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/public/index.html +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-bpa-dev/public/index.html @@ -4,6 +4,13 @@ + + + + + + + + + + + + + + + + - - - React App - - - -
- - - diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/public/logo192.png b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/public/logo192.png deleted file mode 100644 index fa313abf539..00000000000 Binary files a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/public/logo192.png and /dev/null differ diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/public/logo512.png b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/public/logo512.png deleted file mode 100644 index bd5d4b5e235..00000000000 Binary files a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/public/logo512.png and /dev/null differ diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/App.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/App.js deleted file mode 100644 index 999a05e591a..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/App.js +++ /dev/null @@ -1,56 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import './App.css'; -import Inbox from './components/Inbox'; -import { fetchLocalisation } from './components/utils'; - -function App() { - const [localisationData, setData] = useState(JSON.parse(localStorage.getItem("inbox-localisationData")) || {}) - - let userObject ={ - "id": 32563, - "uuid": "8d1dfdc5-13e8-4800-89f9-de284089da9c", - "userName": "QASV", - "name": "Supervisor", - "mobileNumber": "7899898989", - "emailId": null, - "locale": null, - "type": "EMPLOYEE", - "roles": [ - { - "name": "TL Counter Employee", - "code": "TL_CEMP", - "tenantId": "pb.amritsar" - }, - { - "name": "Auto Escalation Supervisor", - "code": "SUPERVISOR", - "tenantId": "pb.amritsar" - }, - { - "name": "Auto Escalation Employee", - "code": "AUTO_ESCALATE", - "tenantId": "pb.amritsar" - } - ], - "active": true, - "tenantId": "pb.amritsar", - "permanentCity": "pb" - }; - userObject.auth = "73ff17e9-1b47-4207-a91c-bf09c951b72b"; - localStorage.setItem("Employee.token", userObject.auth); - - useEffect(() => { - localisationData && Object.keys(localisationData).length == 0 && fetchLocalisation(); - return () => { - } - }, []) - - return ( - -
- localisationData && localisationData[key] ? localisationData[key] : key} historyClick={(e) => console.log("history", e)} historyComp={HH} esclatedComp={I}> -
- ); -} - -export default App; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/App.test.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/App.test.js deleted file mode 100644 index a754b201bf9..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/App.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; - -it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(, div); - ReactDOM.unmountComponentAtNode(div); -}); diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/API/api.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/API/api.js deleted file mode 100644 index b37458ef7bb..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/API/api.js +++ /dev/null @@ -1,133 +0,0 @@ -import { convertQueryArgToString } from "../utils"; - -let controller; - -export const getController = () => { - controller = controller ? controller : new AbortController(); - return controller; -} -export const getSignal = () => { - return getController().signal; -} -export const cancelSignal = () => { - getController().abort(); - controller=new AbortController(); - } - -export const httpRequest = async (apiURL, body) => { - var myHeaders = new Headers(); - myHeaders.append("authority", "uat.digit.org"); - myHeaders.append("sec-ch-ua", "\"Google Chrome\";v=\"89\", \"Chromium\";v=\"89\", \";Not A Brand\";v=\"99\""); - myHeaders.append("accept", "application/json, text/plain, */*"); - myHeaders.append("sec-ch-ua-mobile", "?0"); - myHeaders.append("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36"); - myHeaders.append("content-type", "application/json;charset=UTF-8"); - myHeaders.append("origin", "https://uat.digit.org"); - myHeaders.append("sec-fetch-site", "same-origin"); - myHeaders.append("sec-fetch-mode", "cors"); - myHeaders.append("sec-fetch-dest", "empty"); - myHeaders.append("referer", "https://uat.digit.org/employee/inbox"); - myHeaders.append("accept-language", "en-US,en;q=0.9"); - - var raw = { - "RequestInfo": { - "apiId": "Rainmaker", - "ver": ".01", - "ts": "", - "action": "_search", - "did": "1", - "key": "", - "msgId": "20170310130900|en_IN", - "authToken": localStorage.getItem("Employee.token") - } - } - if (body) { - raw = { ...raw, ...body } - } - - var requestOptions = { - method: 'POST', - headers: myHeaders, - body: JSON.stringify(raw), - redirect: 'follow', - signal: getSignal() - }; - let url = window.location.origin; - return fetch(`${url}/${apiURL}`, requestOptions) - .then(response => response.text()) - .then(response => { if (response && !response.includes("InvalidAccessTokenException")) { return JSON.parse(response); } else { throw new Error("CANCELLED") } }) - // .then(result => console.log(result)) - .catch(error => { console.error(error); return error; }); - -} - - -export const workflowSearchCount = async (businessService) => { - return httpRequest(`egov-workflow-v2/egov-wf/process/_count?tenantId=${localStorage.getItem("inb-tenantId")}&businessService=${businessService}`); -} - -export const workflowSearch = async (businessService) => { - return wfSearch([{ key: "tenantId", value: localStorage.getItem("inb-tenantId") }, { key: "offset", value: "0" }, { key: "limit", value: "10" }, { key: "businessService", value: businessService }]) - // return httpRequest(`egov-workflow-v2/egov-wf/process/_search?tenantId=pb.amritsar&offset=0&limit=10&businessService=${businessService}`); -} - -export const wfSearch = async (queryArg = []) => { - return httpRequest(`egov-workflow-v2/egov-wf/process/_search?${convertQueryArgToString(queryArg)}`); -} - -export const wfBusinessSearch = async (queryArg = []) => { - return httpRequest(`egov-workflow-v2/egov-wf/businessservice/_search?${convertQueryArgToString(queryArg)}`); -} - -export const getMdmsData = async (mdmsCriteria) => { - return httpRequest(`egov-mdms-service/v1/_search`, { "MdmsCriteria": mdmsCriteria }); -} - -export const getInboxConfig = async (tenant = "") => { - return getMdmsData({ - "tenantId": tenant, - "moduleDetails": [ - - { - "moduleName": "common-masters", - "masterDetails": [ - { - "name": "wfSlaConfig" - }, - - { - "name": "TablePaginationOptions" - }, - { - "name": "CommonInboxConfig" - } - - ] - } - ] - }) -} - - -export const getLocalityData = async (module = "", applicationNos = []) => { - return httpRequest(`egov-searcher/locality/${module}/_get`, { - "searchCriteria": { - "referenceNumber": applicationNos - } - }).then(resp => { - if(!resp||!resp.Localities){ - return {}; - } - let localityData = {}; - resp.Localities.map(locality => { - localityData[locality.referencenumber] = locality.locality; - }); - return localityData; - }); -} - - - -export const wfEsclationSearch = async (queryArg = []) => { - return httpRequest(`egov-workflow-v2/egov-wf/escalate/_search?${convertQueryArgToString(queryArg)}`); -} \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Components.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Components.js deleted file mode 100644 index ee0902154c5..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Components.js +++ /dev/null @@ -1,103 +0,0 @@ -import React from 'react'; - -export const FilterDropdown = React.memo(({ header, name, value, id, t, showOptionAll = true, onChangeFunction, className = "inbox-filter-dropdown", data = [] }) => { - return (
- {header && } - -
) -}); - -export const Loader = ({ cancelSignal, t }) => (
-
-
-
-
- {t("CS_LOADING")} -
-
- -
-
) - - -const ArrowBack = ({ className, onClick }) => ( - - {'<'} - - // - // - // - // -); - -const ArrowForward = ({ className, onClick }) => ( - - {'>'} - - // - // - // - // -); - -const ArrowToFirst = ({ className, onClick }) => ( - - {'<<'} - - // - // - // -); - -const ArrowToLast = ({ className, onClick }) => ( - - {'>>'} - - // - // - // -); - -const SortDown = (style) => ( - - - - -); - -const SortUp = (style) => ( - - - - -); - -export const svgIcons = { - ArrowBack, - ArrowToLast, - ArrowToFirst, - ArrowForward, - SortDown, - SortUp -} \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/ErrorBoundary.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/ErrorBoundary.js deleted file mode 100644 index 05fd24ed26e..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/ErrorBoundary.js +++ /dev/null @@ -1,28 +0,0 @@ -import React from "react"; -class ErrorBoundary extends React.Component { - constructor(props) { - super(props); - this.state = { hasError: false }; - } - - static getDerivedStateFromError(error) { - // Update state so the next render will show the fallback UI. - return { hasError: true }; - } - - componentDidCatch(error, errorInfo) { - // You can also log the error to an error reporting service - console.error(error, errorInfo) - } - - render() { - if (this.state.hasError) { - // You can render any custom fallback UI - return

Something went wrong.

; - } else { - return this.props.children; - } - } -} - -export default ErrorBoundary; \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Inbox.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Inbox.js deleted file mode 100644 index e8031428e2c..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Inbox.js +++ /dev/null @@ -1,217 +0,0 @@ - - -import React, { useEffect, useState } from 'react'; -import { getInboxConfig, wfBusinessSearch } from './API/api'; -import ErrorBoundary from './ErrorBoundary'; -import { inboxHelperFunction } from './inboxUtil'; -import "./index.css"; -import TableFilterWrapper from './TableFilterWrapper'; -import { checkUserRole, convertMillisecondsToDays, getLimitAndOffset } from './utils'; - -const { Initdata, - sortOrder, getEsclationRecords, loadAssignedToMeCount } = inboxHelperFunction - -const WfTable = (props) => { - const { user = {}, historyComp = null, historyClick, esclatedComp = null } = props; - let { t: newT = (key) => key } = props; - const t = (key) => newT(key && typeof key == "string" && key.toUpperCase()); - localStorage.setItem("inb-uuid", user.uuid); - localStorage.setItem("inb-tenantId", user.tenantId); - localStorage.setItem("inb-stateTenant", user.permanentCity); - const [isLoading, setIsLoading] = useState(false); - const [data, setData] = useState([]); - const [esclationData, setEsclationData] = useState({ loaded: false, load: false, data: [] }); - const [localityData, setLocalityData] = useState({}); - const [count, setCount] = useState(0); - const [countData, setCountData] = useState({ all: 0, assignedToMe: 0, esclated: 0 }); - const [serviceCount, setServiceCount] = useState({}); - const [wfSlaConfig, setWfSlaConfig] = useState({}); - const [canLoadAll, setLoadAll] = useState(false); - const [loadedAll, setLoadedAll] = useState(false); - const [businessServices, setBusinessServices] = useState([]); - const [localitySearcher, setLocalitySearcher] = useState({}); - const [wfBusinessConfig, setWfBusinessConfig] = useState({}); - const [applicationStates, setApplicationStates] = useState({}); - const [paginationConfig, setPaginationConfig] = useState({}); - const [inboxConfig, setInboxConfig] = useState({}); - const [localities, setSetLocalities] = useState([]); - - useEffect(() => { - if (canLoadAll && !loadedAll) { - - businessServices.map((service) => { - setIsLoading(true); - let limitOffsetObject = getLimitAndOffset(serviceCount[service]); - Initdata({ - businessService: service, - loadAllData: true, - serviceCount: serviceCount, - limit: limitOffsetObject.limit, - offset: limitOffsetObject.offset, - setCount: setCount, setServiceCount: setServiceCount, setData: setData, - setIsLoading: setIsLoading, setLocalityData: setLocalityData, - localityModule: localitySearcher[service], - wfSlaConfig: wfSlaConfig, - wfBusinessConfig: wfBusinessConfig, - setSetLocalities: setSetLocalities, - setApplicationStates: setApplicationStates - }) - }) - } - }, [canLoadAll, businessServices]) - - useEffect(() => { - if (esclationData.load) { - setIsLoading(true); - getEsclationRecords({ - setCountData: setCountData, - setData: setEsclationData, - setIsLoading: setIsLoading, setLocalityData: setLocalityData, - localityModule: localitySearcher, - wfSlaConfig: wfSlaConfig, - wfBusinessConfig: wfBusinessConfig, - setSetLocalities: setSetLocalities, - setApplicationStates: setApplicationStates - }) - } - - - }, [esclationData]) - - useEffect(() => { - getInboxConfig(user.permanentCity || "pb").then(response => { - setWfSlaConfig(response.MdmsRes["common-masters"].wfSlaConfig[0]); - setPaginationConfig(response.MdmsRes["common-masters"].TablePaginationOptions[0]) - setInboxConfig(response.MdmsRes["common-masters"].CommonInboxConfig.reduce((prev, curr) => { - prev[curr.BusinessService] = curr; - return { ...prev }; - }, {})); - loadAssignedToMeCount(setCountData); - setLocalitySearcher(response.MdmsRes["common-masters"].CommonInboxConfig.filter(config => config.locality).reduce((prev, curr) => { - prev[curr.BusinessService] = curr.localityModule; - return { ...prev }; - }, {})) - let businessServices = response.MdmsRes["common-masters"].CommonInboxConfig.filter(config => config.active) || []; - if (user.tenantId) { - businessServices = businessServices.filter(service => checkUserRole(service.roles, props.user.roles.map(role => role.code))) - } - businessServices = businessServices.map(config => config.BusinessService); - // businessServices = ["NewTL"] //dev - setBusinessServices(businessServices); - }); - return () => { - setData([]); - setBusinessServices([]); - setLocalityData({}); - setCount(0); - setServiceCount({}); - setPaginationConfig({}); - setWfSlaConfig({}); - setInboxConfig({}); - setLocalitySearcher({}); - } - - }, []) - - useEffect(() => { - if (businessServices && businessServices.length > 0) { - wfBusinessSearch([{ key: "tenantId", value: user.tenantId }, { key: "businessServices", value: businessServices.join(',') }]).then(resp => { - if (resp) { - let wfService = resp.BusinessServices.reduce((prev, curr) => { - curr.MAX_SLA = convertMillisecondsToDays(curr.businessServiceSla); - prev[curr.businessService] = curr; - return { ...prev } - }, {}) - return wfService; - } - }).then(updatedResp => { - updatedResp && setWfBusinessConfig(state => { - return { - ...state, ...updatedResp - } - }) - updatedResp && businessServices.map((service) => { - setIsLoading(true); - Initdata({ - businessService: service, setCount: setCount, - // businessServices.length>1?60:100 - // limit: businessServices.length > 1 ? 20 : 40, // dev - limit: businessServices.length > 1 ? 60 : 100, - offset: 0, - setServiceCount: setServiceCount, setData: setData, setIsLoading: setIsLoading, - setLocalityData: setLocalityData, localityModule: localitySearcher[service], - wfSlaConfig: wfSlaConfig, - wfBusinessConfig: updatedResp, - setSetLocalities: setSetLocalities, - setApplicationStates: setApplicationStates - }) - }); - }); - - } - }, [businessServices]) - - useEffect(() => { - if (serviceCount) { - if (Object.values(serviceCount).every(service => service.loadedCount == service.totalCount || (service.totalCount - service.loadedCount < 100)) && loadedAll == false && canLoadAll == true) { - setLoadedAll(true); - setLoadAll(false); - } - } - - }, [serviceCount]); - - - - useEffect(() => { - if (count > 0) { - setCountData(state => ({ ...state, all: count })); - !esclationData.loaded && !esclationData.load && setEsclationData({ loaded: false, load: true, data: [] }) - } - }, [count]) - - return ( - -
- {/* data={[...data, ...esclationData.data] to get mix of all tab application and esclated application */} - { - prev[curr] = curr; - return { ...prev } - }, {})} - businessServices={businessServices} - isLoading={isLoading} - localityData={localityData} - paginationConfig={paginationConfig} - sortOrder={sortOrder} - setBusinessServices={setBusinessServices} - historyClick={historyClick} - setLoadAll={setLoadAll} - setEsclationData={setEsclationData} - setData={setData} - wfSlaConfig={wfSlaConfig} - setIsLoading={setIsLoading} - wfBusinessConfig={wfBusinessConfig} - > - -
-
- ) -} -const Inbox = (props) => ( - - - -) -export default Inbox; \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Row.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Row.js deleted file mode 100644 index 8717606e2e5..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Row.js +++ /dev/null @@ -1,81 +0,0 @@ -import React from 'react'; -import { svgIcons } from './Components'; -import { getWfLink, mobileCheck } from './utils'; - - -const { SortDown, - SortUp } = svgIcons; - -const Row = React.memo((props) => { - const { sortOrder = { }, BusinessId: id, t, inboxConfig = { } } = props; - let keys = Object.keys(sortOrder); - keys.sort((x, y) => sortOrder[x].order - sortOrder[y].order); - - let isMobile = mobileCheck() - - if (isMobile) { - return
{ - if (inboxConfig) { - window.location.href = getWfLink(inboxConfig, props.BusinessId, props.other.BusinessService); - } - }}> - { - keys.map((key, index) => { - const isSLA = key == "WF_INBOX_HEADER_SLA_DAYS_REMAINING" && !props.isHeader ? true : false; - return ( - - {isSLA ? "SLA" : t(key)} - {' : '} - - {isSLA ? ( - - {props[key]} - - {props.Esclated && {props.esclatedComp}} - {!props.Esclated && {" "}} - - ) - : t(props[key]) || t("COMMON_NA")} - - ) - }) - } - { - {t('CS_COMMON_VIEW_HISTORY_LINK')} {' ' } - props.historyClick(id)}>{props.historyComp}} -
- } - return ( - - { - keys.map((key, index) => { - const isSLA = key == "WF_INBOX_HEADER_SLA_DAYS_REMAINING" && !props.isHeader ? true : false; - let slaHeader = false; - let clickFunction = () => { }; - if (key == "WF_INBOX_HEADER_SLA_DAYS_REMAINING" && props.isHeader) { - clickFunction = () => { props.setSortOrder(state => !state) } - slaHeader = true; - } else if (key == "WF_INBOX_HEADER_APPLICATION_NO") { - clickFunction = () => { - if (inboxConfig) { - window.location.href = getWfLink(inboxConfig, props.BusinessId, props.other.BusinessService); - } - } - } - return ( - {isSLA ? ( - - {props[key]} - - {props.Esclated && {props.esclatedComp}} - {!props.Esclated && {""}} - props.historyClick(id)}>{props.historyComp} - ) : t(props[key]) || t("COMMON_NA")} - {slaHeader && {props.sort ? : }} - ) - }) - } - ) -}) - -export default Row; \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Table.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Table.js deleted file mode 100644 index 1d385efb237..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/Table.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { cancelSignal } from './API/api'; -import { Loader } from './Components'; -import Row from './Row'; -import { mobileCheck, transformLocality } from './utils'; - - -const Table = ({ data, header, localityData, sortOrder, t, historyComp, setSortOrder, inboxConfig, historyClick, sort, esclatedComp, isLoading }) => { - let isMobile = mobileCheck() - return ( - {!isMobile && } - {data.length != 0 && data.map((item) => )} - {data.length == 0 && !isLoading &&
{t("COMMON_INBOX_NO_DATA")}
} - {isLoading && } -
) -} - -export default Table; \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/TableFilterWrapper.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/TableFilterWrapper.js deleted file mode 100644 index c450558bedc..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/TableFilterWrapper.js +++ /dev/null @@ -1,203 +0,0 @@ -import React, { useEffect, useReducer, useState } from 'react'; -import { cancelSignal, wfEsclationSearch, wfSearch } from './API/api'; -import { FilterDropdown, svgIcons } from './Components'; -import TablePaginationWrapper from './TablePaginationWrapper'; -import { formatWFSearch, mobileCheck, transformLocality } from './utils'; - -const checkStringValid = (str = "") => { - return str.match(new RegExp(/^([a-zA-Z0-9-]){4,25}$/)) ? true : false; -} - -const { SortDown, - SortUp } = svgIcons; - -const checkFilterCondition = (element, filters, localityData, uuid) => { - let condition = false; - if (filters.selected_none) { - condition = true; - } else { - if (filters.service != "ALL" && element.other.BusinessService != filters.service) { - return false; - } else if (filters.status != "ALL" && element.other.State != filters.status) { - return false; - } else if (filters.locality != "ALL" && localityData[element.BusinessId] != filters.locality) { - return false; - } - else if (!filters.assigned_to_all) { - if (filters.assigned_to_me && element.other.uuid != uuid) { - return false; - } - } - else if (!filters.total_records) { - if (element.other.nearingEsclation != filters.nearing_sla_records) { - return false; - } else if (element.other.esclated != filters.sla_breached) { - return false; - } - } - condition = true; - } - return condition; -} - -const reducer = (state, action) => { - switch (action.type) { - case 'service': - return { ...state, selected_none: action.value == "ALL" ? true : false, service: action.value }; - case 'locality': - return { ...state, selected_none: action.value == "ALL" ? true : false, locality: action.value }; - case 'status': - return { ...state, selected_none: action.value == "ALL" ? true : false, status: action.value }; - case 'assigned_to_me': - return { ...state, selected_none: false, assigned_to_all: false, assigned_to_me: true, esclated: false }; - case 'assigned_to_all': - return { ...state, selected_none: true, assigned_to_all: true, assigned_to_me: false, esclated: false }; - case 'esclated': - return { ...state, selected_none: false, assigned_to_all: false, assigned_to_me: false, esclated: true }; - case 'total_records': - return { ...state, selected_none: true, sla_breached: false, nearing_sla_records: false, total_records: true }; - case 'nearing_sla_records': - return { ...state, selected_none: false, sla_breached: false, total_records: false, nearing_sla_records: true }; - case 'sla_breached': - return { ...state, selected_none: false, nearing_sla_records: false, total_records: false, sla_breached: true }; - case 'reset': - return { ...initialState }; - default: - throw new Error(); - } -} -const initialState = { - service: "ALL", locality: "ALL", status: "ALL", assigned_to_me: false, assigned_to_all: true, - esclated: false, - total_records: true, - nearing_sla_records: false, - sla_breached: false, - selected_none: true -}; - -const TableFilterWrapper = ({ businessServices, countData, setData, setLoadAll, count, uuid, loadedAll, localities = [], localityData, t, esclationData, setEsclationData, applicationStates, setIsLoading, setBusinessServices, wfSlaConfig, isLoading, wfBusinessConfig, data, ...rest }) => { - let isMobile = mobileCheck() - const [searchText, setSearchText] = useState(""); - const [searchRecord, setSearchRecord] = useState([]); - const [filters, setFiltersDispatch] = useReducer(reducer, initialState); - const [sort, setSortOrder] = useState(true); - const [filteredData, setFilteredData] = useState(data || []); - useEffect(() => { - if (checkStringValid(searchText)) { - - const timer = setTimeout(() => { - setIsLoading(true); - if (filters.esclated) { - wfSearch([{ key: "businessIds", value: searchText }, { key: "tenantId", value: localStorage.getItem("inb-tenantId") }]).then(resp => resp && resp.ProcessInstances && wfEsclationSearch([{ key: "businessIds", value: resp.ProcessInstances.map(res => res.businessId).join(',') }, { key: "tenantId", value: localStorage.getItem("inb-tenantId") }])).then(resp => resp && resp.ProcessInstances && resp.ProcessInstances.filter(wfrec => businessServices.includes(wfrec.businessService)).map(wfRecord => formatWFSearch(wfRecord, wfSlaConfig, wfBusinessConfig))).then(response => setSearchRecord(response ? response : [])).then(e => setIsLoading(false)); - } else { - wfSearch([{ key: "businessIds", value: searchText }, { key: "tenantId", value: localStorage.getItem("inb-tenantId") }]).then(resp => resp && resp.ProcessInstances && resp.ProcessInstances.filter(wfrec => businessServices.includes(wfrec.businessService)).map(wfRecord => formatWFSearch(wfRecord, wfSlaConfig, wfBusinessConfig))).then(response => setSearchRecord(response ? response : [])).then(e => setIsLoading(false)); - } - - }, 1000) - return () => { - clearTimeout(timer); - cancelSignal() - } - } - }, [searchText]) - - - useEffect(() => { - if (searchRecord.length != 0 && checkStringValid(searchText)) { - let newData = searchRecord.filter(element => checkFilterCondition(element, filters, localityData, uuid)); - setFilteredData(newData); - // setFilteredData([...searchRecord]); - } else if (checkStringValid(searchText) && searchRecord.length == 0) { - setFilteredData([]); - } else if (filters.esclated) { - let newData = esclationData.data.filter(element => checkFilterCondition(element, filters, localityData, uuid)); - setFilteredData(newData); - // setFilteredData([...esclationData.data]); - } else if (filters.selected_none) { - setFilteredData(data); - } else { - !loadedAll && setLoadAll(true); //dev - let newData = data.filter(element => checkFilterCondition(element, filters, localityData, uuid)); - setFilteredData(newData); - } - - }, [filters, data, searchRecord, esclationData]) - return -
-
-

{t("WF_MY_WORKLIST")}

-
-
- - setSearchText(e.target.value)} value={searchText} placeholder={t("INBOX_ENTER_BID")} /> - {searchText.length !== 0 && !checkStringValid(searchText) && {t("ERR_INVALID_APPID")}} -
-
-
- { return { key: `CS_COMMON_INBOX_${service}`, value: service } })} name="businessService" value={filters.service} id="businessService" onChangeFunction={(e) => setFiltersDispatch({ type: 'service', value: e.target.value })} /> - { return { key: transformLocality(locality), value: locality } })} name="locality" value={filters.locality} id="locality" onChangeFunction={(e) => setFiltersDispatch({ type: 'locality', value: e.target.value })} /> - { return { key: `${key}`, value: applicationStates[key] } })} name="status" value={filters.status} id="status" onChangeFunction={(e) => setFiltersDispatch({ type: 'status', value: e.target.value })} /> -
- -
-
- -
-
-
-
{ - setFiltersDispatch({ type: 'total_records' }) - }}> - {t("WF_TOTAL_TASK")} - - {filters.selected_none && searchText === "" ? count : filteredData.length} - - -
-
{ - setFiltersDispatch({ type: 'nearing_sla_records' }) - }}> - {t("WF_TOTAL_NEARING_SLA")} - - {filteredData.filter(item => item.other.nearingEsclation).length} - - -
-
{ - setFiltersDispatch({ type: 'sla_breached' }) - }} > - {t("WF_ESCALATED_SLA")} - - {filteredData.filter(item => item.other.esclated).length} - -
-
-
-
- { - setFiltersDispatch({ type: 'assigned_to_all' }) - }}> - {t("COMMON_INBOX_TAB_ALL")} {` ( ${countData.all} )`} - - { - setFiltersDispatch({ type: 'assigned_to_me' }) - }}> - {t("COMMON_INBOX_TAB_ASSIGNED_TO_ME")} {` ( ${countData.assignedToMe} )`} - - { - !esclationData.loaded && !esclationData.load && setEsclationData({ loaded: false, load: true, data: [] }); - setFiltersDispatch({ type: 'esclated' }) - }}> - {t("COMMON_INBOX_TAB_ESCALATED")} {` ( ${countData.esclated} )`} - - {isMobile && setSortOrder(state => !state)} >{sort ? : }} -
- sort ? x.other.sla - y.other.sla : y.other.sla - x.other.sla)]} t={t} setSortOrder={setSortOrder} isLoading={isLoading} localityData={localityData}{...rest}> -
-
-} - -export default TableFilterWrapper; diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/TablePaginationWrapper.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/TablePaginationWrapper.js deleted file mode 100644 index 786fc006a38..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/TablePaginationWrapper.js +++ /dev/null @@ -1,86 +0,0 @@ -import React, { useEffect, useReducer, useState } from 'react'; -import { FilterDropdown, svgIcons } from './Components'; -import Table from './Table'; - -const { ArrowBack, - ArrowToLast, - ArrowToFirst, - ArrowForward } = svgIcons; - -const reducer = (state, action) => { - let { page, nextPage, prevPage, rowsPerPage } = state; - switch (action.type) { - case 'initMDMS': - return { ...state, initMDMS: true, rowsPerPage: action.value.defaultValue, rowsPerPageOptions: action.value.rowsPerPageOptions }; - case 'change_rows_per_page': - page = 0; - rowsPerPage = Number(action.value); - nextPage = (action.dataCount - rowsPerPage - (rowsPerPage * page)) > 0 ? true : false; - return { ...state, page: page, rowsPerPage: rowsPerPage, prevPage: false, nextPage: nextPage }; - case 'next_page': - page += 1; - nextPage = (action.value - rowsPerPage - (rowsPerPage * page)) > 0 ? true : false; - return { ...state, page: page, prevPage: true, nextPage: nextPage }; - case 'prev_page': - page -= 1; - prevPage = page == 0 ? false : true; - return { ...state, page: page, prevPage: prevPage, nextPage: true }; - case 'first_page': - return { ...state, page: 0, prevPage: false, nextPage: true }; - case 'last_page': - return { ...state, page: (Math.ceil(action.value / rowsPerPage) - 1), prevPage: true, nextPage: false }; - case 'total_records': - return { ...state, selected_none: false, sla_breached: false, nearing_sla_records: false, total_records: true }; - case 'reset': - return { ...initialState }; - default: - throw new Error(); - } -} -const initialState = { - prevPage: false, - nextPage: true, - rowsPerPageOptions: [25, 100], - page: 0, - rowsPerPage: 100, - initMDMS: false -}; - -const TablePaginationWrapper = ({ data, t, paginationConfig, ...rest }) => { - - const [pagination, setPaginationDispatch] = useReducer(reducer, initialState); - const [filteredData, setFilteredData] = useState([]); - let dataCount = data.length; - const { rowsPerPageOptions = [], page, rowsPerPage, initMDMS, prevPage, nextPage } = pagination; - - useEffect(() => { - if (paginationConfig && paginationConfig.rowsPerPageOptions && !initMDMS) { - setPaginationDispatch({ type: 'initMDMS', value: paginationConfig }) - } - }, [paginationConfig]) - - useEffect(() => { - setPaginationDispatch({ type: 'change_rows_per_page', value: rowsPerPage, dataCount: dataCount }) - }, [data]) - - useEffect(() => { - let newData = data.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage); - setFilteredData(newData); - }, [pagination]) - - return - -
- - {t("COMMON_INBOX_ROWS_LABEL")} - { return { key: `${value}`, value: `${value}` } })} name="page" value={rowsPerPage} id="page" onChangeFunction={(e) => setPaginationDispatch({ type: 'change_rows_per_page', value: e.target.value, dataCount: dataCount })} /> - { prevPage && setPaginationDispatch({ type: 'first_page', })} />} - { prevPage && setPaginationDispatch({ type: 'prev_page', value: dataCount })} />} - { nextPage && setPaginationDispatch({ type: 'next_page', value: dataCount })} />} - { nextPage && setPaginationDispatch({ type: 'last_page', value: dataCount })} />} - - -
-} - -export default TablePaginationWrapper; \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/inboxUtil.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/inboxUtil.js deleted file mode 100644 index ddf979169d4..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/inboxUtil.js +++ /dev/null @@ -1,150 +0,0 @@ -import { getLocalityData, wfEsclationSearch, wfSearch, workflowSearchCount } from "./API/api" -import { formatWFEsclatedSearch, formatWFSearch } from "./utils" - -const sortOrder = { - 'CS_INBOX_MODULE_FILTER': { order: 1, width: 70 }, - "WF_INBOX_HEADER_APPLICATION_NO": { order: 0, width: 100 }, - "WF_INBOX_HEADER_STATUS": { order: 2, width: 80 }, - "WF_INBOX_HEADER_LOCALITY": { order: 3, width: 90 }, - "WF_INBOX_HEADER_CURRENT_OWNER": { order: 4, width: 40 }, - "WF_INBOX_HEADER_SLA_DAYS_REMAINING": { order: 5, width: 70 }, - // "AppliedOn": 5, -} - - -const loadLocalityData = async (localityService, businessIds, setLocalityData, setSetLocalities) => { - getLocalityData(localityService, businessIds).then(response => { - setLocalityData(state => { return { ...state, ...response } }) - let localities = Object.values(response).reduce((prev, curr) => { - prev[curr] = curr; - return { ...prev } - }, {}) - setSetLocalities(state => { return { ...state, ...localities } }) - }) -} - -const loadAssignedToMeCount = (setCountData) => { - try { - wfSearch([{ key: "tenantId", value: localStorage.getItem("inb-tenantId") }]).then(response => setCountData(state => ({ ...state, assignedToMe: response.totalCount }))).catch(err => { - console.error(err) - }) - } - catch (e) { - console.log(e); - } -} - -const Initdata = (props) => { - - try { - let businessIds = []; - let status = {}; - wfSearch([{ key: "tenantId", value: localStorage.getItem("inb-tenantId") }, { key: "offset", value: props.offset || 0 }, { key: "limit", value: props.limit || "10" }, { key: "businessService", value: props.businessService }]).then(resp => { - props.setServiceCount((state) => { - if (state[props.businessService]) { - let loadedCount = resp.ProcessInstances && resp.ProcessInstances.length || 0; - if (state[props.businessService].loadedCount) { - loadedCount += state[props.businessService].loadedCount; - } - state[props.businessService] = { ...state[props.businessService], loadedCount: loadedCount }; - } else { - state[props.businessService] = { loadedCount: resp.ProcessInstances && resp.ProcessInstances.length || 0 }; - } - return { ...state } - }); - return resp.ProcessInstances.map(data => { - businessIds.push(data.businessId); - status[`WF_${data.businessService.toUpperCase()}_${data.state.state}`] = data.state.state; - return formatWFSearch(data, props.wfSlaConfig, - props.wfBusinessConfig); - }) - } - ).then(resp => { - props.setIsLoading(false); - props.setData((state) => state.concat(resp)); - if (status) { - props.setApplicationStates(state => { return { ...state, ...status } }); - } - if (props.localityModule && businessIds.length > 0) { - loadLocalityData(props.localityModule, businessIds, props.setLocalityData, props.setSetLocalities); - } - - }).catch(err => { - props.setIsLoading(false); - console.error(err) - }); - - // loadAllData:true, - // loadedCount:totalCount, - - if (!props.loadAllData) { - workflowSearchCount(props.businessService).then(resp => { - resp && typeof resp == "number" && props.setServiceCount((state) => { - if (state[props.businessService]) { - state[props.businessService] = { ...state[props.businessService], totalCount: resp }; - } else { - state[props.businessService] = { totalCount: resp }; - } - return { ...state } - }); - resp && typeof resp == "number" && props.setCount((state) => state + resp) - }).catch(err => { - props.setIsLoading(false); - console.error(err) - }); - } - - } - catch (e) { - console.log(e); - } -} - - - -const getEsclationRecords = (props) => { - - try { - let service = ''; - let businessIds = []; - let status = {}; - wfEsclationSearch([{ key: "tenantId", value: localStorage.getItem("inb-tenantId") }]).then(resp => { - props.setCountData(state => ({ ...state, esclated: resp.totalCount })); - return resp.ProcessInstances.map(data => { - businessIds.push(data.businessId); - service = data.businessService; - status[`WF_${data.businessService.toUpperCase()}_${data.state.state}`] = data.state.state; - return formatWFEsclatedSearch(data, props.wfSlaConfig, - props.wfBusinessConfig); - }) - } - ).then(resp => { - props.setIsLoading(false); - props.setData({ loaded: true, load: false, data: resp }); - if (status) { - props.setApplicationStates(state => { return { ...state, ...status } }); - } - if (props.localityModule && props.localityModule[service] && businessIds.length > 0) { - loadLocalityData(props.localityModule[service], businessIds, props.setLocalityData, props.setSetLocalities); - } - - }).catch(err => { - props.setIsLoading(false); - console.error(err) - }); - - } - catch (e) { - console.log(e); - } -} - - - -export const inboxHelperFunction = { - Initdata: Initdata, - loadLocalityData: loadLocalityData, - sortOrder: sortOrder, - loadAssignedToMeCount: loadAssignedToMeCount, - getEsclationRecords: getEsclationRecords -} \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/index.scss b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/index.scss deleted file mode 100644 index ef6328cb729..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/index.scss +++ /dev/null @@ -1,324 +0,0 @@ -.jk-spinner-wrapper { - width: 100%; - display: flex; - justify-content: center; - z-index: 100; } - - .jk-inbox-loader { - border: 0.4em solid #fe7a51; - border-radius: 50%; - border-top: 0.4em solid #FFFFFF; - width: 4em; - height: 4em; - -webkit-animation: spin 2s linear infinite; - /* Safari */ - animation: spin 1s linear infinite; } - - .jk-sm-inbox-loader { - border: 0.2em solid #fe7a51; - border-radius: 50%; - border-top: 0.2em solid #FFFFFF; - width: 2em; - height: 2em; - -webkit-animation: spin 2s linear infinite; - /* Safari */ - animation: spin 1s linear infinite; } - - /* Safari */ - @-webkit-keyframes spin { - 0% { - -webkit-transform: rotate(0deg); } - 100% { - -webkit-transform: rotate(360deg); } } - - @keyframes spin { - 0% { - transform: rotate(0deg); } - 100% { - transform: rotate(360deg); } } - -.jk-inbox-search-label{ - display: flex; - align-items: center; -} -.jk-inbox-eslcated-mark{ - width: 24px; -} -.jk-inbox-sla-wrapper{ - display: flex; - flex-direction: row; - justify-content: space-between; - width: 100%; -} -.inbox-row-holder{ - display: flex; - justify-content: space-around; - border:1px solid rgba(224, 224, 224, 1); - border-bottom: 0px; - } - -.inbox-row-card{ - - display: flex; - flex-direction: column; - border: 1px solid grey; - border-radius: 15px; - margin: 10px; - -} -.row-WF_INBOX_HEADER_APPLICATION_NO{ - cursor: pointer; - color:rgb(254, 122, 81); -} -.row-WF_INBOX_HEADER_APPLICATION_NO:hover{ - text-decoration: underline; -} -.inbox-row-header-ele{ - font-weight: 500; - color: black; - border-top:2px solid rgba(224, 224, 224, 1); - border-bottom:2px solid rgba(224, 224, 224, 1); - height: 40px !important; -} -.inbox-row-element{ - padding: 10px 7px 11px 7px; - width: 100%; - height: 50px; - display: flex; - align-items: center; -} -.inbox-row{ - padding: 10px 7px 11px 7px; -} - -.inbox-taskboard-holder{ - display: flex; - flex-direction: row; - justify-content: space-evenly; - height: 60px; - margin: 10px 0px; -} - - -.inbox-taskboard-card{ - display: flex; - align-items: center; - border: 1px solid grey; - width: 33%; - flex-direction: column-reverse; - cursor: pointer; - justify-content: center; -} - - -.inbox-cell-badge-primary { - border-radius: 14px; - color: #fff; - letter-spacing: .58px; - padding: 5px 22px; - width: 70px; - text-align: center; - display: inline-block; -} - -.inbox-task-total{ - border:none; - background-color: rgb(171, 211, 237); - border-top:4px solid rgb(53, 152, 219); -} -.inbox-task-nearing-sla{ - border:none; - background-color: rgba(238, 167, 58, 0.38); - border-top: 4px solid rgb(238, 167, 58) -} -.inbox-task-esclated-sla{ - border:none; - background-color: rgba(244, 67, 54, 0.38); - border-top: 4px solid rgb(244, 67, 54); -} -.inbox-task-font{ - font-weight: 500; - font-size: 18px; -} - -.inbox-filter-dropdown{ - width: 25% -} - -.inbox-filter-dropdown select{ - width: 100%; - display: flex; - height: 35px; -} -.jk-inbox-search-holder{ - width: 20%; -} -#inbox-search{ - width: 100%; - display: flex; - height: 35px; -} -.clear-button{ - color:rgb(254, 122, 81); - height: 35px; - background-color: unset; - border: none; - font-size: 17px; - font-weight: 600; - -} - -.inbox-filter-wrapper{ - display: flex; - flex-direction: row; - justify-content: space-between; - margin-top: 10px; -} -.assigned-inbox{ - margin-top: 10px; - width: 10%; - margin-left: 1%; - cursor: pointer; - font-size: medium; - font-weight: 500; -} -.cancel-inbox-api{ - display: flex; - justify-content: center; -} - -.cancel-inbox-api button{ - height: 40px; - margin-top: 30px; - color: rgb(254, 122, 81); - background: none; - border: 1px solid rgb(254, 122, 81); - width: 100px; - cursor: pointer; - font-size: 16px; - font-weight: 600; -} - -.jk-inbox-pointer{ - cursor: pointer; -select{ - cursor: pointer; - -} -} - -.jk-selected-header{ - color: #fe7a51; - /* text-decoration: underline; */ - font-size: large; - font-weight: 600; -} - - -.inbox-pagination-dropdown select{ - width: 55px; - display: flex; - height: 35px; - border: none; -} - - -.inbox-filter-clear-buttons{ - display: flex; - align-items: flex-end; -} -.inbox-page-button{ - margin-right: 5px; - cursor: pointer; - fill:black; - letter-spacing: -2px; - font-size: 35px; - color: black; - font-weight: 500; -} -.inbox-page-button-disabled{ - cursor: default; - fill:lightgray; - color: lightgray; - letter-spacing: -2px; - font-size: 35px; - font-weight: 500; -} -.inbox-page-button-disabled1 path{ - fill:lightgray; -} -.jk-pagination-holder{ - justify-content: flex-end; - height: 50px; - display: flex; - align-items: center; -} -.jk-inbox-first-element{ - display: flex; - justify-content: space-between; -} - -.jk-inbox-tab-header-holder{ - display: flex; - height: 45px; - align-items:center; -} - -.inb-esc-tab{ - width:12%; -} - -.inb-all-tab{ - width:10%; -} -.inb-me-tab{ - width:13%; -} - -@media only screen and (max-width: 768px) { - .jk-sort-ico{ - margin-right: 10px; - } - .inb-esc-tab{ - width:25%; - } - - .inb-all-tab{ - width:15%; - } - .inb-me-tab{ - width:30%; - } - - .jk-inbox-tab-header-holder{ - justify-content:space-between; - } - .history-wrapper-sm{ - padding: 5px 15px; - display: flex; - } - .jk-inbox-first-element{ - flex-direction: column; - } - #inbox-search{ - width: 100%; - } - .jk-inbox-search-holder { - width: 100%; } - .inbox-filter-wrapper{ - flex-direction: column; - } -.inbox-filter-dropdown{ - width: 100%; -} -.assigned-inbox{ - width: 25%; -} -.jk-pagination-holder{ - justify-content: unset; -} -.jk-inbox-sla-wrapper{ - width: 100%; -} -} - diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/utils.js b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/utils.js deleted file mode 100644 index 8435937e480..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/components/utils.js +++ /dev/null @@ -1,181 +0,0 @@ -import { wfSearch } from "./API/api"; - -export const mobileCheck = () => { - let check = false; - (function (a) { - if ( - /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test( - a - ) || - /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( - a.substr(0, 4) - ) - ) - check = true; - })(navigator.userAgent || navigator.vendor || window.opera); - return check; -}; - -export const convertMillisecondsToDays = (milliseconds) => { - return Math.round((milliseconds / (1000 * 60 * 60 * 24))); -} - -export const getSlaColorAndType = (sla, businessService, wfSlaConfig, wfBusinessConfig) => { - const { MAX_SLA = 0 } = wfBusinessConfig[businessService] || {}; - let slaColorType = { esclated: false, nearingEsclation: false, noneType: true, color: '#4CAF50' }; - if (wfSlaConfig) { - if ((MAX_SLA - (MAX_SLA * wfSlaConfig.slotPercentage / 100) <= sla) && sla <= MAX_SLA) { - slaColorType.color = wfSlaConfig.positiveSlabColor; - } else if (0 < sla && sla < MAX_SLA - (MAX_SLA * wfSlaConfig.slotPercentage / 100)) { - slaColorType.nearingEsclation = true; - slaColorType.noneType = false; - slaColorType.color = wfSlaConfig.middleSlabColor; - } else { - slaColorType.esclated = true; - slaColorType.noneType = false; - slaColorType.color = wfSlaConfig.negativeSlabColor; - } - } - if (!wfBusinessConfig || !wfBusinessConfig[businessService]) { - slaColorType.notInitialised = true; - } - return slaColorType; -}; - -export const formatWFSearch = (data, wfSlaConfig = {}, - wfBusinessConfig = {}) => { - const sla = data.businesssServiceSla && convertMillisecondsToDays(data.businesssServiceSla); - const slaColorAndType = getSlaColorAndType(sla, data.businessService, wfSlaConfig, wfBusinessConfig); - return { - 'CS_INBOX_MODULE_FILTER': `CS_COMMON_INBOX_${data.businessService}`, - "BusinessId": data.businessId, - "WF_INBOX_HEADER_APPLICATION_NO": data.businessId, - "WF_INBOX_HEADER_STATUS": `WF_${data.businessService}_${data.state.state}`, - "ModuleName": data.moduleName, - "WF_INBOX_HEADER_CURRENT_OWNER": data.assignes && data.assignes[0] && data.assignes[0].name || "NA", - "WF_INBOX_HEADER_SLA_DAYS_REMAINING": sla, - "AppliedOn": new Date(data.auditDetails.createdTime).toLocaleDateString('id-ID'), - "Esclated": data.escalated, - "other": { - 'BusinessService': data.businessService, - "State": data.state.state, - uuid: data.assignes && data.assignes[0] && data.assignes[0].uuid, - sla: data.businesssServiceSla, - ...slaColorAndType - } - } -} -export const formatWFEsclatedSearch = (data, wfSlaConfig = {}, - wfBusinessConfig = {}) => ({ ...formatWFSearch(data, wfSlaConfig, wfBusinessConfig), Esclated: true }) - -export const getWfLink = (inboxConfig = {}, no, service) => { - let defaultUrl = inboxConfig[service].redirectConfig.DEFAULT || ''; - defaultUrl = defaultUrl.replace("^WFBID^", no); - defaultUrl = defaultUrl.replace("^WFTNID^", localStorage.getItem("inb-tenantId")); - return defaultUrl; -} - -function onlyUnique(value, index, self) { - return self.indexOf(value) === index; -} - -export const getUniqueArray = (array) => array.filter(onlyUnique); - -export const checkUserRole = (mdmsRoles = [], userRoles = []) => { - let validService = false; - mdmsRoles && mdmsRoles.map(mdmsRole => { - if (userRoles && userRoles.includes(mdmsRole)) { - validService = true; - }; - }) - return validService; - -} -export const convertQueryArgToString = (queryArg = []) => { - return queryArg.reduce((prev, curr) => prev + `${prev == "" ? "" : "&"}` + curr.key + '=' + curr.value, ''); -} - -export const loadCompleteRecord = ({ limit = 100, offset = 0, setLoadedAll, setLoadAll, setData, setLocalityData, loadLocalityData, localitySearcher }) => { - /* limit should have count data; */ - let businessIds = []; - wfSearch([{ key: "tenantId", value: "pb.amritsar" }, { key: "offset", value: offset }, { key: "limit", value: limit }]).then(resp => { - return resp.ProcessInstances.map(data => { - businessIds.push(data.businessId); - return formatWFSearch(data); - }) - }).then(response => { - if (localitySearcher) { - getUniqueArray(Object.values(localitySearcher)).map(key => loadLocalityData(key, businessIds, setLocalityData)); - } - setLoadedAll(true); - setLoadAll(false); - setData(response) - }); -} - -export const getLimitAndOffset = (countObject = {}) => { - const { totalCount = 0, loadedCount = 0 } = countObject; - let limit = 0; - let offset = 100; - if (countObject) { - limit = totalCount - loadedCount; - offset = loadedCount - } - // limit = 40 // dev - return { limit, offset } -} - -export const transformLocality = (locality) => { - let tenantId = localStorage.getItem("inb-tenantId"); - if (!tenantId || !locality) { - return "COMMON_NA"; - } - return `${tenantId.toUpperCase().replace(".", "_")}_REVENUE_${locality}`; -} - - -export const asyncForEach = (array, cb) => { - array.forEach((ele) => setTimeout(cb.call(ele), 0)) -} - - -export const fetchLocalisation = async () => { - var myHeaders = new Headers(); - myHeaders.append("Content-Type", "application/json"); - - var raw = JSON.stringify({ - "RequestInfo": { - "apiId": "emp", - "ver": "1.0", - "ts": "10-03-2017 00:00:00", - "action": "create", - "did": "1", - "key": "abcdkey", - "msgId": "20170310130900", - "requesterId": "jagan", - "authToken": "0849501b-e1e0-42b9-8bc6-970a2018ba8f", - "userInfo": { - "id": 1 - } - } - }); - - var requestOptions = { - method: 'POST', - headers: myHeaders, - body: raw, - redirect: 'follow' - }; - - let localisationResponse = await fetch(`${window.location.origin}/localization/messages/v1/_search?locale=en_IN&tenantId=pb&module=rainmaker-common`, requestOptions) - .then(response => response.text()) - .then(result => JSON.parse(result)) - .then(result => result.messages) - .catch(error => console.log('error', error)); - - let transformedData = localisationResponse.reduce((curr, acm) => { - curr[acm.code] = acm.message - return { ...curr }; - }, {}) - localStorage.setItem("inbox-localisationData", JSON.stringify(transformedData)); -} \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/logo.svg b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/logo.svg deleted file mode 100644 index 2e5df0d3ab2..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/package.json b/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/package.json deleted file mode 100644 index 924330e9254..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-inbox-dev/src/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "egov-inbox", - "version": "1.0.0", - "private": false, - "scripts": { - "version-patch": "yarn version --new-version patch", - "version-minor": "yarn version --new-version minor", - "version-major": "yarn version --new-version major" - }, - "description": "\"# react-tour\"", - "main": "index.js", - "devDependencies": {}, - "author": "jagankumar-egov", - "license": "MIT" -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-noc-dev/offline-package.json b/frontend/mono-ui/web/rainmaker/dev-packages/egov-noc-dev/offline-package.json deleted file mode 100644 index da67b475757..00000000000 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-noc-dev/offline-package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "egov-noc-dev", - "version": "0.0.1", - "license": "egov", - "private": true, - "homepage": "https://egov-micro-dev.egovernments.org/employee-common-noc/", - "proxy": "https://egov-micro-dev.egovernments.org/", - "dependencies": { - "@babel/runtime": "^7.3.1", - "@material-ui/core": "^1.4.1", - "@material-ui/icons": "^2.0.3", - "autoselector": "^1.1.0", - "autosuggest-highlight": "^3.1.1", - "axios": "^0.18.0", - "babel-polyfill": "^6.26.0", - "egov-ui-framework":"0.1.41", - "egov-ui-kit": "^0.0.1", - "egov-workflow": "1.3.0", - "egov-bpa": "1.3.0", - "html2canvas": "^1.0.0-alpha.12", - "jquery": "^3.3.1", - "jsonpath": "^1.0.2", - "jspdf": "^1.5.3", - "lodash": "^4.17.10", - "marker-animate-unobtrusive": "^0.2.8", - "mui-datatables": "^2.0.0-beta.58", - "node-sass-chokidar": "^1.2.2", - "pdfmake": "^0.1.40", - "prop-types": "^15.6.2", - "qrcode": "^1.3.3", - "react": "^16.7.0", - "react-autosuggest": "^9.4.3", - "react-dom": "^16.7.0", - "react-google-maps": "^9.4.5", - "react-json-view": "^1.19.1", - "react-loadable": "^5.4.0", - "react-redux": "^5.1.1", - "react-responsive-carousel": "^3.1.45", - "react-router-dom": "^4.3.1", - "react-scripts": "^1.1.4", - "react-select": "^2.3.0", - "react-swipeable-views": "^0.13.1", - "react-text-mask": "^5.4.2", - "recompose": "^0.27.1", - "redux": "^4.0.1", - "redux-logger": "^3.0.6", - "redux-thunk": "^2.3.0", - "url-search-params-polyfill": "^5.0.0" - }, - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-loader": "^7.1.5", - "babel-preset-env": "^1.7.0", - "babel-preset-react": "^6.24.1", - "css-loader": "^1.0.0", - "html-webpack-plugin": "^3.2.0", - "style-loader": "^0.21.0" - }, - "scripts": { - "start": "react-scripts start", - "build-css": "node-sass-chokidar src/ -o src/", - "transpile": "npm run build-css && babel src -d ../../packages/egov-noc --copy-files", - "build": "react-scripts build", - "test": "react-scripts test --env=jsdom", - "eject": "react-scripts eject" - } -} diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-noc-dev/package.json b/frontend/mono-ui/web/rainmaker/dev-packages/egov-noc-dev/package.json index b5b2c785c31..acb1362534c 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-noc-dev/package.json +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-noc-dev/package.json @@ -3,6 +3,66 @@ "version": "0.0.1", "license": "egov", "private": true, - "dependencies": {}, - "scripts": {} + "homepage": "https://egov-micro-dev.egovernments.org/employee-common-noc/", + "proxy": "https://egov-micro-dev.egovernments.org/", + "dependencies": { + "@babel/runtime": "^7.3.1", + "@material-ui/core": "^1.4.1", + "@material-ui/icons": "^2.0.3", + "autoselector": "^1.1.0", + "autosuggest-highlight": "^3.1.1", + "axios": "^0.18.0", + "babel-polyfill": "^6.26.0", + "egov-ui-framework":"0.1.41", + "egov-ui-kit": "^0.0.1", + "egov-workflow": "1.3.0", + "egov-bpa": "1.3.0", + "html2canvas": "^1.0.0-alpha.12", + "jquery": "^3.3.1", + "jsonpath": "^1.0.2", + "jspdf": "^1.5.3", + "lodash": "^4.17.10", + "marker-animate-unobtrusive": "^0.2.8", + "mui-datatables": "^2.0.0-beta.58", + "node-sass-chokidar": "^1.2.2", + "pdfmake": "^0.1.40", + "prop-types": "^15.6.2", + "qrcode": "1.3.3", + "react": "^16.7.0", + "react-autosuggest": "^9.4.3", + "react-dom": "^16.7.0", + "react-google-maps": "^9.4.5", + "react-json-view": "^1.19.1", + "react-loadable": "^5.4.0", + "react-redux": "^5.1.1", + "react-responsive-carousel": "^3.1.45", + "react-router-dom": "^4.3.1", + "react-scripts": "^1.1.4", + "react-select": "^2.3.0", + "react-swipeable-views": "^0.13.1", + "react-text-mask": "^5.4.2", + "recompose": "^0.27.1", + "redux": "^4.0.1", + "redux-logger": "^3.0.6", + "redux-thunk": "^2.3.0", + "url-search-params-polyfill": "^5.0.0" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", + "babel-loader": "^7.1.5", + "babel-preset-env": "^1.7.0", + "babel-preset-react": "^6.24.1", + "css-loader": "^1.0.0", + "html-webpack-plugin": "^3.2.0", + "style-loader": "^0.21.0" + }, + "scripts": { + "start": "react-scripts start", + "build-css": "node-sass-chokidar src/ -o src/", + "transpile": "npm run build-css && babel src -d ../../packages/egov-noc --copy-files", + "build": "react-scripts build", + "test": "react-scripts test --env=jsdom", + "eject": "react-scripts eject" + } } diff --git a/frontend/mono-ui/web/rainmaker/dev-packages/egov-noc-dev/public/index.html b/frontend/mono-ui/web/rainmaker/dev-packages/egov-noc-dev/public/index.html index e386b139730..4dcd156af54 100644 --- a/frontend/mono-ui/web/rainmaker/dev-packages/egov-noc-dev/public/index.html +++ b/frontend/mono-ui/web/rainmaker/dev-packages/egov-noc-dev/public/index.html @@ -4,6 +4,13 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - UPYOG + mSeva Department of Local Government Punjab + + diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/components/index.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/components/index.js index 1cf2253e703..4ef0f0e9f0e 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/components/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/components/index.js @@ -41,12 +41,8 @@ import ToolTipUi from "egov-ui-kit/components/Tooltip"; import TableUi from "egov-ui-kit/components/Tables"; import FloatingButton from "egov-ui-kit/components/FloatingButton"; import UpdateMobile from 'egov-ui-kit/common/propertyTax/UpdateMobile/updateMobile'; -import VerifyMobile from 'egov-ui-kit/common/propertyTax/AlternateMobile'; -import WarningPopup from 'egov-ui-kit/common/propertyTax/AlternateMobile/warningPopup'; export { - WarningPopup, - VerifyMobile, UpdateMobile, Label, Image, diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/common.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/common.js index 739a6dcf9a7..272516bc8bf 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/common.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/common.js @@ -1,19 +1,12 @@ const commonConfig = { MAP_API_KEY: globalConfigExists() ? window.globalConfigs.getConfig("GMAPS_API_KEY") : process.env.REACT_APP_GMAPS_API_KEY, - tenantId: globalConfigExists() ? window.globalConfigs.getConfig("STATE_LEVEL_TENANT_ID") : process.env.REACT_APP_DEFAULT_TENANT_ID, - whatsappNumber: - globalConfigExists() && window.globalConfigs.getConfig("DEFAULT_WHATSAPP_NUMBER") - ? window.globalConfigs.getConfig("DEFAULT_WHATSAPP_NUMBER") - : process.env.REACT_APP_DEFAULT_WHATSAPP_NUMBER - ? process.env.REACT_APP_DEFAULT_WHATSAPP_NUMBER - : 918744060444, - singleInstance: globalConfigExists() ? window.globalConfigs.getConfig("ENABLE_SINGLEINSTANCE") || false : false, - S3BUCKET: globalConfigExists() ? window.globalConfigs.getConfig("S3BUCKET") :"egov-qa-assets", + tenantId: globalConfigExists() ? window.globalConfigs.getConfig('STATE_LEVEL_TENANT_ID') : process.env.REACT_APP_DEFAULT_TENANT_ID, + whatsappNumber: globalConfigExists() && window.globalConfigs.getConfig('DEFAULT_WHATSAPP_NUMBER')? window.globalConfigs.getConfig('DEFAULT_WHATSAPP_NUMBER') :( process.env.REACT_APP_DEFAULT_WHATSAPP_NUMBER?process.env.REACT_APP_DEFAULT_WHATSAPP_NUMBER:918744060444), // forgotPasswordTenant: "pb.amritsar", }; -function globalConfigExists() { - return typeof window.globalConfigs !== "undefined" && typeof window.globalConfigs.getConfig === "function"; -} +function globalConfigExists(){ + return typeof window.globalConfigs !== 'undefined' && typeof window.globalConfigs.getConfig === 'function'; + } export default commonConfig; diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/employeeForgotPasswd.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/employeeForgotPasswd.js index 61fadb11e91..e293b11bab7 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/employeeForgotPasswd.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/employeeForgotPasswd.js @@ -20,7 +20,7 @@ const formConfig = { tenantId: { id: "employee-forgot-password-tenantId", jsonPath: "otp.tenantId", - value:"" + value: commonConfig.forgotPasswordTenant, }, }, submit: { diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/employeeOTP.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/employeeOTP.js index a91fc989376..eb6919fc8d3 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/employeeOTP.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/employeeOTP.js @@ -9,7 +9,6 @@ const formConfig = { errorMessage: "CORE_OTP_ERRORMSG", hintText: "CORE_OTP_PLACEHOLDER", pattern: "^([0-9]){6}$", - value: "", }, newPassword: { id: "employee-forgot-password-new-password", diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/login.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/login.js index 82482e04d6e..b952a710e9a 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/login.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/specs/login.js @@ -30,16 +30,6 @@ const formConfig = { jsonPath: "otp.userType", value: "CITIZEN", }, - citizenConsentForm: { - errorMessage: "Citizen Consent Form", - floatingLabelText: "Citizen Consent Form", - hintText: "Please check Citizen Consent Form", - id: "person-Citizen Consent Form", - jsonPath: "otp.CitizenConsentForm", - required: true, - requiredmessage: "Required", - type: "checkbox", - } }, submit: { type: "submit", diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/transformers/businessModelToViewModelTransformer.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/transformers/businessModelToViewModelTransformer.js index eb67276be5b..f95f8799fc1 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/transformers/businessModelToViewModelTransformer.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/transformers/businessModelToViewModelTransformer.js @@ -2,15 +2,14 @@ const transformer = (formKey, form, state, recordData) => { const transformers = { profile: () => { const { userInfo } = state.auth; - const { name="", emailId, permanentCity, tenantId, photo: imageUri } = userInfo; + const { name, emailId, permanentCity, tenantId, photo: imageUri } = userInfo; const transformedForm = { ...form, fields: { ...form.fields, email: { ...form.fields.email, value: emailId || "" }, city: { ...form.fields.city, value: permanentCity || tenantId }, - name: { ...form.fields.name, value: name&&name.trim() - }, + name: { ...form.fields.name, value: name }, }, files: { ["photo"]: [ diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/transformers/viewModelToBusinessModelTransformer.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/transformers/viewModelToBusinessModelTransformer.js index 88920c53cdb..1ce163946fe 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/transformers/viewModelToBusinessModelTransformer.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/config/forms/transformers/viewModelToBusinessModelTransformer.js @@ -58,7 +58,7 @@ const transformer = (formKey, form = {}, state = {}) => { profile: () => { const { fields } = form; let { userInfo: user } = state.auth; - user = { ...user, name: fields.name.value&& fields.name.value.trim(), permanentCity: fields.city.value, emailId: fields.email.value }; + user = { ...user, name: fields.name.value, permanentCity: fields.city.value, emailId: fields.email.value }; const photos = form.files && form.files["photo"]; let photo = (photos && photos.length && photos[0]) || null; photo = photo ? photo.fileStoreId || photo.imageUri : null; diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/App.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/App.js index 66dfe3f732d..2d00d61dcc6 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/App.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/App.js @@ -12,9 +12,9 @@ import isEmpty from "lodash/isEmpty"; import React, { Component } from "react"; import { connect } from "react-redux"; import { withRouter } from "react-router"; -import './index.css'; import Router from "./Router"; import routes from "./Routes"; + class App extends Component { constructor(props) { super(props); @@ -84,7 +84,7 @@ class App extends Component { if (mobileNumber === citizenMobileNo||(mobileNumber&&typeof mobileNumber=="string"&&mobileNumber.includes(citizenMobileNo))) { let redirectionURL = redirectionLink(href); if (redirectionURL && redirectionURL.includes && redirectionURL.includes('digit-ui')) { - window.location.href = redirectionURL.startsWith('/digit') ? redirectionURL.split('&')[0] : `/${redirectionURL.split('&')[0]}`; + window.location.href = redirectionURL.startsWith('/digit') ? redirectionURL : `/${redirectionURL}`; return; } else { setRoute(redirectionURL); @@ -116,7 +116,7 @@ class App extends Component { } const isWithoutAuthSelfRedirect = location && location.pathname && location.pathname.includes("openlink"); const isPrivacyPolicy = location && location.pathname && location.pathname.includes("privacy-policy"); - const isPublicSearch = location && location.pathname && (location.pathname.includes("/withoutAuth/pt-mutation/public-search") || location.pathname.includes("/withoutAuth/wns/public-search") || location.pathname.includes("/withoutAuth/bnd/viewCertificate")); + const isPublicSearch = location && location.pathname && (location.pathname.includes("/withoutAuth/pt-mutation/public-search") || location.pathname.includes("/withoutAuth/wns/public-search")); const isPublicSearchPay = location && location.pathname && location.pathname.includes("/withoutAuth/egov-common/pay"); if (nextProps.hasLocalisation !== this.props.hasLocalisation && !authenticated && !getQueryArg("", "smsLink") && !isWithoutAuthSelfRedirect && !isPrivacyPolicy && !isPublicSearch && !isPublicSearchPay) { nextProps.hasLocalisation && this.props.history.replace("/language-selection"); @@ -125,48 +125,11 @@ class App extends Component { render() { const { toast, loading, defaultUrl, hasLocalisation } = this.props; - let loginScreens = false; - let logginScreensUrls = ['/citizen/user/login','/citizen/user/otp', '/citizen/forgot-password', '/citizen/language-selection', '/citizen/user/register']; - if (logginScreensUrls.includes(window.location.pathname)) { - loginScreens = true; - } - let sourceUrl = `${window.location.origin}/citizen`; - sourceUrl="https://s3.ap-south-1.amazonaws.com/egov-qa-assets"; // changes for the image configured in s3 bucket - - const pdfUrl = "https://pg-egov-assets.s3.ap-south-1.amazonaws.com/Upyog+Code+and+Copyright+License_v1.pdf"; - return ( + return (
-
- -
- + {toast && toast.open && !isEmpty(toast.message) && } - {loading && } - - {!loginScreens &&
-
- {"Powered { - window.open('https://www.digit.org/', '_blank').focus(); - }}> - | - { window.open('https://niua.in/', '_blank').focus();}} >Copyright © 2022 National Institute of Urban Affairs - | - { window.open(pdfUrl, '_blank').focus();}}>UPYOG License -
-
} - - {loginScreens &&
-
- {"Powered { - window.open('https://www.digit.org/', '_blank').focus(); - }}> - | - { window.open('https://niua.in/', '_blank').focus();}} >Copyright © 2022 National Institute of Urban Affairs - | - { window.open(pdfUrl, '_blank').focus();}}>UPYOG License -
-
}
); } diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/CitizenDashboard/index.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/CitizenDashboard/index.js index cffc2f36889..49e25bad38b 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/CitizenDashboard/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/CitizenDashboard/index.js @@ -6,10 +6,12 @@ import Label from "egov-ui-kit/utils/translationNode"; import ServicesNearby from "./components/ServicesNearby"; import { Notifications, Screen } from "modules/common"; import LogoutDialog from "egov-ui-kit/common/common/Header/components/LogoutDialog"; -import { getUserInfo } from "egov-ui-kit/utils/localStorageUtils"; +import { getUserInfo, localStorageSet, localStorageGet } from "egov-ui-kit/utils/localStorageUtils"; import { toggleSpinner } from "egov-ui-kit/redux/common/actions"; import { setRoute } from "egov-ui-kit/redux/app/actions"; import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; +import WelcomeMessage from "egov-ui-kit/common/common/WelcomeMessage"; +import wc_banner from "egov-ui-kit/assets/images/wc_banner.png"; import get from "lodash/get"; import "./index.css"; @@ -17,17 +19,18 @@ class CitizenDashboard extends Component { state = { whatsNewEvents: [], openDialog: false, + openWCDialog : false, + pCity : '' }; - constructor(props){ - super(props); - /* RAIN-7250 Always Navigate to new UI Incase user clicks on Home */ - window.location.href="/digit-ui/citizen"; - } + componentWillReceiveProps = (nextProps) => { const { cityUpdateDialog } = nextProps; + let { whatShappTenants = [] } = this.props; + let { openWCDialog } = this.state; const permanentCity = get(nextProps, "userInfo.permanentCity"); if (!permanentCity) { - if (get(this.props, "userInfo.permanentCity") !== get(nextProps, "userInfo.permanentCity")) { + let isCheck = get(this.props, "userInfo.permanentCity") !== get(nextProps, "userInfo.permanentCity") + if (isCheck) { if (cityUpdateDialog) { this.setState({ openDialog: true, @@ -35,6 +38,15 @@ class CitizenDashboard extends Component { } } } + if (permanentCity) { + let allCity = whatShappTenants['PGR.WHATSAPP'] && whatShappTenants['PGR.WHATSAPP'].tenants; + if(allCity && !openWCDialog) { + const isCityExists = allCity.find(o => o.code === permanentCity); + const whatsAppImage = localStorageGet("WhatsAppImage"); + if(isCityExists) this.setState({ openWCDialog : whatsAppImage, pCity: isCityExists.name }); + localStorageSet("WhatsAppImage", false); + } + } }; handleClose = () => { @@ -43,6 +55,10 @@ class CitizenDashboard extends Component { this.setState({ ...this.state, openDialog: false }); }; + handleWCClose = () => { + this.setState({ ...this.state, openWCDialog: false }); + }; + redirectToEditProfile = () => { const { setRoute } = this.props; setRoute("user/profile"); @@ -60,7 +76,7 @@ class CitizenDashboard extends Component { render() { const { history, loading, whatsNewEvents, setRoute } = this.props; - const { openDialog } = this.state; + const { openDialog, openWCDialog, pCity } = this.state; return ( {/* */} @@ -102,6 +118,12 @@ class CitizenDashboard extends Component { title={"Alert"} body={"Please update your City"} /> + ); } @@ -112,13 +134,14 @@ const mapStateToProps = (state) => { const cityUpdateDialog = get(state.screenConfiguration, "preparedFinalObject.cityUpdateDialog"); const userInfo = get(state.auth, "userInfo"); const loading = get(state.app, "notificationObj.loading"); + const whatShappTenants = get(state.common, "citiesByModule"); let filteredNotifications = notifications && Object.values(notifications).filter((item) => { return item.type === "BROADCAST" || (item.type === "SYSTEMGENERATED" && item.actions); }); let whatsNewEvents = filteredNotifications && filteredNotifications.slice(0, Math.min(3, filteredNotifications.length)); - return { notifications, userInfo, loading, whatsNewEvents, cityUpdateDialog }; + return { notifications, userInfo, loading, whatsNewEvents, cityUpdateDialog, whatShappTenants }; }; const mapDispatchToProps = (dispatch) => { diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/ContactUs/index.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/ContactUs/index.js index cdccba80f09..62e0819b7f2 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/ContactUs/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/ContactUs/index.js @@ -90,7 +90,7 @@ class ContactUs extends Component { { leftIcon: , primaryText: ( - + {contactNumber ? contactNumber : defaultLoader} ), @@ -132,8 +132,7 @@ class ContactUs extends Component { {domainUrl || defaultLoader} @@ -167,7 +166,7 @@ class ContactUs extends Component {
{twitterUrl && ( - + { )} {facebookUrl && ( - + { { - this.props.fetchLocalizationLabel(this.state.value); + + componentDidMount=()=>{ + this.props.fetchLocalizationLabel(this.state.value||'en_IN'); } onClick = (value) => { @@ -29,7 +30,7 @@ class LanguageSelection extends Component { const { bannerUrl, logoUrl, languages } = this.props; return ( - + ); } diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/User/Login/components/LoginForm/index.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/User/Login/components/LoginForm/index.js index 90ed29fbce7..b736c095563 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/User/Login/components/LoginForm/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/User/Login/components/LoginForm/index.js @@ -7,65 +7,12 @@ import Label from "egov-ui-kit/utils/translationNode"; import { startSMSRecevier } from "egov-ui-kit/utils/commons"; import Hidden from "@material-ui/core/Hidden"; import logo from "egov-ui-kit/assets/images/logo_black.png"; +import logoone from "egov-ui-kit/assets/images/pmidclogo.png"; import "./index.css"; -import { getLocale } from "egov-ui-kit/utils/localStorageUtils"; -import { getLocaleLabels } from "egov-ui-framework/ui-utils/commons"; -import Dialog from "@material-ui/core/Dialog"; -import Grid from '@material-ui/core/Grid'; -import IconButton from '@material-ui/core/IconButton'; -import CloseIcon from '@material-ui/icons/Close'; -const LoginForm = ({ handleFieldChange, form, logoUrl,qrCodeURL,enableWhatsApp, citizenConsentFormData }) => { +const LoginForm = ({ handleFieldChange, form, logoUrl,qrCodeURL,enableWhatsApp }) => { const fields = form.fields || {}; const submit = form.submit; - const isCitizenConsentFormEnabled = citizenConsentFormData && citizenConsentFormData.isCitizenConsentFormEnabled; - - if (!citizenConsentFormData) return
- - if (citizenConsentFormData && !citizenConsentFormData.isCitizenConsentFormEnabled) { - delete fields.citizenConsentForm; - } - - const [open, setOpen] = React.useState(false); - const [mdmsConfig, setMdmsConfig] = React.useState(""); - - const handleClose = () => { - setOpen(false) - } - const onLinkClick = (e) => { - setMdmsConfig(e.target.id); - setOpen(true); - } - - const checkLabels = () => { - return citizenConsentFormData && citizenConsentFormData.checkBoxLabels && citizenConsentFormData.checkBoxLabels.length && - {citizenConsentFormData.checkBoxLabels.map((data, index) => { - return - {data.linkPrefix && {(getLocaleLabels(`${data.linkPrefix}_`, `${data.linkPrefix}_`))}} - {data.link && { onLinkClick(e) }} style={{ color: "#F47738", cursor: "pointer" }}>{getLocaleLabels(`${data.link}_`, `${data.link}_`)}} - {data.linkPostfix && {getLocaleLabels(`${data.linkPostfix}_`, `${data.linkPostfix}_`)}} - {(index == citizenConsentFormData.checkBoxLabels.length - 1) && getLocaleLabels("LABEL", "LABEL")} - {(index == citizenConsentFormData.checkBoxLabels.length - 1) && *} - - })} - - } - - if (fields && fields.citizenConsentForm && fields.citizenConsentForm.floatingLabelText) { - fields.citizenConsentForm.isSeperateLabel = checkLabels(); - } - - let url = ""; - if (citizenConsentFormData && - citizenConsentFormData.checkBoxLabels && - citizenConsentFormData.checkBoxLabels.length && - mdmsConfig) { - let filterData = citizenConsentFormData.checkBoxLabels.filter(data => data.linkId == mdmsConfig); - if (filterData.length) { - url = filterData[0][getLocale()] || ""; - } - } - return (
@@ -74,31 +21,33 @@ const LoginForm = ({ handleFieldChange, form, logoUrl,qrCodeURL,enableWhatsApp, className={enableWhatsApp?"login-cardwidth user-screens-card":"login-cardwidthmob col-sm-offset-4 col-sm-4 user-screens-card"} textChildren={
-
-
- +
+
+
-
+ +
+
+
+ +
+
-
-
- +
+
+
-
+
+
+
+ +
+ +
-
-
- +
+
+
-
+
diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/User/Register/index.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/User/Register/index.js index 5e1b1a95fa8..cc829bfef68 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/User/Register/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/User/Register/index.js @@ -1,28 +1,18 @@ +import React, { Component } from "react"; import formHoc from "egov-ui-kit/hocs/form"; -import { fetchLocalizationLabel } from "egov-ui-kit/redux/app/actions"; -import { getLocale, getLocalization } from "egov-ui-kit/utils/localStorageUtils"; -import get from "lodash/get"; +import RegisterForm from "./components/RegisterForm"; import { Banner } from "modules/common"; -import React, { Component } from "react"; import { connect } from "react-redux"; -import RegisterForm from "./components/RegisterForm"; +import get from "lodash/get"; const RegisterFormHOC = formHoc({ formKey: "register" })(RegisterForm); class Register extends Component { - componentDidMount = () => { - const locale = getLocale() || 'en_IN'; - const localizationLabels = JSON.parse(getLocalization(`localization_${locale}`)) || []; - if (localizationLabels && Array.isArray(localizationLabels) && localizationLabels.length == 0) { - this.props.fetchLocalizationLabel(locale); - } - } - render() { - const { bannerUrl, logoUrl, qrCodeURL, enableWhatsApp } = this.props; + const { bannerUrl, logoUrl,qrCodeURL,enableWhatsApp } = this.props; return ( - + ); } @@ -33,18 +23,11 @@ const mapStateToProps = ({ common }) => { let bannerUrl = get(stateInfoById, "0.bannerUrl"); let logoUrl = get(stateInfoById, "0.logoUrl"); let qrCodeURL = get(stateInfoById, "0.qrCodeURL"); - let enableWhatsApp = get(stateInfoById, "0.enableWhatsApp"); - return { bannerUrl, logoUrl, qrCodeURL, enableWhatsApp }; -}; - - -const mapDispatchToProps = (dispatch) => { - return { - fetchLocalizationLabel: (locale) => dispatch(fetchLocalizationLabel(locale)), - }; + let enableWhatsApp=get(stateInfoById,"0.enableWhatsApp"); + return { bannerUrl, logoUrl ,qrCodeURL,enableWhatsApp}; }; export default connect( mapStateToProps, - mapDispatchToProps + null )(Register); diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/WhatsAppScreen/City/index.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/WhatsAppScreen/City/index.js index 23470f9c2ec..002aeb6e77a 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/WhatsAppScreen/City/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/WhatsAppScreen/City/index.js @@ -83,6 +83,7 @@ class WhatsAppCity extends React.Component { ); return payload; } catch (e) { + console.log(e); } }; @@ -97,19 +98,19 @@ class WhatsAppCity extends React.Component { this.setState({ stateId: stateId, }) + let locale = getQueryArg(window.location.href, "locale") || 'en_IN'; setLocale(locale); setModule('rainmaker-common'); this.props.fetchLocalizationLabel(getLocale(), commonConfig.tenantId, commonConfig.tenantId); const citydata = await this.getMDMSData(stateId); - const citylistCodeModule = get(citydata, "MdmsRes.tenant.citymodule", []); const citylistCode = citylistCodeModule.filter(item => item.module === "PGR.WHATSAPP")[0].tenants const citylist = citylistCode.map((item) => { return { code: item.code, - label: item.name + label: item.name } }) @@ -117,7 +118,6 @@ class WhatsAppCity extends React.Component { citylist: citylist, data: [...citylist] }) - }; @@ -205,4 +205,4 @@ export default connect( mapDispatchToProps )(withStyles(styles)( (WhatsAppCity) -)); \ No newline at end of file +)); diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/WhatsAppScreen/Locality/index.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/WhatsAppScreen/Locality/index.js index e9686262f79..df12dc99f1d 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/WhatsAppScreen/Locality/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/WhatsAppScreen/Locality/index.js @@ -38,6 +38,7 @@ const styles = (theme) => ({ fontSize: "16px", }, }); + const getLocaleDetails = () => { return getQueryArg(window.location.href, "locale") || 'en_IN' } @@ -56,9 +57,9 @@ class WhatsAppLocality extends React.Component { localStorage.clear(); const values = queryString.parse(this.props.location.search) - const cityname = values.tenantId || 'pb.amritsar'; + const cityname = values.tenantId; const phone = values.phone; - // fetchLocalizationLabel(getLocale(), cityname ||"pb.amritsar", cityname||"pb.amritsar"); + // fetchLocalizationLabel(getLocale(), cityname ||"pb.amritsar", cityname||"pb.amritsar"); this.setState({ phone: phone, }) @@ -73,7 +74,6 @@ class WhatsAppLocality extends React.Component { const localitydata = await this.getMDMSData(cityname); const localityistCode = get(localitydata, "MdmsRes.egov-location.TenantBoundary", []); - const localitylist = localityistCode.map((item) => { let cod = this.getConnvertedString(item.code); return { @@ -117,12 +117,12 @@ class WhatsAppLocality extends React.Component { return payload; } catch (e) { + console.log(e); } }; + getLocalisation = async () => { let queryStr = [ - - { "key": 'module', "value": `rainmaker-common,rainmaker-${this.state.cityname}` @@ -151,10 +151,10 @@ class WhatsAppLocality extends React.Component { loadedLocalisation: true, localisedMessages: {} }) - - return; + return; } catch (e) { + console.log(e); } }; getConnvertedString = (code = '') => { @@ -198,7 +198,7 @@ class WhatsAppLocality extends React.Component { const { localitylist } = this.state; const { onChangeText } = this; - console.info(localizationLabels); + return (
@@ -230,18 +230,18 @@ class WhatsAppLocality extends React.Component { }} />
-
- {(this.state.data.length === 0 && this.state.searchText === "") && - - - +
+ {(this.state.data.length === 0 &&this.state.searchText === "") && + + + } { const { localizationLabels = {} } = state.app; return { @@ -283,4 +281,4 @@ export default connect( mapDispatchToProps )(withStyles(styles)( (WhatsAppLocality) -)); \ No newline at end of file +)); diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/index.scss b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/index.scss index 51ea41c2599..bef763dbfba 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/index.scss +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/citizen/index.scss @@ -3,3 +3,10 @@ padding: 12px 8px 60px 8px !important; } } +.rainmaker-displayInline.pmidclogo { + justify-content: right; + width: 61px; + position: absolute; + left: 340px; + top: 10px; +} \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/index.scss b/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/index.scss deleted file mode 100644 index 92000d6c977..00000000000 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/modules/index.scss +++ /dev/null @@ -1,27 +0,0 @@ -.jk-footer { - position: fixed; - width: 100%; - right: 0; - bottom: 0; - height: 2.5em; - --bg-opacity: 1; - background-color: #f4f7fb; - padding-bottom: 16px; - padding-top: 8px; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - z-index: 50; - display: flex; - } - - .jk-footer-image-cursor { - cursor: pointer; - } - - input[type="date"]{ - cursor: pointer; - } - input[type="date" i] { - cursor: pointer; - } diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-config/commonConfig/remote-component-paths/index.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-config/commonConfig/remote-component-paths/index.js index b48aabd3d59..8ade3ea5ece 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-config/commonConfig/remote-component-paths/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-config/commonConfig/remote-component-paths/index.js @@ -91,15 +91,6 @@ const remoteComponentPath = (moduleName, path) => { component = import("egov-noc/ui-containers-local"); } break; - case "egov-bnd": - if (path === "ui-atoms-local") { - component = import("egov-bnd/ui-atoms-local"); - } else if (path === "ui-molecules-local") { - component = import("egov-bnd/ui-molecules-local"); - } else if (path === "ui-containers-local") { - component = import("egov-bnd/ui-containers-local"); - } - break; default: break; } diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-config/commonConfig/remote-config-paths/index.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-config/commonConfig/remote-config-paths/index.js index 34106260fb0..f4852b5727d 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-config/commonConfig/remote-config-paths/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-config/commonConfig/remote-config-paths/index.js @@ -45,16 +45,6 @@ const remoteConfigPath = (path, screenKey) => { case "noc": config = require(`egov-noc/ui-config/screens/specs/${path}/${screenKey}`).default; break; - case "bnd": - case "birth-citizen": - case "birth-employee": - case "birth-common": - case "death-citizen": - case "death-employee": - case "death-common": - case "bnd-common": - config = require(`egov-bnd/ui-config/screens/specs/${path}/${screenKey}`).default; - break; default: config = require(`ui-config/screens/specs/${path}/${screenKey}`).default; break; diff --git a/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-utils/api.js b/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-utils/api.js index ac572a8d282..27c8c575459 100644 --- a/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-utils/api.js +++ b/frontend/mono-ui/web/rainmaker/packages/citizen/src/ui-utils/api.js @@ -1,7 +1,6 @@ import axios from "axios"; -import commonConfig from "config/common.js"; -import { addQueryArg } from "egov-ui-framework/ui-utils/commons"; -import { getAccessToken, getLocale, getTenantId } from "egov-ui-kit/utils/localStorageUtils"; +import { fetchFromLocalStorage, addQueryArg, getDateInEpoch } from "egov-ui-framework/ui-utils/commons"; +import { getAccessToken, getTenantId, getLocale } from "egov-ui-kit/utils/localStorageUtils"; const instance = axios.create({ baseURL: window.location.origin, @@ -24,7 +23,7 @@ const wrapRequestBody = (requestBody, action) => { authToken, }; return Object.assign( - { }, + {}, { RequestInfo, }, @@ -32,8 +31,12 @@ const wrapRequestBody = (requestBody, action) => { ); }; -export const httpRequest = async (method = "get", endPoint, action, queryObject = [], requestBody = { }, headers = []) => { +export const httpRequest = async (method = "get", endPoint, action, queryObject = [], requestBody = {}, headers = []) => { let apiError = "Api Error"; + headers = { + 'X-Frame-Options': 'sameorigin', + 'Cache-Control': "no-cache, no-store, no-transform, must-revalidate, max-age=0", + } if (headers) instance.defaults = Object.assign(instance.defaults, { @@ -72,6 +75,10 @@ export const httpRequest = async (method = "get", endPoint, action, queryObject export const loginRequest = async (username = null, password = null) => { let apiError = "Api Error"; + headers = { + 'X-Frame-Options': 'sameorigin', + 'Cache-Control': "no-cache, no-store, no-transform, must-revalidate, max-age=0", + } try { // api call for login alert("Logged in"); @@ -86,6 +93,10 @@ export const loginRequest = async (username = null, password = null) => { export const logoutRequest = async () => { let apiError = "Api Error"; + headers = { + 'X-Frame-Options': 'sameorigin', + 'Cache-Control': "no-cache, no-store, no-transform, must-revalidate, max-age=0", + } try { alert("Logged out"); return; @@ -107,12 +118,11 @@ export const prepareForm = (params) => { export const uploadFile = async (endPoint, module, file, ulbLevel) => { // Bad idea to fetch from local storage, change as feasible - const tenantId = getTenantId() ? (ulbLevel ? commonConfig.tenantId : commonConfig.tenantId) : ""; + const tenantId = getTenantId() ? (ulbLevel ? getTenantId().split(".")[0] : getTenantId().split(".")[0]) : ""; const uploadInstance = axios.create({ baseURL: window.location.origin, headers: { "Content-Type": "multipart/form-data", - "auth-token":getAccessToken(), }, }); diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/.env b/frontend/mono-ui/web/rainmaker/packages/employee/.env index 45fb6590b31..f4c6f96d2bc 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/.env +++ b/frontend/mono-ui/web/rainmaker/packages/employee/.env @@ -1,5 +1,6 @@ NODE_PATH=./src REACT_APP_NAME=Employee +REACT_APP_GMAPS_API_KEY=AIzaSyDjSk-Bw1OuiOE-5K7jsP6KGN2rbcN7iBk REACT_APP_DEFAULT_TENANT_ID=pb REACT_APP_PGR_DASHBOARD=http://a928e49ebd60d11e78b04069afc6531d-1602439604.ap-southeast-1.elb.amazonaws.com:5601/app/kibana#/dashboards?title=avi_pgr&embed=true REACT_APP_WS_CONSUMERS=https://dashboard-pbuat.egovernments.org/app/kibana#/dashboards?title=W%20%26%20S%20Consumers%20Dashboard&embed=true diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/package.json b/frontend/mono-ui/web/rainmaker/packages/employee/package.json index ea2a930809c..11a00bf57b6 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/package.json +++ b/frontend/mono-ui/web/rainmaker/packages/employee/package.json @@ -3,79 +3,74 @@ "version": "2.0.0", "license": "egov", "private": true, - "homepage": "https://upyog.niua.org/employee", - "proxy": "https://upyog.niua.org", + "homepage": "https://mseva-uat.lgpunjab.gov.in/employee/", + "proxy": "https://mseva-uat.lgpunjab.gov.in/", "dependencies": { - "@babel/runtime": "7.3.1", - "@material-ui/core": "1.5.1", + "@babel/runtime": "^7.3.1", + "@material-ui/core": "^1.5.1", "@material-ui/icons": "^2.0.0", - "autoselector": "1.5.8", - "axios": "0.17.1", - "babel-polyfill": "6.26.0", - "babel-runtime": "6.26.0", + "autoselector": "^1.5.8", + "axios": "^0.17.1", + "babel-polyfill": "^6.26.0", "datatables": "1.10.18", "datatables-buttons": "1.0.3", "datatables.net": "1.11.5", "datatables.net-buttons-bs": "2.0.0", "datatables.net-responsive": "2.2.9", "datatables.net-buttons": "2.2.2", - "disable-browser-back-navigation": "0.1.0", - "egov-abg": "1.8.0", - "egov-billamend": "1.8.0", - "egov-bpa": "1.8.0", - "egov-common": "1.8.0", - "egov-firenoc": "1.8.0", - "egov-hrms": "1.8.0", - "egov-inbox": "1.0.0", - "egov-uc": "1.8.0", - "egov-pt": "1.8.0", - "egov-tradelicence": "1.8.0", - "egov-noc": "1.8.0", + "disable-browser-back-navigation": "^0.1.0", + "egov-abg": "1.3.0", + "egov-billamend": "1.0.0", + "egov-bpa": "1.3.0", + "egov-common": "1.3.0", + "egov-firenoc": "1.3.0", + "egov-hrms": "1.3.0", + "egov-uc": "1.3.0", + "egov-pt": "1.3.0", + "egov-tradelicence": "1.3.0", + "egov-noc": "1.3.0", "egov-ui-framework": "0.1.41", - "egov-ui-kit": "0.0.1", - "egov-wns": "1.8.0", - "egov-bnd": "1.8.1", - "egov-workflow": "1.8.0", - "html2canvas": "1.0.0-alpha.12", - "jsonpath": "1.0.0", - "jspdf": "1.5.3", - "jszip": "3.1.5", - "lodash": "4.17.11", - "material-ui": "0.20.2", + "egov-ui-kit": "^0.0.1", + "egov-wns": "1.3.0", + "egov-workflow": "1.3.0", + "html2canvas": "^1.0.0-alpha.12", + "jsonpath": "^1.0.0", + "jspdf": "^1.5.3", + "jszip": "^3.1.5", + "lodash": "^4.17.11", + "material-ui": "^0.20.2", "mui-datatables": "2.0.0-beta.56", - "node-sass": "4.14.1", - "node-sass-chokidar": "1.5.0", "pdfmake": "0.1.62", - "pgr-employee": "1.8.0", - "prop-types": "15.6.2", - "pt-employee": "1.8.0", + "pgr-employee": "1.3.0", + "prop-types": "^15.6.2", + "pt-employee": "1.3.0", "qrcode": "1.3.3", - "react": "16.8.0", - "react-bootstrap": "0.32.1", - "react-dom": "16.8.0", - "react-google-maps": "9.4.5", - "react-id-swiper": "1.6.8", - "react-jquery-datatables": "1.0.0", - "react-json-view": "1.19.1", - "react-load-image": "0.1.7", - "react-loadable": "5.5.0", - "react-redux": "5.1.1", - "react-router": "4.3.1", - "react-router-dom": "4.3.1", + "react": "^16.7.0", + "react-bootstrap": "^0.32.1", + "react-dom": "^16.7.0", + "react-google-maps": "^9.4.5", + "react-id-swiper": "^1.6.8", + "react-jquery-datatables": "^1.0.0", + "react-json-view": "^1.19.1", + "react-load-image": "^0.1.7", + "react-loadable": "^5.5.0", + "react-redux": "^5.1.1", + "react-router": "^4.3.1", + "react-router-dom": "^4.3.1", "react-scripts": "1.1.1", - "react-select": "2.3.0", - "react-swipeable-views": "0.13.1", - "react-table": "6.8.6", - "react-text-mask": "5.4.3", - "recompose": "0.30.0", - "redux": "3.7.2", - "redux-logger": "3.0.6", - "redux-thunk": "2.2.0", - "url-search-params-polyfill": "3.0.0", - "webfontloader": "1.6.28" + "react-select": "^2.3.0", + "react-swipeable-views": "^0.13.1", + "react-table": "^6.8.6", + "react-text-mask": "^5.4.3", + "recompose": "^0.30.0", + "redux": "^3.7.2", + "redux-logger": "^3.0.6", + "redux-thunk": "^2.2.0", + "url-search-params-polyfill": "^3.0.0", + "webfontloader": "^1.6.28" }, "resolutions": { - "**/datatables.net": "1.11.5", + "**/datatables.net": "1.11.5", "**/datatables.net-dt":"1.12.1", "**/datatables.net-bs":"1.12.1", "**/datatables.net-responsive-dt":"2.3.0", @@ -99,10 +94,10 @@ "egov-ui-kit-utils": "babel src/utils --out-dir src/egov-ui-kit/utils --copy-files" }, "devDependencies": { - "babel-cli": "6.26.0", - "babel-plugin-transform-runtime": "6.23.0", - "babel-preset-es2015": "6.24.1", - "babel-preset-react": "6.24.1", - "babel-preset-stage-0": "6.24.1" + "babel-cli": "^6.26.0", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-preset-es2015": "^6.24.1", + "babel-preset-react": "^6.24.1", + "babel-preset-stage-0": "^6.24.1" } -} \ No newline at end of file +} diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/public/Upyog Code and Copyright License_v1.pdf b/frontend/mono-ui/web/rainmaker/packages/employee/public/Upyog Code and Copyright License_v1.pdf deleted file mode 100644 index 1073bbaa22f..00000000000 Binary files a/frontend/mono-ui/web/rainmaker/packages/employee/public/Upyog Code and Copyright License_v1.pdf and /dev/null differ diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/public/browser-icon.png b/frontend/mono-ui/web/rainmaker/packages/employee/public/browser-icon.png index d5e033a029a..32e2488b00e 100644 Binary files a/frontend/mono-ui/web/rainmaker/packages/employee/public/browser-icon.png and b/frontend/mono-ui/web/rainmaker/packages/employee/public/browser-icon.png differ diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/public/digit-footer-bw.png b/frontend/mono-ui/web/rainmaker/packages/employee/public/digit-footer-bw.png deleted file mode 100644 index 2738f31b537..00000000000 Binary files a/frontend/mono-ui/web/rainmaker/packages/employee/public/digit-footer-bw.png and /dev/null differ diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/public/digit-footer.png b/frontend/mono-ui/web/rainmaker/packages/employee/public/digit-footer.png deleted file mode 100644 index 7d08e1c451b..00000000000 Binary files a/frontend/mono-ui/web/rainmaker/packages/employee/public/digit-footer.png and /dev/null differ diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/public/index.html b/frontend/mono-ui/web/rainmaker/packages/employee/public/index.html index cf2c87faa2d..f1d7f30c646 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/public/index.html +++ b/frontend/mono-ui/web/rainmaker/packages/employee/public/index.html @@ -9,13 +9,15 @@ homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/ --> - + - UPYOG + mSeva Department of Local Government Punjab + + diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/components/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/components/index.js index 82cd6fc2030..42f0bf84919 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/components/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/components/index.js @@ -1,52 +1,48 @@ -import AppBar from "egov-ui-kit/components/AppBar"; -import AutoSuggest from "egov-ui-kit/components/AutoSuggestCommon"; -import AutoSuggestDropdown from "egov-ui-kit/components/AutoSuggestDropdown"; -import BottomNavigation from "egov-ui-kit/components/BottomNavigation"; +import TextField from "egov-ui-kit/components/TextField"; +import TextFieldIcon from "egov-ui-kit/components/TextFieldIcon"; +import MobileNumberField from "egov-ui-kit/components/MobileNumberField"; +import SelectField from "egov-ui-kit/components/DropDown"; +import Label from "egov-ui-kit/components/Label"; +import Checkbox from "egov-ui-kit/components/Checkbox"; +import TextArea from "egov-ui-kit/components/TextArea"; import Button from "egov-ui-kit/components/Button"; -import ButtonGroup from "egov-ui-kit/components/ButtonGroup"; import Card from "egov-ui-kit/components/Card"; -import Carousel from "egov-ui-kit/components/Carousel"; -import Checkbox from "egov-ui-kit/components/Checkbox"; import DatePicker from "egov-ui-kit/components/DatePicker"; +import TimePicker from "egov-ui-kit/components/TimePicker"; +import TimeLine from "egov-ui-kit/components/TimeLine"; +import FilePicker from "egov-ui-kit/components/FilePicker"; import Dialog from "egov-ui-kit/components/Dialog"; -import Divider from "egov-ui-kit/components/Divider"; +import AppBar from "egov-ui-kit/components/AppBar"; import Drawer from "egov-ui-kit/components/Drawer"; -import { default as DropDown, default as SelectField } from "egov-ui-kit/components/DropDown"; -import FilePicker from "egov-ui-kit/components/FilePicker"; -import Icon from "egov-ui-kit/components/Icon"; import Image from "egov-ui-kit/components/Image"; -import ImageModal from "egov-ui-kit/components/ImageModal"; -import InfoTable from "egov-ui-kit/components/InfoTable"; -import Label from "egov-ui-kit/components/Label"; -import List from "egov-ui-kit/components/List"; import LoadingIndicator from "egov-ui-kit/components/LoadingIndicator"; +import BottomNavigation from "egov-ui-kit/components/BottomNavigation"; +import Tabs from "egov-ui-kit/components/Tabs"; import MapLocation from "egov-ui-kit/components/MapLocation"; -import MobileNumberField from "egov-ui-kit/components/MobileNumberField"; +import List from "egov-ui-kit/components/List"; +import AutoSuggest from "egov-ui-kit/components/AutoSuggestCommon"; +import AutoSuggestDropdown from "egov-ui-kit/components/AutoSuggestDropdown"; import ProfileSection from "egov-ui-kit/components/ProfileSection"; -import RadioButton from "egov-ui-kit/components/RadioButton"; import Ratings from "egov-ui-kit/components/Ratings"; -import Receipt from "egov-ui-kit/components/Receipt"; -import ShareButton from "egov-ui-kit/components/ShareButton"; +import ButtonGroup from "egov-ui-kit/components/ButtonGroup"; +import DropDown from "egov-ui-kit/components/DropDown"; +import Icon from "egov-ui-kit/components/Icon"; +import InfoTable from "egov-ui-kit/components/InfoTable"; +import ImageModal from "egov-ui-kit/components/ImageModal"; +import UploadDrawer from "egov-ui-kit/components/UploadDrawer"; +import RadioButton from "egov-ui-kit/components/RadioButton"; +import Toast from "egov-ui-kit/components/Toast"; +import Carousel from "egov-ui-kit/components/Carousel"; +import Divider from "egov-ui-kit/components/Divider"; import SingleCheckbox from "egov-ui-kit/components/SingleCheckbox"; import TableUi from "egov-ui-kit/components/Tables"; -import Tabs from "egov-ui-kit/components/Tabs"; -import TextArea from "egov-ui-kit/components/TextArea"; -import TextField from "egov-ui-kit/components/TextField"; -import TextFieldIcon from "egov-ui-kit/components/TextFieldIcon"; -import TimeLine from "egov-ui-kit/components/TimeLine"; -import TimePicker from "egov-ui-kit/components/TimePicker"; -import Toast from "egov-ui-kit/components/Toast"; import ToolTipUi from "egov-ui-kit/components/Tooltip"; -import UploadDrawer from "egov-ui-kit/components/UploadDrawer"; +import Receipt from "egov-ui-kit/components/Receipt"; +import ShareButton from "egov-ui-kit/components/ShareButton"; import CommonShareContainer from "./CommonShareContainer"; import UpdateMobile from 'egov-ui-kit/common/propertyTax/UpdateMobile/updateMobile'; -import VerifyMobile from 'egov-ui-kit/common/propertyTax/AlternateMobile'; -import WarningPopup from 'egov-ui-kit/common/propertyTax/AlternateMobile/warningPopup'; - export { - WarningPopup, - VerifyMobile, UpdateMobile, Label, Image, @@ -91,4 +87,3 @@ export { ShareButton, CommonShareContainer, }; - diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/common.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/common.js index 24c5b792764..5fba060f34f 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/common.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/common.js @@ -1,13 +1,11 @@ const commonConfig = { MAP_API_KEY: globalConfigExists() ? window.globalConfigs.getConfig("GMAPS_API_KEY") : process.env.REACT_APP_GMAPS_API_KEY, - tenantId: globalConfigExists() ? window.globalConfigs.getConfig("STATE_LEVEL_TENANT_ID") : process.env.REACT_APP_DEFAULT_TENANT_ID, - singleInstance: globalConfigExists() ? window.globalConfigs.getConfig("ENABLE_SINGLEINSTANCE") || false : false, - S3BUCKET: globalConfigExists() ? window.globalConfigs.getConfig("S3BUCKET") :"egov-qa-assets", + tenantId: globalConfigExists() ? window.globalConfigs.getConfig('STATE_LEVEL_TENANT_ID') : process.env.REACT_APP_DEFAULT_TENANT_ID, // forgotPasswordTenant: "pb.amritsar", }; -function globalConfigExists() { - return typeof window.globalConfigs !== "undefined" && typeof window.globalConfigs.getConfig === "function"; -} +function globalConfigExists(){ + return typeof window.globalConfigs !== 'undefined' && typeof window.globalConfigs.getConfig === 'function'; + } export default commonConfig; diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/ownerInfo.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/ownerInfo.js index 4385c49bd20..4d2230a701a 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/ownerInfo.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/ownerInfo.js @@ -63,7 +63,6 @@ const formConfig = { }, ownerRelationship: { id: "ownerRelationship", - required: true, jsonPath: "Properties[0].propertyDetails[0].owners[0].relationship", type: "singleValueList", floatingLabelText: "PT_FORM3_RELATIONSHIP", diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/propertyAddress.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/propertyAddress.js index 5015cf7ee37..02d1f1334cc 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/propertyAddress.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/propertyAddress.js @@ -1,5 +1,5 @@ -import { pincode, mohalla, street, colony, houseNumber, dummy } from "egov-ui-kit/config/forms/specs/PropertyTaxPay/utils/reusableFields"; -import { handleFieldChange } from "egov-ui-kit/redux/form/actions"; +import { pincode, mohalla ,street, colony, houseNumber } from "egov-ui-kit/config/forms/specs/PropertyTaxPay/utils/reusableFields"; +import { handleFieldChange, setFieldProperty } from "egov-ui-kit/redux/form/actions"; import { CITY } from "egov-ui-kit/utils/endPoints"; import { prepareFormData } from "egov-ui-kit/redux/common/actions"; import set from "lodash/set"; @@ -7,8 +7,17 @@ import get from "lodash/get"; import { getLocale, getTenantId } from "egov-ui-kit/utils/localStorageUtils"; import { fetchLocalizationLabel } from "egov-ui-kit/redux/app/actions"; import commonConfig from '../../../common' +import { httpRequest } from "egov-ui-kit/utils/api"; + // const Search = ; +var tenantIdcode = getTenantId(); +let floorDropDownData = []; + +floorDropDownData.push({ label: "2013-14", value: "2013-14" }, { label: "2014-15", value: "2014-15" }, { label: "2015-16", value: "2015-16" }, { label: "2016-17", value: "2016-17" }, { label: "2017-18", value: "2017-18" }, { label: "2018-19", value: "2018-19" }, + { label: "2019-20", value: "2019-20" }, { label: "2020-21", value: "2020-21" }, + { label: "2021-22", value: "2021-22" }, { label: "2022-23", value: "2022-23" }, { label: "2023-24", value: "2023-24" }); + const formConfig = { name: "propertyAddress", @@ -51,10 +60,7 @@ const formConfig = { }, ], }, - updateDependentFields: ({ formKey, field, dispatch, state }) => { - dispatch(prepareFormData("Properties[0].tenantId", field.value)); - // dispatch(setFieldProperty("propertyAddress", "mohalla", "value", "")); - }, + beforeFieldChange: ({ action, dispatch, state }) => { if (get(state, "common.prepareFormData.PropertiesTemp[0].address.city") !== action.value) { const moduleValue = action.value; @@ -63,29 +69,142 @@ const formConfig = { return action; }, }, - ...dummy, ...houseNumber, ...colony, ...street, - ...mohalla, + // ...mohalla, + mohalla: { + id: "mohalla", + jsonPath: "Properties[0].address.locality.code", + type: "AutocompleteDropdown", + floatingLabelText: "PT_PROPERTY_DETAILS_MOHALLA", + hintText: "PT_COMMONS_SELECT_PLACEHOLDER", + fullWidth: true, + toolTip: true, + localePrefix: true, + toolTipMessage: "PT_MOHALLA_TOOLTIP_MESSAGE", + labelsFromLocalisation: true, + //toolTipMessage: "Name of the area in which your property is located", + boundary: true, + numcols: 6, + gridDefination: { + xs: 12, + sm: 6 + }, + errorMessage: "PT_PROPERTY_DETAILS_MOHALLA_ERRORMSG", + dataFetchConfig: { + url: "egov-location/location/v11/boundarys/_search?hierarchyTypeCode=REVENUE&boundaryType=Locality", + action: "", + queryParams: [], + requestBody: {}, + isDependent: true, + hierarchyType: "REVENUE", + }, + errorStyle: { position: "absolute", bottom: -8, zIndex: 5 }, + required: true, + formName: "propertyAddress", + updateDependentFields: async ({ formKey, field, dispatch, state }) => { + if (field.value && field.value.length > 0) { + const mohalla = field.dropDownData.find((option) => { + return option.value === field.value; + }); + dispatch(prepareFormData("Properties[0].address.locality.area", mohalla.area)); + } + setTimeout(async () => { + let localityCode = await state.screenConfiguration.preparedFinalObject.Properties[0].address.locality.code; + if (tenantIdcode == "pb.jalandhar" || tenantIdcode == "pb.testing") { + + let request = { searchCriteria: { tenantId: tenantIdcode } }; + try { + const response = await httpRequest( + "/egov-searcher/rainmaker-pt-gissearch/GetTenantConfig/_get", + "_get", + [], + request); + if (response) { + const data = response.data.find(obj => { + return obj.locality == localityCode; + }); + dispatch(setFieldProperty(formKey, "UID", "required", data ? true : false)); + } + } catch (error) { + console.log("functions-js getUserDataFromUuid error", error); + } + } + }, "100"); + + + }, + }, ...pincode, oldPID: { id: "oldpid", - type: "textFieldIcon", + type: "textfield", className: "pt-old-pid-text-field", - text: "PT_SEARCH_BUTTON", - iconRedirectionURL: "https://pmidc.punjab.gov.in/propertymis/search.php", + //text: "PT_SEARCH_BUTTON", + //iconRedirectionURL: "https://pmidc.punjab.gov.in/propertymis/search.php", jsonPath: "Properties[0].oldPropertyId", floatingLabelText: "PT_PROPERTY_ADDRESS_EXISTING_PID", hintText: "PT_PROPERTY_ADDRESS_EXISTING_PID_PLACEHOLDER", numcols: 6, errorMessage: "PT_PROPERTY_DETAILS_PINCODE_ERRORMSG", errorStyle: { position: "absolute", bottom: -8, zIndex: 5 }, - toolTip: true, + //toolTip: true, pattern: /^[^\$\"'<>?\\\\~`!@$%^+={}*,.:;“”‘’]{1,64}$/i, - toolTipMessage: "PT_OLDPID_TOOLTIP_MESSAGE", + //toolTipMessage: "PT_OLDPID_TOOLTIP_MESSAGE", maxLength: 64, }, + UID: { + id: "UID", + type: "textFieldIcon", + className: "pt-old-pid-text-field", + text: "Search", + iconRedirectionURL: getTenantId() == 'pb.amritsar' ? "https://arcserver.punjab.gov.in/portal/apps/webappviewer/index.html?id=8b678d4d5020448499054bf346843ea9" : getTenantId() == 'pb.hoshiarpur' ? "https://arcserver.punjab.gov.in/portal/apps/webappviewer/index.html?id=9bc1b255320a49c590dd17d4d258e054" : "https://gis.punjab.gov.in", + jsonPath: "Properties[0].surveyId", + floatingLabelText: "Survey Id/UID", + hintText: "Enter Survey Id/UID", + numcols: 6, + errorMessage: "PT_PROPERTY_DETAILS_PINCODE_ERRORMSG", + errorStyle: { position: "absolute", bottom: -8, zIndex: 5 }, + required: false, + // toolTip: true, + //pattern: /^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,64}$/i, + // toolTipMessage: "PT_OLDPID_TOOLTIP_MESSAGE", + maxLength: 64, + }, + + YearcreationProperty: { + id: "YearcreationProperty", + type: "AutocompleteDropdown", + className: "pt-old-pid-text-field", + // iconRedirectionURL: getTenantId()=='pb.amritsar'? "https://arcserver.punjab.gov.in/portal/apps/webappviewer/index.html?id=8b678d4d5020448499054bf346843ea9": getTenantId()=='pb.hoshiarpur'?"https://arcserver.punjab.gov.in/portal/apps/webappviewer/index.html?id=9bc1b255320a49c590dd17d4d258e054": "https://gis.punjab.gov.in", + jsonPath: "Properties[0].additionalDetails.yearConstruction", + floatingLabelText: "Year of creation of Property", + hintText: "Select", + numcols: 6, + gridDefination: { + xs: 12, + sm: 6 + }, + errorMessage: "PT_PROPERTY_DETAILS_PINCODE_ERRORMSG", + errorStyle: { position: "absolute", bottom: -8, zIndex: 5 }, + + formName: "propertyAddress", + dropDownData: floorDropDownData, + updateDependentFields: ({ formKey, field, dispatch }) => { + if (field.value && field.value.length > 0) { + const mohalla = field.dropDownData.find((option) => { + return option.value === field.value; + }); + dispatch(prepareFormData("Properties[0].additionalDetails.yearConstruction", mohalla.code)); + } + }, + // toolTip: true, + //pattern: /^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,64}$/i, + // toolTipMessage: "PT_OLDPID_TOOLTIP_MESSAGE", + maxLength: 64, + }, + }, afterInitForm: (action, store, dispatch) => { let tenantId = getTenantId(); @@ -106,7 +225,14 @@ const formConfig = { }) let cityName = tenantId; if (tenantInfo && tenantInfo.city && tenantInfo.city.name) - cityName = tenantInfo.city.name; + cityName = tenantInfo.city.name; + + let surveyId = get(state.screenConfiguration.preparedFinalObject, "Properties[0].surveyId"); + let year = get(state.screenConfiguration.preparedFinalObject, "Properties[0].additionalDetails.yearConstruction"); + dispatch(handleFieldChange("propertyAddress", "YearcreationProperty", year)); + if (surveyId) + dispatch(handleFieldChange("propertyAddress", "UID", surveyId)); + dispatch(handleFieldChange("propertyAddress", "city", tenantId)); dispatch(prepareFormData("Properties[0].address.city", cityName)); } diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/propertyInformation.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/propertyInformation.js index d810b237c3e..eeedb0dc8f8 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/propertyInformation.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/PropertyTaxPay/propertyInformation.js @@ -40,6 +40,23 @@ const formConfig = { pattern: /^[^\$\"'<>?\\\\~`!@$%^+={}*,.:;“”‘’]{1,64}$/i, maxLength: 64, }, + UID: { + id: "UID", + type: "textfield", + className: "pt-old-pid-text-field", + text: "PT_SEARCH_BUTTON", + iconRedirectionURL: getTenantId()=='pb.amritsar'? "https://arcserver.punjab.gov.in/portal/apps/webappviewer/index.html?id=8b678d4d5020448499054bf346843ea9": getTenantId()=='pb.hoshiarpur'?"https://arcserver.punjab.gov.in/portal/apps/webappviewer/index.html?id=9bc1b255320a49c590dd17d4d258e054": "https://gis.punjab.gov.in", + jsonPath: "Properties[0].surveyId", + floatingLabelText: "Survey Id/UID", + hintText: "Enter Survey Id/UID", + numcols: 6, + errorMessage: "PT_PROPERTY_DETAILS_PINCODE_ERRORMSG", + errorStyle: { position: "absolute", bottom: -8, zIndex: 5 }, + // toolTip: true, + //pattern: /^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,64}$/i, + // toolTipMessage: "PT_OLDPID_TOOLTIP_MESSAGE", + maxLength: 64, + }, }, beforeInitForm: (action, store) => { set(action, "form.fields.city.required", false); diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/employeeForgotPasswd.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/employeeForgotPasswd.js index cea313fe403..df5d3086dd7 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/employeeForgotPasswd.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/employeeForgotPasswd.js @@ -9,7 +9,6 @@ const formConfig = { errorMessage: "CORE_COMMON_PHONENO_INVALIDMSG", hintText: "CORE_COMMON_PHONE_NUMBER_PLACEHOLDER", // pattern: "^([0-9]){10}$", - value: "", }, type: { id: "otp-type", @@ -22,7 +21,6 @@ const formConfig = { required: true, floatingLabelText: "CORE_COMMON_CITY", hintText: "CORE_COMMON_CITY_PLACEHOLDER", - value:"" }, userType: { id: "user-type", diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/employeeOTP.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/employeeOTP.js index 89ad5b33e87..d841d55bdfa 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/employeeOTP.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/specs/employeeOTP.js @@ -9,7 +9,6 @@ const formConfig = { errorMessage: "CORE_OTP_ERRORMSG", hintText: "CORE_OTP_PLACEHOLDER", pattern: "^([0-9]){6}$", - value: "", }, newPassword: { id: "employee-forgot-password-new-password", diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/transformers/viewModelToBusinessModelTransformer.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/transformers/viewModelToBusinessModelTransformer.js index 43ce7fff298..429f7e6b778 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/transformers/viewModelToBusinessModelTransformer.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/config/forms/transformers/viewModelToBusinessModelTransformer.js @@ -129,7 +129,6 @@ const transformer = (formKey, form = {}, state = {}) => { const { auth } = state; const username = get(auth, "userInfo.userName"); const type = process.env.REACT_APP_NAME === "Citizen" ? "CITIZEN" : "EMPLOYEE"; - const userInfo = JSON.parse(getUserInfo()); const tenantId = userInfo.tenantId; formData.tenantId = tenantId; diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/App.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/App.js index c57349931fb..80071fff9ae 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/App.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/App.js @@ -1,17 +1,18 @@ -import { CommonShareContainer, LoadingIndicator, Toast } from "components"; -import commonConfig from "config/common"; -import { fetchCurrentLocation, fetchLocalizationLabel, setRoute, toggleSnackbarAndSetText } from "egov-ui-kit/redux/app/actions"; -import { fetchMDMSData } from "egov-ui-kit/redux/common/actions"; -import { addBodyClass } from "egov-ui-kit/utils/commons"; -import { getLocale } from "egov-ui-kit/utils/localStorageUtils"; -import isEmpty from "lodash/isEmpty"; import React, { Component } from "react"; -import { connect } from "react-redux"; import { withRouter } from "react-router"; -import './index.css'; +import { connect } from "react-redux"; +import { Toast } from "components"; +import { addBodyClass } from "egov-ui-kit/utils/commons"; +import { fetchCurrentLocation, fetchLocalizationLabel, toggleSnackbarAndSetText, setRoute } from "egov-ui-kit/redux/app/actions"; +import { fetchMDMSData } from "egov-ui-kit/redux/common/actions"; import Router from "./Router"; +import commonConfig from "config/common"; // import logoMseva from "egov-ui-kit/assets/images/logo-white.png"; import routes from "./Routes"; +import { getLocale } from "egov-ui-kit/utils/localStorageUtils"; +import isEmpty from "lodash/isEmpty"; +import { LoadingIndicator, CommonShareContainer } from "components"; + class App extends Component { constructor(props) { super(props); @@ -79,70 +80,12 @@ class App extends Component { render() { const { toast, loading, defaultUrl, hasLocalisation } = this.props; - let loginScreens = false; - let logginScreensUrls = ['/employee/user/login', '/employee/forgot-password', '/employee/language-selection']; - if (logginScreensUrls.includes(window.location.pathname)) { - loginScreens = true; - } - let sourceUrl = `${window.location.origin}/employee`; - sourceUrl="https://s3.ap-south-1.amazonaws.com/egov-qa-assets"; // changes for the image configured in s3 bucket - - let dashboardScreen = false; - if (window.location.pathname.includes('integration/dss')) { - dashboardScreen = true; - } - - let isFixedFooter=false; - let otherScreensUrls = [] - /* DSS Module fixed footer removed since it is already shown in dashboard app internally - ['/employee/integration/dss/home', '/employee/integration/dss/propertytax','/employee/integration/dss/tradelicense','/employee/integration/dss/overview','/employee/integration/dss/pgr'];*/ - if (otherScreensUrls.includes(window.location.pathname)) { - isFixedFooter = true; - } - const pdfUrl = "https://pg-egov-assets.s3.ap-south-1.amazonaws.com/Upyog+Code+and+Copyright+License_v1.pdf"; - return ( -
-
+
-
{toast && toast.open && !isEmpty(toast.message) && } {loading && } - - {!loginScreens && !dashboardScreen && isFixedFooter&&
- {"Powered { - window.open('https://www.digit.org/', '_blank').focus(); - }}> - | - { window.open('https://niua.in/', '_blank').focus();}} >Copyright © 2022 National Institute of Urban Affairs - | - { window.open(pdfUrl, '_blank').focus();}}>UPYOG License -
} - - {!loginScreens && !dashboardScreen && !isFixedFooter&&
-
- {"Powered { - window.open('https://www.digit.org/', '_blank').focus(); - }}> - | - { window.open('https://niua.in/', '_blank').focus();}} >Copyright © 2022 National Institute of Urban Affairs - | - { window.open(pdfUrl, '_blank').focus();}}>UPYOG License -
-
} - - {loginScreens &&
-
- {"Powered { - window.open('https://www.digit.org/', '_blank').focus(); - }}> - | - { window.open('https://niua.in/', '_blank').focus();}} >Copyright © 2022 National Institute of Urban Affairs - | - { window.open(pdfUrl, '_blank').focus();}}>UPYOG License -
-
}
); } diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/Routes/employee.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/Routes/employee.js index c39a2438f43..7b4624e6cc4 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/Routes/employee.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/Routes/employee.js @@ -13,7 +13,6 @@ import { ImageModalDisplay } from "modules/common"; import { PrivacyPolicy } from "modules/common"; import LandingPage from "modules/employee/LandingPage"; import Inbox from "modules/employee/Inbox"; -import FireNocInbox from "modules/employee/Inbox/inbox"; import MDMS from "modules/common/MDMS"; import Home from "modules/employee/Home"; import Report from "modules/employee/reports/report"; @@ -121,18 +120,6 @@ const routes = [ isHomeScreen: true, }, }, - { - path: "fire-noc/inbox", - component: FireNocInbox, - needsAuthentication: true, - options: { - hideFooter: true, - redirectionUrl, - title: "fire-noc/inbox", - hideTitle: true, - isHomeScreen: true, - }, - }, { path: "image", component: ImageModalDisplay, diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/assests/digit-footer-logo.png b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/assests/digit-footer-logo.png deleted file mode 100644 index f2b52be9e97..00000000000 Binary files a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/assests/digit-footer-logo.png and /dev/null differ diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/assests/powered-footer-logo.png b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/assests/powered-footer-logo.png deleted file mode 100644 index 5d49f577cf4..00000000000 Binary files a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/assests/powered-footer-logo.png and /dev/null differ diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Erp/EGF/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Erp/EGF/index.js index 16e90182800..e4522df0c48 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Erp/EGF/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Erp/EGF/index.js @@ -8,6 +8,7 @@ class EGFFinance extends Component { this.resetIframe = this.resetIframe.bind(this); } onFrameLoad() { + console.log("iframe got loaded"); document.getElementById("erp_iframe").style.display = "block"; } @@ -23,13 +24,11 @@ class EGFFinance extends Component { winheight = window.innerHeight - 100, erp_url, tenantId = getTenantId(); - //Reading domain name from the request url domainurl = hostname.substring(hostname.indexOf(".") + 1); - // Reading environment name (ex: dev, qa, uat, fin-uat etc) from the globalconfigs if exists else reading from the .env file finEnv = this.globalConfigExists() ? window.globalConfigs.getConfig("FIN_ENV") : process.env.REACT_APP_FIN_ENV; - // Preparing finance subdomain url using the above environment name and the domain url subdomainurl = !!(finEnv) ? "-" + finEnv + "." + domainurl : "." + domainurl; erp_url = loc.protocol + "//" + getTenantId().split(".")[1] + subdomainurl + menuUrl; + console.log("ERP URL : " + erp_url); return (
@@ -59,6 +58,7 @@ class EGFFinance extends Component { } onMessage = (event) => { if (event.data != "close") return; + console.log("event recieved from iframe client"); // document.getElementById('erp_iframe').style.display='none'; this.props.history.push("/inbox"); }; diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/Table/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/Table/index.js index e3bc3775e1e..2a7e9e66662 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/Table/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/Table/index.js @@ -30,8 +30,6 @@ import React from "react"; import { connect } from "react-redux"; import "./index.css"; import { getWFConfig } from "./workflowRedirectionConfig"; -import Tooltip from '@material-ui/core/Tooltip'; - const actionsStyles = theme => ({ root: { flexShrink: 0, @@ -175,6 +173,7 @@ class InboxData extends React.Component { }) } } catch (e) { + console.log(e); } } @@ -193,18 +192,6 @@ class InboxData extends React.Component { onHistoryClick = async (moduleNumber) => { const { toggleSnackbarAndSetText, prepareFinalObject } = this.props; const processInstances = await this.getProcessIntanceData(moduleNumber.text); - let exclamationMarkIndex; - if (processInstances && processInstances.length > 0) { - processInstances.map((data, index) => { - if (data.assigner && data.assigner.roles && data.assigner.roles.length > 0) { - data.assigner.roles.map(role => { - if (role.code === "AUTO_ESCALATE") return exclamationMarkIndex = index - 1; - }) - } - }); - if (exclamationMarkIndex) processInstances[exclamationMarkIndex].isExclamationMark = true; - } - if (processInstances && processInstances.length > 0) { await addWflowFileUrl(processInstances, prepareFinalObject); this.setState({ @@ -235,13 +222,8 @@ class InboxData extends React.Component { // } let contextPath = status === "Initiated" ? getWFConfig(row[0].hiddenText, row[0].subtext).INITIATED : getWFConfig(row[0].hiddenText, row[0].subtext).DEFAULT; let queryParams = `applicationNumber=${taskId}&tenantId=${tenantId}`; - if (row[0].subtext === "PT.CREATE" ) { + if (row[0].subtext === "PT.CREATE") { queryParams += '&type=property'; - } else if (row[0].subtext === "PT.UPDATE" ) { - queryParams += '&type=updateProperty'; - } - else if (row[0].subtext === "PT.LEGACY") { - queryParams += '&type=legacy'; } else if (row[0].subtext === "ASMT") { queryParams += '&type=assessment'; @@ -263,10 +245,9 @@ class InboxData extends React.Component { const { wfSlaConfig } = this.state; const MAX_SLA = businessServiceSla[businessService]; if (wfSlaConfig) { - // if ((MAX_SLA - (MAX_SLA * wfSlaConfig[0].slotPercentage / 100) <= sla) && sla <= MAX_SLA) { - if ((MAX_SLA - (MAX_SLA * wfSlaConfig[0].slotPercentage / 100) <= sla)) { + if ((MAX_SLA - (MAX_SLA * eval(wfSlaConfig[0].slotPercentage)) <= sla) && sla <= MAX_SLA) { return wfSlaConfig[0].positiveSlabColor; - } else if (0 < sla && sla < MAX_SLA - (MAX_SLA * wfSlaConfig[0].slotPercentage / 100)) { + } else if (0 < sla && sla < MAX_SLA - (MAX_SLA * eval(wfSlaConfig[0].slotPercentage))) { return wfSlaConfig[0].middleSlabColor; } else { return wfSlaConfig[0].negativeSlabColor; @@ -293,7 +274,7 @@ class InboxData extends React.Component { }; render() { - const { data={rows:[],headers:[]}, ProcessInstances, classes ,remainingDataLoading} = this.props; + const { data={rows:[],headers:[]}, ProcessInstances, classes } = this.props; const { onHistoryClick, onDialogClose, getModuleLink } = this; const { isSorting, sortOrder } = this.state; const { rows, rowsPerPage, page, rowsPerPageOptions } = this.state; @@ -338,7 +319,7 @@ class InboxData extends React.Component { {data.rows.length === 0 ? ( - {!remainingDataLoading&& ) : ( @@ -361,14 +342,7 @@ class InboxData extends React.Component { } else if (item.badge) { return ( -
- {item.text} - {item.isEscalatedApplication ? - - error - - : ""} -
+ {item.text}
); } else if (item.historyButton) { @@ -399,7 +373,7 @@ class InboxData extends React.Component { )} */} - {!remainingDataLoading&& + - } + @@ -429,7 +403,7 @@ class InboxData extends React.Component { )}
{data.rows.length === 0 ? ( - } /> + } /> ) : (
{data.rows.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row, index) => { @@ -464,11 +438,9 @@ class InboxData extends React.Component {
- {row[4].text} + {row[4].text}
- {/*
- error -
*/} +
onHistoryClick(row[0])}> history
@@ -478,7 +450,7 @@ class InboxData extends React.Component { ); })} - {!remainingDataLoading&& +
-
} +
)} diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/Table/workflowRedirectionConfig.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/Table/workflowRedirectionConfig.js index adea22fcf72..3159229e6a3 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/Table/workflowRedirectionConfig.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/Table/workflowRedirectionConfig.js @@ -47,17 +47,7 @@ export const getWFConfig = (module, businessService) => { INITIATED: "/property-tax/application-preview", DEFAULT: "/property-tax/application-preview", }; - }else if (businessService === "PT.UPDATE") { - return { - INITIATED: "/property-tax/application-preview", - DEFAULT: "/property-tax/application-preview", - }; - }else if (businessService === "PT.LEGACY") { - return { - INITIATED: "/property-tax/application-preview", - DEFAULT: "/property-tax/application-preview", - }; - } else { + } else { return { INITIATED: "/pt-mutation/search-preview", DEFAULT: "/pt-mutation/search-preview", diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/TableData/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/TableData/index.js index 97adc52b9cd..4472ccace7c 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/TableData/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/components/TableData/index.js @@ -116,9 +116,8 @@ class TableData extends Component { showFilter: false, value: 0, totalRowCount: 0, - tabData: [{ label: "COMMON_INBOX_TAB_ALL", dynamicArray: [0] } - , { label: "COMMON_INBOX_TAB_ASSIGNED_TO_ME", dynamicArray: [0] }, - { label: "COMMON_INBOX_TAB_ESCALATED", dynamicArray: [0] }], + tabData: [{ label: "COMMON_INBOX_TAB_ASSIGNED_TO_ME", dynamicArray: [0] } + , { label: "COMMON_INBOX_TAB_ALL", dynamicArray: [0] }], taskboardData: [{ head: 0, body: "WF_TOTAL_TASK", color: "rgb(171,211,237)", baseColor: "rgb(53,152,219)" }, { head: 0, body: "WF_TOTAL_NEARING_SLA", color: "rgb(238, 167, 58 ,0.38)", baseColor: "#EEA73A" }, { head: 0, body: "WF_ESCALATED_SLA", color: "rgb(244, 67, 54 ,0.38)", baseColor: "#F44336" }], @@ -131,10 +130,7 @@ class TableData extends Component { color: "rgb(53,152,219)", timeoutForTyping: false, loadLocalityForInitialData: false, - showLoadingTaskboard: false, - loadedRemainingData:false, - loadingLocality:false, - loadedLocality:false + showLoadingTaskboard:false }; getUniqueList = (list = []) => { @@ -215,11 +211,11 @@ class TableData extends Component { let ESCALATED_SLA = []; let NEARING_SLA = []; let totalRows = [] - if (initialInboxData.length === 3) { + if (initialInboxData.length === 2) { initialInboxData.map((row, ind) => { row.rows = row.rows.filter((eachRow) => { let isValid = this.checkRow(eachRow, filter, searchFilter, taskboardLabel); - if (isValid && ind === 0) { + if (isValid && ind === 1) { let MAX_SLA = this.state.businessServiceSla[eachRow[2].text.props.label.split('_')[1]]; if (eachRow[4].text <= 0) { ESCALATED_SLA.push(eachRow[4].text); @@ -239,7 +235,7 @@ class TableData extends Component { }) } - if (initialInboxData.length === 3) { + if (initialInboxData.length === 2) { initialInboxData.map((row, ind) => { row.rows = row.rows.filter((eachRow) => { let isValid = this.checkSLA(taskboardLabel, eachRow); @@ -251,19 +247,16 @@ class TableData extends Component { - let { taskboardData, tabData, showLoadingTaskboard } = this.state; - if (totalRows.length == totalRowCount && showLoadingTaskboard == false) { - - this.setState({ showLoadingTaskboard: true }) - } - taskboardData[0].head = showLoadingTaskboard ? totalRows.length : totalRowCount; - let counts = totalRowCount < 100 ? totalRowCount - 1 : 100; - taskboardData[1].head = totalRows.length > counts || showLoadingTaskboard ? NEARING_SLA.length : 'LOADING'; - taskboardData[2].head = totalRows.length > counts || showLoadingTaskboard ? ESCALATED_SLA.length : 'LOADING'; - tabData[0].dynamicArray = [showLoadingTaskboard ? totalRows.length : totalRowCount]; - tabData[1].dynamicArray = [initialInboxData[1].rows.length]; - tabData[2].dynamicArray = [initialInboxData[2].rows.length]; - + let { taskboardData, tabData , showLoadingTaskboard } = this.state; +if(totalRows.length == totalRowCount && showLoadingTaskboard==false){ + + this.setState({showLoadingTaskboard:true}) +} + taskboardData[0].head = showLoadingTaskboard?totalRows.length: totalRowCount; + taskboardData[1].head = totalRows.length == totalRowCount || showLoadingTaskboard ? NEARING_SLA.length : 'LOADING'; + taskboardData[2].head = totalRows.length == totalRowCount || showLoadingTaskboard ? ESCALATED_SLA.length : 'LOADING'; + tabData[0].dynamicArray = [initialInboxData[0].rows.length]; + tabData[1].dynamicArray = [showLoadingTaskboard?totalRows.length: totalRowCount]; this.hideLoading(); return { inboxData: initialInboxData, @@ -309,40 +302,9 @@ class TableData extends Component { }); } prepareInboxDataRows = async (data, all, loadLocality = false) => { - - // to avoid duplicate applications. - let inboxTotalData = cloneDeep(data); - let flags = [], output = [], l = inboxTotalData.length, i; - for (let i = 0; i < l; i++) { - if (flags[inboxTotalData[i].businessId]) continue; - flags[inboxTotalData[i].businessId] = true; - output.push(inboxTotalData[i]); - } - - const lookup = inboxTotalData.reduce((a, e) => { - a[e.businessId] = ++a[e.businessId] || 0; - return a; - }, {}); - - const duplicateData = inboxTotalData.filter(e => lookup[e.businessId]); - let filteredDuplicateData = []; - if (duplicateData && duplicateData.length > 0) { - filteredDuplicateData = duplicateData.filter(data => data.businessId && data.isEscalatedApplication) - } - - for (let j = 0; j < output.length; j++) { - for (let k = 0; k < filteredDuplicateData.length; k++) { - if (filteredDuplicateData[k].businessId == output[j].businessId) { - output[j] = filteredDuplicateData[k] - } - } - } - data = output; - - const { toggleSnackbarAndSetText } = this.props; const uuid = get(this.props, "userInfo.uuid"); - if (isEmpty(data)) return { allData: [], assignedToMe: [] }; + if (isEmpty(data)) return{ allData: [], assignedToMe: [] }; let businessServices = []; let businessIds = []; let ptApplicationNo = [] @@ -370,29 +332,21 @@ class TableData extends Component { let endpoints = [] let queries = [] uniqueModules.map((uniqueModule, ind) => { - if (uniqueModule == "PT") { - // const acknowledgementIds = [...ptApplicationNo]; - // for (let i = 0; i <= ptApplicationNo.length + 50; i += 50) { - // let acknowledgementId = acknowledgementIds.splice(0, 50); - // if (acknowledgementId && acknowledgementId.length > 0) { - // const query = [{ key: "tenantId", value: getTenantId() }, - // { key: "acknowledgementIds", value: acknowledgementId.join(',') }] - // requestBodies.push(undefined) - // queries.push(query) - // endpoints.push("property-services/property/_search") - // } - // } - - requestBodies.push({ - searchCriteria: { - "referenceNumber": ptApplicationNo - } - }) - queries.push([]) - endpoints.push(`egov-searcher/locality/property-services/_get`) - } else if (uniqueModule == "pt-services" || uniqueModule == "pgr-services" || uniqueModule == "BS"||uniqueModule == "vehicle" ) { - /*Suppress Locality search of modules which ever not found */ - } else { + // if (uniqueModule == "PT") { + // const acknowledgementIds = [...ptApplicationNo]; + // for (let i = 0; i <= ptApplicationNo.length + 50; i += 50) { + // let acknowledgementId = acknowledgementIds.splice(0, 50); + // if (acknowledgementId && acknowledgementId.length > 0) { + // const query = [{ key: "tenantId", value: getTenantId() }, + // { key: "acknowledgementIds", value: acknowledgementId.join(',') }] + // requestBodies.push(undefined) + // queries.push(query) + // endpoints.push("property-services/property/_search") + // } + // } + // } else if (uniqueModule == "pt-services" || uniqueModule == "pgr-services") { + + // } else { requestBodies.push({ searchCriteria: { "referenceNumber": businessIds @@ -400,7 +354,7 @@ class TableData extends Component { }) queries.push([]) endpoints.push(`egov-searcher/locality/${uniqueModule}/_get`) - } + // } }) const resp = await multiHttpRequest(endpoints, "search", queries, requestBodies) @@ -451,6 +405,7 @@ class TableData extends Component { } } catch (e) { + console.log("error"); } } */ } catch (e) { @@ -469,14 +424,14 @@ class TableData extends Component { let statusDropdownList = []; let assignedToMe = []; - let escalatedToMe = []; const initialData = data.map((item) => { const locality = this.state.showLocality && localitymap.find(locality => { return locality.referencenumber === item.businessId; }) var sla = item.businesssServiceSla && item.businesssServiceSla / (1000 * 60 * 60 * 24); let row0 = { text: item.businessId, subtext: item.businessService, hiddenText: item.moduleName }; - let row1 = { text: locality ?
+
@@ -922,15 +810,7 @@ class TableData extends Component { ); })} - - {remainingDataLoading&&
-
-
-
-
-
-
} +
); @@ -938,15 +818,12 @@ class TableData extends Component { } const mapStateToProps = (state) => { - const { screenConfiguration, auth, app } = state; + const { screenConfiguration, auth } = state; const { userInfo } = auth; - const { inboxRemData } = app; - const { loading: remainingDataLoading, loaded: remainingDataLoaded, records: remainingRecords = [] } = inboxRemData || {}; - const { preparedFinalObject } = screenConfiguration; const { InboxData } = preparedFinalObject; - return { InboxData, userInfo, remainingDataLoading, remainingDataLoaded, remainingRecords }; + return { InboxData, userInfo }; }; const mapDispatchToProps = (dispatch) => { diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/inbox.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/inbox.js deleted file mode 100644 index d3965fc53d4..00000000000 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/inbox.js +++ /dev/null @@ -1,219 +0,0 @@ -// import JkInbox from "@jagankumar-egov/react-tour/components/Inbox"; -import Tooltip from '@material-ui/core/Tooltip'; -import commonConfig from "config/common.js"; -import JkInbox from "egov-inbox/components/Inbox"; -import LoadingIndicator from "egov-ui-framework/ui-molecules/LoadingIndicator"; -import MenuButton from "egov-ui-framework/ui-molecules/MenuButton"; -import { setRoute } from "egov-ui-framework/ui-redux/app/actions"; -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { addWflowFileUrl, getLocaleLabels, orderWfProcessInstances, transformById } from "egov-ui-framework/ui-utils/commons"; -import ServiceList from "egov-ui-kit/common/common/ServiceList"; -import { fetchLocalizationLabel, resetFetchRecords } from "egov-ui-kit/redux/app/actions"; -import { httpRequest } from "egov-ui-kit/utils/api"; -import { getLocale, getLocalization, getTenantId } from "egov-ui-kit/utils/localStorageUtils"; -import Label from "egov-ui-kit/utils/translationNode"; -import { TaskDialog } from "egov-workflow/ui-molecules-local"; -import React, { Component } from "react"; -import { connect } from "react-redux"; -import FilterDialog from "./components/FilterDialog"; -import "./index.css"; - -let localizationLabels = transformById( - JSON.parse(getLocalization(`localization_${getLocale()}`)), - "code" -); -class Inbox extends Component { - state = { - dialogOpen: false, - actionList: [], - hasWorkflow: false, - filterPopupOpen: false - }; - constructor(props){ - super(props); - } - componentDidMount = () => { - const { fetchLocalizationLabel } = this.props - const tenantId = getTenantId(); - fetchLocalizationLabel(getLocale(), tenantId, tenantId); - } - componentWillUnmount = () => { - const { resetFetchRecords } = this.props - resetFetchRecords(); - } - onDialogClose = () => { - this.setState({ - dialogOpen: false, - }); - }; - - componentWillReceiveProps(nextProps) { - const { menu } = nextProps; - const workflowList = menu && menu.filter((item) => item.name === "rainmaker-common-workflow"); - if (workflowList && workflowList.length > 0) { - this.setState({ - hasWorkflow: true, - }); - } else { - this.setState({ - hasWorkflow: false, - }); - } - - const list = menu && menu.filter((item) => item.url === "card"); - this.setState({ - actionList: list, - }); - } - - handleClose = () => { - this.setState({ filterPopupOpen: false }); - }; - - onPopupOpen = () => { - this.setState({ filterPopupOpen: true }); - } - getProcessIntanceData = async (pid) => { - const tenantId = getTenantId(); - const queryObject = [ - { key: "businessIds", value: pid }, - { key: "history", value: true }, - { key: "tenantId", value: tenantId }, - ]; - const payload = await httpRequest("egov-workflow-v2/egov-wf/process/_search?", "", queryObject); - const processInstances = payload && payload.ProcessInstances.length > 0 && orderWfProcessInstances(payload.ProcessInstances); - return processInstances; - }; - - onHistoryClick = async (moduleNumber) => { - const { prepareFinalObject } = this.props; - const processInstances = await this.getProcessIntanceData(moduleNumber); - let exclamationMarkIndex; - if (processInstances && processInstances.length > 0) { - processInstances.map((data, index) => { - if (data.assigner && data.assigner.roles && data.assigner.roles.length > 0) { - data.assigner.roles.map(role => { - if (role.code === "AUTO_ESCALATE") return exclamationMarkIndex = index - 1; - }) - } - }); - if (exclamationMarkIndex) processInstances[exclamationMarkIndex].isExclamationMark = true; - } - if (processInstances && processInstances.length > 0) { - await addWflowFileUrl(processInstances, prepareFinalObject); - this.setState({ - dialogOpen: true, - }); - } else { - console.error("ERROR") - } - }; - - - render() { - const { name, history, setRoute, menu, Loading, inboxLoading, inbox, loaded, mdmsGetLoading, errorMessage = "", error = false, ProcessInstances } = this.props; - const { hasWorkflow } = this.state; - const a = menu ? menu.filter(item => item.url === "quickAction") : []; - const downloadMenu = a.map((obj, index) => { - return { - labelName: obj.displayName, - labelKey: `ACTION_TEST_${obj.displayName.toUpperCase().replace(/[._:-\s\/]/g, "_")}`, - link: () => { - if (obj.navigationURL === "tradelicence/apply") { - this.props.setRequiredDocumentFlag(); - } - if (obj.navigationURL && obj.navigationURL.includes('digit-ui')) { - window.location.href = obj.navigationURL; - return; - } else { - setRoute(obj.navigationURL) - } - } - } - }) - const { isLoading } = Loading; - const buttonItems = { - label: { labelName: "Take Action", labelKey: "INBOX_QUICK_ACTION" }, - rightIcon: "arrow_drop_down", - props: { variant: "outlined", style: { marginLeft: 5, marginRight: 15, marginTop: 10, backgroundColor: "#FE7A51", color: "#fff", border: "none", height: "40px", width: "200px" } }, - menu: downloadMenu - } - let user = { ...JSON.parse(localStorage.getItem("user-info")), auth: localStorage.getItem("token") }; - return ( -
-
- {mdmsGetLoading && } -
-
- {/*
- -
*/} -
- {/*
- -
*/} - {hasWorkflow && inboxLoading &&
-
-
-
-
-
-
} - {!hasWorkflow && !mdmsGetLoading && errorMessage != "" && error &&
-
-
-
} - - {hasWorkflow && { - return getLocaleLabels("", key, localizationLabels); - }} - historyComp={
{ }} style={{ cursor: "pointer" }}> - history -
} - esclatedComp={ - error - } - > - -
} - {/* {hasWorkflow && !inboxLoading && loaded && } */} - - -
- ); - } -} - -const mapStateToProps = (state) => { - const { auth, app, screenConfiguration } = state; - const { menu, inbox, actionMenuFetch } = app; - const { loading: inboxLoading, loaded } = inbox || { }; - const { userInfo } = auth; - const name = auth && userInfo.name; - const { preparedFinalObject } = screenConfiguration; - const { Loading = { }, workflow } = preparedFinalObject; - const { isLoading } = Loading; - const { ProcessInstances } = workflow || []; - const { loading: mdmsGetLoading = false, errorMessage = "", error } = actionMenuFetch; - return { name, menu, Loading, isLoading, inboxLoading, inbox, loaded, mdmsGetLoading, errorMessage, error, ProcessInstances }; -}; - -const mapDispatchToProps = (dispatch) => { - return { - setRoute: url => dispatch(setRoute(url)), - fetchLocalizationLabel: (locale, tenantId, module) => dispatch(fetchLocalizationLabel(locale, tenantId, module)), - setRequiredDocumentFlag: () => dispatch(prepareFinalObject("isRequiredDocuments", true)), - resetFetchRecords: () => dispatch(resetFetchRecords()), - prepareFinalObject: (path, value) => dispatch(prepareFinalObject(path, value)), - }; -} - -export default connect( - mapStateToProps, mapDispatchToProps -)(Inbox); diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/index.js index 0289df47a11..5a4a315defe 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/index.js @@ -1,53 +1,30 @@ -// import JkInbox from "@jagankumar-egov/react-tour/components/Inbox"; -import Tooltip from '@material-ui/core/Tooltip'; -import commonConfig from "config/common.js"; -import JkInbox from "egov-inbox/components/Inbox"; import LoadingIndicator from "egov-ui-framework/ui-molecules/LoadingIndicator"; import MenuButton from "egov-ui-framework/ui-molecules/MenuButton"; import { setRoute } from "egov-ui-framework/ui-redux/app/actions"; import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { addWflowFileUrl, getLocaleLabels, orderWfProcessInstances, transformById } from "egov-ui-framework/ui-utils/commons"; import ServiceList from "egov-ui-kit/common/common/ServiceList"; -import { fetchLocalizationLabel, resetFetchRecords } from "egov-ui-kit/redux/app/actions"; -import { httpRequest } from "egov-ui-kit/utils/api"; -import { getLocale, getLocalization, getTenantId } from "egov-ui-kit/utils/localStorageUtils"; +import { fetchLocalizationLabel } from "egov-ui-kit/redux/app/actions"; +import { getLocale, getTenantId } from "egov-ui-kit/utils/localStorageUtils"; import Label from "egov-ui-kit/utils/translationNode"; -import { TaskDialog } from "egov-workflow/ui-molecules-local"; import React, { Component } from "react"; import { connect } from "react-redux"; import FilterDialog from "./components/FilterDialog"; +import TableData from "./components/TableData"; import "./index.css"; -let localizationLabels = transformById( - JSON.parse(getLocalization(`localization_${getLocale()}`)), - "code" -); class Inbox extends Component { state = { - dialogOpen: false, actionList: [], hasWorkflow: false, filterPopupOpen: false }; - constructor(props){ - super(props); - /* RAIN-7250 Always Navigate to new UI Incase user clicks on Home */ - window.location.href="/digit-ui/employee"; - } + componentDidMount = () => { const { fetchLocalizationLabel } = this.props const tenantId = getTenantId(); fetchLocalizationLabel(getLocale(), tenantId, tenantId); } - componentWillUnmount = () => { - const { resetFetchRecords } = this.props - resetFetchRecords(); - } - onDialogClose = () => { - this.setState({ - dialogOpen: false, - }); - }; + componentWillReceiveProps(nextProps) { const { menu } = nextProps; @@ -75,45 +52,9 @@ class Inbox extends Component { onPopupOpen = () => { this.setState({ filterPopupOpen: true }); } - getProcessIntanceData = async (pid) => { - const tenantId = getTenantId(); - const queryObject = [ - { key: "businessIds", value: pid }, - { key: "history", value: true }, - { key: "tenantId", value: tenantId }, - ]; - const payload = await httpRequest("egov-workflow-v2/egov-wf/process/_search?", "", queryObject); - const processInstances = payload && payload.ProcessInstances.length > 0 && orderWfProcessInstances(payload.ProcessInstances); - return processInstances; - }; - - onHistoryClick = async (moduleNumber) => { - const { prepareFinalObject } = this.props; - const processInstances = await this.getProcessIntanceData(moduleNumber); - let exclamationMarkIndex; - if (processInstances && processInstances.length > 0) { - processInstances.map((data, index) => { - if (data.assigner && data.assigner.roles && data.assigner.roles.length > 0) { - data.assigner.roles.map(role => { - if (role.code === "AUTO_ESCALATE") return exclamationMarkIndex = index - 1; - }) - } - }); - if (exclamationMarkIndex) processInstances[exclamationMarkIndex].isExclamationMark = true; - } - if (processInstances && processInstances.length > 0) { - await addWflowFileUrl(processInstances, prepareFinalObject); - this.setState({ - dialogOpen: true, - }); - } else { - console.error("ERROR") - } - }; - render() { - const { name, history, setRoute, menu, Loading, inboxLoading, inbox, loaded, mdmsGetLoading, errorMessage = "", error = false, ProcessInstances } = this.props; + const { name, history, setRoute, menu, Loading } = this.props; const { hasWorkflow } = this.state; const a = menu ? menu.filter(item => item.url === "quickAction") : []; const downloadMenu = a.map((obj, index) => { @@ -140,11 +81,11 @@ class Inbox extends Component { props: { variant: "outlined", style: { marginLeft: 5, marginRight: 15, marginTop: 10, backgroundColor: "#FE7A51", color: "#fff", border: "none", height: "40px", width: "200px" } }, menu: downloadMenu } - let user = { ...JSON.parse(localStorage.getItem("user-info")), auth: localStorage.getItem("token") }; + return (
- {mdmsGetLoading && } + {Loading && isLoading && }
); } @@ -194,25 +107,20 @@ class Inbox extends Component { const mapStateToProps = (state) => { const { auth, app, screenConfiguration } = state; - const { menu, inbox, actionMenuFetch } = app; - const { loading: inboxLoading, loaded } = inbox || { }; + const { menu } = app; const { userInfo } = auth; const name = auth && userInfo.name; const { preparedFinalObject } = screenConfiguration; - const { Loading = { }, workflow } = preparedFinalObject; + const { Loading = {} } = preparedFinalObject; const { isLoading } = Loading; - const { ProcessInstances } = workflow || []; - const { loading: mdmsGetLoading = false, errorMessage = "", error } = actionMenuFetch; - return { name, menu, Loading, isLoading, inboxLoading, inbox, loaded, mdmsGetLoading, errorMessage, error, ProcessInstances }; + return { name, menu, Loading, isLoading }; }; const mapDispatchToProps = (dispatch) => { return { setRoute: url => dispatch(setRoute(url)), fetchLocalizationLabel: (locale, tenantId, module) => dispatch(fetchLocalizationLabel(locale, tenantId, module)), - setRequiredDocumentFlag: () => dispatch(prepareFinalObject("isRequiredDocuments", true)), - resetFetchRecords: () => dispatch(resetFetchRecords()), - prepareFinalObject: (path, value) => dispatch(prepareFinalObject(path, value)), + setRequiredDocumentFlag: () => dispatch(prepareFinalObject("isRequiredDocuments", true)) }; } diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/index.scss b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/index.scss index 28f712d2929..0320feec0b7 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/index.scss +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/Inbox/index.scss @@ -36,328 +36,4 @@ .inbox-service-list{ margin: 16px 5px 0px 11px; } - .jk-spinner-wrapper{ - width: 100%; - display: flex; - justify-content: center; - z-index: 100; - } - - .jk-inbox-loader { - border: 0.4em solid rgb(254, 122, 81); - border-radius: 50%; - border-top: 0.4em solid #FFFFFF; - width: 4em; - height: 4em; - -webkit-animation: spin 2s linear infinite; /* Safari */ - animation: spin 1s linear infinite; - } - .jk-sm-inbox-loader { - border: 0.2em solid rgb(254, 122, 81); - border-radius: 50%; - border-top: 0.2em solid #FFFFFF; - width: 2em; - height: 2em; - -webkit-animation: spin 2s linear infinite; /* Safari */ - animation: spin 1s linear infinite; - } - - /* Safari */ - @-webkit-keyframes spin { - 0% { -webkit-transform: rotate(0deg); } - 100% { -webkit-transform: rotate(360deg); } - } - - @keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } - } - .inbox-card { - padding: 15px; - } - - .inbox-card .head { - text-align: center; - font-size: 25px; - color: rgba(0, 0, 0, 0.87); - font-weight: 700; - letter-spacing: 1.88px; - /* .rainmaker-card { - .rainmaker-card { - -webkit-box-shadow: none !important; - box-shadow: none !important; - } */ - /* line-height: 54px; */ - } - - .inbox-card .body { - color: rgba(0, 0, 0, 0.6); - // font-size: 16px; - font-weight: 400; - letter-spacing: 0.67px; - line-height: 10px; - text-align: center; - padding-top: 3px; - } - .rainmaker-card { - .rainmaker-card { - -webkit-box-shadow: none !important; - box-shadow: none !important; - } - } - .inbox-data-table-headcell { - color: rgba(0, 0, 0, 0.87) !important; - font-size: 14px !important; - font-weight: 500; - line-height: 17px; - border-bottom: none !important; - padding: 0px 0px 0px 10px !important; - text-align: left !important; - padding-right: 24px !important; - } - - .inbox-data-table-bodycell { - color: rgba(0, 0, 0, 0.87) !important; - font-size: 14px !important; - font-weight: 400; - line-height: 17px; - word-break: break-word; - // border-bottom: 10px solid #f4f7fb !important; - margin-bottom: 10px !important; - padding-right: 0px !important; - padding-left: 10px !important; - text-align: left !important; - } - - .inbox-data-table-bodyrow { - background-color: white !important; - margin-bottom: 10px !important; - } - - .inbox-cell-text { - color: rgba(0, 0, 0, 0.87); - font-size: 14px; - font-weight: 400; - line-height: 17px; - padding-bottom: 5px; - cursor: pointer; - } - - .inbox-cell-subtext { - color: rgba(0, 0, 0, 0.6); - font-size: 14px; - font-weight: 400; - line-height: 17px; - } - - .inbox-cell-badge-primary { - padding-left: 25px; - padding-right: 25px; - padding-top: 5px; - padding-bottom: 5px; - border-radius: 14px; - color: #ffffff; - font-size: 14px; - font-weight: 400; - letter-spacing: 0.58px; - line-height: 17px; - } - - .sla-positive-value { - background-color: #4CAF50; - } - .sla-negative-value { - background-color: #F44336; - } - - .sla-middle-value { - background-color: #EEA73A; - } - - .inbox-taskboard { - display: flex; - margin-left: -5px; - margin-right: -5px; - margin-bottom: 10px; - } - - - .inbox-worklist-card:hover{ - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - cursor : pointer; - - } - .inbox-worklist-card-hover-0:hover{ - border-top: 5px solid #6b98ca; - } - - .inbox-worklist-card-hover-1:hover{ - border-top: 5px solid #daa034; - } - - .inbox-worklist-card-hover-2:hover{ - border-top: 5px solid #F44336; - } - - .inbox-worklist-card { - -webkit-box-shadow: none !important; - box-shadow: none !important; - flex: 33%; - margin: 5px; - height:6em; - align-items: center; - justify-content: center; - /* .rainmaker-card { - -webkit-box-shadow: none !important; - box-shadow: none !important; - - } */ - } - .inbox-module-card { - width: 100%; - cursor: pointer; - padding: 0; - margin: 5px; - max-width: 300px; - } - - .inbox-card-top:hover { - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.24), 0 0 2px 0 rgba(0, 0, 0, 0.12); - } - - .inbox-module-container { - display: flex; - padding: 0px 30px; - } - - .inbox-taskboard-subtext { - text-align: center; - } - - .rainmaker-topHeader { - display: flex; - padding-left: 10px; - } - - .inbox-filter { - position: absolute; - right: 0; - top: 5px; - } - - @media only screen and (max-width: 768px) { - .rainmaker-topHeader { - padding-top: 60px; - } - // .inbox-module-card { - // width: 100%; - // cursor: pointer; - // padding: 0; - // margin: 5px; - // } - .inbox-module-container { - display: flex; - padding: 0px 15px 0px 15px; - } - .inbox-tabs-container { - display: flex 1; - } - .inbox-tab { - flex: 50%; - } - .inbox-data-table-headcell-0, - .inbox-data-table-headcell-1, - .inbox-data-table-headcell-2, - .inbox-data-table-headcell-3, - .inbox-data-table-headcell-4, - .inbox-data-table-headcell-5 { - display: none !important; - } - .inbox-data-table-bodycell-0, - .inbox-data-table-bodycell-1, - .inbox-data-table-bodycell-2, - .inbox-data-table-bodycell-3, - .inbox-data-table-bodycell-4, - .inbox-data-table-bodycell-5 { - display: block !important; - width: 100% !important; - } - .inbox-card-top { - height: 148px; - } - .inbox-card-top-label { - line-height: 20px; - margin-top: -10px; - font-size: 3vw; - } - .inbox-worklist-card { - height: auto; - font-size: 3vw; - } - .inbox-filter { - position: relative; - padding: 10px; - top: 0px; - } - .sort-btn-mob{ - //margin-left: 90%; - flex-direction: row; - - } - .sort-icon{ - //margin-left: 70%; - flex-direction: row; - - } - .sort-icon-flex{ - display: flex; - justify-content: flex-end; - } - } - - .arrow-icon-style { - display: flex; - padding: 0; - margin: 0; - height: 20px; - cursor: pointer; - } - - .arrow-icon-style > svg{ - margin-top : 3px - } - - .arrow-icon-container { - position: absolute; - top: 60px; - right: 60px; - } - - .card-div-style { - display: inline-block; - width: 50%; - } - - .card-viewHistory-icon { - cursor: pointer; - width: 10%; - vertical-align: middle; - display: inline-block; - } - .card-sladiv-style { - display: inline-block; - width: 40%; - } - - - - .inbox-table-pagination-sm td div{ - margin: 0px!important; - } - .inbox-table-pagination-sm td div button{ - width: 30px!important; - } - .inbox-table-pagination-sm td div div div{ - margin: 0px!important; - } \ No newline at end of file diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/PushLocalization/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/PushLocalization/index.js index ad44d656564..57c3dd7e4ec 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/PushLocalization/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/PushLocalization/index.js @@ -76,6 +76,7 @@ class PushLocalization extends Component { } catch (e) { + console.log(e.message) } } else { toggleSnackbarAndSetText( diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/User/ForgotPassword/components/ForgotPasswd/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/User/ForgotPassword/components/ForgotPasswd/index.js index 549518b05f8..a17a7fbd054 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/User/ForgotPassword/components/ForgotPasswd/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/User/ForgotPassword/components/ForgotPasswd/index.js @@ -3,10 +3,11 @@ import { Card, TextField, Image } from "components"; import { Button} from "egov-ui-framework/ui-atoms"; import Label from "egov-ui-kit/utils/translationNode"; import logo from "egov-ui-kit/assets/images/logo_black.png"; +import logone from "egov-ui-kit/assets/images/pmidclogo.png"; import "./index.css"; import { CityPicker } from "modules/common"; -const ForgotPasswd = ({ form, handleFieldChange,logoUrl }) => { +const ForgotPasswd = ({ form, handleFieldChange }) => { const fields = form.fields || {}; const submit = form.submit; @@ -15,17 +16,22 @@ const ForgotPasswd = ({ form, handleFieldChange,logoUrl }) => { className="user-screens-card forgot-passwd-card col-lg-offset-4 col-lg-4 col-md-offset-4 col-md-4" textChildren={
-
-
- +
+
+
-
+
+
+
+ +
+
-
-
- +
+
+
-
+
+
+
+ +
+ +
-
-
- +
+
+
-
+
diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/commons/common.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/commons/common.js index a40aad381d4..dd1ea5d4984 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/commons/common.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/commons/common.js @@ -3,6 +3,7 @@ export function translate(locale_text) { // var langresult = JSON.parse(localStorageGet(`localization_${getLocale()}`)).filter(function(obj) { // return obj.code == locale_text; // }); + // console.log(langresult); // if (langresult[0]) return Object.values(langresult[0])[1]; // else return localStorage.locale == 'mr_IN' ? localization_MR_Data[locale_text] || locale_text : localization_EN_Data[locale_text] || locale_text; // } @@ -24,6 +25,7 @@ export function validate_fileupload(files, formats) { if (filename.length <= 30) { if (formats.indexOf(fileext) >= 0 || !formats || formats.length === 0) { if (filesize <= filelimit) { + //console.log('file size validation success'); } else { return "File size exceeds 5MB"; } diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/commons/url.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/commons/url.js index 5b098030ef0..19c93336f66 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/commons/url.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/commons/url.js @@ -11,12 +11,12 @@ // }; export const getResultUrl = (moduleName,reportName) => { - let reportResultUrl = `/report/${moduleName}/${reportName}/_get`; + let reportResultUrl = `/report/${moduleName}/_get`; return reportResultUrl; } export const getMetaDataUrl = (moduleName,reportName) => { - let metaDataUrl = `/report/${moduleName}/${reportName}/metadata/_get`; + let metaDataUrl = `/report/${moduleName}/metadata/_get`; return metaDataUrl; }; diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/components/boundary/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/components/boundary/index.js index 4615e5132fe..0b7c7f973f6 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/components/boundary/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/components/boundary/index.js @@ -62,6 +62,7 @@ class UiBoundary extends Component { boundaryData = JSON.parse(boundaryData); } catch (error) { boundaryData = []; + console.log(error); } } else { const queryObj = [ diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/index.scss b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/index.scss index 555c1d98fc6..f4b0538379e 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/index.scss +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/index.scss @@ -109,16 +109,5 @@ @media only screen and (max-width: 704px) { #reportTable_wrapper { overflow: scroll; - .col-xs-12 .text-center{ - position: unset; - } } } - - -.dt-button-collection{ - margin-top: 2% !important; - display: flex!important; - flex-direction: row-reverse!important; - width: 100%!important; -} diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/report.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/report.js index 065b7a4589a..380b79ebb8f 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/report.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/report.js @@ -2,13 +2,12 @@ import React, { Component } from "react"; import { connect } from "react-redux"; import { commonApiPost } from "egov-ui-kit/utils/api"; import SearchForm from "./searchForm"; -import ReportResult from "egov-ui-kit/utils/reportResult"; +import ReportResult from "./reportResult"; import { getMetaDataUrl } from "./commons/url"; import commonConfig from "config/common.js"; import { Screen } from "modules/common"; import { getTenantId, setReturnUrl, localStorageGet } from "egov-ui-kit/utils/localStorageUtils"; -import { toggleSnackbarAndSetText } from "egov-ui-kit/redux/app/actions"; -import { getTransformedLocale } from "egov-ui-framework/ui-utils/commons"; + class Report extends Component { constructor(props) { super(props); @@ -36,32 +35,21 @@ class Report extends Component { } } - setError = (err) => { - err && - err.message && - this.props.toggleSnackbarAndSetText( - true, - { labelName: getTransformedLocale(err.message), labelKey: getTransformedLocale(err.message) }, - "error" - ); - }; - initData = (moduleName, reportName) => { let { setMetaData, setFlag, showTable, setReportResult } = this.props; var tenantId = getTenantId() ? getTenantId() : commonConfig.tenantId; - let urlBase = getMetaDataUrl(moduleName, reportName); - const { setError } = this; + let urlBase = getMetaDataUrl(moduleName,reportName); urlBase && - commonApiPost(urlBase, {}, { tenantId: tenantId, reportName: reportName }).then( - function (response) { + commonApiPost(urlBase, {}, { tenantId: tenantId, reportName: reportName}).then( + function(response) { if (response && response.reportDetails) response.reportDetails.reportName = reportName; //temp soln for custom report name setFlag(1); showTable(false); setReportResult({}); setMetaData(response); }, - function (err) { - setError(err ? err : "Try again later"); + function(err) { + alert("Try again later"); } ); }; @@ -107,7 +95,6 @@ const mapDispatchToProps = (dispatch) => ({ setLoadingStatus: (loadingStatus) => { dispatch({ type: "SET_LOADING_STATUS", loadingStatus }); }, - toggleSnackbarAndSetText: (open, message, error) => dispatch(toggleSnackbarAndSetText(open, message, error)), toggleDailogAndSetText: (dailogState, msg) => { dispatch({ type: "TOGGLE_DAILOG_AND_SET_TEXT", dailogState, msg }); }, @@ -130,4 +117,7 @@ const mapDispatchToProps = (dispatch) => ({ }); }, }); -export default connect(mapStateToProps, mapDispatchToProps)(Report); +export default connect( + mapStateToProps, + mapDispatchToProps +)(Report); diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/reportResult.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/reportResult.js index b48c520b402..9a1d7be5e64 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/reportResult.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/reportResult.js @@ -5,26 +5,25 @@ import { commonApiPost } from "egov-ui-kit/utils/api"; import { translate } from "./commons/common"; import $ from "jquery"; import _ from "lodash"; -// import "datatables-buttons"; -// import "datatables"; -// import "datatables.net"; -// import "datatables.net-buttons"; -// import "datatables.net-dt"; -// import "datatables.net-buttons-bs"; -// import "datatables.net-responsive"; -// import "datatables.net-responsive-dt"; +import "datatables-buttons"; +import "datatables"; +import "datatables.net"; +import "datatables.net-buttons"; +import "datatables.net-dt"; +import "datatables.net-buttons-bs"; +import "datatables.net-responsive"; +import "datatables.net-responsive-dt"; import JSZip from "jszip/dist/jszip"; import get from "lodash/get"; import pdfMake from "pdfmake/build/pdfmake"; import pdfFonts from "pdfmake/build/vfs_fonts"; -// import "datatables.net-buttons/js/buttons.html5.js"; // HTML 5 file export -// import "datatables.net-buttons/js/buttons.flash.js"; // Flash file export -// import "datatables.net-buttons/js/buttons.colVis.min.js"; +import "datatables.net-buttons/js/buttons.html5.js"; // HTML 5 file export +import "datatables.net-buttons/js/buttons.flash.js"; // Flash file export +import "datatables.net-buttons/js/buttons.colVis.min.js"; import { getResultUrl } from "./commons/url"; import Label from "egov-ui-kit/utils/translationNode"; import commonConfig from "config/common.js"; import { getTenantId, setReturnUrl, localStorageSet } from "egov-ui-kit/utils/localStorageUtils"; -import { getLocaleLabels ,getTransformedLocale } from "egov-ui-framework/ui-utils/commons"; import "./index.css"; pdfMake.vfs = pdfFonts.pdfMake.vfs; @@ -33,17 +32,6 @@ window.JSZip = JSZip; var sumColumn = []; var footerexist = false; let rTable; - -const formatLocaleKeys=(key="")=>{ -if(typeof key!='string'){ - return key; -} -key=key.trim&&key.trim()||key; -key=key.toUpperCase&&key.toUpperCase()||key; -key=key.replace(/[.:-\s\/]/g, "_")||key; -return key; -} - class ShowField extends Component { constructor(props) { super(props); @@ -100,36 +88,36 @@ class ShowField extends Component { const { tabLabel, metaData } = _this.props; const reportDetails = metaData.hasOwnProperty("reportDetails") ? metaData.reportDetails : {}; - const additionalConfig = reportDetails.hasOwnProperty("additionalConfig") && reportDetails.additionalConfig ? reportDetails.additionalConfig : {}; + const additionalConfig = reportDetails.hasOwnProperty("additionalConfig") && reportDetails.additionalConfig ? reportDetails.additionalConfig: {}; const reportHeader = reportDetails.hasOwnProperty("reportHeader") ? reportDetails.reportHeader : []; - const pageSize = (additionalConfig.print && additionalConfig.print.pdfPageSize) ? additionalConfig.print.pdfPageSize : "LEGAL" + const pageSize = (additionalConfig.print && additionalConfig.print.pdfPageSize)? additionalConfig.print.pdfPageSize: "LEGAL" let reportTitle = this.getReportTitle(); let xlsTitle = this.getXlsReportTitle(); let orientation = reportHeader.length > 6 ? "landscape" : "portrait"; const buttons = [ { - text: `${getLocaleLabels("RT_DOWNLOAD_AS","RT_DOWNLOAD_AS")}`, + text: "Download as : ", className: "report-download-button-text", }, { extend: "pdf", filename: _this.state.reportName, messageTop: tabLabel, - text: getLocaleLabels("RT_DOWNLOAD_PDF","RT_DOWNLOAD_PDF"), + text: "PDF", orientation: orientation, pageSize: pageSize, footer: true, - customize: function (doc) { + customize: function(doc) { doc.content[0].text = []; - doc.content[0].text.push({ text: `${getLocaleLabels("RT_HEADER","RT_HEADER")}\n\n`, bold: true, fontSize: 20 }); + doc.content[0].text.push({ text: "mSeva System Reports\n\n", bold: true, fontSize: 20 }); doc.content[0].text.push({ text: reportTitle, fontSize: 18 }); }, className: "report-pdf-button", }, { extend: "excel", - text: getLocaleLabels("RT_DOWNLOAD_XLS","RT_DOWNLOAD_XLS"), + text: "XLS", filename: _this.state.reportName, title: xlsTitle, messageTop: tabLabel, @@ -174,12 +162,12 @@ class ShowField extends Component { scrollY: 400, aLengthMenu: [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]], scrollX: true, - fnInitComplete: function () { + fnInitComplete: function() { this.css("visibility", "visible"); $(".dataTables_scrollBody thead tr").css({ visibility: "collapse" }); }, - drawCallback: function (settings) { + drawCallback: function(settings) { $(".dataTables_scrollBody thead tr").css({ visibility: "collapse" }); }, ...tableConfig, @@ -236,7 +224,7 @@ class ShowField extends Component { searchParams, } ).then( - function (response) { + function(response) { if (response.viewPath && response.reportData && response.reportData[0]) { localStorage.reportData = JSON.stringify(response.reportData); setReturnUrl(window.location.hash.split("#/")[1]); @@ -261,7 +249,8 @@ class ShowField extends Component { setFlag(1); } }, - function (err) { + function(err) { + console.log(err); } ); } else if (object.defaultValue && object.defaultValue.search("_url") > -1) { @@ -316,31 +305,8 @@ class ShowField extends Component { (reportResult.reportHeader[i].type == "currency" || reportResult.reportHeader[i].total) ) { return this.addCommas(Number(val) % 1 === 0 ? Number(val) : Number(val).toFixed(2)); - } - else if (val && reportResult && - reportResult.reportHeader && - reportResult.reportHeader.length && - reportResult.reportHeader[i] && - reportResult.reportHeader[i].isLocalisationRequired && reportResult.reportHeader[i].localisationPrefix) { - - if(reportResult.reportHeader[i].localisationPrefix=='ACCESSCONTROL_ROLES_ROLES_'){ - let list=val&&val.split(','); - return list.map(v1=>(
-
- +
, @@ -51,7 +47,7 @@ class ShowForm extends Component { if (fromDateIndex !== undefined) searchParams[fromDateIndex].maxValue = new Date(); if (toDateIndex !== undefined) { searchParams[toDateIndex].minValue = undefined; - searchParams[toDateIndex].maxValue = new Date(); + searchParams[toDateIndex].maxValue = undefined; } setSearchParams(searchParams); } @@ -192,7 +188,9 @@ class ShowForm extends Component { let endDate = this.props.searchForm.toDate; this.props.handleChange(e, name, required, pattern); this.validateDate(startDate, endDate, required, "fromDate"); //3rd param to denote whether field fails - } catch (e) {} + } catch (e) { + console.log(e); + } } else { this.props.handleChange(e, name, required, pattern); } @@ -203,7 +201,9 @@ class ShowForm extends Component { let startDate = this.props.searchForm.fromDate; this.props.handleChange(e, name, required, pattern); this.validateDate(startDate, endDate, required, "toDate"); //3rd param to denote whether field fails - } catch (e) {} + } catch (e) { + console.log(e); + } } } }; @@ -239,7 +239,7 @@ class ShowForm extends Component { // set the value here, introduce the disabled handleFormFields = () => { - let { metaData, searchForm, labels } = this.props; + let { metaData, searchForm ,labels} = this.props; if (!_.isEmpty(metaData) && metaData.reportDetails && metaData.reportDetails.searchParams && metaData.reportDetails.searchParams.length > 0) { return metaData.reportDetails.searchParams.map((item, index) => { item["value"] = !_.isEmpty(searchForm) ? (searchForm[item.name] ? searchForm[item.name] : "") : ""; @@ -248,8 +248,6 @@ class ShowForm extends Component { item.maxValue = this.toDateObj(item.maxValue); } else if (item.type === "epoch" && item.name == "fromDate" && item.maxValue === null) { item.maxValue = new Date(); - } else if (item.type === "epoch" && item.name == "toDate" && item.maxValue === null) { - item.maxValue = new Date(); } if (item.type === "singlevaluelist") { item["searchText"] = !_.isEmpty(searchForm) ? (searchForm[item.name] ? searchForm[item.name] : "") : ""; @@ -263,7 +261,7 @@ class ShowForm extends Component { dateField={this.state.datefield} dateError={this.state.dateError} handler={this.handleChange} - localizationLabels={labels} + localizationLabels = {labels} /> ) ); @@ -349,58 +347,41 @@ class ShowForm extends Component { metaData.reportDetails.searchParams.filter((field) => field.displayOnly).map((field) => field.name) ); }; - setError = (err) => { - err && - err.message && - this.props.toggleSnackbarAndSetText( - true, - { labelName: getTransformedLocale(err.message), labelKey: getTransformedLocale(err.message) }, - "error" - ); - }; - defautSearch = (e = null, isDrilldown = false, rptName, moduleName) => { if (e) { e.preventDefault(); } - let { showTable, changeButtonText, setReportResult, setFlag, pushReportHistory, clearReportHistory } = this.props; + let { + showTable, + changeButtonText, + setReportResult, + setFlag, + pushReportHistory, + clearReportHistory + } = this.props; let today = new Date(); let date = today.getDate() + "/" + (today.getMonth() + 1) + "/" + today.getFullYear(); let tabLabel = `Showing data upto : ${date}`; this.props.updateTabLabel(tabLabel); - const { setError } = this; var tenantId = getTenantId() ? getTenantId() : commonConfig.tenantId; let self = this; if (!isDrilldown) { let searchParams = []; clearReportHistory(); - let resulturl = getResultUrl(moduleName, rptName); - resulturl && + let resulturl = getResultUrl(moduleName,rptName); + resulturl && commonApiPost(resulturl, {}, { tenantId: tenantId, reportName: rptName || this.state.reportName, searchParams }).then( - function (response) { - if (response && response.reportHeader && response.reportData) { - let hiddenRows = []; - response.reportHeader.map((e, i) => { - if (!e.showColumn) { - hiddenRows.push(i); - } - }); - response.reportHeader = response.reportHeader.filter((e) => e.showColumn); - response.reportData = response.reportData.map((ele) => - ele.filter((e, i) => !hiddenRows.includes(i)).map((ele) => (ele == null ? "" : ele)) - ); - } + function(response) { pushReportHistory({ tenantId: tenantId, reportName: self.state.reportName, searchParams }); setReportResult(response); showTable(true); setFlag(1); }, - function (err) { + function(err) { showTable(false); - setError(err); - // alert(err); + alert("Something went wrong or try again later"); } ); } @@ -411,7 +392,7 @@ class ShowForm extends Component { if (e) { e.preventDefault(); } - const { setError } = this; + let { showTable, changeButtonText, @@ -424,33 +405,27 @@ class ShowForm extends Component { pushReportHistory, clearReportHistory, decreaseReportIndex, - toggleSnackbarAndSetText, - hideSpinner, - showSpinner, + toggleSnackbarAndSetText } = this.props; let searchParams = []; var tenantId = getTenantId() ? getTenantId() : commonConfig.tenantId; let self = this; - let mandatoryfields = []; - metaData.reportDetails.searchParams.forEach((param) => { - if (param.isMandatory) { + let mandatoryfields=[] + metaData.reportDetails.searchParams.forEach(param=>{ + if(param.isMandatory){ mandatoryfields.push(param.name); } }); - let filledMandatoryFieldsCount = searchForm - ? Object.keys(searchForm).filter((param) => searchForm[param] && mandatoryfields.includes(param)).length - : 0; - if (filledMandatoryFieldsCount != mandatoryfields.length) { - toggleSnackbarAndSetText( - true, - { labelKey: "COMMON_MANDATORY_MISSING_ERROR", labelName: "Please fill all mandatory fields to search" }, - "error" - ); - return; - } + let filledMandatoryFieldsCount = searchForm ? Object.keys(searchForm) + .filter(param => mandatoryfields.includes(param)).length : 0; + if (filledMandatoryFieldsCount != mandatoryfields.length) { + toggleSnackbarAndSetText(true, { labelKey: "COMMON_MANDATORY_MISSING_ERROR", labelName: "Please fill all mandatory fields to search" }, + "error"); + return; + } if (!isDrilldown) { const displayOnlyFields = this.getDisplayOnlyFields(metaData); - + searchForm = searchForm ? Object.keys(searchForm) .filter((param) => !_.includes(displayOnlyFields, param)) @@ -462,7 +437,7 @@ class ShowForm extends Component { for (var variable in searchForm) { let input; - + if (this.state.moduleName == "oldPGR") { if (variable == "fromDate") { input = @@ -489,13 +464,17 @@ class ShowForm extends Component { input = searchForm[variable].setHours(0); input = searchForm[variable].setMinutes(0); input = searchForm[variable].setSeconds(0); - } catch (e) {} + } catch (e) { + console.log(e); + } } else if (variable == "toDate") { try { input = searchForm[variable].setHours(23); input = searchForm[variable].setMinutes(59); input = searchForm[variable].setSeconds(59); - } catch (e) {} + } catch (e) { + console.log(e); + } } else { input = searchForm[variable]; } @@ -503,126 +482,67 @@ class ShowForm extends Component { if (input && input != "All") { searchParams.push({ name: variable, input }); } - - if (metaData && metaData.reportDetails && metaData.reportDetails.reportName === "ChannelsReport" && input && input == "All") { - searchParams.push({ name: variable, input }); + } + let fromDate = 0; + let toDate = 0; + if (searchParams && Array.isArray(searchParams) && searchParams.length > 1) { + searchParams.map(searchParam => { + if (searchParam.name == 'fromDate') { + fromDate = searchParam.input; + } + if (searchParam.name == 'toDate') { + toDate = searchParam.input; + } + }) + if ((toDate - fromDate) / (60 * 60 * 24 * 1000) > 7 && this.props.match.params.moduleName == 'rainmaker-pt' && this.props.match.params.reportName=='ReceiptRegister_V2') { + { + toggleSnackbarAndSetText(true, { labelKey: "COMMON_MANDATORY_SEVEN_ERROR", labelName: "Please fill all mandatory fields to ERROR" }, + "error"); + return; + } } } - showSpinner(); setSearchParams(searchParams); clearReportHistory(); - let resulturl = getResultUrl(this.state.moduleName, this.state.reportName); - /* searchForm */ - if (metaData && metaData.reportDetails && metaData.reportDetails.reportName === "TLApplicationStatusReport") { - searchParams = searchParams.map((ele) => - ele.name == "applicationStatus" ? { ...ele, input: ele.input && ele.input.map((ele) => ele.substr(0, ele.indexOf("-"))) } : { ...ele } - ); - } - - if (metaData && metaData.reportDetails && metaData.reportDetails.reportName === "ObpsApplicationStatusReport") { - searchParams = searchParams.map((ele) => { - return (ele.name == "status" || ele.name == "serviceType" || ele.name == "applicationType" || ele.name == "applicationChannel") ? { ...ele, input: ele.input && ele.input.map((ele) => ele.replaceAll(",", "_")) } : { ...ele } - } - ); - } - - if (metaData && metaData.reportDetails && metaData.reportDetails.reportName === "ChannelsReport") { - const filterData = metaData.reportDetails.searchParams && metaData.reportDetails.searchParams.length > 0 && metaData.reportDetails.searchParams.filter(data => data.name == "ulb"); - const ulbDefaultValues = filterData && filterData.length > 0 && filterData[0].defaultValue || {}; - searchParams = searchParams.map((ele) => { - return (ele.name == "ulb" && ele.input[0] == "All") ? { ...ele, input: ele.input && Object.keys(ulbDefaultValues) } : { ...ele } - } - ); - } - - resulturl && + let resulturl = getResultUrl(this.state.moduleName,this.state.reportName); + resulturl && commonApiPost(resulturl, {}, { tenantId: tenantId, reportName: this.state.reportName, searchParams }).then( - function (response) { - if (response && response.reportHeader && response.reportData) { - if (window.location.pathname.includes("TradeLicenseDailyCollectionReport")) { - const ind = response.reportHeader.findIndex((d) => d.name === "username"); - // response.reportHeader[ind].showColumn = false; - response.reportData = response.reportData.map((eachArr) => { - eachArr[ind + 1] = `${eachArr[ind + 1]}/${eachArr[ind]}`; - return eachArr; - }); - } - let hiddenRows = []; - - response.reportHeader.map((e, i) => { - if (!e.showColumn) { - hiddenRows.push(i); - } - }); - response.reportHeader = response.reportHeader.filter((e) => e.showColumn); - response.reportData = response.reportData.map((ele) => - ele.filter((e, i) => !hiddenRows.includes(i)).map((ele) => (ele == null ? "" : ele)) - ); - } - hideSpinner(); + function(response) { pushReportHistory({ tenantId: tenantId, reportName: self.state.reportName, searchParams }); setReportResult(response); showTable(true); setFlag(1); }, - function (err) { - hideSpinner(); + function(err) { showTable(false); - setError(err); - // alert(err); + alert("Something went wrong or try again later"); } ); } else { if (_.isEmpty(JSON.parse(localStorageGet("searchCriteria")))) { let reportData = reportHistory[reportIndex - 1 - 1]; - let resulturl = getResultUrl(this.state.moduleName, this.state.reportName); - resulturl && + let resulturl = getResultUrl(this.state.moduleName,this.state.reportName); + resulturl && commonApiPost(resulturl, {}, { ...reportData }).then( - function (response) { - if (response && response.reportHeader && response.reportData) { - let hiddenRows = []; - response.reportHeader.map((e, i) => { - if (!e.showColumn) { - hiddenRows.push(i); - } - }); - response.reportHeader = response.reportHeader.filter((e) => e.showColumn); - response.reportData = response.reportData.map((ele) => - ele.filter((e, i) => !hiddenRows.includes(i)).map((ele) => (ele == null ? "" : ele)) - ); - } + function(response) { decreaseReportIndex(); setReportResult(response); showTable(true); setFlag(1); }, - function (err) { + function(err) { showTable(false); - setError(err); - // alert(err); + alert("Something went wrong or try again later"); } ); } else { - showSpinner(); var reportData = JSON.parse(localStorageGet("searchCriteria")); let resulturl = getResultUrl(localStorageGet("moduleName")); - resulturl && + resulturl && commonApiPost(resulturl, {}, { ...reportData }).then( - function (response) { - if (response && response.reportHeader && response.reportData) { - let hiddenRows = []; - response.reportHeader.map((e, i) => { - if (!e.showColumn) { - hiddenRows.push(i); - } - }); - response.reportHeader = response.reportHeader.filter((e) => e.showColumn); - response.reportData = response.reportData.map((ele) => - ele.filter((e, i) => !hiddenRows.includes(i)).map((ele) => (ele == null ? "" : ele)) - ); - } + function(response) { setReturnUrl(""); localStorageSet("searchCriteria", JSON.stringify({})); localStorageSet("moduleName", ""); @@ -630,17 +550,14 @@ class ShowForm extends Component { self.handleChange({ target: { value: reportData.searchParams[i].name } }, reportData.searchParams[i].input, false, false); } setSearchParams(reportData.searchParams); - hideSpinner(); setReportResult(response); showTable(true); setFlag(1); }, - function (err) { - hideSpinner(); + function(err) { showTable(false); - setError(err); - // alert(err); + alert("Something went wrong or try again later"); } ); } @@ -660,9 +577,11 @@ class ShowForm extends Component { let tabLabel = ""; if (fromDate && toDate) { - tabLabel = `Showing data for : ${fromDate.getDate() + "/" + (fromDate.getMonth() + 1) + "/" + fromDate.getFullYear()} to ${ - toDate.getDate() + "/" + (toDate.getMonth() + 1) + "/" + toDate.getFullYear() - }`; + tabLabel = `Showing data for : ${fromDate.getDate() + "/" + (fromDate.getMonth() + 1) + "/" + fromDate.getFullYear()} to ${toDate.getDate() + + "/" + + (toDate.getMonth() + 1) + + "/" + + toDate.getFullYear()}`; } /** Zone wise selection show in header */ @@ -697,7 +616,7 @@ class ShowForm extends Component { return reportTitle; }); } - return (reportTitle && typeof reportTitle == "string" && getLocaleLabels(getTransformedLocale(reportTitle))) || reportTitle; + return reportTitle; }; getReportTitlefromTwoOptions = (metaData) => { @@ -711,11 +630,7 @@ class ShowForm extends Component { ); } else { return ( - get(metaData, "reportDetails.reportName") && ( -
- {getLocaleLabels(getTransformedLocale(metaData.reportDetails.reportName), getTransformedLocale(metaData.reportDetails.reportName))} -
- ) + get(metaData, "reportDetails.reportName") &&
{this.getReportTitle(metaData.reportDetails.reportName)}
); } }; @@ -737,13 +652,18 @@ class ShowForm extends Component { textChildren={
@@ -794,7 +706,7 @@ class ShowForm extends Component { } const mapStateToProps = (state) => { - const labels = get(state.app, "localizationLabels"); + const labels = get(state.app , "localizationLabels") return { searchForm: state.formtemp.form, fieldErrors: state.formtemp.fieldErrors, @@ -804,7 +716,7 @@ const mapStateToProps = (state) => { metaData: state.report.metaData, reportHistory: state.report.reportHistory, reportIndex: state.report.reportIndex, - labels, + labels }; }; @@ -851,8 +763,10 @@ const mapDispatchToProps = (dispatch) => ({ setFlag: (flag) => { dispatch({ type: "SET_FLAG", flag }); }, - toggleSnackbarAndSetText: (open, message, type) => { - dispatch(toggleSnackbarAndSetText(open, message, type)); + toggleSnackbarAndSetText:(open,message,type)=>{ + dispatch(toggleSnackbarAndSetText( + open,message,type + )) }, setMetaData: (metaData) => { dispatch({ type: "SET_META_DATA", metaData }); @@ -869,12 +783,9 @@ const mapDispatchToProps = (dispatch) => ({ decreaseReportIndex: () => { dispatch({ type: "DECREASE_REPORT_INDEX" }); }, - hideSpinner: () => { - dispatch(hideSpinner()); - }, - showSpinner: () => { - dispatch(showSpinner()); - }, }); -export default connect(mapStateToProps, mapDispatchToProps)(ShowForm); +export default connect( + mapStateToProps, + mapDispatchToProps +)(ShowForm); diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/showField.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/showField.js index e2249eefe08..6f9625ab84e 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/showField.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/employee/reports/showField.js @@ -4,14 +4,14 @@ import SelectField from "material-ui/SelectField"; import MenuItem from "material-ui/MenuItem"; import Checkbox from "material-ui/Checkbox"; import { translate } from "./commons/common"; -import Grid from "@material-ui/core/Grid"; +import Grid from '@material-ui/core/Grid'; import Label from "egov-ui-kit/utils/translationNode"; import UiBoundary from "./components/boundary"; import boundaryConfig from "./commons/config"; import isEmpty from "lodash/isEmpty"; import filter from "lodash/filter"; import AutoSuggestDropdown from "egov-ui-kit/components/AutoSuggestDropdown"; -import { getLocaleLabels, getTransformedLocale } from "egov-ui-framework/ui-utils/commons"; +import { getLocaleLabels } from "egov-ui-framework/ui-utils/commons"; export default class ShowField extends Component { constructor(props) { @@ -27,7 +27,7 @@ export default class ShowField extends Component { renderFields = (obj) => { let des = getLocaleLabels(obj.label, obj.label); - const { localizationLabels } = this.props; + const {localizationLabels} =this.props; let { maxDate } = this.state; let description = des; @@ -36,48 +36,27 @@ export default class ShowField extends Component { if (!isEmpty(obj.defaultValue)) { dropDownData.push({ value: "All", - label: "RT_ALL", + label: "All", }); } - // + if (typeof obj.defaultValue == "object") { - if (obj.name == "applicationStatus" && obj.label === "reports.tl.applicationstatus") { - Object.keys(obj.defaultValue).map((key,i) => { - dropDownData.push({ - value: `${obj.defaultValue[key]}-${i}`, - label: obj.isLocalisationRequired ? getTransformedLocale(key) : key, - }); + for (var variable in obj.defaultValue) { + dropDownData.push({ + value: variable, + label: obj.defaultValue[variable], }); - } else { - for (var variable in obj.defaultValue) { - if (obj.isLocalisationRequired) { - dropDownData.push({ - value: variable, - label: - obj.name == "ulb" - ? `TENANT_TENANTS_${getTransformedLocale(variable)}` - : obj.defaultValue[variable] && getTransformedLocale(obj.defaultValue[variable]), - // label: obj.name=="ulb"?`TENANT_TENANTS_${getTransformedLocale(variable)}`:`RT_${getTransformedLocale(variable)}`, - }); - } else { - dropDownData.push({ - value: variable, - label: (obj.defaultValue[variable] && obj.defaultValue[variable]) || "", - }); - } - } } } switch (obj.type) { case "string": return ( - + - ); @@ -208,7 +186,7 @@ export default class ShowField extends Component { floatingLabelText={ {description} {obj.isMandatory ? " *" : ""} - + } value={typeof obj.value == "undefined" ? "" : obj.value} onChange={(event, key, value) => { @@ -233,14 +211,7 @@ export default class ShowField extends Component { id={obj.label.split(".").join("-")} fullWidth={true} multiple={true} - style={{ height: "auto" }} - dropDownMenuProps={{ - anchorOrigin: { - vertical: "bottom", - horizontal: "left", - }, - }} - // dropDownMenuProps={{ targetOrigin: { horizontal: "left", vertical: "top" } }} + dropDownMenuProps={{ targetOrigin: { horizontal: "left", vertical: "top" } }} floatingLabelFixed={true} floatingLabelText={
@@ -255,22 +226,7 @@ export default class ShowField extends Component { } value={typeof obj.value == "undefined" ? "" : obj.value} onChange={(event, key, value) => { - const dataValue = value[value.length - 1]; let e = { target: { value } }; - if (dataValue == "All") { - e = { target: { value: [dataValue] } }; - } - - const allValuePresent = value && value.length > 1 && value.includes("All"); - if (allValuePresent && value.length > 1 && dataValue != "All") { - let finalData = []; - value.forEach((value) => { - if (value != "All") { - finalData.push(value); - } - }); - e = { target: { value: finalData } }; - } this.props.handler(e, obj.name, obj.isMandatory ? true : false, ""); }} maxHeight={200} @@ -281,7 +237,7 @@ export default class ShowField extends Component { checked={obj.value && obj.value.indexOf(dd.value) > -1 ? true : false} value={translate(dd.value)} key={index} - primaryText={getLocaleLabels(dd.label, dd.label, localizationLabels)} + primaryText={getLocaleLabels(dd.label,dd.label,localizationLabels)} /> ))} @@ -322,5 +278,5 @@ const getDropdownLabel = (value, data) => { if (object.length > 0) { label = object[0].label; } - return label && getLocaleLabels("NA", label); + return label; }; diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/index.scss b/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/index.scss deleted file mode 100644 index 92000d6c977..00000000000 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/modules/index.scss +++ /dev/null @@ -1,27 +0,0 @@ -.jk-footer { - position: fixed; - width: 100%; - right: 0; - bottom: 0; - height: 2.5em; - --bg-opacity: 1; - background-color: #f4f7fb; - padding-bottom: 16px; - padding-top: 8px; - -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; - z-index: 50; - display: flex; - } - - .jk-footer-image-cursor { - cursor: pointer; - } - - input[type="date"]{ - cursor: pointer; - } - input[type="date" i] { - cursor: pointer; - } diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/commonConfig/remote-component-paths/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/commonConfig/remote-component-paths/index.js index 33f165901d0..9a81e250438 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/commonConfig/remote-component-paths/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/commonConfig/remote-component-paths/index.js @@ -109,15 +109,6 @@ const remoteComponentPath = (moduleName, path) => { component = import("egov-noc/ui-containers-local"); } break; - case "egov-bnd": - if (path === "ui-atoms-local") { - component = import("egov-bnd/ui-atoms-local"); - } else if (path === "ui-molecules-local") { - component = import("egov-bnd/ui-molecules-local"); - } else if (path === "ui-containers-local") { - component = import("egov-bnd/ui-containers-local"); - } - break; default: if (path === "ui-atoms-local") { component = import("ui-atoms-local"); diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/commonConfig/remote-config-paths/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/commonConfig/remote-config-paths/index.js index 302da34dadf..c1d7a3899eb 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/commonConfig/remote-config-paths/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/commonConfig/remote-config-paths/index.js @@ -27,7 +27,6 @@ const remoteConfigPath = (path, screenKey) => { break; case "receipts": case "abg": - case "bills": config = require(`egov-abg/ui-config/screens/specs/${path}/${screenKey}`).default; break; case "bill-amend": @@ -43,16 +42,6 @@ const remoteConfigPath = (path, screenKey) => { case "noc": config = require(`egov-noc/ui-config/screens/specs/${path}/${screenKey}`).default; break; - case "bnd": - case "birth-citizen": - case "birth-employee": - case "birth-common": - case "death-citizen": - case "death-employee": - case "death-common": - case "bnd-common": - config = require(`egov-bnd/ui-config/screens/specs/${path}/${screenKey}`).default; - break; default: config = require(`ui-config/screens/specs/${path}/${screenKey}`).default; break; diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/create.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/create.js index 7203b2d7dfe..6812256a46d 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/create.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/create.js @@ -1,13 +1,19 @@ import { - getCommonCard, getCommonContainer, getCommonHeader, - getDateField, getPattern, getSelectField, getTextField, getTimeField + getCommonCard, + getTextField, + getCommonHeader, + getDateField, + getSelectField, + getCommonContainer, + getPattern, + getTimeField, } from "egov-ui-framework/ui-config/screens/specs/utils"; -import { handleScreenConfigurationFieldChange as handleField, prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; +import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; +import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; import get from "lodash/get"; import set from "lodash/set"; -import { footer, getDeleteButton, getMapLocator, getMdmsData, getSingleMessage, showHideMapPopup } from "../utils"; +import { footer, getSingleMessage, getMdmsData, getMapLocator, showHideMapPopup, getDeleteButton } from "../utils"; const header = getCommonHeader({ labelName: getQueryArg(window.location.href, "uuid") ? "Edit Event" : "Add New Event", @@ -61,7 +67,7 @@ export const createForm = getCommonCard({ labelKey: "EVENTS_NAME_PLACEHOLDER", }, required: true, - pattern: getPattern("Name"), + pattern: getPattern("eventName"), jsonPath: "events[0].name", gridDefination: { xs: 12, @@ -123,7 +129,7 @@ export const createForm = getCommonCard({ labelName: "Description (Max Char Limit : 500)", labelKey: "EVENTS_DESCRIPTION_LIMIT_PLACEHOLDER", }, - pattern: getPattern("Address"), + pattern: getPattern("eventDescription"), required: true, jsonPath: "events[0].description", props: { @@ -171,8 +177,8 @@ export const createForm = getCommonCard({ // min: getTodaysDateInYMD(), // max: getFinancialYearDates("yyyy-mm-dd").endDate, // }, - // iconObj: { position: "end", iconName: "calendar_today" }, - // style: { marginBottom: 10 }, + iconObj: { position: "end", iconName: "calendar_today" }, + style: { marginBottom: 10 }, }, }), }, @@ -196,9 +202,9 @@ export const createForm = getCommonCard({ // min: getTodaysDateInYMD(), // max: getFinancialYearDates("yyyy-mm-dd").endDate, // }, - // iconObj: { position: "end", iconName: " access_time" }, + iconObj: { position: "end", iconName: " access_time" }, defaultValue: "00:00", - style: { paddingRight: 80 }, + style: { marginBottom: 10, paddingRight: 80 }, }, }), }, @@ -229,8 +235,8 @@ export const createForm = getCommonCard({ // min: getNextMonthDateInYMD(), // max: getFinancialYearDates("yyyy-mm-dd").endDate, // }, - // iconObj: { position: "end", iconName: "calendar_today" }, - // style: { marginBottom: 10 }, + iconObj: { position: "end", iconName: "calendar_today" }, + style: { marginBottom: 10 }, }, }), }, @@ -254,8 +260,8 @@ export const createForm = getCommonCard({ // max: getFinancialYearDates("yyyy-mm-dd").endDate, // }, defaultValue: "00:00", - // iconObj: { position: "end", iconName: " access_time" }, - style: { paddingRight: 80 }, + iconObj: { position: "end", iconName: " access_time" }, + style: { marginBottom: 10, paddingRight: 80 }, }, }), }, @@ -430,7 +436,6 @@ const screenConfig = { "components.div.children.createCard.children.createForm.children.cardContent.children.createContainer.children.ulb.props", props ); - dispatch(handleField("search", "components.div.children.searchResults", "visible", false)); dispatch(prepareFinalObject("events[0].tenantId", tenantId)); if (uuid) { getSingleMessage(state, dispatch, messageTenant, uuid); diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/search.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/search.js index c5dadd1084e..9362dd98e0b 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/search.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/search.js @@ -1,12 +1,12 @@ -import { getBreak, getCommonHeader, getLabel } from "egov-ui-framework/ui-config/screens/specs/utils"; +import { getCommonHeader, getLabel, getBreak } from "egov-ui-framework/ui-config/screens/specs/utils"; import { setRoute } from "egov-ui-framework/ui-redux/app/actions"; -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; +import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; +import { searchResults, searchApiCall } from "./searchResults"; import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; import get from "lodash/get"; import set from "lodash/set"; import { ulbFilter } from "../utils"; -import { searchApiCall, searchResults } from "./searchResults"; const hasButton = getQueryArg(window.location.href, "hasButton"); let enableButton = true; @@ -14,7 +14,7 @@ enableButton = hasButton && hasButton === "false" ? false : true; const pageResetAndChange = (state, dispatch) => { dispatch(prepareFinalObject("events", [])); - window.location.href="./create"; + dispatch(setRoute("/events/create")); }; const header = getCommonHeader({ @@ -31,11 +31,6 @@ const eventsSearchAndResult = { props.value = tenantId; props.disabled = true; set(action.screenConfig, "components.div.children.cityFilter.children.cardContent.children.container.children.ulb.props", props); - set( - action.screenConfig, - "components.div.children.searchResults.visible", - false - ); return action; }, components: { @@ -50,6 +45,7 @@ const eventsSearchAndResult = { headerDiv: { uiFramework: "custom-atoms", componentPath: "Container", + children: { header: { gridDefination: { diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/searchResults.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/searchResults.js index a39253bd66e..7dba048040c 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/searchResults.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/events/searchResults.js @@ -1,17 +1,17 @@ +import React from "react"; import { LabelContainer } from "egov-ui-framework/ui-containers"; import { handleScreenConfigurationFieldChange as handleField, toggleSnackbar } from "egov-ui-framework/ui-redux/screen-configuration/actions"; import { - epochToYmd, getStatusKey, getUserDataFromUuid, - transformById + epochToYmd, + getUserDataFromUuid, + transformById, + getStatusKey } from "egov-ui-framework/ui-utils/commons"; import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; +import { getEventsByType, sortByEpoch, getEpochForDate } from "../utils"; import get from "lodash/get"; -import React from "react"; -import { getEpochForDate, getEventsByType, sortByEpoch } from "../utils"; -import {routeTo} from "egov-ui-kit/utils/PTCommon/FormWizardUtils/formActionUtils" export const searchApiCall = async (state, dispatch) => { - dispatch(handleField("search", "components.div.children.searchResults", "visible", false)); const queryObject = [ { key: "tenantId", @@ -38,49 +38,48 @@ export const searchApiCall = async (state, dispatch) => { events.map((item) => { //const status = item.eventDetails.toDate > currentDate ? item.status : "INACTIVE"; return { - ["EVENTS_EVENT_NAME_LABEL"]: item && item.name, - ["EVENTS_EVENT_CATEGORY_LABEL"]: item && item.eventCategory + ["EVENTS_EVENT_NAME_LABEL"]: item.name, + ["EVENTS_EVENT_CATEGORY_LABEL"]: item.eventCategory ? () + labelKey={`MSEVA_EVENTCATEGORIES_${item.eventCategory}`} + labelName={item.eventCategory} + />) : "-", - ["EVENTS_START_DATE_LABEL"]: item && item.eventDetails + ["EVENTS_START_DATE_LABEL"]: item.eventDetails ? epochToYmd(item.eventDetails.fromDate) : "-", - ["EVENTS_END_DATE_LABEL"]: item && item.eventDetails ? epochToYmd(item.eventDetails.toDate) : "-", - ["EVENTS_POSTEDBY_LABEL"]: get(userResponse, item && item.auditDetails.lastModifiedBy, {}).name, - ["EVENTS_STATUS_LABEL"]: item && item.status, - ["ID"]: item && item.id, - ["TENANT_ID"]: item && item.tenantId, + ["EVENTS_END_DATE_LABEL"]: item.eventDetails ? epochToYmd(item.eventDetails.toDate) : "-", + ["EVENTS_POSTEDBY_LABEL"]: get(userResponse, item.auditDetails.lastModifiedBy).name, + ["EVENTS_STATUS_LABEL"]: item.status, + ["ID"]: item.id, + ["TENANT_ID"]: item.tenantId, }; }); - dispatch(handleField("search", "components.div.children.searchResults", "visible", true)); dispatch(handleField("search", "components.div.children.searchResults", "props.data", data)); dispatch(handleField("search", "components.div.children.searchResults", "props.rows", data.length)); } catch (error) { dispatch(toggleSnackbar(true, error.message, "error")); + console.log(error); } }; const onRowClick = (rowData) => { - routeTo(`create?uuid=${rowData[7]}&tenantId=${rowData[6]}`); + window.location.href = `create?uuid=${rowData[7]}&tenantId=${rowData[6]}`; }; export const searchResults = () => { return { uiFramework: "custom-molecules", componentPath: "Table", - visible: false, props: { columns: [ - { labelName: "Event Name", labelKey: "EVENTS_EVENT_NAME_LABEL" }, - { labelName: "Event Category", labelKey: "EVENTS_EVENT_CATEGORY_LABEL" }, - { labelName: "Start Date", labelKey: "EVENTS_START_DATE_LABEL" }, - { labelName: "End Date", labelKey: "EVENTS_END_DATE_LABEL" }, - { labelName: "Posted By", labelKey: "EVENTS_POSTEDBY_LABEL" }, + {labelName: "Event Name", labelKey: "EVENTS_EVENT_NAME_LABEL"}, + {labelName: "Event Category", labelKey: "EVENTS_EVENT_CATEGORY_LABEL"}, + {labelName: "Start Date", labelKey: "EVENTS_START_DATE_LABEL"}, + {labelName: "End Date", labelKey: "EVENTS_END_DATE_LABEL"}, + {labelName: "Posted By", labelKey: "EVENTS_POSTEDBY_LABEL"}, { - labelName: "Status", + labelName: "Status", labelKey: "EVENTS_STATUS_LABEL", options: { filter: false, @@ -110,7 +109,7 @@ export const searchResults = () => { }, }, ], - title: { labelName: "Created Events", labelKey: "EVENTS_CREATED_EVENTS_HEADER" }, + title: {labelName: "Created Events", labelKey: "EVENTS_CREATED_EVENTS_HEADER" }, rows: "", options: { diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/create.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/create.js index 1f590731dcf..d678321d0c5 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/create.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/create.js @@ -1,12 +1,20 @@ import { - getCommonCard, getCommonContainer, getCommonHeader, getCommonParagraph, getCommonSubHeader, getDateField, getPattern, getSelectField, getTextField + getCommonCard, + getTextField, + getCommonHeader, + getDateField, + getSelectField, + getCommonContainer, + getPattern, + getCommonSubHeader, + getCommonParagraph, } from "egov-ui-framework/ui-config/screens/specs/utils"; -import { handleScreenConfigurationFieldChange as handleField, prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; +import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; +import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; import get from "lodash/get"; import set from "lodash/set"; -import { footer, getDeleteButton, getMdmsData, getSingleMessage } from "../utils"; +import { footer, getSingleMessage, getMdmsData, getDeleteButton } from "../utils"; const header = getCommonHeader({ labelName: getQueryArg(window.location.href, "uuid") ? "Edit Public Message" : "Add New Public Message", @@ -60,7 +68,7 @@ export const createForm = getCommonCard({ labelKey: "EVENTS_TITLE_LABEL_PLACEHOLDER", }, required: true, - pattern: getPattern("Name"), + pattern: getPattern("eventName"), jsonPath: "events[0].name", gridDefination: { xs: 12, @@ -92,7 +100,7 @@ export const createForm = getCommonCard({ labelKey: "EVENTS_DESCRIPTION_LIMIT_PLACEHOLDER", }, required: true, - pattern: getPattern("Address"), + pattern: getPattern("eventDescription"), jsonPath: "events[0].description", props: { multiline: true, @@ -197,8 +205,8 @@ export const createForm = getCommonCard({ pattern: getPattern("Date"), jsonPath: "events[0].eventDetails.fromDate", props: { - // iconObj: { position: "end", iconName: "calendar_today", style: { width: 24, height: 24 } }, - // style: { marginBottom: 10 }, + iconObj: { position: "end", iconName: "calendar_today", style: { width: 24, height: 24 } }, + style: { marginBottom: 10 }, }, }), }, @@ -224,8 +232,8 @@ export const createForm = getCommonCard({ pattern: getPattern("Date"), jsonPath: "events[0].eventDetails.toDate", props: { - // iconObj: { position: "end", iconName: "calendar_today" }, - // style: { marginBottom: 10 }, + iconObj: { position: "end", iconName: "calendar_today" }, + style: { marginBottom: 10 }, }, }), }, @@ -239,7 +247,6 @@ const screenConfig = { const tenantId = getTenantId(); const uuid = getQueryArg(window.location.href, "uuid"); const messageTenant = getQueryArg(window.location.href, "tenantId"); - dispatch(handleField("search", "components.div.children.searchResults", "visible", false)); getMdmsData(action, state, dispatch); let props = get( action.screenConfig, diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/search.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/search.js index dd0aab4cb98..547b05b2830 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/search.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/search.js @@ -1,12 +1,12 @@ -import { getBreak, getCommonHeader, getLabel } from "egov-ui-framework/ui-config/screens/specs/utils"; +import { getCommonHeader, getLabel, getBreak } from "egov-ui-framework/ui-config/screens/specs/utils"; import { setRoute } from "egov-ui-framework/ui-redux/app/actions"; -import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; +import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions"; +import { searchResults, searchApiCall } from "./searchResults"; import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; import get from "lodash/get"; import set from "lodash/set"; import { ulbFilter } from "../utils"; -import { searchApiCall, searchResults } from "./searchResults"; const hasButton = getQueryArg(window.location.href, "hasButton"); let enableButton = true; @@ -14,7 +14,7 @@ enableButton = hasButton && hasButton === "false" ? false : true; const pageResetAndChange = (state, dispatch) => { dispatch(prepareFinalObject("events", [])); - window.location.href="./create"; + dispatch(setRoute("/notifications/create")); }; const header = getCommonHeader({ @@ -32,11 +32,6 @@ const eventsSearchAndResult = { props.value = tenantId; props.disabled = true; set(action.screenConfig, "components.div.children.cityFilter.children.cardContent.children.container.children.ulb.props", props); - set( - action.screenConfig, - "components.div.children.searchResults.visible", - false - ); return action; }, components: { diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/searchResults.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/searchResults.js index f7d82aea76b..8ef80f6bfc8 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/searchResults.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/notifications/searchResults.js @@ -1,14 +1,17 @@ +import React from "react"; import { LabelContainer } from "egov-ui-framework/ui-containers"; import { handleScreenConfigurationFieldChange as handleField, toggleSnackbar } from "egov-ui-framework/ui-redux/screen-configuration/actions"; -import { epochToYmd, getStatusKey, getUserDataFromUuid, transformById } from "egov-ui-framework/ui-utils/commons"; +import { + epochToYmd, + getUserDataFromUuid, + transformById, + getStatusKey +} from "egov-ui-framework/ui-utils/commons"; import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; -import { routeTo } from "egov-ui-kit/utils/PTCommon/FormWizardUtils/formActionUtils"; +import { getEventsByType, sortByEpoch, getEpochForDate } from "../utils"; import get from "lodash/get"; -import React from "react"; -import { getEpochForDate, getEventsByType, sortByEpoch } from "../utils"; export const searchApiCall = async (state, dispatch) => { - dispatch(handleField("search", "components.div.children.searchResults", "visible", false)); const queryObject = [ { key: "tenantId", @@ -36,48 +39,51 @@ export const searchApiCall = async (state, dispatch) => { events.map((item) => { //const status = item.eventDetails && item.eventDetails.toDate > currentDate ? item.status : "INACTIVE"; return { - ["EVENTS_MESSAGE_LABEL"]: item && item.name, - ["EVENTS_POSTING_DATE_LABEL"]: item && item.auditDetails && epochToYmd(item.auditDetails.lastModifiedTime), - ["EVENTS_START_DATE_LABEL"]: item && item.eventDetails ? epochToYmd(item.eventDetails.fromDate) : "-", - ["EVENTS_END_DATE_LABEL"]: item && item.eventDetails ? epochToYmd(item.eventDetails.toDate) : "-", - ["EVENTS_POSTEDBY_LABEL"]: get(userResponse, item && item.auditDetails.lastModifiedBy, {}).name, - ["EVENTS_STATUS_LABEL"]: item && item.status, - ["ID"]: item && item.id, - ["TENANT_ID"]: item && item.tenantId, + ["EVENTS_MESSAGE_LABEL"]: item.name, + ["EVENTS_POSTING_DATE_LABEL"]: epochToYmd(item.auditDetails.lastModifiedTime), + ["EVENTS_START_DATE_LABEL"]: item.eventDetails + ? epochToYmd(item.eventDetails.fromDate) + : "-", + ["EVENTS_END_DATE_LABEL"]: item.eventDetails ? epochToYmd(item.eventDetails.toDate) : "-", + ["EVENTS_POSTEDBY_LABEL"]: get(userResponse, item.auditDetails.lastModifiedBy).name, + ["EVENTS_STATUS_LABEL"]: item.status, + ["ID"]: item.id, + ["TENANT_ID"]: item.tenantId, }; }); - dispatch(handleField("search", "components.div.children.searchResults", "visible", true)); dispatch(handleField("search", "components.div.children.searchResults", "props.data", data)); dispatch(handleField("search", "components.div.children.searchResults", "props.rows", data.length)); } catch (error) { dispatch(toggleSnackbar(true, error.message, "error")); + console.log(error); } }; const onRowClick = (rowData) => { - routeTo(`create?uuid=${rowData[7]}&tenantId=${rowData[6]}`); + window.location.href = `create?uuid=${rowData[7]}&tenantId=${rowData[6]}`; }; export const searchResults = () => { return { uiFramework: "custom-molecules", componentPath: "Table", - visible: false, props: { columns: [ - { labelName: "Message", labelKey: "EVENTS_MESSAGE_LABEL" }, - { labelName: "Posting Date", labelKey: "EVENTS_POSTING_DATE_LABEL" }, - { labelName: "Start Date", labelKey: "EVENTS_START_DATE_LABEL" }, - { labelName: "End Date", labelKey: "EVENTS_END_DATE_LABEL" }, - { labelName: "Posted By", labelKey: "EVENTS_POSTEDBY_LABEL" }, + {labelName:"Message", labelKey:"EVENTS_MESSAGE_LABEL"}, + {labelName:"Posting Date", labelKey:"EVENTS_POSTING_DATE_LABEL"}, + {labelName:"Start Date", labelKey:"EVENTS_START_DATE_LABEL"}, + {labelName:"End Date", labelKey:"EVENTS_END_DATE_LABEL"}, + {labelName:"Posted By", labelKey:"EVENTS_POSTEDBY_LABEL"}, { - labelName: "Status", - labelKey: "EVENTS_STATUS_LABEL", + labelName:"Status", + labelKey:"EVENTS_STATUS_LABEL", options: { filter: false, - customBodyRender: (value) => ( + customBodyRender: value => ( @@ -99,7 +105,7 @@ export const searchResults = () => { }, }, ], - title: { labelName: "Uploaded Messages", labelKey: "EVENTS_UPLOADED_MESSAGES_HEADER" }, + title: {labelName: "Uploaded Messages", labelKey: "EVENTS_UPLOADED_MESSAGES_HEADER" }, rows: "", options: { filter: true, diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/utils/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/utils/index.js index 06f2509bbf1..ecd1e46310d 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/utils/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-config/screens/specs/utils/index.js @@ -172,6 +172,7 @@ export const getEventsByType = async (queryObj) => { return payload.events; } } catch (e) { + console.log(e.message); } }; @@ -265,6 +266,7 @@ export const getMdmsData = async (action, state, dispatch) => { const localities = get(state.screenConfiguration, "preparedFinalObject.applyScreenMdmsData.tenant.localities", []); dispatch(prepareFinalObject("applyScreenMdmsData", payload.MdmsRes)); } catch (e) { + console.log(e); } }; diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-molecules-local/MapLocator/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-molecules-local/MapLocator/index.js index 0b27c8a79d1..7b241293bee 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-molecules-local/MapLocator/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-molecules-local/MapLocator/index.js @@ -48,6 +48,7 @@ class MapLocator extends Component { }); }, function(error) { + console.log(error.code); } ); } diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-utils/api.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-utils/api.js index a40413974e0..92762f660bb 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-utils/api.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-utils/api.js @@ -1,6 +1,6 @@ import axios from "axios"; -import commonConfig from "config/common.js"; -import { getTenantId ,getAccessToken} from "egov-ui-kit/utils/localStorageUtils"; +import { fetchFromLocalStorage, addQueryArg, getDateInEpoch } from "egov-ui-framework/ui-utils/commons"; +import { getTenantId } from "egov-ui-kit/utils/localStorageUtils"; const instance = axios.create({ baseURL: window.location.origin, @@ -46,12 +46,11 @@ export const prepareForm = (params) => { export const uploadFile = async (endPoint, module, file, ulbLevel) => { // Bad idea to fetch from local storage, change as feasible - const tenantId = getTenantId() ? (ulbLevel ? commonConfig.tenantId : commonConfig.tenantId) : ""; + const tenantId = getTenantId() ? (ulbLevel ? getTenantId().split(".")[0] : getTenantId().split(".")[0]) : ""; const uploadInstance = axios.create({ baseURL: window.location.origin, headers: { "Content-Type": "multipart/form-data", - "auth-token":getAccessToken(), }, }); diff --git a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-views/IFrameInterface/index.js b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-views/IFrameInterface/index.js index ca2e817d2b7..62117d1570d 100644 --- a/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-views/IFrameInterface/index.js +++ b/frontend/mono-ui/web/rainmaker/packages/employee/src/ui-views/IFrameInterface/index.js @@ -26,7 +26,7 @@ class IFrameInterface extends React.Component { const isOrign = get(uiCommonConstants, `${moduleName}.iframe-routes.${pageName}.isOrigin`, false); const domain = isOrign ? process.env.NODE_ENV === "development" - ? "https://qa.digit.org" + ? "https://egov-micro-dev.egovernments.org" : document.location.origin : get(uiCommonConstants, `${moduleName}.iframe-routes.${pageName}.domain`, ""); diff --git a/frontend/mono-ui/web/ui-dashboard/src/App.js.bak b/frontend/mono-ui/web/ui-dashboard/src/App.js.bak deleted file mode 100644 index 03ef48f8863..00000000000 --- a/frontend/mono-ui/web/ui-dashboard/src/App.js.bak +++ /dev/null @@ -1,130 +0,0 @@ -import React, { Component } from 'react'; -import { connect } from 'react-redux' -import Grid from 'material-ui/Grid'; -import StatBox from './components/StatBox' -import CustomPieChart from './components/CustomPieChart' -import CustomBarChart from './components/CustomBarChart' -import { fetchFilterData, fetchDashboardData, inputChange, addConstraint} from './actions/dashboardActions' -import ResponsiveDrawer from './components/ResponsiveDrawer' -import CustomSelectBox from './components/CustomSelectBox' -import CustomDatePicker from './components/CustomDatePicker' -import CustomMap from './components/CustomMap' -import Button from 'material-ui/Button'; -import { ListItem } from 'material-ui/List'; - -class App extends Component { - - - constructor(props) { - super(props); - - this.handleChange = this.handleChange.bind(this); - this.handleSubmit = this.handleSubmit.bind(this); - this.handleClick = this.handleClick.bind(this); - } - - handleChange(event) { - const {dispatch} = this.props - dispatch(inputChange(event.target.name, event.target.value)) - dispatch(addConstraint(event.target.name, event.target.value)) - - } - - handleSubmit(event) { - const {dispatch} = this.props - dispatch(fetchDashboardData('complaint/_msearch')); - - } - - handleClick(data, index) { - const {dispatch} = this.props - console.log(data) - console.log('Clicked') - } - - - - componentDidMount(){ - const {dispatch} = this.props - dispatch(fetchFilterData('complaint/_msearch')); - dispatch(fetchDashboardData('complaint/_msearch')); - } - - - render() { - const {data, form, filter} = this.props - if((Object.keys(data).length === 0 && data.constructor === Object) || - (Object.keys(filter["data"]).length === 0 && filter["data"].constructor === Object)) - return null - - return ( -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- ); - } -} - -const mapStateToProps = state => { - - const {dashboardReducer} = state || {} - const {dashboard, form, query, filter} = dashboardReducer || {} - return { - data: dashboard.data || {}, - form: form || {}, - query: query || {}, - filter: filter || {} - } -} - - -export default connect(mapStateToProps)(App) - - diff --git a/frontend/mono-ui/web/ui-uploader/src/api/index.js b/frontend/mono-ui/web/ui-uploader/src/api/index.js index b197db17440..c5279a8f48a 100644 --- a/frontend/mono-ui/web/ui-uploader/src/api/index.js +++ b/frontend/mono-ui/web/ui-uploader/src/api/index.js @@ -123,7 +123,7 @@ export const Api = () => { }; const headers = { "Content-Type": "application/x-www-form-urlencoded", - Authorization: "Basic ZWdvdi11c2VyLWNsaWVudDo=" + Authorization: "Basic ZWdvdi11c2VyLWNsaWVudDplZ292LXVzZXItc2VjcmV0" }; const endPoint = getRequestUrl( apiEndpoints.USER_LOGIN_ENDPOINT, diff --git a/frontend/upyog-ui/web/micro-ui-internals/packages/css/package.json b/frontend/upyog-ui/web/micro-ui-internals/packages/css/package.json index 11b230fa6a5..31a0fa3b4dd 100644 --- a/frontend/upyog-ui/web/micro-ui-internals/packages/css/package.json +++ b/frontend/upyog-ui/web/micro-ui-internals/packages/css/package.json @@ -34,7 +34,7 @@ "gulp-clean": "^0.4.0", "gulp-clean-css": "^4.3.0", "gulp-livereload": "^4.0.2", - "gulp-postcss": "^9.0.1", + "gulp-postcss": "9.0.1", "gulp-rename": "^2.0.0", "gulp-sass": "^4.1.1", "postcss": "8.4.12", diff --git a/frontend/workbench-ui/.gitignore b/frontend/workbench-ui/.gitignore new file mode 100644 index 00000000000..feb4cac5c94 --- /dev/null +++ b/frontend/workbench-ui/.gitignore @@ -0,0 +1,32 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +.env +.eslintcache + +# yarn $ +.yarn +yarn.lock +.yarnrc.yml + +# dependencies +node_modules +.yarn +/.pnp +.pnp.js + +# testing +/coverage + +# production +/web/build +dist +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/frontend/workbench-ui/CODEOWNERS b/frontend/workbench-ui/CODEOWNERS new file mode 100644 index 00000000000..ee47f9464c2 --- /dev/null +++ b/frontend/workbench-ui/CODEOWNERS @@ -0,0 +1 @@ +* @jagankumar-egov @sathishp-eGov diff --git a/frontend/workbench-ui/Jenkinsfile b/frontend/workbench-ui/Jenkinsfile new file mode 100644 index 00000000000..1206b9c141d --- /dev/null +++ b/frontend/workbench-ui/Jenkinsfile @@ -0,0 +1,3 @@ +library 'ci-libs' + +buildPipeline(configFile: './build/build-config.yml') diff --git a/frontend/workbench-ui/README.md b/frontend/workbench-ui/README.md new file mode 100644 index 00000000000..9420dbb760d --- /dev/null +++ b/frontend/workbench-ui/README.md @@ -0,0 +1,140 @@ + +# workbench ui + +A React App built on top of DIGIT UI Core. + +# DIGIT + +DIGIT eGovernance Platform Services + +DIGIT (Digital Infrastructure for Governance, Impact & Transformation) is India's largest platform for governance services. Visit https://core.digit.org/ for more details. + +DIGIT platform is microservices based API platform enabling quick rebundling of services as per specific needs. This is a repo that lays down the core platform on top of which other mission services depend. + + +# DIGIT UI + + +This repository contains source code for web implementation of the new Digit UI modules with dependencies and libraries. + +Workbench module is used to Manage the master data (MDMS V2 Service) used across the DIGIT Services / Applications + +It is also used to manage the Localisation data present in the system (Localisation service) + + +## Run Locally + +Clone the project + +```bash + git clone https://github.com/egovernments/DIGIT-Frontend.git +``` + +Go to the Sub directory to run UI +```bash + cd into micro-ui/web/micro-ui-internals +``` + +Install dependencies + +```bash + yarn install +``` + +Add .env file +```bash + micro-ui/web/micro-ui-internals/example/.env +``` + +Start the server + +```bash + yarn start +``` + + +## Environment Variables + +To run this project, you will need to add the following environment variables to your .env file + +`REACT_APP_PROXY_API` :: `{{server url}}` + +`REACT_APP_GLOBAL` :: `{{server url}}` + +`REACT_APP_PROXY_ASSETS` :: `{{server url}}` + +`REACT_APP_USER_TYPE` :: `{{EMPLOYEE||CITIZEN}}` + +`SKIP_PREFLIGHT_CHECK` :: `true` + +[sample .env file](https://github.com/egovernments/Digit-Core/blob/workbench/frontend/micro-ui/web/micro-ui-internals/example/.env-unifieddev) + +## Tech Stack + +**Libraries:** + +[React](https://react.dev/) + +[React Hook Form](https://www.react-hook-form.com/) + +[React Query](https://tanstack.com/query/v3/) + +[Tailwind CSS](https://tailwindcss.com/) + +[Webpack](https://webpack.js.org/) + +## License + +[MIT](https://choosealicense.com/licenses/mit/) + + +## Author + +- [@jagankumar-egov](https://www.github.com/jagankumar-egov) + + +## Documentation + +[Documentation](https://https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui) + + +## Support + +For support, add the issues in https://github.com/egovernments/DIGIT-core/issues. + + +## Modules + + 1. Core + 2. Workbench + 3. HRMS + 4. Dashboard + 5. Engagement + 6. Payment + +## Starting with Digit-UI App (Impelmentation Teams) - MICRO-UI + + +Go to the Sub directory to run UI + +```bash + cd into micro-ui/web +``` + +```bash + yarn install +``` + +Add .env file +```bash + micro-ui/web/.env +``` + +Start the server + +```bash + yarn start +``` + + +![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png) diff --git a/frontend/workbench-ui/package.json b/frontend/workbench-ui/package.json new file mode 100644 index 00000000000..19a3c47d6ee --- /dev/null +++ b/frontend/workbench-ui/package.json @@ -0,0 +1,4 @@ +{ + "name": "workbench-ui", + "version": "1.0.0" +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/.babelrc b/frontend/workbench-ui/web/.babelrc new file mode 100644 index 00000000000..5f90443d15e --- /dev/null +++ b/frontend/workbench-ui/web/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + "@babel/preset-env","@babel/preset-react" + ] + } \ No newline at end of file diff --git a/frontend/workbench-ui/web/.env.sample b/frontend/workbench-ui/web/.env.sample new file mode 100644 index 00000000000..e87c7f586c4 --- /dev/null +++ b/frontend/workbench-ui/web/.env.sample @@ -0,0 +1,3 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_STATE_LEVEL_TENANT_ID=pb +REACT_APP_PROXY_URL=https://works-dev.digit.org diff --git a/frontend/workbench-ui/web/core/App.js b/frontend/workbench-ui/web/core/App.js new file mode 100644 index 00000000000..26a4f11a8ed --- /dev/null +++ b/frontend/workbench-ui/web/core/App.js @@ -0,0 +1,72 @@ +import React from "react"; +import { initLibraries } from "@egovernments/digit-ui-libraries"; +import { + paymentConfigs, + PaymentLinks, + PaymentModule, +} from "@egovernments/digit-ui-module-common"; +import { DigitUI } from "@egovernments/digit-ui-module-core"; +import { initDSSComponents } from "@egovernments/digit-ui-module-dss"; +import { initEngagementComponents } from "@egovernments/digit-ui-module-engagement"; +import { initHRMSComponents } from "@egovernments/digit-ui-module-hrms"; +import { initUtilitiesComponents } from "@egovernments/digit-ui-module-utilities"; +import { UICustomizations } from "./Customisations/UICustomizations"; +import { initWorkbenchComponents } from "@egovernments/digit-ui-module-workbench"; + +window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH"); + +const enabledModules = [ + "DSS", + "NDSS", + "Utilities", + "HRMS", + "Engagement", + "Workbench", +]; + +const moduleReducers = (initData) => ({ + initData, +}); + +const initDigitUI = () => { + window.Digit.ComponentRegistryService.setupRegistry({ + PaymentModule, + ...paymentConfigs, + PaymentLinks, + }); + + initDSSComponents(); + initHRMSComponents(); + initEngagementComponents(); + initUtilitiesComponents(); + initWorkbenchComponents(); + + window.Digit.Customizations = { + PGR: {}, + commonUiConfig: UICustomizations, + }; +}; + +initLibraries().then(() => { + initDigitUI(); +}); + +function App() { + window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH"); + const stateCode = + window.globalConfigs?.getConfig("STATE_LEVEL_TENANT_ID") || + process.env.REACT_APP_STATE_LEVEL_TENANT_ID; + if (!stateCode) { + return

stateCode is not defined

; + } + return ( + + ); +} + +export default App; diff --git a/frontend/workbench-ui/web/core/Dockerfile b/frontend/workbench-ui/web/core/Dockerfile new file mode 100644 index 00000000000..0e5c5add33d --- /dev/null +++ b/frontend/workbench-ui/web/core/Dockerfile @@ -0,0 +1,29 @@ +FROM egovio/alpine-node-builder-14:yarn AS build +#FROM ghcr.io/egovernments/alpine-node-builder-14:yarn AS build +RUN apk update && apk upgrade +RUN apk add --no-cache git>2.30.0 +ARG WORK_DIR +WORKDIR /app +ENV NODE_OPTIONS "--max-old-space-size=4792" + +COPY ${WORK_DIR} . +RUN ls -lah + +#RUN node web/envs.js +RUN cd web/ \ + && node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(1024*1024))' \ + && node -e 'console.log("core only")' \ + && cd core/ \ + && ./install-deps.sh \ + && cd ../ \ + && yarn install \ + && yarn build:webpack + +FROM nginx:mainline-alpine +#FROM ghcr.io/egovernments/nginx:mainline-alpine +ENV WORK_DIR=/var/web/core-ui + +RUN mkdir -p ${WORK_DIR} + +COPY --from=build /app/web/build ${WORK_DIR}/ +COPY --from=build /app/web/core/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/frontend/workbench-ui/web/core/install-deps.sh b/frontend/workbench-ui/web/core/install-deps.sh new file mode 100644 index 00000000000..3de106c45f7 --- /dev/null +++ b/frontend/workbench-ui/web/core/install-deps.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +BRANCH="$(git branch --show-current)" + +echo "Main Branch: $BRANCH" + +INTERNALS="micro-ui-internals" +cd .. + +cp core/App.js src +cp core/package.json package.json +cp core/webpack.config.js webpack.config.js +cp core/inter-package.json $INTERNALS/package.json + +cp $INTERNALS/example/src/UICustomizations.js src/Customisations + +echo "UI :: core " && echo "Branch: $(git branch --show-current)" && echo "$(git log -1 --pretty=%B)" && echo "installing packages" + diff --git a/frontend/workbench-ui/web/core/inter-package.json b/frontend/workbench-ui/web/core/inter-package.json new file mode 100644 index 00000000000..41a1aaecd38 --- /dev/null +++ b/frontend/workbench-ui/web/core/inter-package.json @@ -0,0 +1,74 @@ +{ + "name": "egovernments", + "version": "1.0.0", + "main": "index.js", + "workspaces": [ + "packages/libraries", + "example", + "packages/css", + "packages/react-components", + "packages/modules/*" + ], + "author": "JaganKumar ", + "license": "MIT", + "private": true, + "engines": { + "node": ">=14" + }, + "scripts": { + "start": "SKIP_PREFLIGHT_CHECK=true run-s build start:dev", + "sprint": "SKIP_PREFLIGHT_CHECK=true run-s start:script", + "start:dev": "run-p dev:**", + "start:script": "./scripts/create.sh", + "dev:css": "cd packages/css && yarn start", + "publish:css": "cd packages/css && yarn publish --access public", + "dev:libraries": "cd packages/libraries && yarn start", + "dev:components": "cd packages/react-components && yarn start", + "dev:example": "cd example && yarn start", + "dev:core": "cd packages/modules/core && yarn start", + "dev:dss": "cd packages/modules/dss && yarn start", + "dev:hrms": "cd packages/modules/hrms && yarn start", + "devD:common": "cd packages/modules/common && yarn start", + "devD:utilities": "cd packages/modules/utilities && yarn start", + "dev:workbench": "cd packages/modules/workbench && yarn start", + "dev:engagement": "cd packages/modules/engagement && yarn start", + "build": "run-p build:**", + "build:libraries": "cd packages/libraries && yarn build", + "build:components": "cd packages/react-components && yarn build", + "build:svgcomponents": "cd packages/svg-components && yarn build", + "build:dss": "cd packages/modules/dss && yarn build", + "build:core": "cd packages/modules/core && yarn build", + "build:hrms": "cd packages/modules/hrms && yarn build", + "build:common": "cd packages/modules/common && yarn build", + "build:utilities": "cd packages/modules/utilities && yarn build", + "build:engagement": "cd packages/modules/engagement && yarn build", + "build:workbench": "cd packages/modules/workbench && yarn build", + "deploy:jenkins": "./scripts/jenkins.sh", + "clean": "rm -rf node_modules" + }, + "resolutions": { + "**/@babel/runtime": "7.20.1", + "**/babel-preset-react-app": "10.0.0" + }, + "devDependencies": { + "husky": "7.0.4", + "lint-staged": "12.3.7", + "npm-run-all": "4.1.5", + "prettier": "2.1.2" + }, + "husky": {}, + "lint-staged": { + "*.{js,css,md}": "prettier --write" + }, + "dependencies": { + "lodash": "4.17.21", + "microbundle-crl": "0.13.11", + "@egovernments/digit-ui-react-components": "1.8.0-beta.1", + "react": "17.0.2", + "react-dom": "17.0.2", + "react-hook-form": "6.15.8", + "react-i18next": "11.16.2", + "react-query": "3.6.1", + "react-router-dom": "5.3.0" + } +} diff --git a/frontend/workbench-ui/web/core/nginx.conf b/frontend/workbench-ui/web/core/nginx.conf new file mode 100644 index 00000000000..cd96c34913f --- /dev/null +++ b/frontend/workbench-ui/web/core/nginx.conf @@ -0,0 +1,12 @@ +server +{ + listen 80; + underscores_in_headers on; + + location /core-ui + { + root /var/web; + index index.html index.htm; + try_files $uri $uri/ /core-ui/index.html; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/core/package.json b/frontend/workbench-ui/web/core/package.json new file mode 100644 index 00000000000..62675c6355d --- /dev/null +++ b/frontend/workbench-ui/web/core/package.json @@ -0,0 +1,84 @@ +{ + "name": "micro-ui", + "version": "1.0.0", + "author": "Jagankumar ", + "license": "MIT", + "private": true, + "engines": { + "node": ">=14" + }, + "workspaces": [ + "micro-ui-internals/packages/libraries", + "micro-ui-internals/packages/react-components", + "micro-ui-internals/packages/modules/*" + ], + "homepage": "/core-ui", + "dependencies": { + "@egovernments/digit-ui-libraries": "1.8.0-beta", + "@egovernments/digit-ui-module-workbench": "1.0.0-beta", + "@egovernments/digit-ui-module-core": "1.8.0-beta.5", + "@egovernments/digit-ui-module-hrms": "1.8.0-beta.2", + "@egovernments/digit-ui-react-components": "1.8.0-beta.1", + "@egovernments/digit-ui-module-dss": "1.8.0-beta", + "@egovernments/digit-ui-module-common": "1.8.0-beta", + "@egovernments/digit-ui-module-utilities": "1.0.0-beta", + "@egovernments/digit-ui-module-engagement": "1.5.20", + "babel-loader": "8.1.0", + "clean-webpack-plugin": "4.0.0", + "react": "17.0.2", + "react-dom": "17.0.2", + "jsonpath": "^1.1.1", + "react-router-dom": "5.3.0", + "react-scripts": "4.0.1", + "web-vitals": "1.1.2", + "terser-brunch": "^4.1.0", + "react-hook-form": "6.15.8", + "react-i18next": "11.16.2", + "react-query": "3.6.1", + "css-loader":"5.2.6", + "style-loader": "2.0.0", + "webpack-cli": "4.10.0" + }, + "devDependencies": { + "@babel/plugin-proposal-private-property-in-object": "7.21.0", + "http-proxy-middleware": "1.3.1", + "lodash": "4.17.21", + "microbundle-crl": "0.13.11", + "react": "17.0.2", + "react-dom": "17.0.2", + "react-hook-form": "6.15.8", + "react-i18next": "11.16.2", + "react-query": "3.6.1", + "react-router-dom": "5.3.0", + "husky": "7.0.4", + "lint-staged": "12.3.7", + "npm-run-all": "4.1.5", + "prettier": "2.1.2" + }, + "scripts": { + "start": "react-scripts start", + "build": "GENERATE_SOURCEMAP=false SKIP_PREFLIGHT_CHECK=true react-scripts build", + "build:prepare": "./build.sh", + "build:libraries": "cd micro-ui-internals && yarn build", + "build:prod": "webpack --mode production", + "build:webpack":"yarn build:libraries &&cd .. && ls && cd ./web && ls && yarn build:prod", + "clean": "rm -rf node_modules" + }, + "eslintConfig": { + "extends": [ + "react-app" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/frontend/workbench-ui/web/core/webpack.config.js b/frontend/workbench-ui/web/core/webpack.config.js new file mode 100644 index 00000000000..83428036d3e --- /dev/null +++ b/frontend/workbench-ui/web/core/webpack.config.js @@ -0,0 +1,44 @@ +const path = require("path"); +const HtmlWebpackPlugin = require("html-webpack-plugin"); +const { CleanWebpackPlugin } = require("clean-webpack-plugin"); +// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; + +module.exports = { + // mode: 'development', + entry: "./src/index.js", + devtool: "none", + module: { + rules: [ + { + test: /\.(js)$/, + exclude: /node_modules/, + use: ["babel-loader"], + }, + { + test: /\.css$/i, + use: ["style-loader", "css-loader"], + } + ], + }, + output: { + filename: "[name].bundle.js", + path: path.resolve(__dirname, "build"), + publicPath: "/core-ui/", + }, + optimization: { + splitChunks: { + chunks: 'all', + minSize:20000, + maxSize:50000, + enforceSizeThreshold:50000, + minChunks:1, + maxAsyncRequests:30, + maxInitialRequests:30 + }, + }, + plugins: [ + new CleanWebpackPlugin(), + // new BundleAnalyzerPlugin(), + new HtmlWebpackPlugin({ inject: true, template: "public/index.html" }), + ], +}; \ No newline at end of file diff --git a/frontend/workbench-ui/web/docker/Dockerfile b/frontend/workbench-ui/web/docker/Dockerfile new file mode 100644 index 00000000000..72d64bbab52 --- /dev/null +++ b/frontend/workbench-ui/web/docker/Dockerfile @@ -0,0 +1,26 @@ +# FROM egovio/alpine-node-builder-14:yarn AS build +FROM ghcr.io/egovernments/alpine-node-builder-14:yarn AS build +RUN apk update && apk upgrade +RUN apk add --no-cache git>2.30.0 +ARG WORK_DIR +WORKDIR /app +ENV NODE_OPTIONS "--max-old-space-size=8168" + +COPY ${WORK_DIR} . +RUN ls -lah + +#RUN node web/envs.js +RUN cd web/ \ + && chmod +x install-deps.sh \ + && ./install-deps.sh \ + && yarn install \ + && yarn build:webpack + +FROM nginx:mainline-alpine +#FROM ghcr.io/egovernments/nginx:mainline-alpine +ENV WORK_DIR=/var/web/digit-ui + +RUN mkdir -p ${WORK_DIR} + +COPY --from=build /app/web/build ${WORK_DIR}/ +COPY --from=build /app/web/docker/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/frontend/workbench-ui/web/docker/devDockerfile b/frontend/workbench-ui/web/docker/devDockerfile new file mode 100644 index 00000000000..d7b1ba1870a --- /dev/null +++ b/frontend/workbench-ui/web/docker/devDockerfile @@ -0,0 +1,26 @@ +#FROM egovio/alpine-node-builder-14:yarn AS build +FROM ghcr.io/egovernments/alpine-node-builder-14:yarn AS build +RUN apk update && apk upgrade +RUN apk add --no-cache git>2.30.0 +ARG WORK_DIR +WORKDIR /app +ENV NODE_OPTIONS "--max-old-space-size=1792" + +COPY ${WORK_DIR} . +RUN ls -lah + +#RUN node web/envs.js +RUN cd web/ \ + && node envs.js \ + && ./install-deps.sh \ + && yarn install \ + && yarn build + +#FROM nginx:mainline-alpine +FROM ghcr.io/egovernments/nginx:mainline-alpine +ENV WORK_DIR=/var/web/digit-ui + +RUN mkdir -p ${WORK_DIR} + +COPY --from=build /app/web/build ${WORK_DIR}/ +COPY --from=build /app/web/docker/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/frontend/workbench-ui/web/docker/masDockerfile b/frontend/workbench-ui/web/docker/masDockerfile new file mode 100644 index 00000000000..5d7cf45dd87 --- /dev/null +++ b/frontend/workbench-ui/web/docker/masDockerfile @@ -0,0 +1,25 @@ +#FROM egovio/alpine-node-builder-14:yarn AS build +FROM ghcr.io/egovernments/alpine-node-builder-14:yarn AS build +RUN apk update && apk upgrade +RUN apk add --no-cache git>2.30.0 +ARG WORK_DIR +WORKDIR /app +ENV NODE_OPTIONS "--max-old-space-size=3792" + +COPY ${WORK_DIR} . +RUN ls -lah + +#RUN node web/envs.js +RUN cd web/ \ + && node envs.js \ + && yarn install \ + && yarn build + +#FROM nginx:mainline-alpine +FROM ghcr.io/egovernments/nginx:mainline-alpine +ENV WORK_DIR=/var/web/digit-ui + +RUN mkdir -p ${WORK_DIR} + +COPY --from=build /app/web/build ${WORK_DIR}/ +COPY --from=build /app/web/docker/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/frontend/workbench-ui/web/docker/nginx.conf b/frontend/workbench-ui/web/docker/nginx.conf new file mode 100644 index 00000000000..4f532e4a6ed --- /dev/null +++ b/frontend/workbench-ui/web/docker/nginx.conf @@ -0,0 +1,12 @@ +server +{ + listen 80; + underscores_in_headers on; + + location /digit-ui + { + root /var/web; + index index.html index.htm; + try_files $uri $uri/ /digit-ui/index.html; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/envs.js b/frontend/workbench-ui/web/envs.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/frontend/workbench-ui/web/install-deps.sh b/frontend/workbench-ui/web/install-deps.sh new file mode 100644 index 00000000000..efaceaee20d --- /dev/null +++ b/frontend/workbench-ui/web/install-deps.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +BRANCH="$(git branch --show-current)" + +echo "Main Branch: $BRANCH" + +INTERNALS="micro-ui-internals" + +cp $INTERNALS/example/src/UICustomizations.js src/Customisations + +cd $INTERNALS && echo "Branch: $(git branch --show-current)" && echo "$(git log -1 --pretty=%B)" && echo "installing packages" + + +# yarn install diff --git a/frontend/workbench-ui/web/micro-ui-internals/.gitignore b/frontend/workbench-ui/web/micro-ui-internals/.gitignore new file mode 100644 index 00000000000..1747c795d6f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/.gitignore @@ -0,0 +1,143 @@ +# Created by https://www.toptal.com/developers/gitignore/api/node,react +# Edit at https://www.toptal.com/developers/gitignore?templates=node,react + +### eGov ### +packages/css/example/index.css +package-lock.json +locales/ +build/ +packages/**/dist/ + +# yarn # +.yarn +.yarnrc.yml + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test +.env*.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +dist-storybook + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +### react ### +.DS_* +**/*.backup.* +**/*.back.* + +node_modules + +*.sublime* + +psd +thumb +sketch + +# vs code +.vscode/ + +# End of https://www.toptal.com/developers/gitignore/api/node,react \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/.prettierignore b/frontend/workbench-ui/web/micro-ui-internals/.prettierignore new file mode 100644 index 00000000000..d54de016ef0 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/.prettierignore @@ -0,0 +1,23 @@ + +# See https://help.github.com/ignore-files/ for more about ignoring files. +# dependencies +node_modules +# builds +build +dist +.rpt2_cache +# dev +dev.css +index.css +index.compat.css +index.min.css +# misc +.DS_Store +.env +.env.local +.env.development.local +.env.test.local +.env.production.local +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/frontend/workbench-ui/web/micro-ui-internals/.prettierrc.json b/frontend/workbench-ui/web/micro-ui-internals/.prettierrc.json new file mode 100644 index 00000000000..b975008d6f8 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "printWidth": 150 +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/README.md b/frontend/workbench-ui/web/micro-ui-internals/README.md new file mode 100644 index 00000000000..f23a1fcfe9c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/README.md @@ -0,0 +1,100 @@ + +# workbench ui + +A React App built on top of DIGIT UI Core. + + +# DIGIT UI + +DIGIT (Digital Infrastructure for Governance, Impact & Transformation) is India's largest platform for governance services. Visit https://www.digit.org for more details. + +This repository contains source code for web implementation of the new Digit UI modules with dependencies and libraries. + +Workbench module is used to Manage the master data (MDMS V2 Service) used across the DIGIT Services / Applications + +It is also used to manage the Localisation data present in the system (Localisation service) + + +## Run Locally + +Clone the project + +```bash + git clone https://github.com/egovernments/Digit-Core.git +``` + +Go to the Sub directory to run UI +```bash + cd into frontend/micro-ui/web/micro-ui-internals +``` + +Install dependencies + +```bash + yarn install +``` + +Add .env file +```bash + frontend/micro-ui/web/micro-ui-internals/example/.env +``` + +Start the server + +```bash + yarn start +``` + + +## Environment Variables + +To run this project, you will need to add the following environment variables to your .env file + +`REACT_APP_PROXY_API` :: `{{server url}}` + +`REACT_APP_GLOBAL` :: `{{server url}}` + +`REACT_APP_PROXY_ASSETS` :: `{{server url}}` + +`REACT_APP_USER_TYPE` :: `{{EMPLOYEE||CITIZEN}}` + +`SKIP_PREFLIGHT_CHECK` :: `true` + +[sample .env file](https://github.com/egovernments/Digit-Core/blob/workbench/frontend/micro-ui/web/micro-ui-internals/example/.env-unifieddev) + +## Tech Stack + +**Libraries:** + +[React](https://react.dev/) + +[React Hook Form](https://www.react-hook-form.com/) + +[React Query](https://tanstack.com/query/v3/) + +[Tailwind CSS](https://tailwindcss.com/) + +[Webpack](https://webpack.js.org/) + +## License + +[MIT](https://choosealicense.com/licenses/mit/) + + +## Author + +- [@jagankumar-egov](https://www.github.com/jagankumar-egov) + + +## Documentation + +[Documentation](https://https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui) + + +## Support + +For support, add the issues in https://github.com/egovernments/DIGIT-core/issues. + + +![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png) + diff --git a/frontend/workbench-ui/web/micro-ui-internals/clean.sh b/frontend/workbench-ui/web/micro-ui-internals/clean.sh new file mode 100644 index 00000000000..2235ef1c1d0 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/clean.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +BASEDIR="$( cd "$( dirname "$0" )" && pwd )" + +msg() { + echo -e "\n\n\033[32;32m$1\033[0m" +} + +msg "Cleaning root" +rm -rf node_modules + +msg "Cleaning css" +cd "$BASEDIR/packages/css" && rm -rf node_modules + +msg "Cleaning libraries" +cd "$BASEDIR/packages/libraries" && rm -rf node_modules + +msg "Cleaning react-components" +cd "$BASEDIR/packages/react-components" && rm -rf node_modules + +msg "Cleaning PGR module" +cd "$BASEDIR/packages/modules/pgr" && rm -rf node_modules + +msg "Cleaning FSM module" +cd "$BASEDIR/packages/modules/fsm" && rm -rf node_modules + +msg "Cleaning Core module" +cd "$BASEDIR/packages/modules/core" && rm -rf node_modules diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/.env-fsm b/frontend/workbench-ui/web/micro-ui-internals/example/.env-fsm new file mode 100644 index 00000000000..1343375f3f7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/.env-fsm @@ -0,0 +1,7 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_USER_TYPE= +REACT_APP_EMPLOYEE_TOKEN= +REACT_APP_CITIZEN_TOKEN= +REACT_APP_PROXY_API=https://unified-dev.digit.org +REACT_APP_PROXY_ASSETS=https://unified-dev.digit.org +REACT_APP_GLOBAL=https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigsFSM.js diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/.env-health-qa b/frontend/workbench-ui/web/micro-ui-internals/example/.env-health-qa new file mode 100644 index 00000000000..73b42b7dfad --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/.env-health-qa @@ -0,0 +1,7 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_USER_TYPE=EMPLOYEE +REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a +REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c +REACT_APP_PROXY_API=https://health-qa.digit.org +REACT_APP_PROXY_ASSETS=https://health-qa.digit.org +REACT_APP_GLOBAL=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/globalConfigsWorkbenchHCM.js diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/.env-mz-prod b/frontend/workbench-ui/web/micro-ui-internals/example/.env-mz-prod new file mode 100644 index 00000000000..2d02707d7eb --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/.env-mz-prod @@ -0,0 +1,7 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_USER_TYPE=EMPLOYEE +REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a +REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c +REACT_APP_PROXY_API=https://salama.digit.org +REACT_APP_PROXY_ASSETS=https://salama.digit.org +REACT_APP_GLOBAL=https://moz-health-prd.s3.af-south-1.amazonaws.com/globalConfig.js diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/.env-mz-uat b/frontend/workbench-ui/web/micro-ui-internals/example/.env-mz-uat new file mode 100644 index 00000000000..bedf28a95b1 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/.env-mz-uat @@ -0,0 +1,7 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_USER_TYPE=EMPLOYEE +REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a +REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c +REACT_APP_PROXY_API=https://moz-health-uat.digit.org +REACT_APP_PROXY_ASSETS=https://moz-health-uat.digit.org +REACT_APP_GLOBAL=https://moz-health-uat.s3.ap-south-1.amazonaws.com/globalConfig.js diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/.env-qa b/frontend/workbench-ui/web/micro-ui-internals/example/.env-qa new file mode 100644 index 00000000000..fbef1be340a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/.env-qa @@ -0,0 +1,7 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_USER_TYPE=EMPLOYEE +REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a +REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c +REACT_APP_PROXY_API=https://qa.digit.org +REACT_APP_PROXY_ASSETS=https://qa.digit.org +REACT_APP_GLOBAL=https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/.env-unifieddev b/frontend/workbench-ui/web/micro-ui-internals/example/.env-unifieddev new file mode 100644 index 00000000000..e443e98e036 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/.env-unifieddev @@ -0,0 +1,8 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_USER_TYPE=EMPLOYEE +REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a +REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c +REACT_APP_PROXY_API=https://unified-dev.digit.org +REACT_APP_PROXY_ASSETS=https://unified-dev.digit.org +REACT_APP_GLOBAL=https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigsWorkbench.js +REACT_APP_CONTEXT=works \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/.env-upyog b/frontend/workbench-ui/web/micro-ui-internals/example/.env-upyog new file mode 100644 index 00000000000..f434772b7c2 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/.env-upyog @@ -0,0 +1,8 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_USER_TYPE=EMPLOYEE +REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a +REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c +REACT_APP_PROXY_API=https://upyog.niua.org +REACT_APP_PROXY_ASSETS=https://upyog.niua.org +REACT_APP_GLOBAL=https://s3.ap-south-1.amazonaws.com/in-egov-assets/globalConfigs.js +REACT_APP_CONTEXT=digit-ui \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/.env-workbench b/frontend/workbench-ui/web/micro-ui-internals/example/.env-workbench new file mode 100644 index 00000000000..2b49a958229 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/.env-workbench @@ -0,0 +1,8 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_USER_TYPE=EMPLOYEE +REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a +REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c +REACT_APP_PROXY_API=https://works-dev.digit.org +REACT_APP_PROXY_ASSETS=https://works-dev.digit.org +REACT_APP_GLOBAL=https://s3.ap-south-1.amazonaws.com/works-dev-asset/globalConfigsWorkbench.js +REACT_APP_CONTEXT=works \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/.env-workbench-qa b/frontend/workbench-ui/web/micro-ui-internals/example/.env-workbench-qa new file mode 100644 index 00000000000..ccf4e7ca08f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/.env-workbench-qa @@ -0,0 +1,8 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_USER_TYPE=EMPLOYEE +REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a +REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c +REACT_APP_PROXY_API=https://qa.digit.org +REACT_APP_PROXY_ASSETS=https://qa.digit.org +REACT_APP_GLOBAL=https://s3.ap-south-1.amazonaws.com/egov-qa-assets/globalConfigsWorkbench.js +REACT_APP_CONTEXT=works \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/.env-worksdev b/frontend/workbench-ui/web/micro-ui-internals/example/.env-worksdev new file mode 100644 index 00000000000..b42651ee829 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/.env-worksdev @@ -0,0 +1,8 @@ +SKIP_PREFLIGHT_CHECK=true +REACT_APP_USER_TYPE=EMPLOYEE +REACT_APP_EMPLOYEE_TOKEN=c835932f-2ad4-4d05-83d6-49e0b8c59f8a +REACT_APP_CITIZEN_TOKEN=7cd58aae-30b3-41ed-a1b3-3417107a993c +REACT_APP_PROXY_API=https://works-dev.digit.org +REACT_APP_PROXY_ASSETS=https://works-dev.digit.org +REACT_APP_GLOBAL=https://s3.ap-south-1.amazonaws.com/works-dev-asset/globalConfigsWorks.js +REACT_APP_CONTEXT=works \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/maspackage.json b/frontend/workbench-ui/web/micro-ui-internals/example/maspackage.json new file mode 100644 index 00000000000..1f54328562b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/maspackage.json @@ -0,0 +1,31 @@ +{ + "name": "@egovernments/digit-ui-example", + "version": "1.3.0", + "main": "index.js", + "license": "MIT", + "private": true, + "homepage": "digit-ui/", + "scripts": { + "start": "react-scripts start" + }, + "devDependencies": { + "http-proxy-middleware": "^1.0.5", + "react": "17.0.2", + "react-dom": "17.0.2", + "react-i18next": "11.16.2", + "react-router-dom": "5.3.0", + "react-scripts": "^4.0.1" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/package.json b/frontend/workbench-ui/web/micro-ui-internals/example/package.json new file mode 100644 index 00000000000..f3753ae0715 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/package.json @@ -0,0 +1,40 @@ +{ + "name": "@egovernments/digit-ui-example", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "private": true, + "homepage": "digit-ui", + "scripts": { + "start": "react-scripts start" + }, + "devDependencies": { + "@egovernments/digit-ui-libraries": "1.8.0-beta", + "@egovernments/digit-ui-module-workbench": "1.0.0-beta", + "@egovernments/digit-ui-module-dss": "1.8.0-beta", + "@egovernments/digit-ui-module-core": "1.8.0-beta.5", + "@egovernments/digit-ui-module-common": "1.8.0-beta", + "@egovernments/digit-ui-module-hrms": "1.8.0-beta.2", + "@egovernments/digit-ui-module-utilities": "1.0.0-beta", + "@egovernments/digit-ui-module-engagement": "1.5.20", + "@egovernments/digit-ui-react-components": "1.8.0-beta.1", + "http-proxy-middleware": "^1.0.5", + "react": "17.0.2", + "react-dom": "17.0.2", + "react-i18next": "11.16.2", + "react-router-dom": "5.3.0", + "react-scripts": "^4.0.1" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/public/index.html b/frontend/workbench-ui/web/micro-ui-internals/example/public/index.html new file mode 100644 index 00000000000..b85e17ebfce --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/public/index.html @@ -0,0 +1,26 @@ + + + + + + + + + + DIGIT + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/src/ComponentRegistry.js b/frontend/workbench-ui/web/micro-ui-internals/example/src/ComponentRegistry.js new file mode 100644 index 00000000000..9bafce3dc89 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/src/ComponentRegistry.js @@ -0,0 +1,11 @@ +class Registry { + constructor(registry = {}) { + this._registry = registry; + } + + getComponent(id) { + return this._registry[id]; + } +} + +export default Registry; diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/src/UICustomizations.js b/frontend/workbench-ui/web/micro-ui-internals/example/src/UICustomizations.js new file mode 100644 index 00000000000..140c4664d72 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/src/UICustomizations.js @@ -0,0 +1,420 @@ +import { Link } from "react-router-dom"; +import _ from "lodash"; + +//create functions here based on module name set in mdms(eg->SearchProjectConfig) +//how to call these -> Digit?.Customizations?.[masterName]?.[moduleName] +// these functions will act as middlewares +var Digit = window.Digit || {}; + +const businessServiceMap = { + "muster roll": "MR", +}; + +const inboxModuleNameMap = { + "muster-roll-approval": "muster-roll-service", +}; + +export const UICustomizations = { + businessServiceMap, + updatePayload: (applicationDetails, data, action, businessService) => { + if (businessService === businessServiceMap.estimate) { + const workflow = { + comment: data.comments, + documents: data?.documents?.map((document) => { + return { + documentType: action?.action + " DOC", + fileName: document?.[1]?.file?.name, + fileStoreId: document?.[1]?.fileStoreId?.fileStoreId, + documentUid: document?.[1]?.fileStoreId?.fileStoreId, + tenantId: document?.[1]?.fileStoreId?.tenantId, + }; + }), + assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null, + action: action.action, + }; + //filtering out the data + Object.keys(workflow).forEach((key, index) => { + if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key]; + }); + + return { + estimate: applicationDetails, + workflow, + }; + } + if (businessService === businessServiceMap.contract) { + const workflow = { + comment: data?.comments, + documents: data?.documents?.map((document) => { + return { + documentType: action?.action + " DOC", + fileName: document?.[1]?.file?.name, + fileStoreId: document?.[1]?.fileStoreId?.fileStoreId, + documentUid: document?.[1]?.fileStoreId?.fileStoreId, + tenantId: document?.[1]?.fileStoreId?.tenantId, + }; + }), + assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null, + action: action.action, + }; + //filtering out the data + Object.keys(workflow).forEach((key, index) => { + if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key]; + }); + + return { + contract: applicationDetails, + workflow, + }; + } + if (businessService === businessServiceMap?.["muster roll"]) { + const workflow = { + comment: data?.comments, + documents: data?.documents?.map((document) => { + return { + documentType: action?.action + " DOC", + fileName: document?.[1]?.file?.name, + fileStoreId: document?.[1]?.fileStoreId?.fileStoreId, + documentUid: document?.[1]?.fileStoreId?.fileStoreId, + tenantId: document?.[1]?.fileStoreId?.tenantId, + }; + }), + assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null, + action: action.action, + }; + //filtering out the data + Object.keys(workflow).forEach((key, index) => { + if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key]; + }); + + return { + musterRoll: applicationDetails, + workflow, + }; + } + if (businessService === businessServiceMap?.["works.purchase"]) { + const workflow = { + comment: data.comments, + documents: data?.documents?.map((document) => { + return { + documentType: action?.action + " DOC", + fileName: document?.[1]?.file?.name, + fileStoreId: document?.[1]?.fileStoreId?.fileStoreId, + documentUid: document?.[1]?.fileStoreId?.fileStoreId, + tenantId: document?.[1]?.fileStoreId?.tenantId, + }; + }), + assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null, + action: action.action, + }; + //filtering out the data + Object.keys(workflow).forEach((key, index) => { + if (!workflow[key] || workflow[key]?.length === 0) delete workflow[key]; + }); + + const additionalFieldsToSet = { + projectId: applicationDetails.additionalDetails.projectId, + invoiceDate: applicationDetails.billDate, + invoiceNumber: applicationDetails.referenceId.split("_")?.[1], + contractNumber: applicationDetails.referenceId.split("_")?.[0], + documents: applicationDetails.additionalDetails.documents, + }; + return { + bill: { ...applicationDetails, ...additionalFieldsToSet }, + workflow, + }; + } + }, + enableModalSubmit: (businessService, action, setModalSubmit, data) => { + if (businessService === businessServiceMap?.["muster roll"] && action.action === "APPROVE") { + setModalSubmit(data?.acceptTerms); + } + }, + enableHrmsSearch: (businessService, action) => { + if (businessService === businessServiceMap.estimate) { + return action.action.includes("TECHNICALSANCTION") || action.action.includes("VERIFYANDFORWARD"); + } + if (businessService === businessServiceMap.contract) { + return action.action.includes("VERIFY_AND_FORWARD"); + } + if (businessService === businessServiceMap?.["muster roll"]) { + return action.action.includes("VERIFY"); + } + if (businessService === businessServiceMap?.["works.purchase"]) { + return action.action.includes("VERIFY_AND_FORWARD"); + } + return false; + }, + getBusinessService: (moduleCode) => { + if (moduleCode?.includes("estimate")) { + return businessServiceMap?.estimate; + } else if (moduleCode?.includes("contract")) { + return businessServiceMap?.contract; + } else if (moduleCode?.includes("muster roll")) { + return businessServiceMap?.["muster roll"]; + } else if (moduleCode?.includes("works.purchase")) { + return businessServiceMap?.["works.purchase"]; + } else if (moduleCode?.includes("works.wages")) { + return businessServiceMap?.["works.wages"]; + } else if (moduleCode?.includes("works.supervision")) { + return businessServiceMap?.["works.supervision"]; + } else { + return businessServiceMap; + } + }, + getInboxModuleName: (moduleCode) => { + if (moduleCode?.includes("estimate")) { + return inboxModuleNameMap?.estimate; + } else if (moduleCode?.includes("contract")) { + return inboxModuleNameMap?.contracts; + } else if (moduleCode?.includes("attendence")) { + return inboxModuleNameMap?.attendencemgmt; + } else { + return inboxModuleNameMap; + } + }, + + AttendanceInboxConfig: { + preProcess: (data) => { + //set tenantId + data.body.inbox.tenantId = Digit.ULBService.getCurrentTenantId(); + data.body.inbox.processSearchCriteria.tenantId = Digit.ULBService.getCurrentTenantId(); + + const musterRollNumber = data?.body?.inbox?.moduleSearchCriteria?.musterRollNumber?.trim(); + if (musterRollNumber) data.body.inbox.moduleSearchCriteria.musterRollNumber = musterRollNumber; + + const attendanceRegisterName = data?.body?.inbox?.moduleSearchCriteria?.attendanceRegisterName?.trim(); + if (attendanceRegisterName) data.body.inbox.moduleSearchCriteria.attendanceRegisterName = attendanceRegisterName; + + // deleting them for now(assignee-> need clarity from pintu,ward-> static for now,not implemented BE side) + const assignee = _.clone(data.body.inbox.moduleSearchCriteria.assignee); + delete data.body.inbox.moduleSearchCriteria.assignee; + if (assignee?.code === "ASSIGNED_TO_ME") { + data.body.inbox.moduleSearchCriteria.assignee = Digit.UserService.getUser().info.uuid; + } + + //cloning locality and workflow states to format them + // let locality = _.clone(data.body.inbox.moduleSearchCriteria.locality ? data.body.inbox.moduleSearchCriteria.locality : []); + + let selectedOrg = _.clone(data.body.inbox.moduleSearchCriteria.orgId ? data.body.inbox.moduleSearchCriteria.orgId : null); + delete data.body.inbox.moduleSearchCriteria.orgId; + if (selectedOrg) { + data.body.inbox.moduleSearchCriteria.orgId = selectedOrg?.[0]?.applicationNumber; + } + + // let selectedWard = _.clone(data.body.inbox.moduleSearchCriteria.ward ? data.body.inbox.moduleSearchCriteria.ward : null); + // delete data.body.inbox.moduleSearchCriteria.ward; + // if(selectedWard) { + // data.body.inbox.moduleSearchCriteria.ward = selectedWard?.[0]?.code; + // } + + let states = _.clone(data.body.inbox.moduleSearchCriteria.state ? data.body.inbox.moduleSearchCriteria.state : []); + let ward = _.clone(data.body.inbox.moduleSearchCriteria.ward ? data.body.inbox.moduleSearchCriteria.ward : []); + // delete data.body.inbox.moduleSearchCriteria.locality; + delete data.body.inbox.moduleSearchCriteria.state; + delete data.body.inbox.moduleSearchCriteria.ward; + + // locality = locality?.map((row) => row?.code); + states = Object.keys(states)?.filter((key) => states[key]); + ward = ward?.map((row) => row?.code); + + // //adding formatted data to these keys + // if (locality.length > 0) data.body.inbox.moduleSearchCriteria.locality = locality; + if (states.length > 0) data.body.inbox.moduleSearchCriteria.status = states; + if (ward.length > 0) data.body.inbox.moduleSearchCriteria.ward = ward; + const projectType = _.clone(data.body.inbox.moduleSearchCriteria.projectType ? data.body.inbox.moduleSearchCriteria.projectType : {}); + if (projectType?.code) data.body.inbox.moduleSearchCriteria.projectType = projectType.code; + + //adding tenantId to moduleSearchCriteria + data.body.inbox.moduleSearchCriteria.tenantId = Digit.ULBService.getCurrentTenantId(); + + //setting limit and offset becoz somehow they are not getting set in muster inbox + data.body.inbox.limit = data.state.tableForm.limit; + data.body.inbox.offset = data.state.tableForm.offset; + delete data.state; + return data; + }, + postProcess: (responseArray, uiConfig) => { + const statusOptions = responseArray?.statusMap + ?.filter((item) => item.applicationstatus) + ?.map((item) => ({ code: item.applicationstatus, i18nKey: `COMMON_MASTERS_${item.applicationstatus}` })); + if (uiConfig?.type === "filter") { + let fieldConfig = uiConfig?.fields?.filter((item) => item.type === "dropdown" && item.populators.name === "musterRollStatus"); + if (fieldConfig.length) { + fieldConfig[0].populators.options = statusOptions; + } + } + }, + additionalCustomizations: (row, key, column, value, t, searchResult) => { + if (key === "ATM_MUSTER_ROLL_ID") { + return ( + + + {String(value ? (column.translate ? t(column.prefix ? `${column.prefix}${value}` : value) : value) : t("ES_COMMON_NA"))} + + + ); + } + if (key === "ATM_ATTENDANCE_WEEK") { + const week = `${Digit.DateUtils.ConvertTimestampToDate(value?.startDate, "dd/MM/yyyy")}-${Digit.DateUtils.ConvertTimestampToDate( + value?.endDate, + "dd/MM/yyyy" + )}`; + return
{week}
; + } + if (key === "ATM_NO_OF_INDIVIDUALS") { + return
{value?.length}
; + } + if (key === "ATM_AMOUNT_IN_RS") { + return {value ? Digit.Utils.dss.formatterWithoutRound(value, "number") : t("ES_COMMON_NA")}; + } + if (key === "ATM_SLA") { + return parseInt(value) > 0 ? ( + {t(value) || ""} + ) : ( + {t(value) || ""} + ); + } + if (key === "COMMON_WORKFLOW_STATES") { + return {t(`WF_MUSTOR_${value}`)}; + } + //added this in case we change the key and not updated here , it'll throw that nothing was returned from cell error if that case is not handled here. To prevent that error putting this default + return {t(`CASE_NOT_HANDLED`)}; + }, + MobileDetailsOnClick: (row, tenantId) => { + let link; + Object.keys(row).map((key) => { + if (key === "ATM_MUSTER_ROLL_ID") + link = `/${window.contextPath}/employee/attendencemgmt/view-attendance?tenantId=${tenantId}&musterRollNumber=${row[key]}`; + }); + return link; + }, + populateReqCriteria: () => { + const tenantId = Digit.ULBService.getCurrentTenantId(); + return { + url: "/org-services/organisation/v1/_search", + params: { limit: 50, offset: 0 }, + body: { + SearchCriteria: { + tenantId: tenantId, + functions: { + type: "CBO", + }, + }, + }, + config: { + enabled: true, + select: (data) => { + return data?.organisations; + }, + }, + }; + }, + }, + SearchWageSeekerConfig: { + customValidationCheck: (data) => { + //checking both to and from date are present + const { createdFrom, createdTo } = data; + if ((createdFrom === "" && createdTo !== "") || (createdFrom !== "" && createdTo === "")) + return { warning: true, label: "ES_COMMON_ENTER_DATE_RANGE" }; + + return false; + }, + preProcess: (data) => { + data.params = { ...data.params, tenantId: Digit.ULBService.getCurrentTenantId() }; + + let requestBody = { ...data.body.Individual }; + const pathConfig = { + name: "name.givenName", + }; + const dateConfig = { + createdFrom: "daystart", + createdTo: "dayend", + }; + const selectConfig = { + wardCode: "wardCode[0].code", + socialCategory: "socialCategory.code", + }; + const textConfig = ["name", "individualId"]; + let Individual = Object.keys(requestBody) + .map((key) => { + if (selectConfig[key]) { + requestBody[key] = _.get(requestBody, selectConfig[key], null); + } else if (typeof requestBody[key] == "object") { + requestBody[key] = requestBody[key]?.code; + } else if (textConfig?.includes(key)) { + requestBody[key] = requestBody[key]?.trim(); + } + return key; + }) + .filter((key) => requestBody[key]) + .reduce((acc, curr) => { + if (pathConfig[curr]) { + _.set(acc, pathConfig[curr], requestBody[curr]); + } else if (dateConfig[curr] && dateConfig[curr]?.includes("day")) { + _.set(acc, curr, Digit.Utils.date.convertDateToEpoch(requestBody[curr], dateConfig[curr])); + } else { + _.set(acc, curr, requestBody[curr]); + } + return acc; + }, {}); + + data.body.Individual = { ...Individual }; + return data; + }, + additionalCustomizations: (row, key, column, value, t, searchResult) => { + //here we can add multiple conditions + //like if a cell is link then we return link + //first we can identify which column it belongs to then we can return relevant result + switch (key) { + case "MASTERS_WAGESEEKER_ID": + return ( + + + {String(value ? (column.translate ? t(column.prefix ? `${column.prefix}${value}` : value) : value) : t("ES_COMMON_NA"))} + + + ); + + case "MASTERS_SOCIAL_CATEGORY": + return value ? {String(t(`MASTERS_${value}`))} : t("ES_COMMON_NA"); + + case "CORE_COMMON_PROFILE_CITY": + return value ? {String(t(Digit.Utils.locale.getCityLocale(value)))} : t("ES_COMMON_NA"); + + case "MASTERS_WARD": + return value ? ( + {String(t(Digit.Utils.locale.getMohallaLocale(value, row?.tenantId)))} + ) : ( + t("ES_COMMON_NA") + ); + + case "MASTERS_LOCALITY": + return value ? ( + {String(t(Digit.Utils.locale.getMohallaLocale(value, row?.tenantId)))} + ) : ( + t("ES_COMMON_NA") + ); + default: + return t("ES_COMMON_NA"); + } + }, + MobileDetailsOnClick: (row, tenantId) => { + let link; + Object.keys(row).map((key) => { + if (key === "MASTERS_WAGESEEKER_ID") + link = `/${window.contextPath}/employee/masters/view-wageseeker?tenantId=${tenantId}&wageseekerId=${row[key]}`; + }); + return link; + }, + additionalValidations: (type, data, keys) => { + if (type === "date") { + return data[keys.start] && data[keys.end] ? () => new Date(data[keys.start]).getTime() <= new Date(data[keys.end]).getTime() : true; + } + }, + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/src/complaintConfig.js b/frontend/workbench-ui/web/micro-ui-internals/example/src/complaintConfig.js new file mode 100644 index 00000000000..28c85515205 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/src/complaintConfig.js @@ -0,0 +1,31 @@ +export const config = { + routes: { + "complaint-type": { + nextStep: "pincode", + }, + landmark: { + nextStep: "apartment", + }, + apartment: { + component: "SelectName", + texts: { + header: "Apartment or Society", + cardText: "CS_COMPLAINT_SUBTYPE_TEXT", + submitBarLabel: "PT_COMMONS_NEXT", + }, + inputs: [ + { + label: "Apartment", + type: "text", + name: "custom.additionalDetails.apartment", + validation: { + minLength: 6, + maxLength: 7, + }, + error: "CORE_COMMON_PINCODE_INVALID", + }, + ], + nextStep: "upload-photos", + }, + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/src/components/SelectName.js b/frontend/workbench-ui/web/micro-ui-internals/example/src/components/SelectName.js new file mode 100644 index 00000000000..56d2a195c12 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/src/components/SelectName.js @@ -0,0 +1,8 @@ +import React from "react"; +import { FormStep } from "@egovernments/digit-ui-react-components"; + +const SelectName = ({ config, onSelect, onSkip, t }) => { + return ; +}; + +export default SelectName; diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/src/fsm.js b/frontend/workbench-ui/web/micro-ui-internals/example/src/fsm.js new file mode 100644 index 00000000000..271d3ddad56 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/src/fsm.js @@ -0,0 +1,38 @@ +const fsmCustomizations = { + getEmployeeApplicationCustomization: (config, t) => { + const employeeConfig = [ + { + name: "applicationDetails", + // fields: ["sanitationType", "applicationChannel"], + // fieldsOrder: {sanitationType: 0, applicationChannel: 1}, // TODO + allFields: true, // for example: If in applicationDetails you have 10 fields and in fieldsOrder you only enter 3 fields name then on browser you will only see 3 fields in that order but if you want to see rest of 7 fields at the bottom. + // removeFields: ["applicantName"], // type the name of the field in camelCase to remove it + addFields: [ + // by default all the custom fields will add at the bottom, you can add "field name" to "fieldsOrder" if you want them in your custom order. + { + name: "example", + label: t("EXAMPLE"), + type: "text", + isMandatory: true, + populators: { + name: "example", + validation: { + required: true, + pattern: /[A-Za-z]/, + }, + }, + }, + ], + }, + ]; + + return { + config: employeeConfig, + defaultConfig: true, // You want to use defaultConfig and you only want to update one field section. The above employeeConfig is also an order for all the field section. So if defaultConfig is false then on browser you will only see those field section who are inside employeeConfig + }; + }, +}; + +const fsmComponents = {}; + +export { fsmCustomizations, fsmComponents }; diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/src/index.js b/frontend/workbench-ui/web/micro-ui-internals/example/src/index.js new file mode 100644 index 00000000000..e2946604fc0 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/src/index.js @@ -0,0 +1,84 @@ +import React from "react"; +import ReactDOM from "react-dom"; + +import { initLibraries } from "@egovernments/digit-ui-libraries"; +// import { paymentConfigs, PaymentLinks, PaymentModule } from "@egovernments/digit-ui-module-common"; +import { DigitUI } from "@egovernments/digit-ui-module-core"; +import { initDSSComponents } from "@egovernments/digit-ui-module-dss"; +import { initEngagementComponents } from "@egovernments/digit-ui-module-engagement"; +import { initHRMSComponents } from "@egovernments/digit-ui-module-hrms"; +// import { initUtilitiesComponents } from "@egovernments/digit-ui-module-utilities"; +import {initWorkbenchComponents} from "@egovernments/digit-ui-module-workbench"; + +import "@egovernments/digit-ui-css/example/index.css"; + +import { pgrCustomizations } from "./pgr"; +import { UICustomizations } from "./UICustomizations"; + +var Digit = window.Digit || {}; + +const enabledModules = [ "DSS", "HRMS", +"Workbench" +// "Engagement", "NDSS","QuickPayLinks", "Payment", + // "Utilities", +//added to check fsm +// "FSM" +]; + +const initTokens = (stateCode) => { + const userType = window.sessionStorage.getItem("userType") || process.env.REACT_APP_USER_TYPE || "CITIZEN"; + const token = window.localStorage.getItem("token") || process.env[`REACT_APP_${userType}_TOKEN`]; + + const citizenInfo = window.localStorage.getItem("Citizen.user-info"); + + const citizenTenantId = window.localStorage.getItem("Citizen.tenant-id") || stateCode; + + const employeeInfo = window.localStorage.getItem("Employee.user-info"); + const employeeTenantId = window.localStorage.getItem("Employee.tenant-id"); + + const userTypeInfo = userType === "CITIZEN" || userType === "QACT" ? "citizen" : "employee"; + window.Digit.SessionStorage.set("user_type", userTypeInfo); + window.Digit.SessionStorage.set("userType", userTypeInfo); + + if (userType !== "CITIZEN") { + window.Digit.SessionStorage.set("User", { access_token: token, info: userType !== "CITIZEN" ? JSON.parse(employeeInfo) : citizenInfo }); + } else { + // if (!window.Digit.SessionStorage.get("User")?.extraRoleInfo) window.Digit.SessionStorage.set("User", { access_token: token, info: citizenInfo }); + } + + window.Digit.SessionStorage.set("Citizen.tenantId", citizenTenantId); + + if (employeeTenantId && employeeTenantId.length) window.Digit.SessionStorage.set("Employee.tenantId", employeeTenantId); +}; + +const initDigitUI = () => { + window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH") || "digit-ui"; + window.Digit.Customizations = { + PGR: pgrCustomizations, + commonUiConfig: UICustomizations + }; + window?.Digit.ComponentRegistryService.setupRegistry({ + // PaymentModule, + // ...paymentConfigs, + // PaymentLinks, + }); + + initDSSComponents(); + initHRMSComponents(); + initEngagementComponents(); + // initUtilitiesComponents(); + initWorkbenchComponents(); + + + const moduleReducers = (initData) => initData; + + + const stateCode = window?.globalConfigs?.getConfig("STATE_LEVEL_TENANT_ID") || "pb"; + initTokens(stateCode); + + ReactDOM.render(, document.getElementById("root")); +}; + +initLibraries().then(() => { + initDigitUI(); +}); diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/src/pgr.js b/frontend/workbench-ui/web/micro-ui-internals/example/src/pgr.js new file mode 100644 index 00000000000..48a498e4582 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/src/pgr.js @@ -0,0 +1,15 @@ +import SelectName from "./components/SelectName"; + +// import { config as complaintConfig } from "./complaintConfig"; + +const pgrCustomizations = { + // complaintConfig, + getComplaintDetailsTableRows: ({ id, service, role, t }) => { + return {}; + }, +}; + +const pgrComponents = { + SelectName: SelectName, +}; +export { pgrCustomizations, pgrComponents }; diff --git a/frontend/workbench-ui/web/micro-ui-internals/example/src/setupProxy.js b/frontend/workbench-ui/web/micro-ui-internals/example/src/setupProxy.js new file mode 100644 index 00000000000..cf3a6f7c26c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/example/src/setupProxy.js @@ -0,0 +1,87 @@ +const { createProxyMiddleware } = require("http-proxy-middleware"); + +const createProxy = createProxyMiddleware({ + //target: process.env.REACT_APP_PROXY_API || "https://uat.digit.org", + // target: process.env.REACT_APP_PROXY_API || "https://qa.digit.org", + target: process.env.REACT_APP_PROXY_API || "https://works-dev.digit.org", + changeOrigin: true, + secure:false +}); +const assetsProxy = createProxyMiddleware({ + target: process.env.REACT_APP_PROXY_ASSETS || "https://works-dev.digit.org", + changeOrigin: true, + secure:false +}); +const mdmsProxy = createProxyMiddleware({ + target: process.env.REACT_APP_PROXY_ASSETS || "http://localhost:8080", + changeOrigin: true, + secure:false +}); +module.exports = function (app) { + ["/mdms-v2/v2/_create"].forEach((location) => app.use(location, mdmsProxy)); + [ + "/access/v1/actions/mdms", + "/egov-mdms-service", + "/mdms-v2", + "/egov-idgen", + "/egov-location", + "/localization", + "/egov-workflow-v2", + "/pgr-services", + "/filestore", + "/egov-hrms", + "/user-otp", + "/user", + "/fsm", + "/billing-service", + "/collection-services", + "/pdf-service", + "/pg-service", + "/vehicle", + "/vendor", + "/property-services", + "/fsm-calculator/v1/billingSlab/_search", + "/pt-calculator-v2", + "/dashboard-analytics", + "/echallan-services", + "/egov-searcher/bill-genie/mcollectbills/_get", + "/egov-searcher/bill-genie/billswithaddranduser/_get", + "/egov-searcher/bill-genie/waterbills/_get", + "/egov-searcher/bill-genie/seweragebills/_get", + "/egov-pdf/download/UC/mcollect-challan", + "/egov-hrms/employees/_count", + "/tl-services/v1/_create", + "/tl-services/v1/_search", + "/egov-url-shortening/shortener", + "/inbox/v1/_search", + "/inbox/v2/_search", + "/tl-services", + "/tl-calculator", + "/org-services", + "/edcr", + "/bpa-services", + "/noc-services", + "/egov-user-event", + "/egov-document-uploader", + "/egov-pdf", + "/egov-survey-services", + "/ws-services", + "/sw-services", + "/ws-calculator", + "/sw-calculator/", + "/egov-searcher", + "/report", + "/inbox/v1/dss/_search", + "/loi-service", + "/project/v1/", + "/estimate-service", + "/loi-service", + "/works-inbox-service/v2/_search", + "/egov-pdf/download/WORKSESTIMATE/estimatepdf", + "/muster-roll", + "/individual", + "/mdms-v2" + ].forEach((location) => app.use(location, createProxy)); + ["/pb-egov-assets"].forEach((location) => app.use(location, assetsProxy)); + ["/mdms-v2/v2/_create"].forEach((location) => app.use(location, mdmsProxy)); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/package.json b/frontend/workbench-ui/web/micro-ui-internals/package.json new file mode 100644 index 00000000000..4a4412cedfd --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/package.json @@ -0,0 +1,74 @@ +{ + "name": "egovernments", + "version": "1.0.0", + "main": "index.js", + "workspaces": [ + "packages/libraries", + "example", + "packages/css", + "packages/react-components", + "packages/modules/*" + ], + "author": "JaganKumar ", + "license": "MIT", + "private": true, + "engines": { + "node": ">=14" + }, + "scripts": { + "start": "run-s build start:dev", + "sprint": "run-s start:script", + "start:dev": "run-p dev:**", + "start:script": "./scripts/create.sh", + "dev:css": "cd packages/css && yarn start", + "publish:css": "cd packages/css && yarn publish --access public", + "dev:libraries": "cd packages/libraries && yarn start", + "dev:components": "cd packages/react-components && yarn start", + "dev:example": "cd example && yarn start", + "dev:core": "cd packages/modules/core && yarn start", + "dev:dss": "cd packages/modules/dss && yarn start", + "dev:hrms": "cd packages/modules/hrms && yarn start", + "devD:common": "cd packages/modules/common && yarn start", + "devD:utilities": "cd packages/modules/utilities && yarn start", + "dev:workbench": "cd packages/modules/workbench && yarn start", + "dev:engagement": "cd packages/modules/engagement && yarn start", + "build": "run-p build:**", + "build:libraries": "cd packages/libraries && yarn build", + "build:components": "cd packages/react-components && yarn build", + "build:svgcomponents": "cd packages/svg-components && yarn build", + "build:dss": "cd packages/modules/dss && yarn build", + "build:core": "cd packages/modules/core && yarn build", + "build:hrms": "cd packages/modules/hrms && yarn build", + "build:common": "cd packages/modules/common && yarn build", + "build:utilities": "cd packages/modules/utilities && yarn build", + "build:engagement": "cd packages/modules/engagement && yarn build", + "build:workbench": "cd packages/modules/workbench && yarn build", + "deploy:jenkins": "./scripts/jenkins.sh", + "clean": "rm -rf node_modules" + }, + "resolutions": { + "**/@babel/runtime": "7.20.1", + "**/babel-preset-react-app": "10.0.0" + }, + "devDependencies": { + "husky": "7.0.4", + "lint-staged": "12.3.7", + "npm-run-all": "4.1.5", + "prettier": "2.1.2" + }, + "husky": {}, + "lint-staged": { + "*.{js,css,md}": "prettier --write" + }, + "dependencies": { + "lodash": "4.17.21", + "microbundle-crl": "0.13.11", + "@egovernments/digit-ui-react-components": "1.8.0-beta.1", + "react": "17.0.2", + "react-dom": "17.0.2", + "react-hook-form": "6.15.8", + "react-i18next": "11.16.2", + "react-query": "3.6.1", + "react-router-dom": "5.3.0" + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/config/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/config/index.js new file mode 100644 index 00000000000..87090e08d09 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/config/index.js @@ -0,0 +1,3 @@ +module.exports = { + PORT: "3000", +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/config/package.json b/frontend/workbench-ui/web/micro-ui-internals/packages/config/package.json new file mode 100644 index 00000000000..bb380df1243 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/config/package.json @@ -0,0 +1,6 @@ +{ + "name": "@egovernments/digit-ui-config", + "version": "1.0.1", + "main": "index.js", + "license": "MIT" +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/README.md b/frontend/workbench-ui/web/micro-ui-internals/packages/css/README.md new file mode 100644 index 00000000000..3749ccd49c4 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/README.md @@ -0,0 +1,78 @@ + + +# digit-ui-css + +## Install + +```bash +npm install --save @egovernments/digit-ui-css +``` + +## Limitation + +```bash +This Package is more specific to DIGIT-UI's can be used across mission's +It is the base css for all Digit UI's +``` + +## Usage + +After adding the dependency make sure you have this dependency in + +```bash +frontend/micro-ui/web/package.json +``` + +```json +"@egovernments/digit-ui-css":"^1.5.0", +``` + +then navigate to App.js + +```bash +frontend/micro-ui/web/public/index.html +``` + +```jsx +/** add this import **/ + + + +``` +# Changelog + +```bash +1.8.0-beta.13 fixed the login text styling issue +1.8.0-beta.1 styles for login dropdown and homepage dropdowns +1.8.0-beta added workbench related css and some new Digit v2 constants based on em +1.7.0 urban 2.9 +1.6.0 urban 2.8 +1.5.41 added styles for login dropdown and homepage dropdowns +1.5.40 aligment issue in edit and logout +1.5.39 updated login scss and alignment issues +1.5.37 updated the readme content +1.5.36 enhanced the formcomposer with header attribute +1.5.35 Fixed the card css issues +1.5.34 Fixed breadcrumb styling issue +1.5.33 fixed some card related css issues due to v2 css +1.5.32 newer css DIGITv2 added and corrected few existing issues +1.5.31 Corrected the CSS for inbox composers and default core ui +1.5.30 Updated the css for dynamic drodown filter dss +1.5.29 layout issues fixed +1.5.28 Horizontal Bar chart alignment fixes +1.5.27 DSS UI alignment fixes for Horizontal Metric and bar chart +1.5.26 added new css class for dss enhancements +1.5.25 added the css of inbox search composers +1.5.24 added the readme file +1.5.23 base version +``` +# Contributors + +[jagankumar-egov] [nipunarora-eGov] [Tulika-eGov] [Ramkrishna-egov] [nabeelmd-eGov] [anil-egov] [vamshikrishnakole-wtt-egov] + +## Published from DIGIT Core +Digit Core Repo (https://github.com/egovernments/Digit-Core/tree/digit-ui-core) + +## License + +MIT © [jagankumar-egov](https://github.com/jagankumar-egov) \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/gulpfile.js b/frontend/workbench-ui/web/micro-ui-internals/packages/css/gulpfile.js new file mode 100644 index 00000000000..74bc884bf13 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/gulpfile.js @@ -0,0 +1,70 @@ +const fs = require("fs"); +const { name, version, author, cssConfig } = JSON.parse(fs.readFileSync("package.json")); + +const headerString = ` +@charset "UTF-8"; +/*! + * ${name} - ${version} + * + * Copyright (c) ${new Date().getFullYear()} ${author} + * + */ + `; +const { series, src, dest, watch, task } = require("gulp"); +const header = require("postcss-header"); + +const clean = require("gulp-clean"); +const postcss = require("gulp-postcss"); +const sass = require("gulp-sass"); +const postcssPresetEnv = require("postcss-preset-env"); +const cleanCSS = require("gulp-clean-css"); +const rename = require("gulp-rename"); +const livereload = require("gulp-livereload"); + +let output = "./example"; +if (process.env.NODE_ENV === "production") { + output = "./dist"; +} + +function cleanStyles() { + return src(`${output}/*.css`, { read: false }).pipe(clean()); +} + +function styles() { + const plugins = [ + require("postcss-import"), + require("tailwindcss"), + postcssPresetEnv({ stage: 2, autoprefixer: { cascade: false }, features: { "custom-properties": true } }), + require("autoprefixer"), + require("cssnano"), + header({ header: headerString }), + ]; + return src("src/index.scss").pipe(postcss(plugins)).pipe(sass()).pipe(dest(output)); +} + +function minify() { + return src(`${output}/index.css`).pipe(cleanCSS()).pipe(rename(`index.min.css`)).pipe(dest(output)); +} + +function stylesLive() { + styles().pipe(livereload({ start: true })); +} + +function livereloadStyles() { + livereload.listen(); + watch("src/**/*.scss", series(stylesLive)); +} + +exports.styles = styles; +exports.default = series(styles); +exports.watch = livereloadStyles; +if (process.env.NODE_ENV === "production") { + exports.build = series(cleanStyles, styles, minify); +} else { + exports.build = series(styles, livereloadStyles); +} + +// gulp.task("watch:styles", function () { +// livereload.listen(); +// gulp.watch("**/*.scss", ["styles"]); +// }); diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/img/browser-icon.png b/frontend/workbench-ui/web/micro-ui-internals/packages/css/img/browser-icon.png new file mode 100644 index 00000000000..32e2488b00e Binary files /dev/null and b/frontend/workbench-ui/web/micro-ui-internals/packages/css/img/browser-icon.png differ diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/img/m_seva_white_logo.png b/frontend/workbench-ui/web/micro-ui-internals/packages/css/img/m_seva_white_logo.png new file mode 100644 index 00000000000..394e483de3a Binary files /dev/null and b/frontend/workbench-ui/web/micro-ui-internals/packages/css/img/m_seva_white_logo.png differ diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/img/mseva-demo.png b/frontend/workbench-ui/web/micro-ui-internals/packages/css/img/mseva-demo.png new file mode 100644 index 00000000000..50a52517263 Binary files /dev/null and b/frontend/workbench-ui/web/micro-ui-internals/packages/css/img/mseva-demo.png differ diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/package.json b/frontend/workbench-ui/web/micro-ui-internals/packages/css/package.json new file mode 100644 index 00000000000..d9cbc9c9ebc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/package.json @@ -0,0 +1,65 @@ +{ + "name": "@egovernments/digit-ui-css", + "version": "1.8.0-beta.13", + "license": "MIT", + "main": "dist/index.css", + "author": "Jagankumar ", + "engines": { + "node": ">=14" + }, + "cssConfig": { + "prefix": "" + }, + "scripts": { + "start": "gulp build", + "build:prod": "NODE_ENV=production gulp build", + "prepublish": "yarn build:prod", + "deploy": "gulp && cp -R svg example && cp -R img example && gh-pages -d example" + }, + "browserslist": [ + "> 3%", + "last 2 versions" + ], + "style": "./dist/index.css", + "dependencies": { + "node-sass": "^4.14.1", + "normalize.css": "^8.0.1", + "postcss-scss": "^3.0.1", + "tailwindcss": "^1.8.10" + }, + "devDependencies": { + "autoprefixer": "^10.0.0", + "cssnano": "^4.1.10", + "gh-pages": "^3.1.0", + "gulp": "^4.0.2", + "gulp-clean": "^0.4.0", + "gulp-clean-css": "^4.3.0", + "gulp-livereload": "^4.0.2", + "gulp-postcss": "^9.0.0", + "gulp-rename": "^2.0.0", + "gulp-sass": "^4.1.0", + "postcss": "^8.0.9", + "postcss-cli": "^8.0.0", + "postcss-header": "^2.0.0", + "postcss-import": "^12.0.1", + "postcss-prefixer": "^2.1.2", + "postcss-preset-env": "^6.7.0", + "postcss-scss": "^3.0.1", + "sass": "^1.26.11" + }, + "files": [ + "dist/index.min.css", + "dist/index.css", + "svg/**/*.svg", + "img/**/*.png", + "src/**/*.scss", + "src/**/*.css" + ], + "keywords": [ + "digit", + "egov", + "dpg", + "digit-ui", + "css" + ] +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/postcss.config.js b/frontend/workbench-ui/web/micro-ui-internals/packages/css/postcss.config.js new file mode 100644 index 00000000000..18485de221e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/postcss.config.js @@ -0,0 +1,55 @@ +const postcssPresetEnv = require("postcss-preset-env"); + +module.exports = { + parser: require("postcss-scss"), + plugins: [ + require("postcss-import"), + require("postcss-nested").default, + require("tailwindcss"), + require("postcss-preset-env"), + require("autoprefixer"), + // require("cssnano"), + ], +}; + +// const fs = require('fs'); +// const { name, version, author, cssConfig } = JSON.parse(fs.readFileSync('package.json')); + +// const header = ` +// @charset "UTF-8"; +// /*! +// * ${name} - ${version} +// * +// * Copyright (c) ${new Date().getFullYear()} ${author.name} +// */ +// `; + +// module.exports = (ctx) => { +// const prefix = ctx.env === 'compat' ? '' : cssConfig.prefix; +// const devMessage = `🎉🎉🎉🎉 \n${name} ${ctx.env} build was compiled sucessfully! \n`; + + +// return { +// map: ctx.options.map, +// parser: ctx.options.parser, +// plugins: { +// 'postcss-import': { root: ctx.file.dirname }, +// 'postcss-prefixer': { +// prefix, +// ignore: [/\[class\*=.*\]/], +// }, +// 'postcss-preset-env': { +// autoprefixer: { +// cascade: false, +// }, +// features: { +// 'custom-properties': true, +// }, +// }, +// cssnano: ctx.env === 'production' || ctx.env === 'compat' ? {} : false, +// 'postcss-header': { +// header, +// }, +// }, +// }; +// }; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/CardBasedOptions.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/CardBasedOptions.scss new file mode 100644 index 00000000000..f2607b04638 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/CardBasedOptions.scss @@ -0,0 +1,46 @@ +.CardBasedOptions { + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16); + @apply bg-white mb-md px-sm py-md mx-sm rounded w-full; + .headContent { + @apply flex justify-between mb-lg; + h2 { + @apply text-heading-s font-bold text-text-primary; + } + p { + @apply text-link text-primary-main font-medium cursor-pointer; + } + } + + .mainContent { + @apply flex justify-evenly; + .CardBasedOptionsMainChildOption { + width: 25%; + @apply text-center; + .ChildOptionImageWrapper { + margin: auto !important; + background: rgba(244, 119, 56, 0.12); + mix-blend-mode: normal; + padding-top: 14px; + @apply h-12 w-12 rounded-full cursor-pointer; + svg { + height: 20px; + width: 20px; + fill: theme(colors.primary.main); + margin: auto; + } + } + .ChildOptionName { + font-size: 12px; + line-height: 14px; + padding-top: 1rem; + } + } + } +} + +@screen dt { + .CardBasedOptions { + width: calc(50% - 16px); + @apply p-md; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/CitizenHomeCard.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/CitizenHomeCard.scss new file mode 100644 index 00000000000..45df9551f19 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/CitizenHomeCard.scss @@ -0,0 +1,56 @@ +.CitizenHomeCard { + @apply bg-white mx-md p-md mb-lg; + + .header { + @apply flex font-bold text-heading-l text-text-primary justify-between pb-sm; + + svg { + width: 33px; + height: 33px; + } + } + + .links { + @apply text-heading-s text-primary-main; + + a { + @apply block pb-sm; + } + } +} + +@screen dt { + .citizenAllServiceGrid { + display: flex; + flex-direction: column; + justify-content: center; + flex: 1; + } + + .CitizenHomeCard { + @apply p-lg; + .header { + @apply pb-lg text-heading-l-dt; + svg { + @apply w-12 h-12; + } + } + + .links { + @apply grid grid-cols-4 gap-px; + .linksWrapper { + height: 25px; + margin-bottom: 0.5em; + } + a { + @apply pb-md; + padding-left: 0.2em; + margin-bottom: 16px; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + min-width: 0; + } + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/EllipsisMenu.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/EllipsisMenu.scss new file mode 100644 index 00000000000..0eb243a266d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/EllipsisMenu.scss @@ -0,0 +1,17 @@ +.ellipsis-menu-wrap{ + @apply relative; + + .menu{ + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + @apply absolute right-0 bg-white z-30; + .item{ + @apply flex items-center justify-between p-sm; + &:hover{ + @apply bg-grey-mid cursor-pointer; + } + svg { + margin-right: 10px; + } + } + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/EventCalendarView.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/EventCalendarView.scss new file mode 100644 index 00000000000..58e6d3f8a56 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/EventCalendarView.scss @@ -0,0 +1,10 @@ +.EventCalendarView{ + .MonthViewInEventCalendar{ + @apply bg-primary-main text-legend text-white font-medium text-center py-sm; + } + + .DateViewInEventCalendar{ + @apply bg-grey-mid text-heading-l font-bold text-primary-main text-center py-md; + } + +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/FAQ.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/FAQ.scss new file mode 100644 index 00000000000..48b65688f56 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/FAQ.scss @@ -0,0 +1,64 @@ +.searchInputFAQs { + @apply mr-lg; + margin-bottom: 10px; + input{ + margin-bottom: 0; + background: border-box; + @apply pr-xl; + } + } + +.faq-page{ + width: 92%; + margin: 16px; +} + +.faqs{ + cursor: pointer; + .faq-question{ + font-weight: 400; + margin: 16px; + background: #fff; + justify-content: space-between; + display: flex; + font-size: 16px; + } + + .faqicon{ + float: right; + } + + .faq-answer{ + background: #fff; + overflow: hidden; + margin: 5px; + @apply text-form-field text-text-secondary mb-sm; + + span { + display: block; + font-size: 14px; + font-weight: 400; + margin: 0px 12px 5px + } + } + .cs-box-border { + height: 1px; + position: relative; + border-bottom: 1px solid lightgray;; + background: lightgray; + margin-left: 16px; + margin-right: 16px; + } +} + +.faq-list{ + background: #fff; + margin: 5px 0; + padding-top: 4px; + padding-bottom: 4px; +} + +.rotate { + transform: rotate(90deg); +} + \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/OnGroundEventCard.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/OnGroundEventCard.scss new file mode 100644 index 00000000000..13468a645cc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/OnGroundEventCard.scss @@ -0,0 +1,72 @@ +.OnGroundEventCard{ + box-shadow: 0px 1px 2px 0px #00000029; + @apply bg-white mx-sm mb-md p-md cursor-pointer; + + .EventCalendarView{ + width: 100px; + @apply inline-block mr-md; + } + + .EventDetails{ + width: calc( 100% - 116px ); + @apply inline-block align-top; + + h2{ + @apply text-caption-m font-bold mb-md text-text-primary; + } + + .EventLocation{ + @apply flex mb-md; + svg{ + @apply h-4 w-4; + } + p{ + @apply text-body-s text-text-primary ml-sm; + } + } + + .EventTime{ + @apply flex ; + svg{ + @apply h-4 w-4; + } + p{ + @apply text-body-s text-text-primary ml-sm; + } + } + + .EventCategory{ + p{ + @apply text-body-s text-text-primary ; + } + } + + } + + +} + +@screen dt{ + .OnGroundEventCard{ + .EventDetails{ + .EventLocation{ + p{ + @apply text-body-s-dt; + } + } + + .EventTime{ + p{ + @apply text-body-s-dt; + } + } + + .EventCategory{ + p{ + @apply text-body-s-dt; + } + } + + } + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/PageBasedInput.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/PageBasedInput.scss new file mode 100644 index 00000000000..b2ba959698a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/PageBasedInput.scss @@ -0,0 +1,29 @@ +.PageBasedInputWrapper { + .SubmitBar { + z-index: 60; + @apply p-sm fixed w-full bottom-0 left-0 text-right bg-white; + } + .SubmitBarInCardInDesktopView { + @apply hidden; + } + label { + margin-left: 0 !important; + } +} + +@screen dt { + .PageBasedInputWrapper { + .SubmitBar { + @apply hidden; + } + .SubmitBarInCardInDesktopView { + @apply block; + } + .card { + max-width: 960px; + } + button { + max-width: 240px; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/PopupHeadingLabel.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/PopupHeadingLabel.scss new file mode 100644 index 00000000000..c8e80a5ed18 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/PopupHeadingLabel.scss @@ -0,0 +1,15 @@ +.popupModalHeading{ + @apply flex gap-3 mb-lg; + .headingIconAndLabel{ + @apply flex gap-3 items-center; + svg{ + @apply w-6 h-4; + } + h3{ + @apply text-heading-l font-bold; + } + } + .popupResetFormButton{ + @apply p-sm border border-solid border-text-primary border-opacity-25 self-center; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/PropertySearchForm.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/PropertySearchForm.scss new file mode 100644 index 00000000000..47f1f00cd7c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/PropertySearchForm.scss @@ -0,0 +1,58 @@ +.PropertySearchForm { + .pt-search-action { + @apply w-full; + display: flex; + margin-right: 10px; + justify-content: end; + align-items: center; + .pt-search-action-submit button { + width: 100% !important; + } + .pt-search-action-reset { + text-align: right; + cursor: pointer; + } + } + + .PropertySearchFormSwitcher{ + border-bottom: 1px solid theme(colors.border); + cursor: pointer; + margin-bottom: 20px; + display: flex; + .non-selected { + color: theme(colors.text.secondary); + font-weight: 400; + } + .selected { + color: theme(colors.primary.main); + font-weight: 700; + padding-bottom: 10px; + border-bottom: 2px solid theme(colors.primary.main); + } + span { + margin-right: 20px; + } + } + + + .form-field { + width: 30% !important; + margin-bottom: 20px; + } + @media (min-width: 780px) { + .pt-form-field{ + width: 30% !important; + margin-bottom: 20px; + } + } + @media (max-width: 780px) { + .form-field{ + width: 100% !important; + margin-bottom: 15px; + } + .pt-form-field{ + width: 100% !important; + margin-bottom: 15px; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/SearchForm.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/SearchForm.scss new file mode 100644 index 00000000000..41f3b212648 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/SearchForm.scss @@ -0,0 +1,56 @@ +.search-form-wrapper{ + @apply flex flex-wrap justify-between bg-white mb-lg py-lg pl-lg; + .form-field{ + width: calc( 25% - 16px ); + @apply inline-block mr-md align-middle; + } + .SubmitAndClearAllContainer{ + @apply w-full; + .submit{ + right: 36px; + margin-top: 22px; + margin-left: -16px !important; + @apply flex flex-row-reverse items-center w-full align-middle text-center !important; + button{ + margin: 0; + @apply inline-block w-1/4 !important; + } + p{ + @apply cursor-pointer text-link text-focus w-1/4 inline-block ; + } + } + } + .submit{ + right: 36px; + margin-top: 22px; + @apply inline align-middle text-center !important; + button{ + margin: 0; + @apply inline-block w-full !important; + } + p{ + @apply cursor-pointer text-link text-focus w-full inline-block ; + } + } + .pt-property-search{ + justify-content: unset; + } + +} + +@media (min-width: 780px) { + .search-form-wrapper{ + .pt-form-field{ + width: 30% !important; + margin-bottom: 20px; + } + } + } + @media (max-width: 780px) { + .search-form-wrapper{ + .pt-form-field{ + width: 100% !important; + margin-bottom: 15px; + } + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/SearchOnRadioButton.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/SearchOnRadioButton.scss new file mode 100644 index 00000000000..1f9e2e597aa --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/SearchOnRadioButton.scss @@ -0,0 +1,10 @@ +.SearchOnRadioButton{ + svg{ + fill: theme(colors.text.secondary); + width: 24px; + height: 24px; + top: 8px; + right: 8px; + @apply absolute; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/StandaloneSearchBar.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/StandaloneSearchBar.scss new file mode 100644 index 00000000000..69dd018a42d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/StandaloneSearchBar.scss @@ -0,0 +1,10 @@ +.StandaloneSearchBar{ + @apply bg-white flex rounded-3xl px-md py-sm w-full; + svg{ + fill: theme(colors.text.secondary); + @apply mr-md; + } + input{ + @apply w-full mr-md outline-none; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/TimeLine.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/TimeLine.scss new file mode 100644 index 00000000000..8547f22f5cf --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/TimeLine.scss @@ -0,0 +1,68 @@ +.timeline-container { + @apply flex; + margin: 0px 8px 15px; + .timeline-checkpoint { + @apply relative flex-1; + z-index: 1; + } + + .timeline-content { + @apply flex flex-col items-center; + + span { + text-align: center; + color: white; + } + + .secondary-color { + color: theme(colors.text.primary); + padding: 5px; + font-size: small; + } + } + + .line { + @apply absolute; + top: 12px; + left: calc(50% + 8px); + right: calc(-50% + 8px); + border-top: 4px solid theme(colors.border); + z-index: -1; + } + + .circle { + width: 24px; + height: 24px; + background-color: #B1B4B6; + border-radius: 50%; + text-align: center; + } + + .active { + background-color: theme(colors.primary.main); + border-color: theme(colors.primary.main); + } +} + +.TLComments{ + max-width: 360px; + @apply mb-sm p-sm bg-grey-light; + h3{ + @apply font-bold text-caption-m; + } + p{ + @apply text-body-l; + } +} + +@screen dt{ + .TLComments{ + width: 360px; + h3{ + @apply text-caption-m-dt; + } + p{ + @apply text-body-l-dt; + } + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/WhatsNewCard.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/WhatsNewCard.scss new file mode 100644 index 00000000000..395b2fc4401 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/WhatsNewCard.scss @@ -0,0 +1,13 @@ +.WhatsNewCard{ + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16); + @apply rounded bg-white border-primary-main border-l-4 border-solid p-sm; + h2{ + @apply text-body-l text-text-primary font-medium mb-xs; + } + p{ + @apply text-form-field text-text-secondary mb-sm; + } + a{ + @apply block text-form-field text-primary-main mb-sm + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/actionLink.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/actionLink.scss new file mode 100644 index 00000000000..46a1f449ae1 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/actionLink.scss @@ -0,0 +1,3 @@ +.action-link { + @apply text-primary-main text-text-btn mr-lg !important; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/actionbar.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/actionbar.scss new file mode 100644 index 00000000000..18c905c20d2 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/actionbar.scss @@ -0,0 +1,97 @@ +.action-bar-wrap { + box-shadow: rgba(0, 0, 0, 0.16) 0 -2px 8px; + max-width: 480px; + z-index: 100; + + @apply left-0 bottom-0 w-full bg-white py-sm px-sm fixed text-right; + + div { + @apply w-full; + } + .menu-wrap { + @apply absolute bg-white text-left mb-xs z-30 cursor-pointer; + bottom: 45px; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + width: calc(100% - 16px); + right: 8px; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + + &:hover { + @apply bg-grey-mid w-full; + } + } + } +} + +@screen dt { + .action-bar-wrap { + box-shadow: rgba(0, 0, 0, 0.16) 0 -2px 8px; + left: 0; + max-width: none; + z-index: 999; + + @apply fixed bottom-0 bg-white py-sm pr-lg text-right; + + div { + width: calc(100% - 16px); + } + + .menu-wrap { + bottom: 45px; + top: unset; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + @apply absolute h-auto bg-white text-left mb-xs z-30; + width: 240px; + right: 24px; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + + &:hover { + @apply bg-grey-mid w-full; + } + } + } + } +} + +.action-bar-wrap-registry { + + div { + @apply w-full; + } + .menu-wrap { + @apply absolute bg-white text-left mb-xs z-30 cursor-pointer; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + width: 160px; + right: 60px; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + + &:hover { + @apply bg-grey-mid w-full; + } + } + } + + .search-add { + padding: 12px 16px; + color: rgb(244, 119, 56); + display: flex; + cursor: pointer; + } + + .search-add-icon { + background: rgb(244, 119, 56); + border-radius: 50%; + height: 24px; + width: 24px; + display: flex; + justify-content: center; + align-items: center; + margin-left: 10px; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/bannercomponents.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/bannercomponents.scss new file mode 100644 index 00000000000..0433dc0c320 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/bannercomponents.scss @@ -0,0 +1,136 @@ +.success-wrap, +.emp-success-wrap { + @apply block bg-success w-full text-center text-white pt-md pb-sm mb-md; + + header { + @apply block mb-sm font-rc font-bold text-heading-xl; + } + + div { + img { + padding: 13.67px; + margin-left: auto; + margin-right: auto; + @apply border border-solid border-white rounded-full h-16 w-16 bg-white mb-md; + } + + svg { + padding: 13.67px; + margin-left: auto; + margin-right: auto; + @apply border border-solid border-white rounded-full h-16 w-16 bg-white mb-md; + } + + svg.payment-svg { + border: unset; + background-color: unset; + @apply rounded-full; + } + + h2 { + @apply font-bold text-caption-m mb-sm; + } + + p { + @apply font-bold text-caption-l; + } + } +} + +.error-wrap, +.emp-error-wrap { + @apply block bg-error w-full text-center text-white pt-md pb-sm mb-md; + + header { + @apply block mb-sm font-rc font-bold text-heading-xl; + } + + img { + margin-left: auto; + margin-right: auto; + padding: 13.67px; + @apply border border-solid border-white rounded-full bg-white h-16 w-16 mb-md; + } + + svg { + margin-left: auto; + margin-right: auto; + padding: 13.67px; + @apply border border-solid border-white rounded-full bg-white h-16 w-16 mb-md; + } +} + +@screen dt { + .success-wrap { + header { + @apply text-heading-xl-dt; + } + } + .emp-success-wrap { + width: calc(100%); + header { + @apply text-heading-xl-dt; + } + } + + .error-wrap { + width: 100%; + header { + @apply text-heading-xl-dt; + } + } + + .emp-error-wrap { + width: calc(100%); + header { + @apply text-heading-xl-dt; + } + } +} + +.photos-wrap { + max-width: 640px; + @apply flex pt-md; + + img { + width: calc(33% - 9.333px); + margin-right: 14px; + } + + svg { + width: calc(33% - 9.333px); + margin-right: 14px; + } + + .last { + width: calc(33% - 9.333px); + } +} + +.banner { + @apply flex justify-center items-center; + height: calc(100vh - 80px); + background: linear-gradient(rgba(11, 75, 102, 0.8), rgba(11, 75, 102, 0.8)), var(--banner-url) center center; + + .bannerCard { + min-width: 400px; + } + .bannerLogo { + width: 80px; + height: 40px; + object-fit: contain; + padding-right: 10px; + margin-right: 10px; + border-right: 1px solid theme(colors.text.primary); + } + .bannerHeader { + @apply flex justify-center items-center; + margin-bottom: 24px; + } +} + +.banner-container { + flex-direction: column; + justify-content: center; + align-items: center !important; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/body.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/body.scss new file mode 100644 index 00000000000..8965c861f45 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/body.scss @@ -0,0 +1,144 @@ +body { + @apply bg-grey-bg; +} + +.body-container { + @apply bg-grey-bg h-full min-h-screen overflow-x-hidden; +} + +.navbar { + @apply text-white bg-secondary p-md w-full mb-md; + img { + height: 24px; + } +} +/* .navbar-header{ + @apply text-navbarheader float-left px-sm +} + +.navbar-subheader{ + @apply font-light px-sm border-solid border-l border-white border-opacity-100 +}*/ + +.h1 { + @apply text-heading-l text-text-primary font-bold mb-md ml-md; +} + +.link-label { + @apply block text-link text-primary-main mb-md ml-md cursor-pointer; + + &:hover { + @apply text-primary-main; + } +} + +.back-btn { + width: fit-content; + @apply block border-solid border-b border-text-primary font-rc text-text-primary text-text-btn ml-sm mt-md; + + label { + @apply inline mr-sm align-middle; + } + + p { + @apply inline float-right; + } +} + +.bread-crumb { + font-size: 14px; + color: theme(colors.text.secondary); + display: flex; + margin-bottom: 10px; + list-style: none; + padding: 0; +} +.bread-crumb--item { + margin-left: 5px; + + &:not(:last-child):after { + content: " /"; + } + + button { + outline: none; + } + + .last { + color: theme(colors.text.primary); + } +} + +.back-btn2 { + cursor: pointer; + width: fit-content; + @apply flex border-solid border-b border-text-primary font-rc text-text-primary text-text-btn ml-sm mb-md; + + img { + @apply flex; + } + + svg { + @apply flex; + } + + p { + @apply flex; + } +} + +@screen dt { + .employee-app-container { + @apply w-full; + } + + .app-container { + width: 100%; + form { + .card { + max-width: 960px; + h2 { + text-align: left; + } + .field-container { + max-width: 540px; + } + button { + max-width: 240px; + } + .input-otp-wrap, + .card-text-button { + text-align: left; + } + } + } + } + + .h1 { + margin-left: 0; + @apply text-heading-l-dt; + } + + .link-label { + margin-left: 0; + } + + .back-btn { + margin-left: 0; + } + + .back-btn2 { + margin-left: 0; + } +} + +.body-container::-webkit-scrollbar { + display: none; +} +.audit-card { + width: 80%; + margin-left: -21%; + margin-right: -27%; + max-height: 120px; + margin-top: 90px; +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/buttons.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/buttons.scss new file mode 100644 index 00000000000..14312a25052 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/buttons.scss @@ -0,0 +1,101 @@ +.selector-button-primary { + @apply h-8 bg-primary-main text-center border-b-2 border-input-border border-solid outline-none px-lg; + + &:focus { + @apply outline-none; + } + + h2 { + @apply font-rc font-medium text-legend text-white; + } +} + +.selector-button-border { + @apply h-8 bg-border text-center border-b-2 border-input-border border-solid outline-none px-lg; + + &:focus { + @apply outline-none; + } + + h2 { + @apply font-rc font-medium text-legend text-text-primary; + } +} + +.input-mirror-selector-button{ + @apply h-16 bg-border text-center border-b-2 border-input-border border-solid outline-none px-lg !important; + + &:focus { + @apply outline-none; + } + + h2 { + @apply font-rc font-medium text-legend text-text-primary; + } +} + +.selector-button-primary-disabled { + @apply h-8 bg-primary-main text-center border-b-2 border-input-border border-solid outline-none px-lg opacity-50; + + &:focus { + @apply outline-none; + } + + h2 { + @apply font-rc font-medium text-legend text-white; + } +} +.submit-bar:focus { + @apply outline-none !important; +} + +.jk-digit-secondary-btn { + width: auto; + height: 40px; + background: theme(colors.white); + border: 1px solid theme(colors.primary.main); + padding: 12px; + color: theme(colors.primary.main); + display: flex; + align-items: center; + font-size: 19px; + cursor: pointer; + svg { + margin: 0 10px; + } +} +.jk-digit-primary-btn { + width: auto; + height: 40px; + background: theme(colors.primary.main); + border: 1px solid theme(colors.primary.main); + padding: 6px; + color: theme(colors.white); + display: flex; + align-items: center; + cursor: pointer; + font-size: 19px; + box-shadow: inset 0 -2px 0 #0b0c0c; + svg { + margin: 0 15px; + } +} + +.jk-digit-disabled-btn { + opacity: 0.5; + font-size: 19px; + cursor: not-allowed; +} + +.jk-header-btn-wrapper { + display: flex; + justify-content: space-between; +} + +/* for mobile view */ +@media (max-width: 780px) { + .jk-header-btn-wrapper { + flex-flow: column; + margin-bottom: 15px; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/card.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/card.scss new file mode 100644 index 00000000000..16d6c352cab --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/card.scss @@ -0,0 +1,391 @@ +.card { + @apply bg-white m-sm px-md pt-md pb-lg shadow-card; + border-radius: 4px; + max-width: 960px; + + .card-header { + @apply text-text-primary text-heading-xl font-bold font-rc align-middle text-left mb-md; + } + + .card-sub-header { + @apply text-text-primary text-caption-xl font-bold align-middle text-left mb-sm; + } + + .card-caption { + @apply text-text-secondary text-caption-xl mb-sm; + } + + .card-text { + @apply text-text-secondary text-body-l align-middle text-left mb-lg; + + span { + @apply text-text-primary; + } + } + + .card-text-primary { + @apply text-text-primary text-body-l; + } + + .card-text-button { + @apply text-primary-main text-text-btn; + } + + .card-label { + @apply text-legend text-text-primary mb-sm; + } + + .card-label-error { + @apply block text-body-s text-error mb-md; + } + + .card-label-desc { + @apply font-bold text-text-secondary text-heading-s mb-md; + } + + .card-link { + @apply block text-center text-link text-primary-main mt-md cursor-pointer; + } +} + +.validation-error { + @apply block text-body-s text-error; +} + +.docsDescription { + color: theme(colors.text.primary) !important; +} + +.field-container { + @apply flex items-center; + /*@apply flex justify-center items-center;*/ +} + +.employeeCard { + @apply bg-white shadow-card p-md mb-xl; + border-radius: 4px; + + .card-header { + @apply text-text-primary text-heading-xl font-bold font-rc align-middle text-left mb-md; + } + + .card-sub-header, + .employee-card-sub-header { + @apply text-text-primary text-caption-xl font-bold align-middle text-left; + } + + .card-section-header { + @apply text-text-primary text-heading-m font-bold; + } + + .card-section-sub-text{ + @apply text-text-primary text-body-s; + } + + .card-caption { + @apply text-text-secondary text-caption-xl mb-sm; + } + + .card-text { + @apply text-text-secondary text-body-l align-middle text-left mb-lg; + + span { + @apply text-text-primary; + } + } + + .card-text-primary { + @apply text-text-primary text-body-l; + } + + .card-text-button { + @apply text-primary-main text-text-btn; + } + + .card-label { + @apply text-legend text-text-primary mb-md; + } + + .card-label-error { + @apply block text-body-s text-error mb-md; + } + + .card-label-desc { + @apply font-bold text-text-secondary text-heading-s mb-md; + } + + .card-link { + @apply block text-center text-link text-link-normal mt-md; + } + + .card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; + } +} + +.header-wrap { + @apply flex mb-md; + + .header-start { + margin-right: auto; + } + + .header-content { + margin-top: 0.2rem; + } + + .header-end { + margin-left: auto; + } +} + +.card-emp { + @extend .card; + padding-right: 0; + padding-top: 0; + padding-left: 0; + @apply bg-white m-sm; +} + +.submit-bar { + @apply h-10 bg-primary-main text-center w-full outline-none; + box-shadow: inset 0px -2px 0px theme(colors.text.primary); + cursor: pointer; + &:focus { + @apply outline-none; + } + + header { + @apply font-rc font-medium text-legend text-white leading-10; + } +} + +.submit-bar-disabled { + @apply h-10 bg-primary-main text-center w-full outline-none opacity-50; + + &:focus { + @apply outline-none; + } + + header { + @apply font-rc font-medium text-legend text-white leading-10; + } +} + +@screen dt { + .submit-bar, + .submit-bar-disabled { + width: 240px; + } + + .card { + display: flex; + flex-direction: column; + + .card-header { + @apply text-heading-xl-dt; + } + + .card-sub-header { + @apply text-heading-l-dt; + } + + .card-caption { + @apply text-caption-xl-dt; + } + + .card-text, + .card-text-primary { + @apply text-body-l-dt; + } + + .card-link { + @apply text-left; + } + } + + .employeeCard { + /* TODO need to revisit that we need mx-md NABEEL/ANIL + @apply mb-md mx-md !important; + */ + @apply mb-md !important; + &.filter { + margin-left: auto; + margin-right: auto; + } + + .card-header { + @apply text-heading-xl-dt; + } + + .card-sub-header { + @apply text-heading-l-dt; + } + + .employee-card-sub-header { + margin-bottom: 40px; + @apply text-heading-l-dt; + } + + .card-section-header { + margin-bottom: 40px; + @apply text-heading-m-dt; + } + + .card-section-sub-text{ + @apply text-text-primary text-body-s-dt; + } + + .card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; + } + + .card-caption { + @apply text-caption-xl-dt; + } + + .card-text, + .card-text-primary { + @apply text-body-l-dt; + } + + .card-link { + @apply text-left; + } + + .label-field-pair { + @apply flex items-center; + + h2 { + width: 30%; + } + + .field { + width: 50%; + margin-right: 20%; + .field { + margin-right: unset; + } + } + } + + .field-container { + span { + border: 2px solid black; + background: rgb(247, 247, 247); + width: 40px; + height: 40px; + display: flex; + justify-content: center; + align-items: center; + margin-top: -16px; + border-right: none; + } + } + } + + .header-wrap { + @apply flex mb-md; + + .header-start { + margin-right: auto; + } + + .header-content { + } + + .header-end { + margin-left: auto; + } + } +} + +.card-section-header { + @apply text-text-primary text-heading-m font-bold; +} + +.card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; +} + +.button-sub-text { + width: 100%; +} + +.home-page-info-banner-wrap { + margin: "0px 16px 24px 16px"; +} + +@media (min-width: 780px) { + .button-sub-text { + width: 240px; + } + .home-page-info-banner-wrap { + max-width: 45%; + min-width: 40%; + margin-left: 0; + margin-right: 24px; + margin-bottom: 24px; + } + .info-banner-wrap-citizen-override { + } + .oc-aknowledgement-screen { + width: auto; + min-width: 240px; + max-width: 100%; + padding: 0px 10px; + } +} + +.card-label-error { + @apply block text-body-s text-error mb-md; +} + +.employeeCard-override { + margin-left: 0px !important; +} + +.BPAemployeeCard { + margin-left: 0px !important; + margin-right: 0px !important; + margin-bottom: 64px !important; +} + +.employee-application-details { + display: flex !important; + justify-content: space-between !important; + max-height: 60px !important; + height: 60px !important; +} +.employee-main-application-details { + padding: 10px !important; +} + +.employee-mulitlink-main-div { + z-index: 10 !important; + max-width: 41% !important; +} + +.employee-download-btn-className { + position: unset !important; + display: flex !important; + justify-content: flex-end !important; +} + +.employee-options-btn-className { + position: unset !important; + margin: 0 !important; + width: 100% !important; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/cardHeaderWithOptions.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/cardHeaderWithOptions.scss new file mode 100644 index 00000000000..a19f1dc164a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/cardHeaderWithOptions.scss @@ -0,0 +1,14 @@ +.cardHeaderWithOptions{ + @apply flex flex-row justify-between; + .multilinkWrapper{ + @apply relative; + .multilink-labelWrap{ + position: unset; + @apply flex z-10 items-center align-middle text-center m-md; + } + .multilink-optionWrap{ + top: 32px; + right: 0%; + } + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/changeLanguage.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/changeLanguage.scss new file mode 100644 index 00000000000..f030a38e809 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/changeLanguage.scss @@ -0,0 +1,3 @@ +.language-title { + margin-bottom: "5px"; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/charts.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/charts.scss new file mode 100644 index 00000000000..e7d398886f6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/charts.scss @@ -0,0 +1,186 @@ +.chartHeader { + display: flex; + flex-direction: row; + justify-content: space-between; + + .sideContent { + @apply flex justify-around items-center ; + + } +} + +.searchInput { + @apply mr-lg; + input{ + margin-bottom: 0; + @apply pr-xl; + } +} + +.signature-img{ + top: 8px; + right: 8px; + fill: theme(colors.text.secondary); + @apply absolute; +} + +.column-direction { + flex-direction: column; +} + +.chart-wrapper { + padding: 0 10px; + margin-top: 60px; +} + +.chart-row { + @apply flex justify-between flex-wrap; + .chart-item { + flex-grow: 1; + margin-bottom: 15px; + width: 100%; + + &:last-child { + margin-right: 0px; + } + } +} + +.cursorPointer { + @apply cursor-pointer; +} + +.options { + @apply flex justify-between items-center; + div { + display: none; + } +} + +.options-m { + width: 95%; + margin: 0 auto 15px; + @apply flex justify-between; + + svg { + margin-right: 10px; + } +} + +.options-m { + div { + @apply flex; + } +} +.no-data { + @apply flex justify-center items-center; + height: 90%; + margin-bottom: 40px; + white-space:pre; +} + +@screen dt { + .chart-wrapper { + padding-left: 15px; + margin-top: 10px; + + .chart-item { + margin-right: 25px !important; + margin-bottom: 25px !important; + margin-left: 0 !important; + width: 31%; + } + } + .column-direction { + flex-direction: row; + } + .options-m { + display: none; + } + + .options { + div { + @apply flex cursor-pointer; + } + } +} + +.showMore { + @apply text-right cursor-pointer; + color: theme(colors.primary.main); +} + +@media (max-width: 420px) { + .recharts-default-tooltip { + width: 85%; + ul { + width: 100% !important; + } + ul li { + width: 100%; + display: flex !important; + flex-wrap: wrap; + } + } +} + + +@media print{ + .page-break { + margin-top: 1rem; + display: block; + page-break-before: auto; + } + .chart-wrapper { + @media print{ + .chart-row { + @media print{ + @apply flex justify-between flex-wrap; + .chart-item { + @media print{ + flex-grow: 1; + margin-right: 25px; + margin-bottom: 25px; + width: 31%; + + &:last-child { + margin-right: 0px; + } + .chartHeader { + display: flex; + justify-content: space-between; + + .sideContent { + @apply flex justify-around items-center ; + + .searchInput { + @apply mr-lg; + input{ + margin-bottom: 0; + @apply pr-xl; + } + } + + .signature-img{ + top: 8px; + right: 8px; + fill: theme(colors.text.secondary); + @apply absolute; + } + } + } + } + } + } + } + + .options { + @apply flex justify-end; + } + + .options-m { + display: none; + } + } +} +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/checkbox.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/checkbox.scss new file mode 100644 index 00000000000..b805530f4d7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/checkbox.scss @@ -0,0 +1,53 @@ +.checkbox-wrap { + @apply flex mb-md relative items-baseline; + + input { + width: 38px; + height: 38px; + @apply opacity-0 absolute top-0 left-0 z-10; + } + + .input-emp { + @extend input; + width: 24px; + height: 24px; + } + + .custom-checkbox { + width: 38px; + height: 38px; + @apply absolute top-0 left-0 border border-solid border-input-border z-0; + + img { + @apply opacity-0; + } + + svg { + @apply opacity-0; + } + } + + .custom-checkbox-emp { + @extend .custom-checkbox; + width: 24px; + height: 24px; + } + + input:checked ~ .custom-checkbox, + input:hover ~ .custom-checkbox { + @apply border-2 border-primary-main; + } + + input:checked ~ .custom-checkbox img { + @apply opacity-100; + } + + input:checked ~ .custom-checkbox svg { + @apply opacity-100; + } + + .label { + margin-left: 56px; + @apply text-form-field text-text-primary; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/checkpoint.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/checkpoint.scss new file mode 100644 index 00000000000..6d0e3fc7262 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/checkpoint.scss @@ -0,0 +1,63 @@ +.checkpoint-connect-wrap { + padding-bottom: 40px; + @apply relative; +} +.checkpoint-done { + @apply flex; + + h2 { + width: 24px; + height: 24px; + border-radius: 50%; + @apply border-b border-solid border-primary-main bg-primary-main; + } + + header { + @apply text-heading-s ml-md; + + p { + margin-top: 4px; + @apply text-heading-s text-text-secondary; + } + } +} + +.checkpoint { + @apply flex; + + h2 { + width: 24px; + height: 24px; + border-radius: 50%; + --text-opacity: 1; + @apply border-b border-solid border-border bg-border; + } + + header { + @apply text-heading-s ml-md; + + p { + margin-top: 4px; + @apply text-heading-s text-text-secondary; + } + } +} + +.checkpoint-connect { + margin-left: 12px; + margin-top: 22px; + @apply absolute top-0 left-0 h-full border-l border-solid border-border; +} + +.checkpoint-comments-wrap { + max-width: 560px; + @apply bg-grey-mid p-sm mt-sm; + + h4{ + @apply text-text-primary text-heading-s; + } + + p{ + @apply text-text-secondary text-body-s-dt; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/citizenInfoLabel.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/citizenInfoLabel.scss new file mode 100644 index 00000000000..bbb1ce45220 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/citizenInfoLabel.scss @@ -0,0 +1,14 @@ +.citizen-info-label { + @apply p-sm border-4 border-solid border-link-normal text-heading-m m-sm; + max-width: 960px; + + p { + @apply text-link-normal font-bold mt-xs text-heading-s; + } +} + +@screen dt { + .citizen-info-label { + margin: 0; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/custombtn.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/custombtn.scss new file mode 100644 index 00000000000..82b369ab798 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/custombtn.scss @@ -0,0 +1,11 @@ +.customBtn { + @apply bg-white text-text-primary box-border inline-block outline-none px-sm border border-solid border-primary-main; + margin: 0px 4.65% 0px 0px; + height: 30px; + line-height: 30px; +} + +.customBtn-selected { + @extend .customBtn; + @apply bg-primary-main text-white font-medium; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/datatable.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/datatable.scss new file mode 100644 index 00000000000..b2756a61e96 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/datatable.scss @@ -0,0 +1,134 @@ +.data-table { + @apply text-text-primary; + + .row { + @apply flex border-b border-border pb-sm mb-sm; + + span { + width: 70%; + display: contents; + } + + h2 { + width: 40%; + @apply font-bold text-heading-s; + } + + .value { + width: 50%; + @apply text-heading-s; + word-break: break-all; + } + .caption { + width: 70%; + @apply text-heading-s text-text-secondary; + } + } + + .last { + border: none; + padding: 0; + margin: 0; + } +} + +.employee-data-table { + .row { + @apply flex pb-sm mb-sm; + + span { + width: 70%; + display: contents; + } + + h2 { + width: 30%; + @apply font-bold text-heading-s; + } + + .value { + width: 50%; + @apply text-heading-s; + white-space: break-spaces !important; + word-break: break-all; + } + + .caption { + width: 70%; + @apply text-heading-s text-text-secondary; + } + } + + .last { + border: none; + padding: 0; + margin: 0; + } +} + +.employee-data-table { + .row { + @apply flex pb-sm mb-sm; + + span { + width: 70%; + display: contents; + } + + h2 { + width: 30%; + @apply font-medium text-heading-s; + } + + .value { + white-space: break-spaces !important; + word-break: break-all; + width: 60%; + @apply text-heading-s; + &.status-row-radio { + div { + margin-right: 1rem; + width: 50%; + } + .mg-sm { + width: 30%; + } + } + } + + .caption { + width: 70%; + @apply text-heading-s text-text-secondary; + } + } + + .last { + border: none; + padding: 0; + margin: 0; + } + &.status-radio-table { + margin-top: 1rem; + .row { + span { + width: 24px; + display: block; + float: left; + border-radius: 50%; + } + } + } + + &.view-header { + .row { + display: grid; + grid-template-columns: 1fr 68%; + } + } +} + + +.pt-citizen {.data-table {.row { + justify-content: space-between; + +}}} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/datewrap.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/datewrap.scss new file mode 100644 index 00000000000..1f3c8897774 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/datewrap.scss @@ -0,0 +1,21 @@ +.date-wrap { + @apply flex mb-md; + + img, + svg { + height: 22px; + width: 20px; + } + + p { + @apply text-text-primary text-body-l pl-sm; + } +} + +@screen dt { + .date-wrap { + p { + @apply text-body-l-dt; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/detailscard.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/detailscard.scss new file mode 100644 index 00000000000..cfbc83a99e3 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/detailscard.scss @@ -0,0 +1,6 @@ +.details-card { + @apply bg-white m-sm px-sm pt-sm pb-lg shadow-card; + .card-label { + @apply font-bold text-legend text-text-primary mb-md; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/detailscontainer.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/detailscontainer.scss new file mode 100644 index 00000000000..fa3ab70b9d5 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/detailscontainer.scss @@ -0,0 +1,13 @@ +.details-container { + @apply flex flex-col m-sm pt-md pb-md pl-sm pr-sm bg-white rounded; + .detail { + @apply grid grid-cols-2 gap-2 items-baseline; + .label { + width: 138px; + @apply font-bold text-heading-s text-text-primary mb-md; + } + .name { + @apply pt-md; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/filters.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/filters.scss new file mode 100644 index 00000000000..dd4b6634b19 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/filters.scss @@ -0,0 +1,98 @@ +.filters-wrapper { + display: none; + padding: 20px 0px 0px; + z-index: 1; + + .filters-input { + flex-basis: 22%; + } + + .filters-input:not(:first-of-type) { + margin-left: 5%; + } + + .switch-wrapper { + display: flex; + justify-content: space-between; + max-width: 200px; + + .radio-switch { + display: none; + + &:checked ~ label { + border-color: theme(colors.primary.main); + color: theme(colors.primary.main); + } + } + + label { + border: 1px solid; + padding: 6px 10px; + display: block; + @apply border border-solid border-input-border; + &:hover{ + @apply border-2 border-solid border-primary-main; + } + } + } +} + +.pickerShadow { + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); +} + +.filter-close { + @apply flex justify-end; +} + +.filter-header { + @apply flex; + + p { + font-weight: bold; + font-size: 24px; + line-height: 1; + margin: 0 12px 20px 8px; + } +} + +.clearText { + display: none; +} + +@screen dt { + .filters-wrapper { + display: flex; + } + + .filter-close, + .filter-header { + display: none; + } + + .clearText { + display: block; + text-align: right; + color: theme(colors.primary.main); + margin-top: 20px; + margin-left: 10px; + } +} + +@media (max-width: 780px) { + .filters-modal { + display: block; + position: fixed; + width: 100%; + height: 100vh; + left: 0; + top: 130px; + padding: 16px; + background-color: #fff; + z-index: 99; + } + + .rdrDefinedRangesWrapper { + display: none; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/grey.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/grey.scss new file mode 100644 index 00000000000..eec759d99fe --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/grey.scss @@ -0,0 +1,3 @@ +.grey { + @apply text-text-secondary; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/hoc/InboxComposer.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/hoc/InboxComposer.scss new file mode 100644 index 00000000000..98bacf62f21 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/hoc/InboxComposer.scss @@ -0,0 +1,115 @@ +.InboxComposerWrapper { + .form-field-flex-one { + .form-field { + @apply flex-1; + } + } +} + +.inboxPopupMobileWrapper { + @apply block p-md w-full overflow-scroll; + .submit { + @apply flex left-0 w-full px-xl items-center flex-row-reverse !important; + } + .form-field { + margin: 0 !important; + @apply w-full; + } + .InboxMobilePopupCloseButtonWrapper { + @apply flex flex-row-reverse; + } +} + +@screen dt { + .InboxComposerWrapper { + grid-template-columns: calc(25% - 32px) 75%; + @apply grid gap-x-8 gap-y-6; + } + + .wns-inbox-composer { + .filter-form { + height: fit-content; + } + + .wns-search-field { + width: 30% !important; + .field-container { + } + } + .form-field { + width: 100% !important; + } + + .SubmitAndClearAllContainer { + width: 100%; + display: flex; + justify-content: end; + align-items: center; + .clear-search { + width: 30%; + display: inline-block; + vertical-align: middle; + text-align: right; + cursor: pointer; + p { + padding: 1rem; + color: rgb(244, 119, 56); + text-align: end; + } + } + .submit { + width: 30% !important; + margin-left: unset !important; + button { + width: 100% !important; + } + } + } + } + + .search-form-wns-inbox { + .clear-search-container { + grid-column: 2/3; + text-align: right; + .clear-search { + width: 100%; + color: rgb(244, 119, 56); + } + } + button { + width: 100%; + } + + .filter-form { + height: fit-content; + } + + .search-complaint-container { + flex-direction: column; + align-items: flex-start; + --bg-opacity: 1; + background-color: #fff; + background-color: rgba(255, 255, 255, var(--bg-opacity)); + padding: 16px; + display: unset; + flex-wrap: unset; + justify-content: unset; + margin-bottom: 0; + .complaint-input-container { + display: grid; + grid-template-columns: 33.33% 33.33% 33.33%; + } + .form-field { + width: 100%; + padding-right: 15px; + .clear-search { + padding-top: 10px; + } + } + } + .submit { + margin-top: 0; + right: 0; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/hoc/index.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/hoc/index.scss new file mode 100644 index 00000000000..d651ce49346 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/hoc/index.scss @@ -0,0 +1 @@ +@import "./InboxComposer.scss" \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/howItWorks.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/howItWorks.scss new file mode 100644 index 00000000000..c77a82b2b1a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/howItWorks.scss @@ -0,0 +1,71 @@ +.how-it-works-page{ + width: 92%; + margin: 16px; + .how-it-works-page-header{ + margin-bottom: 15px; + } +} + +.video-icon{ + float: left; + background-color: #6F6F6F; + height: 60px; + width: 100px; + cursor: pointer; + margin: 5px; + + .vid-svg{ + padding-left: 35px; + padding-top: 18px; + } +} + +.how-it-works-header-description{ + padding: 5px; + overflow-wrap: break-word; + h2{ + font-size: 16px; + font-weight: 400; + } + p{ + font-size: 12px; + font-weight: 400; + } +} + +.how-it-works-pdf-section{ + display: flex; + justify-content: space-between; + .pdf-icon-header-desc{ + float: left; + .pdf-icon{ + display: inline-block; + } + .pdf-header-desc{ + display: inline-block; + position: absolute; + padding: 5px; + overflow-wrap: break-word; + h2{ + font-size: 16px; + font-weight: 400; + } + p{ + font-size: 12px; + font-weight: 400; + } + } + } + .download-icon{ + float: right; + } +} + +.how-it-works-video-play{ + display: inline-block; + .close-button{ + float: right; + cursor: pointer; + } +} + diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/imageviewer.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/imageviewer.scss new file mode 100644 index 00000000000..1f0568f8d01 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/imageviewer.scss @@ -0,0 +1,33 @@ +.image-viewer-wrap { + @apply bg-text-primary p-md top-0 left-0 z-20 fixed w-full h-full; + + svg { + top: 90px; + right: 16px; + @apply absolute h-6 w-6; + } + + img { + margin-top: 40%; + @apply max-w-full h-auto; + } +} + +@screen dt { + .image-viewer-wrap { + @apply flex fixed top-0 left-0 w-full h-full z-20 bg-text-primary p-md; + + svg { + top: 90px; + right: 16px; + @apply absolute h-6 w-6; + } + + img { + width: auto; + height: auto; + max-width: 640px; + margin: auto; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/InboxLinks.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/InboxLinks.scss new file mode 100644 index 00000000000..7549fe0b3d9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/InboxLinks.scss @@ -0,0 +1,59 @@ +@import url("../../digitv2/index.scss"); + +.inbox-search-links-container { + @extend .light-paper-primary; + height: 100%; + width: 100% !important; + display: flex; + flex-direction: column; + padding: 1rem; + .header { + @extend .light-text-color-primary; + display: grid; + grid-template-columns: 20% 1fr; + .logo { + display: flex; + align-items: center; + justify-content: flex-start; + .inbox-search-icon--projects { + fill : #f47738; + height: 2rem; + width: 2rem; + } + } + .text { + @extend .light-text-color-primary; + line-height: 32px; + font-weight: 700; + color : black; + display: flex; + align-items: center; + justify-content: flex-start; + } + + @media (min-width: 1024px) { + .text { + font-size: 24px; + } + } + + @media (max-width: 1024px) { + .text { + font-size: 20px; + } + } + } + .contents { + margin-top: 1rem; + box-sizing: border-box; + display: flex; + flex-direction: column; + .link { + @extend .light-primary; + padding: 8px; + --text-opacity: 1; + color: #f47738; + color: rgba(244, 119, 56, var(--text-opacity)); + } + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/horizontalNav.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/horizontalNav.scss new file mode 100644 index 00000000000..13fd228d181 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/horizontalNav.scss @@ -0,0 +1,224 @@ +@import url("../../digitv2/index.scss"); + +.horizontal-nav { + @extend .light-paper-primary; + @extend .light-text-color-primary; + overflow: auto; + display: flex; + margin-top: 3rem; + + .menu-item { + border: 10px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; + text-decoration: none; + margin: 0px; + padding: 0px; + outline: none; + font-size: 16px; + position: relative; + color: rgb(95, 92, 98); + line-height: 48px; + transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; + min-height: 48px; + white-space: initial; + background: none; + + .icon { + @extend .light-background; + display: block; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + height: 21px !important; + width: 21px !important; + float: left; + margin-top: 12px; + } + + .edit-btn-ico { + height: 17px; + width: 17px; + margin-top: 16px; + } + + .icon+.menu-label { + margin-left: 36px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + + @media (min-width: 780px) { + .sidebar-list { + padding-right: 30px; + padding-left: 30px; + background-color: #EEEEEE; + border: 1px solid #DDDDDD; + border-radius: 8px 8px 0px 0px; + + &.active { + font-weight: 600; + border-bottom: 3px solid theme(colors.primary.main); + + background-color: #FFFFFF; + + .menu-label { + color: theme(colors.primary.main); + } + + .icon { + fill: theme(colors.primary.main); + } + } + + .submenu-container { + cursor: pointer; + display: flex; + flex-direction: column; + + .sidebar-link { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px!important; + padding-top: 20px!important; + svg { + width: 24px !important; + height: 24px !important; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + + .actions { + .tooltip { + margin-left: 16px; + } + } + } + + .actions { + display: flex; + align-items: center; + overflow: hidden !important; + + span { + margin-left: 13px; + line-height: 48px; + white-space: nowrap; + color: #5f5c62; + overflow: hidden; + text-overflow: ellipsis; + } + } + } + .submenu-container:first-child { + margin-top:5px; + .employee-search-input{ + margin-left:16px !important; + } + } + } + .sidebar-list-search-form { + padding-right: 30px; + padding-left: 30px; + + &.active { + font-weight: 600; + border-bottom: 3px solid theme(colors.primary.main); + + background-color: #FFFFFF; + + .menu-label { + color: theme(colors.primary.main); + } + + .icon { + fill: theme(colors.primary.main); + } + } + + .submenu-container { + cursor: pointer; + display: flex; + flex-direction: column; + + .sidebar-link { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px!important; + padding-top: 20px!important; + svg { + width: 24px !important; + height: 24px !important; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + + .actions { + .tooltip { + margin-left: 16px; + } + } + } + + .actions { + display: flex; + align-items: center; + overflow: hidden !important; + + span { + margin-left: 13px; + line-height: 48px; + white-space: nowrap; + color: #5f5c62; + overflow: hidden; + text-overflow: ellipsis; + } + } + } + .submenu-container:first-child { + margin-top:5px; + .employee-search-input{ + margin-left:16px !important; + } + } + } + + + .dropdown-link { + .actions { + display: flex; + padding: 1em; + + svg { + width: 21px; + height: 21px; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + + span { + color: #5f5c62; + } + } + } + } +} + + + +.sidebar-link { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px!important; + padding-top: 20px!important; + svg { + width: 24px !important; + height: 26px !important; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearch.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearch.scss new file mode 100644 index 00000000000..a24f8919f3b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearch.scss @@ -0,0 +1,116 @@ +@import url("../../digitv2/index.scss"); + +.search-wrapper { + @extend .light-text-color-primary; + @extend .light-paper-primary; + height: 100%; + width: 100%; + padding: 1rem; + + .popup-label { + display: flex; + font-size: large; + @extend .light-text-color-primary; + .header { + @extend .light-text-color-primary; + width: 100%; + font-weight: normal; + font-size: large; + .icon { + @extend .light-primary; + margin-right: 12px; + margin-top: 5px; + } + } + } + + .filter-header-wrapper { + @extend .light-text-color-primary; + display: grid; + grid-template-columns: 15% 1fr 15%; + height: 3rem; + margin-bottom: 1rem; + .icon-refresh { + display: flex; + align-items: center; + justify-content: center; + border: 1px solid #00000017; + cursor: pointer; + svg { + height: 60%; + width: 40%; + } + } + .label { + @extend .light-text-color-primary; + display: flex; + align-items: center; + justify-content: flex-start; + } + + @media (min-width: 1024px) { + .label { + font-size: 24px; + } + } + + @media (max-width: 1024px) { + .label { + font-size: 16px; + } + } + + .icon-filter { + display: flex; + align-items: center; + justify-content: flex-start; + } + } + + .search-field-wrapper { + display: grid; + row-gap: 0.25rem; + column-gap: 1rem; + &.inbox { + grid-template-columns: repeat(3, 1fr); + &.filter { + display: flex; + flex-direction: column; + } + } + &.search { + grid-template-columns: repeat(4, 1fr); + } + .text-input{ + @extend .light-primary; + } + } + + .search-button-wrapper { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 1rem; + padding-top: 8px; + &.inbox { + grid-column: 2 / span 2; + &.filter { + button { + width: 100%; + } + } + } + &.search { + grid-column: 3 / span 2; + } + } +} + +@screen sm { + .search-wrapper { + .search-field-wrapper { + display: flex; + flex-direction: column; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearchComposer.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearchComposer.scss new file mode 100644 index 00000000000..091a4e6a249 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/inboxSearchComposer.scss @@ -0,0 +1,134 @@ +@import url("../../digitv2/index.scss"); + +.inbox-search-wrapper { + /* + TODO NABEEL/ANIL Removed these since it creates issues in search screen + @extend .light-background; + + */ + height: 100%; + .inbox-search-component-wrapper { + /* + TODO NABEEL/ANIL Removed these since it creates issues in search screen + @extend .light-background; + + */ height: 100%; + width: 100%; + .sections-parent { + /* + TODO NABEEL/ANIL Removed these since it creates issues in search screen + @extend .light-background; + + */ height: 100%; + display: grid; + grid-template-columns: 20% 1fr; + gap : 1rem; + &.inbox { + @extend .light-text-color-primary; + .links{ + @extend .light-primary; + @extend .light-paper-primary; + .text{ + @extend .light-text-color-primary; + } + .inbox-links-icon{ + color:#f47738; + fill:#f47738; + path{ + fill:#f47738; + } + } + } + } + &.search { + display: flex; + flex-direction: column; + .section { + &.links { + display: none; + } + &.filter { + display: none; + } + } + .search-wrapper { + @extend .light-paper-primary; + .search-field-wrapper.search.custom-both-clear-search{ + .search-button-wrapper.search { + grid-column: initial; + } + .search-button-wrapper{ + .link-label{ + @extend .light-primary; + white-space:initial; + } + .submit-bar { + @extend .light-primary-button; + width: 60%; + } + } + } + } + } + &.download { + grid-template-columns: 100% + } + .section { + @extend .light-paper-primary; + @extend .light-text-color-primary; + min-height: 10rem; + /* background-color: white; */ + display: flex; + align-items: center; + justify-content: center; + border-radius: 4px; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 16%); + &.search-results { + min-height: 0; + } + &.links { + height: 100%; + color : #f47738; + .inbox-search-links-component { + height: 100% !important; + width: 100%; + } + } + &.filter { + @extend .light-paper-primary; + @extend .light-text-color-primary; + height: fit-content; + } + } + } + } +} + +@screen sm { + .employee-main-application-details-for-modal { + padding: 0 !important; + } + .inbox-search-wrapper { + .inbox-search-component-wrapper { + .sections-parent { + display: flex; + flex-direction : column; + .section { + &.search-results { + } + &.links { + } + &.filter { + + } + &.as-modal { + position : fixed; + top : 0; + height : 100vh; + width : 100vw; + } + } + } + } + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/index.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/index.scss new file mode 100644 index 00000000000..bad206269e9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/index.scss @@ -0,0 +1,5 @@ +@import "./horizontalNav.scss"; +@import "./InboxLinks.scss"; +@import "./inboxSearch.scss"; +@import "./searchComponentTable.scss"; +@import "./inboxSearchComposer.scss"; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/searchComponentTable.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/searchComponentTable.scss new file mode 100644 index 00000000000..a542d721fa9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inboxv2/searchComponentTable.scss @@ -0,0 +1,44 @@ +.search-component-table { + width: 100%; + display: block; + overflow-x: auto; + overflow-y:hidden; + table { + th { + .tooltip { + min-width: 80px; + } + } + tr { + td { + span { + white-space: pre; + min-width: 80px; + .tooltip { + position: relative; + min-width: 80px; + display: inline-block; + margin-left: 16px; + .tooltiptext { + visibility: hidden; + background-color: #555; + color: #fff; + text-align: left; + border-radius: 6px; + padding: 5px; + position: absolute; + z-index: 1; + bottom: 125%; + left: 50%; + margin-left: -60px; + opacity: 0; + transition: opacity 0.3s; + width: 30rem; + } + } + + } + } + } + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/info-banner.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/info-banner.scss new file mode 100644 index 00000000000..3ed3b4ac46b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/info-banner.scss @@ -0,0 +1,35 @@ +.info-banner-wrap { + @apply bg-link-normal bg-opacity-25 m-sm p-md; + max-width: 960px; + + background-color: #C7E0F1; + border-radius: 4px; + svg { + margin-top: 5px; + @apply rounded-full; + } + + div { + @apply flex; + } + + h2 { + @apply text-heading-m text-link-normal mb-md font-bold ml-sm; + } + + p { + @apply text-body-l text-link-normal whitespace-pre-line; + } +} + +@screen dt { + .info-banner-wrap { + h2 { + @apply text-heading-m-dt; + } + + p { + @apply text-body-l-dt; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inputotp.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inputotp.scss new file mode 100644 index 00000000000..686694452fc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/inputotp.scss @@ -0,0 +1,15 @@ +.input-otp-wrap { + @apply mb-lg; + + input { + @apply border-2 border-solid border-input-border outline-none h-10 w-10 text-form-field text-text-primary mr-sm mb-sm text-center; + } + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + input[type="number"] { + -moz-appearance: textfield; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/keynote.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/keynote.scss new file mode 100644 index 00000000000..df736c06aa4 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/keynote.scss @@ -0,0 +1,27 @@ +.key-note-pair { + @apply mb-md; + + h3 { + margin-bottom: 4px; + @apply font-bold text-text-primary text-heading-s; + } + + p { + @apply text-text-primary text-body-l; + } + + .caption { + @apply text-body-l text-text-secondary; + } +} + +@screen dt { + .key-note-pair { + p { + @apply text-body-l-dt; + } + .caption { + @apply text-body-l-dt text-text-secondary; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/languageSelector.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/languageSelector.scss new file mode 100644 index 00000000000..86da3527354 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/languageSelector.scss @@ -0,0 +1,23 @@ +.language-selector { + @apply flex flex-wrap; +} + +.language-selector div:not(:first-child) { + margin-left: 10px; +} +.bannerCard .language-button-container button { + width: 6.2rem; + height: 2.5rem; +} +.bannerCard .customBtn { + border-color: theme(colors.text.secondary); +} +.bannerCard .customBtn:focus { + outline: none; +} +.bannerCard .customBtn-selected { + border-color: transparent; +} +.bannerCard .bannerHeader p { + font-size: 19px; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/loader.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/loader.scss new file mode 100644 index 00000000000..1784a54c44c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/loader.scss @@ -0,0 +1,96 @@ +.page-loader, +.module-loader { + text-align: center; +} + +.page-loader { + padding-top: 88px; +} + +.module-loader { + padding: 16px; +} + +@keyframes ldio-pjg92h09b2o { + 0% { + transform: translate(-50%, -50%) rotate(0deg); + } + + 100% { + transform: translate(-50%, -50%) rotate(360deg); + } +} + +.ldio-pjg92h09b2o div { + position: absolute; + width: 52px; + height: 52px; + border: 12px solid theme(colors.secondary); + border-top-color: transparent; + border-radius: 50%; +} + +.ldio-pjg92h09b2o div { + animation: ldio-pjg92h09b2o 1s linear infinite; + top: 50px; + left: 50px; +} + +.loadingio-spinner-rolling-faewnb8ux8 { + width: 48px; + height: 48px; + display: inline-block; + overflow: hidden; + background: none; +} + +.ldio-pjg92h09b2o { + width: 100%; + height: 100%; + position: relative; + transform: translateZ(0) scale(0.48); + backface-visibility: hidden; + transform-origin: 0 0; + /* see note above */ +} + +.ldio-pjg92h09b2o div { + box-sizing: content-box; +} + +/* +.loader { + position: absolute; + left: 50%; + top: 50%; + z-index: 1; + width: 80px; + height: 80px; + margin: -80px 0 0 -40px; + border: 8px solid #f3f3f3; + border-radius: 50%; + border-top-color: #3498db; + -webkit-animation: loader-spin 1s linear infinite; + animation: loader-spin 1s linear infinite; +} + +@-webkit-keyframes loader-spin { + 0% { + -webkit-transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + } +} + +@keyframes loader-spin { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} +*/ diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/map.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/map.scss new file mode 100644 index 00000000000..7e0fb5829ca --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/map.scss @@ -0,0 +1,30 @@ +.map-wrap { + @apply pb-lg; +} + +.map { + width: 100%; + height: 384px; + overflow: visible; + position: relative; +} + +.map-search-bar-wrap { + border-radius: 4px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5); + margin-bottom: 4px; + display: flex; + width: 100%; +} + +.map-search-bar-icon { + @apply inline h-6 w-6 m-sm; +} + +.map-search-bar { + @apply block outline-none text-form-field text-text-primary h-10 w-full !important; +} + +.map-search-bar:focus { + border: none; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/menu.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/menu.scss new file mode 100644 index 00000000000..e69de29bb2d diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/metricsTable.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/metricsTable.scss new file mode 100644 index 00000000000..786adc3c346 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/metricsTable.scss @@ -0,0 +1,28 @@ +.metricsTable { + @apply bg-white px-md pt-md pb-lg shadow-card; + max-width: 440px; + border-radius: 4px; + + .row { + @apply flex justify-between; + height: 80px; + width: 100%; + } + + .lower_red { + @apply inline; + color: rgb(229, 77, 66); + } + + .upper_green { + @apply inline; + color: theme(colors.success); + } +} + +.chart-metric-wrapper{ + display: flex; + flex-wrap: wrap; + margin-top: 15px; + justify-content: space-evenly; +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/multiLink.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/multiLink.scss new file mode 100644 index 00000000000..816bfec9637 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/multiLink.scss @@ -0,0 +1,88 @@ +.multilink-labelWrap{ + top: 73px; + @apply flex items-center align-middle text-center m-md absolute right-0 z-10; +} + +.multilink-link-button{ + margin: 0; + @apply text-heading-s text-primary-light +} + +.multilink-optionWrap{ + right: 0; + top:110px; + width: max-content; + @apply absolute shadow-card bg-white m-md z-10; + + .multilink-option{ + + svg{ + margin-top: auto; + margin-bottom: auto; + @apply mx-sm + } + + &:hover{ + @apply bg-grey-mid cursor-pointer; + } + @apply p-md; + } +} +.overCard{ + top: 23px; +} + +.multilink-block-wrapper{ + @apply relative; + .multilink-labelWrap{ + margin: 0 !important; + top: unset; + @apply relative text-text-primary !important; + svg{ + fill: theme(colors.text.secondary); + } + span{ + @apply text-text-primary !important; + } + } + .multilink-optionWrap{ + top: 8px; + right: -50%; + @apply block !important; + } +} + +@screen dt { + + .multilink-block-wrapper{ + .multilink-optionWrap{ + right: 0 !important; + } + } + + .multilink-labelWrap{ + right: 20%; + top: 80px; + } + + .multilink-optionWrap{ + right: 20%; + top: 110px; + @apply shadow-card rounded-sm; + } +} + +.reports-download-btn{ + justify-content: flex-end; + position: unset; +} + +.reports-options-download{ + position: absolute; + justify-content: flex-end; + float: right; + right:0%; + display: flex; + flex-direction: row; + top:2rem; +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/multiSelectDropdown.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/multiSelectDropdown.scss new file mode 100644 index 00000000000..5848ee0214c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/multiSelectDropdown.scss @@ -0,0 +1,77 @@ +.multi-select-dropdown-wrap{ + @apply relative text-form-field text-text-primary w-full; + .master, .master-active{ + @apply relative border border-solid border-input-border h-10 w-full; + input[type=text]{ + @apply absolute top-0 left-0 p-sm pl-sm min-h-full min-w-full opacity-0; + &:focus{ + @apply outline-none; + } + } + .label{ + @apply flex justify-between p-sm w-full h-full; + svg{ + @apply h-6 w-6; + } + } + + &:hover{ + @apply border-2 border-solid border-primary-main; + } + } + + .master-active{ + @apply border-2 border-primary-main; + input[type=text]{ + @apply opacity-100; + } + .label{ + @apply hidden; + } + } + + .server{ + + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + top:40px; + + max-height:20vmax; + overflow: scroll; + @apply absolute min-w-full z-20; + div{ + @apply flex w-full bg-white; + justify-content: flex-start; + align-items: center; + &:hover{ + @apply bg-grey-mid; + } + input{ + height: 44px; + @apply absolute min-w-full opacity-0 z-20 cursor-pointer; + } + p{ + padding: 12px; + margin-top: 5px; + margin-bottom: 5px; + @apply text-form-field text-text-primary; + } + .custom-checkbox{ + height: 28px; + width: 28px; + @apply border border-solid border-input-border m-sm; + svg{ + @apply opacity-0 z-10; + } + } + input:checked ~ .custom-checkbox, + input:hover ~ .custom-checkbox { + @apply border-2 border-primary-main; + } + + input:checked ~ .custom-checkbox svg { + @apply opacity-100; + } + + } + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/navbar.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/navbar.scss new file mode 100644 index 00000000000..94eb1369c2d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/navbar.scss @@ -0,0 +1,312 @@ +.navbar { + @apply text-white bg-secondary p-md w-full; + position: fixed; + z-index: 9999; + + img { + display: inline-block; + min-width: 78px; + height: 24px; + } + .nav { + display: flex; + justify-content: space-between; + } + .nav-wrapper { + display: flex; + @media (min-width: 780px) { + .hamburger-span { + display: none; + } + } + } + + h3 { + @apply inline-block border-l border-solid border-white pl-sm ml-sm; + } +} + +.img-circle { + border-radius: 50%; +} + +.profile-section { + height: auto; + display: flex; + flex-direction: column; + align-items: center; + padding-top: 30px; + background-color: theme(colors.white); + + img { + width: 89px; + height: 88px; + margin: 0px auto 16px; + } + + .label-container { + .label-text { + color: #767676; + } + &.name-Profile { + .label-text { + letter-spacing: 0.6px; + font-weight: 700; + font-size: 18px; + color: theme(colors.text.primary); + } + } + } + .profile-divider { + border-top: 1px solid theme(colors.border); + margin-left: 20px; + margin-right: 20px; + width: 90%; + margin-top: 1rem; + } +} + +.drawer-list { + @apply pt-md; + position: relative; + min-height: 1px; + overflow: auto; + .menu-item { + border: 10px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; + text-decoration: none; + margin: 0px; + padding: 0px; + outline: none; + font-size: 16px; + position: relative; + color: rgb(95, 92, 98); + line-height: 48px; + transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; + min-height: 48px; + white-space: initial; + background: none; + .icon { + display: block; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + height: 21px; + width: 21px; + float: left; + margin-top: 12px; + } + .edit-btn-ico{ + height: 17px; + width: 17px; + margin-top: 16px; + } + .icon + .menu-label { + margin-left: 36px; + text-overflow: ellipsis; + white-space: nowrap; + } + } + .sidebar-list { + padding-right: 16px; + padding-left: 16px; + &.active { + border-left: 5px solid theme(colors.primary.main); + .menu-label { + color: theme(colors.primary.main); + } + .icon { + fill: theme(colors.primary.main); + } + } + + .submenu-container { + cursor: pointer; + display: flex; + flex-direction: column; + + .sidebar-link { + display: flex; + justify-content: space-between; + align-items: center; + svg { + width: 21px; + height: 21px; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + } + .actions { + display: flex; + align-items: center; + overflow: hidden !important; + + span { + margin-left: 13px; + line-height: 48px; + white-space: nowrap; + color: #5f5c62; + overflow: hidden; + text-overflow: ellipsis; + } + input { + border: none; + outline: none; + margin-left: 16px; + padding: 0.5em; + color: #5f5c62; + } + } + } + } + + .dropdown-link { + .actions { + display: flex; + padding: 1em; + svg { + width: 21px; + height: 21px; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + span { + color: #5f5c62; + } + } + } +} + +.drawer-desktop { + overflow: auto; + .menu-item { + border: 10px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + cursor: pointer; + text-decoration: none; + margin: 0px; + padding: 0px; + outline: none; + font-size: 16px; + position: relative; + color: rgb(95, 92, 98); + line-height: 48px; + transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; + min-height: 48px; + white-space: initial; + background: none; + .icon { + display: block; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + height: 21px !important; + width: 21px !important; + float: left; + margin-top: 12px; + } + .edit-btn-ico { + height: 17px; + width: 17px; + margin-top: 16px; + } + .icon + .menu-label { + margin-left: 36px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + @media (min-width: 780px) { + .sidebar-list { + padding-right: 16px; + padding-left: 16px; + &.active { + border-left: 5px solid theme(colors.primary.main); + padding-left: 11px; + .menu-label { + color: theme(colors.primary.main); + } + .icon { + fill: theme(colors.primary.main); + } + } + + .submenu-container { + margin-left: 1.5rem; + cursor: pointer; + display: flex; + flex-direction: column; + + .sidebar-link { + display: flex; + justify-content: space-between; + align-items: center; + svg { + width: 21px; + height: 21px; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + .actions { + .tooltip { + margin-left: 16px; + } + } + } + .actions { + display: flex; + align-items: center; + overflow: hidden !important; + + span { + margin-left: 13px; + line-height: 48px; + white-space: nowrap; + color: #5f5c62; + overflow: hidden; + text-overflow: ellipsis; + } + } + } + } + + .dropdown-link { + .actions { + display: flex; + padding: 1em; + svg { + width: 21px; + height: 21px; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + } + span { + color: #5f5c62; + } + } + } + } +} + +/* .navbar-header{ + @apply text-navbarheader float-left px-sm +} + +.navbar-subheader{ + @apply font-light px-sm border-solid border-l border-white border-opacity-100 +}*/ + +.side-bar-footer { + width: 200px; + margin-left: 50px; + margin-top: 24px; + margin-bottom: 16px; + position: relative; +} + +.digit-footer { + @apply flex h-4 mb-sm; + img { + @apply mr-sm; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/plusMinus.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/plusMinus.scss new file mode 100644 index 00000000000..d482a9a50b0 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/plusMinus.scss @@ -0,0 +1,15 @@ +.PlusMinus { + text-align: center; + display: flex; + align-content: center; + justify-content: center; +} +.PlusMinusbutton{ + border: 1px solid theme(colors.border); + background-color: theme(colors.grey.mid); + color: theme(colors.text.secondary); + font-size: 27px; + font-weight: 400; + text-align: center; + width: 40px; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/popup.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/popup.scss new file mode 100644 index 00000000000..bf6e6d3d684 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/popup.scss @@ -0,0 +1,16 @@ +.popup-wrap { + background: rgba(0, 0, 0, 0.7); + @apply flex fixed w-full h-full overflow-auto top-0 left-0 min-h-screen; + z-index: 10000; +} + +@screen dt { + .popup-wrap { + background: rgba(0, 0, 0, 0.7); + @apply min-h-screen; + } +} + +.popup-close-icon{ + @apply flex justify-end; +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/radiobtn.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/radiobtn.scss new file mode 100644 index 00000000000..74b73623789 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/radiobtn.scss @@ -0,0 +1,45 @@ +.radio-wrap { + @apply my-sm block leading-10 mb-lg; + + div { + @apply block mb-md; + } + + .radio-btn-wrap { + @apply block float-left relative; + &:hover { + .radio-btn-checkmark { + @apply border-primary-main; + } + } + } + + .radio-btn { + @apply opacity-0 absolute cursor-pointer h-10 w-10; + } + + .radio-btn-checkmark { + @apply h-10 w-10 border border-input-border border-solid rounded-full block; + } + + label { + @apply text-text-primary text-form-field ml-md; + } + + .radio-btn-checkmark:after { + content: ""; + } + + .radio-btn-wrap input:checked ~ .radio-btn-checkmark { + @apply border-2 border-primary-main; + } + + .radio-btn-wrap input:checked ~ .radio-btn-checkmark:after { + @apply block bg-primary-main h-5 w-5 rounded-full absolute top-10 left-10; + } +} +.reverse-radio-selection-wrapper{ + div{ + @apply flex flex-row-reverse place-content-between items-center; ; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/ratingstar.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/ratingstar.scss new file mode 100644 index 00000000000..e3429ab698d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/ratingstar.scss @@ -0,0 +1,33 @@ +.rating-star-wrap { + @apply flex w-full mb-lg; + img { + width: 40px; + height: 38px; + display: block; + @apply mr-sm; + } + + svg { + width: 40px; + height: 38px; + display: block; + @apply mr-sm; + } +} + +@screen dt { + .rating-star-wrap { + @apply w-2/5; + } +} + +.rating-with-text { + @apply flex place-items-center w-full; + + svg { + width: 24px; + height: 38px; + display: block; + @apply mr-sm; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/roundedLabel.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/roundedLabel.scss new file mode 100644 index 00000000000..ae734267665 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/roundedLabel.scss @@ -0,0 +1,10 @@ +.roundedLabel { + width: 24px; + height: 24px; + border-radius: 15px; + position: absolute; + z-index: 100; + bottom: 10px; + right: 70px; + @apply ml-sm bg-error text-center text-white; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/searchAction.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/searchAction.scss new file mode 100644 index 00000000000..69d908acf19 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/searchAction.scss @@ -0,0 +1,20 @@ +.searchBox { + @apply flex m-sm justify-between; + .searchAction { + position: relative; + @apply flex flex-row text-focus; + .searchText { + @apply ml-sm; + } + } +} + +.svgPrimaryH16px{ + svg{ + width: 18px; + @apply h-6; + path{ + fill: theme(colors.primary.main); + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/sectionalDropdown.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/sectionalDropdown.scss new file mode 100644 index 00000000000..c62103e66a7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/sectionalDropdown.scss @@ -0,0 +1,43 @@ +.sect-dropdown-wrap { + @apply mb-lg relative; + + .sect-dropdown-input-wrap { + @apply block w-full h-10 border border-solid border-input-border; + + input[type="text"] { + width: calc(100% - 32px); + @apply h-full outline-none text-text-primary text-form-field pl-sm; + } + p { + padding-top: 9px; + @apply text-form-field text-text-primary float-left ml-sm; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + } + + .sect-dropdown-card { + width: 100% !important; + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + @apply absolute z-10 mt-xs pb-sm bg-white; + + h1 { + @apply pl-sm pt-md text-text-primary text-form-field; + } + + p { + padding-left: 21px; + @apply w-full pt-sm text-text-secondary text-form-field; + + &:hover { + @apply bg-grey-mid; + } + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/selectdropdown.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/selectdropdown.scss new file mode 100644 index 00000000000..98ef8ec40fd --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/selectdropdown.scss @@ -0,0 +1,174 @@ +/*.select { + + @apply mb-lg block border-2 border-input-border border-solid outline-none rounded-none w-full h-10 bg-white leading-10; + + option { + @apply h-10 text-form-field text-text-primary align-top text-left; + } + + } + +.select:active { + @apply border-focus border-2; +} + +@screen dt { + .select { + @apply w-2/5; + } +} +*/ +.employee-select-wrap { + @apply mb-lg relative; + + .select { + @apply relative block w-full h-10 border border-solid border-input-border; + &:hover { + @apply border-2 border-solid border-primary-main; + } + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + padding-top: 9px; + @apply text-form-field text-text-primary float-left ml-sm; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .select-active { + @apply relative block w-full h-10 border-2 border-solid border-primary-main; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + @apply text-form-field text-text-primary float-left ml-sm; + } + + p { + padding-top: 9px; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .options-card { + width: 100% !important; + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + max-height: 400px; + overflow: auto; + @apply absolute z-20 mt-xs bg-white max-w-full; + + p { + padding-top: 14px; + @apply w-full h-12 pl-sm text-text-primary text-form-field; + + &:hover { + @apply bg-grey-mid; + } + } + } +} + +.employee-select-wrap--elipses { + width: 85% !important; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.select-wrap { + @apply mb-lg relative; + max-width: 540px; + + .select { + @apply relative block w-full h-10 border border-solid border-input-border; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + padding-top: 9px; + @apply text-form-field text-text-primary float-left ml-sm; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .select-active { + @apply relative block w-full h-10 border-2 border-solid border-primary-main; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + @apply text-form-field text-text-primary float-left ml-sm; + } + + p { + padding-top: 9px; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .options-card { + width: 100% !important; + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + @apply absolute z-20 mt-xs bg-white; + + p { + padding-top: 14px; + @apply w-full h-12 pl-sm text-text-primary text-form-field; + + &:hover { + @apply bg-grey-mid; + } + } + } +} + +@screen dt { +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/sidebar.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/sidebar.scss new file mode 100644 index 00000000000..6a04adffdc2 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/sidebar.scss @@ -0,0 +1,141 @@ +.sidebar-link:hover .arrow { + display: block; +} + +.hidden-arrow { + display: none; +} +.new-dropdown-link{ + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 15px 15px !important; + color: #fff; + font-size: 1rem; + font-weight: 500; + text-decoration: none; + margin-left: 0px !important; + height: 3rem !important; + margin-left: 1rem; + margin-top: 0.5rem; +} +.selected { + background-color: #e0e0e0; /* Change this to your desired highlight color */ +} + +.selected-item { + background-color: #e0e0e0; /* Set your desired background color for the selected item */ + color: #000; /* Set your desired text color for the selected item */ + /* Add any other styles you want to apply to the selected item */ +} +/* Style the container that acts as the viewport */ +.new-sidebar { + height: 90%; /* Set a fixed height for the viewport */ + overflow: scroll; /* Hide the scrollbar */ + + &::-webkit-scrollbar { + display: none; + } + + &::-webkit-scrollbar { + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ + } +} + +/* Style the content inside the viewport */ +.new-sidebar > div { + height: auto; /* Allow content to expand vertically */ + overflow-y: auto; /* Enable vertical scrolling */ + overflow-x: hidden; + padding-right: 2px; /* Add space for the hidden scrollbar (adjust as needed) */ +} + +/* Style the scrollbar thumb to make it transparent */ +.new-sidebar > div::-webkit-scrollbar-thumb { + background: transparent; +} +.link-icon{ + width: 24px !important; + height: 26px !important; +} +.link-icon svg{ + width: 24px !important; + height: 26px !important; +} + +.employee-search-input{ + width: 150px; + background-color: transparent; + &.nav-bar { + color:#fff; + } + &.nav-bar::placeholder { + color: #fff; + } +} + +.search-icon-wrapper-new { + margin-left: 0.35rem; +} + +.search-icon-wrapper-new svg{ + fill: theme(colors.white) !important; + width: 21px; + height: 21px; +} +.search-icon-wrapper-new svg path { + fill: theme(colors.white) !important; + } + +.submenu-container { + overflow: scroll; + margin-bottom: 1rem; + /* Hide the scrollbar */ + &::-webkit-scrollbar { + display: none; + } + + &.level-2 { + border-left: 1px solid; + margin-left: 2rem; + } + &.level-1 { + margin-left: -1.5rem; + } +} + +.actions { + &.level-0 { + margin-left: 0.4rem; + } + &.selected-action-level-0 { + color: theme(colors.primary.main) !important; + } + &.selected-action-level-1 { + border-left:4px solid theme(colors.primary.main); + margin-left: -0.6rem; + height: 2rem; + color: theme(colors.primary.main) !important; + } + + &.default-0 { + &.active { + + } + } + &.default-1 { + margin-left: -0.6rem; + height: 2rem; + width: 111% !important; + } + + + &.custom { + margin-left: 0.3rem; + } + &:hover { + background-color: #6A8E9D; + opacity: 0.8; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/staticDynamicMessages.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/staticDynamicMessages.scss new file mode 100644 index 00000000000..cbf0b895528 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/staticDynamicMessages.scss @@ -0,0 +1,107 @@ +.pay-whatsapp-card{ + display: flex; + justify-content: space-between; + cursor: pointer; +} +.pay-whatsapp-text{ + color: #25D366; + float: left; + font-family: 'Roboto'; + font-size: 16px; + font-weight: 700; +} +.dynamicDataCard{ + background: rgba(244, 119, 56, 0.12); + mix-blend-mode: normal; + height: auto; + max-height: 64px; + border-radius: 4px; + margin-bottom: 16px; +} +.dynamicData{ + padding: 10px 16px 16px 16px; + display: flex; +} +.dynamicData-content{ + font-family: 'Roboto'; + font-size: 14px; + font-weight: 400; + padding-top: 4px; + word-break: break-word; + margin-inline: 20px; +} +.staticDataCard{ + background: rgba(238, 238, 238, 1); + mix-blend-mode: normal; + height: auto; + max-height: 100px; + border-radius: 4px; + margin-bottom: 16px; +} +.staticData{ + display: flex; +} +.timerIcon{ + padding: 16px 0px 16px 16px; +} +.static-data-content{ + display: grid; + margin-inline: 20px; + padding-top: 8px; +} +.rupeeSymbol{ + padding: 16px 0px 16px 16px; +} +.validityIcon{ + padding: 16px 0px 16px 8px; +} +.static-data-content-first{ + font-family: 'Roboto'; + font-size: 14px; + font-weight: 400; +} +.static-data-content-second{ + font-family: 'Roboto'; + font-size: 16px; + font-weight: 700; + word-break: break-word; +} +.staticDataCardLast{ + background: rgba(238, 238, 238, 1); + mix-blend-mode: normal; + height: 56px; + border-radius: 4px; +} +.whatsAppIconG{ + float: right; +} +.static-home-Card{ + display: flex; + justify-content: space-between; +} +.static-home-Card-header{ + font-family: 'Roboto'; + font-size: 16px; + font-weight: 700; + float: left; +} +.helplineIcon{ + float: right; +} +.call-center-card-text{ + display: grid; +} +.call-center-card-content{ + float: left; +} +.serviceCentrIcon{ + float: right; +} +.service-center-details-card{ + display: flex; + overflow-wrap: break-word; +} +.service-center-details-text{ + float: left; + width: 180px; +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/staticSideBar.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/staticSideBar.scss new file mode 100644 index 00000000000..b87fa57e830 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/staticSideBar.scss @@ -0,0 +1,27 @@ +.sidebar-menu { + display: flex; + flex-direction: column; + padding-top: 16px; + padding-left: 16px; + padding-right: 16px; + color: #757575; + + .menu-item { + display: flex; + cursor: pointer; + min-height: 48px; + margin: 0; + padding: 0; + .menu-item-icon { + svg { + color: #757575; + fill: #757575; + width: 21px; + height: 21px; + } + } + .menu-item-text { + margin-left: 1em; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/statushighlight.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/statushighlight.scss new file mode 100644 index 00000000000..ef564ab082b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/statushighlight.scss @@ -0,0 +1,17 @@ +.status-highlight { + --bg-opacity: 12% !important; + border-radius: 16px; + @apply h-8 w-20 bg-error mb-sm; + + p { + padding-top: 6px; + @apply block text-center text-caption-m text-error cursor-pointer; + } + + &.success { + @apply bg-success; + p { + @apply text-success; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/submiterrors.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/submiterrors.scss new file mode 100644 index 00000000000..f0f6c92c715 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/submiterrors.scss @@ -0,0 +1,11 @@ +.error-message-wrap { + @apply w-full mb-sm p-md border-4 border-solid border-error; + + h2 { + @apply font-bold text-caption-m block mb-sm; + } + + p { + @apply font-bold text-caption-m text-error block; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/summary.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/summary.scss new file mode 100644 index 00000000000..3c044a0cacb --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/summary.scss @@ -0,0 +1,29 @@ +.summary-wrapper { + @apply flex justify-around; + + .wrapper-child { + @apply flex flex-col justify-center flex-grow; + } + + .blocks { + display: flex; + margin-bottom: 25px; + + p:only-child { + font-weight: bold; + font-size: 24px; + } + + div { + margin-right: 25px; + + p:not(:first-child) { + font-weight: bold; + font-size: 24px; + } + } + } +} +.summary-card-margin{ + margin:0 24px 20px 0px !important; +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/table.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/table.scss new file mode 100644 index 00000000000..379af9fa6a1 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/table.scss @@ -0,0 +1,201 @@ +.table { + @apply bg-white w-full; + + thead { + th { + padding: 20px 18px; + @apply font-bold align-middle text-left; + &:first-child { + min-width: 256px; + } + &:nth-child(2) { + min-width: 200px; + } + } + } + + + tbody { + border: none; + padding: 0; + margin: 0; + td { + @apply border-t border-border text-left align-middle; + padding: "20px 18px"; + } + } +} + +.pagination { + display: flex; + justify-content: flex-end; + background-color: rgba(255, 255, 255, var(--bg-opacity)); + border-top: 1px solid rgb(214, 213, 212); + padding: 20px 40px 20px 0px; + color: rgb(80, 90, 95); + + svg { + fill: theme(colors.text.secondary); + @apply ml-md; + } +} + +.pagination button:nth-child(1) span::after { + content: "\f105"; +} + +.fullWidth { + width: 100% !important; +} + +.customTable { + width: 100%; + th { + font-weight: bold; + } + + th, + td { + text-align: left; + border-bottom: 1px solid #b1b4b6; + padding: 15px 10px; + } + + tr:nth-child(odd) { + background-color: theme(colors.grey.mid); + } + tr:nth-child(even) { + background-color: #fff; + } + + thead { + tr:first-child { + background-color: unset; + } + } +} + +.table-fixed-first-column { + thead { + th:first-child { + position: sticky; + background: #fff; + left: 0; + border-right: 1px solid #b1b4b6; + border-top-left-radius: 4px; + } + } + tbody { + td:first-child { + position: sticky; + background: #fff; + color: theme(colors.primary.main); + left: 0; + border-right: 1px solid #b1b4b6; + } + } +} + +.table-fixed-last-column { + thead { + th:last-child { + position: sticky; + background: #fff; + right: 0; + left:0; + border-top-left-radius: 4px; + } + } + tbody { + td:last-child { + position: sticky; + background: #fff; + color: theme(colors.primary.main); + left: 0; + right:0; + } + } +} + +.table-fixed-column-common-pay { + thead { + th:first-child { + position: sticky; + background: rgb(238, 238, 238); + left: 0; + border-top-left-radius: 4px; + } + th:last-child { + position: sticky; + background: rgb(238, 238, 238); + right: 0; + border-top-left-radius: 4px; + } + } + tbody { + td:first-child { + position: sticky; + background: rgb(238, 238, 238); + left: 0; + } + td:last-child { + position: sticky; + background: rgb(238, 238, 238); + right: 0; + } + } +} + +.table-fixed-first-second-column { + thead { + th:nth-child(2) { + position: sticky; + left: 0; + background-color: white; + } + } + tbody { + td:nth-child(2) { + position: sticky; + left: 0; + background-color: inherit; + } + } +} +.table-border-style { + border: 1px solid #b1b4b6; + border-radius: 4px; + border-spacing: 0; + border-collapse: separate; +} +.dss-table-wrapper { + width: 100%; + display: block; + overflow-x: auto; + table { + th { + .tooltip { + min-width: 80px; + } + } + tr { + td { + span { + white-space: pre; + min-width: 80px; + } + } + } + } +} + +.reports-table { + margin-top: 2rem; + thead { + th { + &:first-child { + min-width: unset; + } + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/tag.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/tag.scss new file mode 100644 index 00000000000..0d0d0e9b347 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/tag.scss @@ -0,0 +1,27 @@ +.tag-container { + @apply flex flex-wrap mb-md; + .tag { + @apply bg-grey-mid rounded-2xl pt-sm pb-sm flex justify-between items-center; + padding-left: 12px; + padding-right: 12px; + font-size: 14px; + margin-left: 2px; + height: 2rem; + margin-top: 1rem; + .text { + padding-right: 5px; + max-width: calc( 100% - 24px ); + height: 22px; + overflow: hidden; + text-overflow: clip; + } + + &:hover { + @apply cursor-pointer; + + .close { + fill: black; + } + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/telephone.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/telephone.scss new file mode 100644 index 00000000000..7b711d21f76 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/telephone.scss @@ -0,0 +1,17 @@ +.telephone { + @apply flex items-baseline; + img, + svg { + height: 22px; + width: 20px; + @apply text-primary-main ml-sm items-center; + } + + p { + @apply text-text-primary text-body-l pl-sm; + } +} + +.call { + @apply flex text-text-secondary text-body-l; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/textfields.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/textfields.scss new file mode 100644 index 00000000000..715140131c0 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/textfields.scss @@ -0,0 +1,96 @@ +.card-input { + @apply mb-lg pl-sm outline-none mt-sm block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.employee-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} +.employee-card-input:disabled { + @apply border-grey-dark text-grey-dark !important; + pointer-events: none !important; +} +.employee-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + background: theme(colors.grey.mid); + border-right: 0; + padding-right: 5px; +} +.employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.card-textarea, +.employee-card-textarea { + @apply block outline-none mt-md mb-lg border w-full border-input-border border-solid bg-white h-24 text-form-field text-text-primary p-sm; +} + +.inputWrapper { + display: flex; + justify-content: flex-start; + max-width: 500px; + + div { + max-width: 80px; + } + + span { + margin-top: 16px; + margin-left: 10%; + margin-right: 10%; + } +} + +@screen dt { + .card-input { + width: 480px; + } + + .card-input-emp { + width: 240px; + } + + .card-input-error { + width: 480px; + } + + .employee-card-input { + @apply w-full; + } + + .employee-card-input-error { + @apply w-full; + } + + .card-textarea { + /* //width: 480px; */ + @apply w-full; + max-width:540px; + } + + .employee-card-textarea { + @apply w-full; + } + + .card-input-emp { + width: 240px; + } +} + +.citizen-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.citizen-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + background: theme(colors.grey.mid); + border-right: 0; + padding-right: 5px; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/toast.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/toast.scss new file mode 100644 index 00000000000..3a442bcf9d2 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/toast.scss @@ -0,0 +1,31 @@ +.toast-success { + max-width: 480px; + width: calc(100% - 20px); + bottom: 64px; + left: 0; + margin: 0 10px; + gap: 16px; + border-radius: 4px; + min-height: 48px; + @apply fixed flex bg-success leading-7 z-20 items-center pl-md pr-sm; + + svg { + height: 20px; + width: 20px; + } + + .toast-close-btn { + margin-left: auto; + } + + h2 { + @apply text-body-s-dt text-white; + } +} + +@screen dt { + .toast-success { + width: 100%; + left: calc(50% - 240px); + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/toggleSwitch.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/toggleSwitch.scss new file mode 100644 index 00000000000..6c09986db2e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/toggleSwitch.scss @@ -0,0 +1,41 @@ +.react-switch-checkbox { + height: 0; + width: 0; + visibility: hidden; + } + + .react-switch-label { + display: flex; + align-items: center; + justify-content: space-between; + cursor: pointer; + width: 50px; + height: 20px; + background: white; + border-radius: 100px; + position: relative; + transition: background-color .2s; + border: 1px solid #bbb; + } + + .react-switch-label .react-switch-button { + content: ''; + position: absolute; + top: 2px; + left: 2px; + width: 14px; + height: 14px; + border-radius: 45px; + transition: 0.2s; + background: theme(colors.primary.main); + box-shadow: 0 0 2px 0 rgba(10, 10, 10, 0.29); + } + + .react-switch-checkbox:checked + .react-switch-label .react-switch-button { + left: calc(100% - 2px); + transform: translateX(-100%); + } + + .react-switch-label:active .react-switch-button { + width: 45px; + } \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/topbar.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/topbar.scss new file mode 100644 index 00000000000..56bbd8426ec --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/topbar.scss @@ -0,0 +1,153 @@ +.topbar { + position: fixed; + top: 0; + width: 100%; + padding: 10px 24px; + background: white; + box-shadow: rgba(0, 0, 0, 0.24) 0 1px 4px; + z-index: 9999999; + @apply flex items-center; + + img { + display: inline; + + &.city { + margin-right: 8px; + height: 48px; + width: 48px; + } + + &.state { + height: 20px; + max-height: 20px; + width: auto; + } + } + + .ulb { + font-weight: bold; + display: inline-block; + } + + .right { + float: right; + margin-top: 12px; + position: relative; + + svg { + display: inline; + } + + .user-img-txt { + background: theme(colors.primary.main); + padding: 10px 15px; + border-radius: 50%; + color: white; + font-weight: 700; + } + } + + .left { + float: left; + } + + .w-80 { + width: 70%; + } + + .width-20 { + width: 30%; + } + + .margin-top-6 { + margin-top: 6px; + } + + .margin-right-30 { + margin-right: 30px; + } + + .margin-top-10 { + margin-top: 10px; + } + + .icon { + display: block; + color: rgb(117, 117, 117); + fill: rgb(117, 117, 117); + height: 21px; + width: 21px; + } + + .column-gap-15 { + column-gap: 15px; + } + + .column-gap-5 { + column-gap: 5px; + } + + .select-wrap, + .employee-select-wrap { + margin-bottom: 0px; + .profile-dropdown--item { + span { + white-space: pre; + } + } + } +} + +.cp { + cursor: pointer; + .hamburger { + display: none; + } + + @media (max-width: 780px) { + .hamburger { + display: none; + } + } +} + +.citizen { + .right { + margin-top: 5px; + margin-bottom: 5px; + } + + .topbar-select-wrap { + margin-bottom: 0; + } + + .flex-between { + @apply flex items-center justify-between; + } +} + +.profile-dropdown--item { + display: flex; + flex-direction: row; + padding: 10px; + column-gap: 10px; + color: theme(colors.text.secondary); + + &:hover { + background: theme(colors.grey.mid); + } +} + +.flex-right { + @apply flex items-center justify-end; + min-width: 85px; +} +video::-webkit-media-controls-panel { + top: 55%; + position: absolute; + width: 100%; +} + +.topbarOptionsClassName { + right: -3rem !important +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/uploadcomponents.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/uploadcomponents.scss new file mode 100644 index 00000000000..349f2f9b524 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/components/uploadcomponents.scss @@ -0,0 +1,100 @@ +.upload-wrap { + @apply flex w-full h-40 bg-grey-light relative mb-lg px-sm border border-border border-dashed; + max-width: 540px; + + img { + display: block; + margin-top: 58px; + margin-left: calc(50% - 23px); + height: 42px; + width: 46px; + } + + svg { + display: block; + margin-top: 58px; + margin-left: calc(50% - 23px); + height: 42px; + width: 46px; + } + + input { + @apply absolute w-full h-full opacity-0 top-0; + } +} + +.multi-upload-wrap { + @apply flex mb-lg; + + div { + display: block; + position: relative; + background-color: theme(colors.grey.light); + width: calc((100% - 16px) / 3); + margin-right: 8px; + + .delete { + position: absolute; + height: 24px; + width: 24px; + border-radius: 100%; + top: 2px; + right: 2px; + } + } + + .upload-img-container { + border: 1px dashed theme(colors.border); + margin: 0 !important; + + img { + margin-left: auto; + margin-right: auto; + padding-top: calc(33% - 21px); + } + + svg { + @apply flex; + margin: auto; + } + + svg { + margin-left: auto; + margin-right: auto; + top: calc(50% - 21px); + position: relative; + } + + input { + @apply absolute w-full h-full opacity-0 top-0; + } + } +} + +.upload-file-max-width { + max-width: 540px; +} + +.upload-file { + min-height: 56px; + @apply relative border border-input-border w-full; + + div { + @apply flex flex-row h-full items-center pl-md mt-sm flex-wrap; + + .file-upload-status { + @apply text-body-s-dt ml-sm; + } + } + input { + width: 160px; + @apply absolute top-0 left-0 opacity-0 h-full; + } +} + +@screen dt { + .multi-upload-wrap img { + width: 100%; + height: 158px; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ErrorMessage.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ErrorMessage.scss new file mode 100644 index 00000000000..07117cc830e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ErrorMessage.scss @@ -0,0 +1,6 @@ +@import url("../index.scss"); + +.digit-error-message { + @extend .alert-error; + @apply block text-body-s mb-md; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/FormComposerV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/FormComposerV2.scss new file mode 100644 index 00000000000..1fe70a1b7b4 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/FormComposerV2.scss @@ -0,0 +1,120 @@ +@import url("../index.scss"); + +.field-container { + display: flex; + align-items: center; + max-width: 540px; + @apply flex items-center; + + .component-in-front { + @apply flex justify-center items-center; + @extend .light-background; + @extend .light-input-border; + margin-top: 0; + border: 1px solid; + border-right: none; + padding: 7px; + } +} + +.card-date-input { + @apply absolute top-0 left-0 w-3/4 bg-white pl-sm border border-input-border border-solid border-r-0; + outline: transparent solid 1px; + height: 2.5rem; + @extend .light-input-border; +} +.text-input-width { + max-width: 540px; +} + +.text-input { + @apply relative w-full; + input { + background-color: transparent; + &:hover { + @apply border-2 border-solid border-primary-main; + @extend .light-input-border; + } + } +} +.employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; +} +.card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; +} + +.employee-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; +} +.employee-card-input:disabled { + @apply border-grey-dark text-grey-dark !important; + pointer-events: none !important; + @extend .light-input-border; + @extend .light-text-color-disabled; +} +.employee-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + /* background: theme(colors.grey.mid); */ + @extend .light-background; + border-right: 0; + padding-right: 5px; +} +.employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; +} + +.card-textarea, +.employee-card-textarea { + @apply block outline-none mt-md mb-lg border w-full border-input-border border-solid bg-white h-24 text-form-field text-text-primary p-sm; + @extend .light-input-border; +} +.employee-card-textarea { + @apply w-full; +} + +.citizen-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; +} +.citizen-card-input--front { + @extend .light-background; + width: fit-content !important; + display: flex; + align-items: center; + /* background: theme(colors.grey.mid); */ + border-right: 0; + padding-right: 5px; +} + +.break-line { + @extend .light-input-border; + @apply border-border my-lg; +} + +.primary-label-btn { + @apply flex; + gap: 10px; + + svg { + fill: theme(colors.primary.main); + } + + @extend .light-primary; + cursor: pointer; + font-weight: 500; + width: fit-content; +} + +.digit-form-composer-header{ + font-size:theme(digitv2.fontSize.heading-l-dt); +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionLinkV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionLinkV2.scss new file mode 100644 index 00000000000..c41b0b25d07 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionLinkV2.scss @@ -0,0 +1,7 @@ +@import url("../index.scss"); + +.digit-action-links { + @extend .light-primary; + @apply text-text-btn mr-lg !important; + cursor: pointer; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionbarV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionbarV2.scss new file mode 100644 index 00000000000..e5a69acd35e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/actionbarV2.scss @@ -0,0 +1,110 @@ +@import url("../index.scss"); + +.digit-action-bar-wrap { + @extend .light-text-color-primary; + @extend .light-paper-primary; + box-shadow: rgba(0, 0, 0, 0.16) 0 -2px 8px; + max-width: 100%; + z-index: 100; + + @apply left-0 bottom-0 w-full bg-white py-sm px-sm fixed text-right; + + div { + @apply w-full; + } + + .digit-menu-wrap { + @apply absolute bg-white text-left mb-xs z-30 cursor-pointer; + @extend .light-background; + bottom: 45px; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + width: calc(100% - 16px); + right: 8px; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + @extend .light-primary; + + &:hover { + @apply bg-grey-mid w-full; + @extend .light-background; + } + } + } +} + +@screen dt { + .digit-action-bar-wrap { + box-shadow: rgba(0, 0, 0, 0.16) 0 -2px 8px; + left: 0; + max-width: none; + z-index: 999; + + @apply fixed bottom-0 bg-white py-sm pr-lg text-right; + /* @extend .light-background; */ + + div { + width: calc(100% - 16px); + } + + .digit-menu-wrap { + bottom: 45px; + top: unset; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + @apply absolute h-auto bg-white text-left mb-xs z-30; + width: 240px; + right: 24px; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + + &:hover { + @apply bg-grey-mid w-full; + /* @extend .light-background; */ + } + } + } + } +} + +.digit-action-bar-wrap-registry { + div { + @apply w-full; + } + .digit-menu-wrap { + @apply absolute bg-white text-left mb-xs z-30 cursor-pointer; + box-shadow: rgba(0, 0, 0, 0.14) 0 8px 10px 1px, rgba(0, 0, 0, 0.12) 0 3px 14px 2px, rgba(0, 0, 0, 0.2) 0 5px 5px -3px; + width: 160px; + right: 60px; + @extend .light-background; + + div { + @apply h-12 pl-sm py-md text-body-l text-text-primary; + + &:hover { + @apply bg-grey-mid w-full; + @extend .light-background; + } + } + } + + .digit-search-add { + padding: 12px 16px; + @extend .light-primary; + color: rgb(244, 119, 56); + display: flex; + cursor: pointer; + } + + .digit-search-add-icon { + @extend .light-primary-button; + background: rgb(244, 119, 56); + border-radius: 50%; + height: 24px; + width: 24px; + display: flex; + justify-content: center; + align-items: center; + margin-left: 10px; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/appContainerV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/appContainerV2.scss new file mode 100644 index 00000000000..fda32e93240 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/appContainerV2.scss @@ -0,0 +1,55 @@ +@import url("../index.scss"); + +.app-container { + @extend .light-background; + width: 100%; + form { + .card { + max-width: 960px; + h2 { + @extend .light-text-color-primary; + text-align: left; + } + .field-container { + max-width: 540px; + } + button { + @extend .light-primary-button; + max-width: 240px; + } + .input-otp-wrap, + .card-text-button { + @extend .light-primary-button; + text-align: left; + } + } + } +} + +@screen dt { + .employee-app-container { + @apply w-full; + } + + .app-container { + width: 100%; + form { + .card { + max-width: 960px; + h2 { + text-align: left; + } + .field-container { + max-width: 540px; + } + button { + max-width: 240px; + } + .input-otp-wrap, + .card-text-button { + text-align: left; + } + } + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/backButtonV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/backButtonV2.scss new file mode 100644 index 00000000000..68f7cf957c0 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/backButtonV2.scss @@ -0,0 +1,26 @@ +@import url("../index.scss"); + +.digit-back-button { + @extend .light-text-color-primary; + @extend .light-input-border; + width: fit-content; + @apply flex items-center cursor-pointer border-b font-rc text-text-btn ml-sm mb-md; + + img { + @apply flex; + } + + svg { + @apply flex; + } + + p { + @apply flex; + } +} + +@screen dt { + .digit-back-button { + margin-left: 0; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bannerV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bannerV2.scss new file mode 100644 index 00000000000..06c16970a7f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bannerV2.scss @@ -0,0 +1,120 @@ +@import url("../index.scss"); + +.digit-banner-success-wrap, +.digit-banner-emp-success-wrap { + @apply block bg-success w-full text-center text-white pt-md pb-sm mb-md; + + header { + @apply block mb-sm font-rc font-bold text-heading-xl; + } + + div { + img { + padding: 13.67px; + margin-left: auto; + margin-right: auto; + @apply border border-solid border-white rounded-full h-16 w-16 bg-white mb-md; + } + + svg { + padding: 13.67px; + margin-left: auto; + margin-right: auto; + @apply border border-solid border-white rounded-full h-16 w-16 bg-white mb-md; + } + + svg.payment-svg { + border: unset; + background-color: unset; + @apply rounded-full; + } + + h2 { + @apply font-bold text-caption-m mb-sm; + } + + p { + @apply font-bold text-caption-l; + } + } +} + +.digit-banner-error-wrap, +.digit-banner-emp-error-wrap { + @apply block bg-error w-full text-center text-white pt-md pb-sm mb-md; + + + header { + @apply block mb-sm font-rc font-bold text-heading-xl; + } + + img { + margin-left: auto; + margin-right: auto; + padding: 13.67px; + @apply border border-solid border-white rounded-full bg-white h-16 w-16 mb-md; + } + + svg { + margin-left: auto; + margin-right: auto; + padding: 13.67px; + @apply border border-solid border-white rounded-full bg-white h-16 w-16 mb-md; + } +} + +@screen dt { + .digit-banner-success-wrap { + header { + @apply text-heading-xl-dt; + } + } + .digit-banner-emp-success-wrap { + width: calc(100%); + header { + @apply text-heading-xl-dt; + } + } + + .digit-banner-error-wrap { + width: 100%; + header { + @apply text-heading-xl-dt; + } + } + + .digit-banner-emp-error-wrap { + width: calc(100%); + header { + @apply text-heading-xl-dt; + } + } +} + +.banner { + @apply flex justify-center items-center; + height: calc(100vh - 80px); + background: linear-gradient(rgba(11, 75, 102, 0.8), rgba(11, 75, 102, 0.8)), var(--banner-url) center center; + + .bannerCard { + min-width: 400px; + } + .bannerLogo { + width: 80px; + height: 40px; + object-fit: contain; + padding-right: 10px; + margin-right: 10px; + border-right: 1px solid theme(colors.text.primary); + } + .bannerHeader { + @apply flex justify-center items-center; + margin-bottom: 24px; + } +} + +.banner-container { + flex-direction: column; + justify-content: center; + align-items: center !important; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bodyContainerV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bodyContainerV2.scss new file mode 100644 index 00000000000..9836a7104df --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/bodyContainerV2.scss @@ -0,0 +1,39 @@ +@import url("../index.scss"); + +body { + @extend .light-background; +} + +.body-container { + @extend .light-background; + @apply h-full min-h-screen overflow-x-hidden; +} + +.body-container::-webkit-scrollbar { + display: none; +} + +.h1 { + @extend .light-text-color-primary; + @apply text-heading-l font-bold mb-md ml-md; +} + +.link-label { + @extend .light-primary; + @apply block mb-md ml-md cursor-pointer; + + &:hover { + @extend .light-text-color-primary; + } +} + +@screen dt { + .h1 { + margin-left: 0; + @apply text-heading-l-dt; + } + + .link-label { + margin-left: 0; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breadCrumbV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breadCrumbV2.scss new file mode 100644 index 00000000000..2b13c868290 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breadCrumbV2.scss @@ -0,0 +1,31 @@ +@import url("../index.scss"); + +.digit-bread-crumb { + @extend .light-text-color-secondary; + font-size: 14px; + display: flex; + margin-bottom: 10px; +} +.digit-bread-crumb--item { + margin-left: 5px; + + &:not(:last-child):after { + content: " /"; + } + + button { + outline: none; + } + + .last { + @extend .light-text-color-primary; + } + + span { + cursor: pointer; + } +} +ol, +ul { + list-style: none; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breakLineV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breakLineV2.scss new file mode 100644 index 00000000000..1b67e4bcc81 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/breakLineV2.scss @@ -0,0 +1,6 @@ +@import url("../index.scss"); + +.digit-break-line { + @apply border-solid border-2; + @extend .light-input-border; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/buttonsV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/buttonsV2.scss new file mode 100644 index 00000000000..13334e22958 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/buttonsV2.scss @@ -0,0 +1,40 @@ +@import url("../index.scss"); + +.digit-button-primary { + height: fit-content; + @extend .light-primary-button; + @apply text-center cursor-pointer outline-none px-lg; + + &.disabled { + opacity: 0.5; + } + &:focus { + @apply outline-none; + } + + h2 { + @apply font-rc font-medium text-legend text-white; + } +} + +.digit-button-secondary { + height: fit-content; + @extend .light-paper-secondary; + @apply text-center cursor-pointer border-primary-main border-b-2 border-solid outline-none px-lg; + + &:focus { + @apply outline-none; + } + + h2 { + @extend .light-primary; + @apply font-rc font-medium text-legend; + } + .disabled { + opacity: 0.5; + } +} + +.submit-bar:focus { + @apply outline-none !important; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/cardV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/cardV2.scss new file mode 100644 index 00000000000..ee75e5a9689 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/cardV2.scss @@ -0,0 +1,385 @@ +@import url("../index.scss"); + +.digit-card { + @apply bg-white m-sm px-md pt-md pb-lg shadow-card; + @extend .light-paper-primary; + border-radius: 4px; + max-width: 960px; + + .digit-card-header { + @extend .light-primary; + @apply text-heading-xl font-bold font-rc align-middle text-left mb-md; + } + + .digit-card-sub-header { + @extend .light-primary; + @apply text-caption-xl font-bold align-middle text-left mb-sm; + } + + .digit-card-caption { + @extend .light-text-color-secondary; + @apply text-caption-xl mb-sm; + } + + .digit-card-text { + @extend .light-text-color-secondary; + @apply text-body-l align-middle text-left mb-lg; + + span { + @extend .light-text-color-primary; + } + } + + .digit-card-text-primary { + @extend .light-primary; + @apply text-body-l; + } + + .digit-card-text-button { + @extend .light-primary; + @apply text-text-btn; + } + + .digit-card-label { + @extend .light-primary; + @apply text-legend mb-sm; + } + + .digit-card-label-error { + @extend .alert-error; + @apply block text-body-s text-error mb-md; + } + + .digit-card-label-desc { + @extend .light-text-color-secondary; + @apply font-bold text-heading-s mb-md; + } + + .digit-card-link { + @extend .light-primary; + @apply block text-center text-link mt-md cursor-pointer; + } +} + +.digit-validation-error { + @extend .alert-error; + @apply block text-body-s text-error; +} + +.digit-docsDescription { + @extend .light-text-color-primary; +} + +.digit-field-container { + @apply flex items-center; +} + +.digit-employee-card { + @extend .light-paper-primary; + @apply shadow-card p-md mb-xl; + border-radius: 4px; + + .digit-card-header { + @extend .light-primary; + @apply text-heading-xl font-bold font-rc align-middle text-left mb-md; + } + + .digit-card-sub-header, + .digit-employee-card-sub-header { + @extend .light-primary; + @apply text-caption-xl font-bold align-middle text-left; + } + + .digit-card-section-header { + @extend .light-primary; + @apply text-heading-m font-bold; + } + + .digit-card-section-sub-text { + @extend .light-primary; + @apply text-body-s; + } + + .digit-card-caption { + @extend .light-text-color-secondary; + @apply text-caption-xl mb-sm; + } + + .digit-card-text { + @extend .light-text-color-secondary; + @apply text-body-l align-middle text-left mb-lg; + + span { + @extend .light-text-color-primary; + } + } + + .card-text-primary { + @extend .light-primary; + @apply text-body-l; + } + + .card-text-button { + @extend .light-primary; + @apply text-text-btn; + } + + .card-label { + @extend .light-primary; + @apply text-legend mb-md; + } + + .card-label-error { + @extend .alert-error; + @apply block text-body-s text-error mb-md; + } + + .card-label-desc { + @extend .light-text-color-secondary; + @apply font-bold text-heading-s mb-md; + } + + .card-link { + @extend .light-primary; + @apply block text-center text-link text-link-normal mt-md; + } + + .card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; + } +} + +.header-wrap { + @apply flex mb-md; + + .header-start { + margin-right: auto; + } + + .header-content { + } + + .header-end { + margin-left: auto; + } +} + +.card-emp { + @extend .card; + padding-right: 0; + padding-top: 0; + padding-left: 0; + @apply bg-white m-sm; + @extend .light-background; +} + +.submit-bar { + @extend .light-primary-button; + @apply h-10 text-center w-full outline-none; + box-shadow: inset 0px -2px 0px theme(colors.text.primary); + cursor: pointer; + + &:focus { + @apply outline-none; + } + + header { + @apply font-rc font-medium text-legend text-white leading-10; + } +} + +.submit-bar-disabled { + @apply h-10 bg-primary-main text-center w-full outline-none opacity-50; + + &:focus { + @apply outline-none; + } + + header { + @apply font-rc font-medium text-legend text-white leading-10; + } +} + +@screen dt { + .submit-bar, + .submit-bar-disabled { + width: 240px; + } + + .card { + display: flex; + flex-direction: column; + + .card-header { + @apply text-heading-xl-dt; + } + + .card-sub-header { + @apply text-heading-l-dt; + } + + .card-caption { + @apply text-caption-xl-dt; + } + + .card-text, + .card-text-primary { + @apply text-body-l-dt; + } + + .card-link { + @apply text-left; + } + } + + .digit-employee-card { + @apply mb-md mx-md !important; + + &.digit-filter { + margin-left: auto; + margin-right: auto; + } + + .digit-card-header { + @apply text-heading-xl-dt; + } + + .digit-card-sub-header { + @apply text-heading-l-dt; + } + + .digit-employee-card-sub-header { + margin-bottom: 40px; + @apply text-heading-l-dt; + } + + .digit-card-section-header { + margin-bottom: 40px; + @apply text-heading-m-dt; + } + + .digit-card-section-sub-text { + @apply text-text-primary text-body-s-dt; + } + + .digit-card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; + } + + .digit-card-caption { + @apply text-caption-xl-dt; + } + + .digit-card-text, + .digit-card-text-primary { + @apply text-body-l-dt; + } + + .digit-card-link { + @apply text-left; + } + + .digit-label-field-pair { + @apply flex items-center; + + h2 { + width: 30%; + } + + .field { + width: 50%; + margin-right: 20%; + .field { + margin-right: unset; + } + } + } + + .digit-field-container { + span { + border: 2px solid black; + background: rgb(247, 247, 247); + width: 40px; + height: 40px; + display: flex; + justify-content: center; + align-items: center; + margin-top: -16px; + border-right: none; + } + } + } + + .digit-header-wrap { + @apply flex mb-md; + + .header-start { + margin-right: auto; + } + + .header-content { + } + + .header-end { + margin-left: auto; + } + } +} + +.digit-card-section-header { + @extend .light-text-color-primary; + @apply text-text-primary text-heading-m font-bold; +} + +.digit-card-search-heading { + margin-right: 0px !important; + margin-left: 0px !important; + margin-bottom: 0px !important; + padding-bottom: 0px; + padding-left: 25px; +} + +.digit-card-label-error { + @extend .alert-error; + @apply block text-body-s text-error mb-md; +} + +.digit-employee-card-override { + margin-left: 0px !important; +} + +.digit-employee-application-details { + display: flex !important; + justify-content: space-between !important; + max-height: 60px !important; + height: 60px !important; +} +.digit-employee-main-application-details { + padding: 10px !important; +} + +.digit-employee-mulitlink-main-div { + @extend .light-primary; + z-index: 10 !important; + max-width: 41% !important; +} + +.digit-employee-download-btn-className { + position: unset !important; + display: flex !important; + justify-content: flex-end !important; +} + +.digit-employee-options-btn-className { + position: unset !important; + margin: 0 !important; + width: 100% !important; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkboxV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkboxV2.scss new file mode 100644 index 00000000000..c19cfe8c247 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkboxV2.scss @@ -0,0 +1,61 @@ +@import url("../index.scss"); + +.digit-checkbox-wrap { + @apply flex mb-md relative items-baseline; + + input { + width: 38px; + height: 38px; + @apply opacity-0 absolute top-0 left-0 z-10; + @extend .light-input-border; + } + + .input-emp { + @extend input; + width: 24px; + height: 24px; + } + + .digit-custom-checkbox { + width: 38px; + height: 38px; + @apply absolute top-0 left-0 border border-solid border-input-border z-0; + @extend .light-input-border; + + img { + @apply opacity-0; + } + + svg { + @apply opacity-0; + } + } + + .digit-custom-checkbox-emp { + @extend .digit-custom-checkbox; + width: 24px; + height: 24px; + } + + input:checked ~ .digit-custom-checkbox, + input:hover ~ .digit-custom-checkbox { + @apply border-2 border-primary-main; + @extend .light-input-border; + } + + input:checked ~ .digit-custom-checkbox img { + @apply opacity-100; + } + + input:checked ~ .digit-custom-checkbox svg { + @apply opacity-100; + width: 35px; + height: 35px; + } + + .label { + margin-left: 56px; + @apply text-form-field text-text-primary; + @extend .light-text-color-primary; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkpointV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkpointV2.scss new file mode 100644 index 00000000000..f751e8a910b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/checkpointV2.scss @@ -0,0 +1,71 @@ +@import url("../index.scss"); + +.digit-checkpoint-connect-wrap { + padding-bottom: 40px; + @apply relative; +} +.digit-checkpoint-done { + @apply flex items-center; + + h2 { + z-index: 1; + width: 24px; + height: 24px; + border-radius: 50%; + @apply border-b border-solid border-primary-main bg-primary-main; + } + + header { + @apply text-heading-s ml-md; + + p { + margin-top: 4px; + @extend .light-text-color-secondary; + @apply text-heading-s; + } + } +} + +.digit-checkpoint { + @apply flex items-center; + + h2 { + z-index: 1; + width: 24px; + height: 24px; + border-radius: 50%; + --text-opacity: 1; + @apply border-b border-solid border-border bg-border; + } + + header { + @apply text-heading-s ml-md; + + p { + margin-top: 4px; + @extend .light-text-color-secondary; + @apply text-heading-s; + } + } +} + +.digit-checkpoint-connect { + margin-left: 12px; + margin-top: 22px; + @apply absolute top-0 left-0 h-full border-l border-solid border-border; +} + +.digit-checkpoint-comments-wrap { + max-width: 560px; + @apply bg-grey-mid p-sm mt-sm; + + h4 { + @extend .light-text-color-primary; + @apply text-heading-s; + } + + p { + @extend .light-text-color-secondary; + @apply text-body-s-dt; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/collapseAndExpandGroups.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/collapseAndExpandGroups.scss new file mode 100644 index 00000000000..3e0b65a668d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/collapseAndExpandGroups.scss @@ -0,0 +1,60 @@ +@import url("../../digitv2/index.scss"); + +.digit-expand-collapse-wrapper { + display: flex; + flex-direction: column; + margin-top: 1rem; +} + +.digit-expand-collapse-header { + background-color: #f2f2f2; + display: grid; + grid-template-columns: 1fr 1fr; + align-items: center; + padding: 12px; + position: relative; + font-weight: bolder; + border: 1px solid #828282; + border-radius: 4px; +} + +.digit-icon-toggle { + position: absolute; + right: 10px; + top: 50%; + transform: translate(0%, -50%); + cursor: pointer; + span{ + display: inline-flex; + align-items: center; + + h5{ + color: theme(colors.primary.main); + display: inline; + } + } +} + +.digit-expand-collapse-header .label { + display: block; + text-align: left; +} + +.digit-expand-collapse-header .value { + display: block; + text-align: right; + margin-right: 2rem; +} + +.digit-toggling-wrapper.digit-collapse { + flex: none; + overflow: hidden; + height: 0; + transition: 0.2s ease-in-out; +} + +.digit-toggling-wrapper { + flex: 1; + transition: 0.2s ease-in-out; + box-sizing: border-box; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/dateWrapV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/dateWrapV2.scss new file mode 100644 index 00000000000..3d2dc3db77b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/dateWrapV2.scss @@ -0,0 +1,12 @@ +.digit-date-picker { + @apply relative w-full cursor-pointer; + .citizen { + max-width: 540px; + } + .digit-employee-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + width: calc(100%-62px); + padding-right: 9px; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/displayPhotosV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/displayPhotosV2.scss new file mode 100644 index 00000000000..77bd2d221bc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/displayPhotosV2.scss @@ -0,0 +1,33 @@ +.digit-photos-wrap { + max-width: 640px; + @apply flex pt-md; + + img { + width: calc(33% - 9.333px); + margin-right: 14px; + } + + svg { + width: calc(33% - 9.333px); + margin-right: 14px; + } + + .last { + width: calc(33% - 9.333px); + } +} + +.digit-image-pdf-icon { + @apply flex flex-wrap justify-start content-center; + .digit-url { + min-width: 100px; + margin-right: 10px; + max-width: 100px; + height: auto; + .digit-icon { + background: #f6f6f6; + padding: 8px; + width: 100px; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/headerV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/headerV2.scss new file mode 100644 index 00000000000..9f514c0d983 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/headerV2.scss @@ -0,0 +1,6 @@ +@import url("../index.scss"); + +.digit-header { + @extend .light-text-color-primary; + @apply text-heading-l font-bold mb-md ml-md; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/infoBannerV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/infoBannerV2.scss new file mode 100644 index 00000000000..132ee6c0b96 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/infoBannerV2.scss @@ -0,0 +1,37 @@ +@import url("../index.scss"); + +.digit-info-banner-wrap { + @apply bg-opacity-25 m-sm p-md; + max-width: 960px; + + @extend .alert-info-bg; + border-radius: 4px; + svg { + margin-top: 5px; + @apply rounded-full; + } + + div { + @apply flex items-center; + } + + h2 { + @apply text-heading-m text-link-normal mb-md font-bold ml-sm; + } + + p { + @apply text-body-l text-link-normal whitespace-pre-line; + } +} + +@screen dt { + .digit-info-banner-wrap { + h2 { + @apply text-heading-m-dt; + } + + p { + @apply text-body-l-dt; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/keynoteV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/keynoteV2.scss new file mode 100644 index 00000000000..02fe872b5c6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/keynoteV2.scss @@ -0,0 +1,35 @@ +.digit-key-note-pair { + @apply mb-md; + + h3 { + margin-bottom: 4px; + @apply font-bold text-text-primary text-heading-s; + } + + p { + @apply text-text-primary text-body-l; + } + .digit-key-note-container { + display: inline-flex; + .digit-unmask-container { + display: inline-flex; + width: fit-content; + margin-left: 10px; + margin-top: 5px; + } + } + .digit-caption { + @apply text-body-l text-text-secondary; + } +} + +@screen dt { + .digit-key-note-pair { + p { + @apply text-body-l-dt; + } + .digit-caption { + @apply text-body-l-dt text-text-secondary; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/loaderV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/loaderV2.scss new file mode 100644 index 00000000000..7e435da688a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/loaderV2.scss @@ -0,0 +1,81 @@ +@import url("../index.scss"); + +.digit-screen-loader { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + z-index: 9999; + @extend .light-background; + .digit-ldio-pjg92h09b2o div { + position: absolute; + width: 52px; + height: 52px; + border: 12px solid theme(digitv2.lightTheme.primary); + border-top-color: transparent; + border-radius: 50%; + } +} + +.digit-page-loader, +.digit-module-loader { + text-align: center; +} + +.digit-page-loader { + padding-top: 88px; +} + +.digit-module-loader { + padding: 16px; +} + +@keyframes digit-ldio-pjg92h09b2o { + 0% { + transform: translate(-50%, -50%) rotate(0deg); + } + + 100% { + transform: translate(-50%, -50%) rotate(360deg); + } +} + +.digit-ldio-pjg92h09b2o div { + position: absolute; + width: 52px; + height: 52px; + border: 12px solid theme(colors.secondary); + border-top-color: transparent; + border-radius: 50%; +} + +.digit-ldio-pjg92h09b2o div { + animation: digit-ldio-pjg92h09b2o 1s linear infinite; + top: 50px; + left: 50px; +} + +.digit-loadingio-spinner-rolling-faewnb8ux8 { + width: 48px; + height: 48px; + display: inline-block; + overflow: hidden; + background: none; +} + +.digit-ldio-pjg92h09b2o { + width: 100%; + height: 100%; + position: relative; + transform: translateZ(0) scale(0.48); + backface-visibility: hidden; + transform-origin: 0 0; +} + +.digit-ldio-pjg92h09b2o div { + box-sizing: content-box; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/mobileNumberV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/mobileNumberV2.scss new file mode 100644 index 00000000000..5c7f6088047 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/mobileNumberV2.scss @@ -0,0 +1,33 @@ +@import url("../index.scss"); + +.digit-mobile-number-container { + @apply flex items-center; + + .digit-citizen-card-input--front { + @extend .light-background; + width: fit-content !important; + display: flex; + align-items: center; + /* background: theme(colors.grey.mid); */ + border-right: 0; + padding-right: 5px; + } + + .digit-citizen-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; + } + + .digit-citizen-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + background: theme(colors.grey.mid); + border-right: 0; + padding-right: 5px; + } + .digit-employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/multiSelectDropdownV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/multiSelectDropdownV2.scss new file mode 100644 index 00000000000..0862eebe234 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/multiSelectDropdownV2.scss @@ -0,0 +1,92 @@ +@import url("../index.scss"); + +.digit-multi-select-dropdown-wrap { + margin-bottom: 24px; + @apply relative text-form-field text-text-primary w-full; + .digit-master, + .digit-master-active { + @apply relative border border-solid border-input-border h-10 w-full; + input[type="text"] { + @apply absolute top-0 left-0 p-sm pl-sm min-h-full min-w-full opacity-0; + &:focus { + @apply outline-none; + } + } + .digit-label { + @apply flex justify-between p-sm w-full h-full; + svg { + @apply h-6 w-6; + } + } + + &:hover { + @apply border-2 border-solid border-primary-main; + } + } + + .digit-master-active { + @apply border-2 border-primary-main; + input[type="text"] { + @apply opacity-100; + } + .digit-label { + @apply hidden; + } + } + + .digit-server { + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + top: 40px; + + max-height: 20vmax; + overflow: scroll; + @apply absolute min-w-full z-20; + div { + @apply flex w-full bg-white; + justify-content: flex-start; + align-items: center; + &:hover { + @apply bg-grey-mid; + } + input { + height: 44px; + @apply absolute min-w-full opacity-0 z-20 cursor-pointer; + } + p { + padding: 12px; + margin-top: 5px; + margin-bottom: 5px; + @apply text-form-field text-text-primary; + } + .digit-custom-checkbox { + height: 28px; + width: 28px; + @apply border border-solid border-input-border m-sm; + svg { + @apply opacity-0 z-10; + } + } + input:checked ~ .digit-custom-checkbox, + input:hover ~ .digit-custom-checkbox { + @apply border-2 border-primary-main; + } + + input:checked ~ .digit-custom-checkbox svg { + @apply opacity-100; + } + } + } + .digit-cursorPointer { + @apply cursor-pointer; + } + .digit-master { + .digit-label { + p { + white-space: pre; + margin: auto; + margin-left: 0px; + padding-left: 1%; + } + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/noresultsfoundV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/noresultsfoundV2.scss new file mode 100644 index 00000000000..aedadebe94f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/noresultsfoundV2.scss @@ -0,0 +1,11 @@ +.digit-no-data-found { + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + .digit-error-msg { + margin-top: 2rem; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/otpInputV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/otpInputV2.scss new file mode 100644 index 00000000000..b16e2c90182 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/otpInputV2.scss @@ -0,0 +1,15 @@ +.digit-input-otp-wrap { + @apply mb-lg; + + input { + @apply border-2 border-solid border-input-border outline-none h-10 w-10 text-form-field text-text-primary mr-sm mb-sm text-center; + } + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + input[type="number"] { + -moz-appearance: textfield; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/popUpV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/popUpV2.scss new file mode 100644 index 00000000000..94f6fc0188a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/popUpV2.scss @@ -0,0 +1,16 @@ +.digit-popup-wrap { + background: rgba(0, 0, 0, 0.7); + @apply flex fixed w-full h-full overflow-auto top-0 left-0 min-h-screen; + z-index: 10000; +} + +@screen dt { + .digit-popup-wrap { + background: rgba(0, 0, 0, 0.7); + @apply min-h-screen; + } +} + +.digit-popup-close-icon { + @apply flex justify-end; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/radiobtnV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/radiobtnV2.scss new file mode 100644 index 00000000000..638271e149a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/radiobtnV2.scss @@ -0,0 +1,51 @@ +@import url("../index.scss"); + +.digit-radio-wrap { + @apply my-sm block leading-10 mb-lg; + + div { + @apply block mb-md; + } + + .digit-radio-btn-wrap { + @apply block float-left relative; + &:hover { + .digit-radio-btn-checkmark { + @apply border-primary-main; + } + } + } + + .digit-radio-btn { + @apply opacity-0 absolute cursor-pointer h-10 w-10; + } + + .digit-radio-btn-checkmark { + @extend .light-input-border; + @apply h-10 w-10 border border-input-border border-solid rounded-full block; + } + + label { + @extend .light-text-color-primary; + @apply text-text-primary text-form-field ml-md; + } + + .digit-radio-btn-checkmark:after { + content: ""; + } + + .digit-radio-btn-wrap input:checked ~ .digit-radio-btn-checkmark { + /* @extend .light-input-border; */ + @apply border-2 border-primary-main; + } + + .digit-radio-btn-wrap input:checked ~ .digit-radio-btn-checkmark:after { + /* @extend .light-background; */ + @apply block bg-primary-main h-5 w-5 rounded-full absolute top-10 left-10; + } +} +.digit-reverse-radio-selection-wrapper { + div { + @apply flex flex-row-reverse place-content-between items-center; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ratingV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ratingV2.scss new file mode 100644 index 00000000000..98e9e6d5642 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/ratingV2.scss @@ -0,0 +1,33 @@ +.digit-rating-star-wrap { + @apply flex w-full mb-lg; + img { + width: 40px; + height: 38px; + display: block; + @apply mr-sm; + } + + svg { + width: 40px; + height: 38px; + display: block; + @apply mr-sm; + } +} + +@screen dt { + .digit-rating-star-wrap { + @apply w-2/5; + } +} + +.digit-rating-with-text { + @apply flex place-items-center w-full; + + svg { + width: 24px; + height: 38px; + display: block; + @apply mr-sm; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/selectdropdownV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/selectdropdownV2.scss new file mode 100644 index 00000000000..a4f4118c91d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/selectdropdownV2.scss @@ -0,0 +1,170 @@ +.digit-employee-select-wrap { + @apply mb-lg relative; + + .digit-select { + @extend .light-input-border; + @apply relative block w-full h-10 border border-solid border-input-border; + &:hover { + @extend .light-input-border; + @apply border-2 border-solid border-primary-main; + } + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + @extend .light-input-border; + @extend .light-text-color-primary; + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + padding-top: 9px; + @extend .light-text-color-primary; + @apply text-form-field text-text-primary float-left ml-sm; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .digit-select-active { + @apply relative block w-full h-10 border-2 border-solid border-primary-main; + @extend .light-input-border; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + @extend .light-background; + @extend .light-text-color-primary; + + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + @extend .light-text-color-primary; + @apply text-form-field text-text-primary float-left ml-sm; + } + + p { + padding-top: 9px; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .digit-options-card { + width: 100% !important; + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + max-height: 400px; + overflow: auto; + @apply absolute z-20 mt-xs bg-white max-w-full; + + p { + padding-top: 14px; + @extend .light-text-color-primary; + @apply w-full h-12 pl-sm text-text-primary text-form-field; + + &:hover { + @apply bg-grey-mid; + @extend .light-background; + } + } + } +} + +.digit-employee-select-wrap--elipses { + width: 85% !important; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.digit-select-wrap { + @apply mb-lg relative; + max-width: 540px; + + .digit-select { + @apply relative block w-full h-10 border border-solid border-input-border; + @extend .light-input-border; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + @extend .light-text-color-primary; + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + padding-top: 9px; + @extend .light-text-color-primary; + @apply text-form-field text-text-primary float-left ml-sm; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .digit-select-active { + @extend .light-input-border; + @apply relative block w-full h-10 border-2 border-solid border-primary-main; + + input[type="text"] { + width: calc(100% - 32px); + background-color: transparent; + @extend .light-text-color-primary; + @apply absolute z-10 w-full h-full outline-none text-text-primary text-form-field pl-sm; + } + + p { + @extend .light-text-color-primary; + @apply text-form-field text-text-primary float-left ml-sm; + } + + p { + padding-top: 9px; + } + + img { + @apply float-right h-6 w-6 mt-sm mr-sm; + } + + svg { + @apply absolute right-0 float-right h-6 w-6 mt-sm mr-sm; + } + } + + .digit-options-card { + width: 100% !important; + box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); + @extend .light-background; + @apply absolute z-20 mt-xs bg-white; + + p { + padding-top: 14px; + @extend .light-text-color-primary; + @apply w-full h-12 pl-sm text-text-primary text-form-field; + + &:hover { + @apply bg-grey-mid; + } + } + } +} + +@screen dt { +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/tagV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/tagV2.scss new file mode 100644 index 00000000000..a202bbd671f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/tagV2.scss @@ -0,0 +1,28 @@ +.digit-tag-container { + @apply flex flex-wrap mb-md; + + .digit-tag { + @apply bg-grey-mid rounded-2xl pt-sm pb-sm flex justify-between items-center; + padding-left: 12px; + padding-right: 12px; + font-size: 14px; + margin-left: 2px; + height: 2rem; + margin-top: 1rem; + .digit-text { + padding-right: 5px; + max-width: calc(100% - 24px); + height: 22px; + overflow: hidden; + text-overflow: clip; + } + + &:hover { + @apply cursor-pointer; + + .close { + fill: black; + } + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/telephoneV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/telephoneV2.scss new file mode 100644 index 00000000000..0953ca8d717 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/telephoneV2.scss @@ -0,0 +1,18 @@ +.digit-telephone { + @apply flex items-baseline; + img, + svg { + height: 22px; + width: 20px; + @apply text-primary-main ml-sm items-center; + margin-left: 0px; + } + + p { + @apply text-text-primary text-body-l pl-sm; + } +} + +.digit-call { + @apply flex text-text-secondary text-body-l; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textInputV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textInputV2.scss new file mode 100644 index 00000000000..863500eb5e4 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textInputV2.scss @@ -0,0 +1,123 @@ +@import url("../index.scss"); + +.digit-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; +} +.digit-text-input { + @apply relative w-full; +} + +.digit-text-input-width { + max-width: 540px; +} +.digit-card-input { + @apply mb-lg pl-sm outline-none mt-sm block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.digit-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.digit-employee-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} +.digit-employee-card-input:disabled { + @apply border-grey-dark text-grey-dark !important; + pointer-events: none !important; +} +.digit-employee-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + background: theme(colors.grey.mid); + border-right: 0; + padding-right: 5px; +} +.digit-employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.digit-card-textarea, +.digit-employee-card-textarea { + @apply block outline-none mt-md mb-lg border w-full border-input-border border-solid bg-white h-24 text-form-field text-text-primary p-sm; +} + +.digit-inputWrapper { + display: flex; + justify-content: flex-start; + max-width: 500px; + + div { + max-width: 80px; + } + + span { + margin-top: 16px; + margin-left: 10%; + margin-right: 10%; + } +} + +@screen dt { + .digit-card-input { + width: 480px; + } + + .digit-card-input-emp { + width: 240px; + } + + .digit-card-input-error { + width: 480px; + } + + .digit-employee-card-input { + @apply w-full; + } + + .digit-employee-card-input-error { + @apply w-full; + } + + .digit-card-textarea { + /* //width: 480px; */ + @apply w-full; + max-width: 540px; + } + + .digit-employee-card-textarea { + @apply w-full; + } + + .card-input-emp { + width: 240px; + } +} + +.digit-citizen-card-input { + @apply mb-lg pl-sm outline-none block border w-full h-10 border-input-border border-solid bg-white leading-10 text-form-field text-text-primary; +} + +.digit-citizen-card-input--front { + width: fit-content !important; + display: flex; + align-items: center; + background: theme(colors.grey.mid); + border-right: 0; + padding-right: 5px; +} + +.digit-employee-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; +} +.digit-card-input-error { + @apply mb-lg pl-sm block w-full h-10 outline-none border-2 border-error border-solid bg-white leading-10 text-form-field text-text-primary; + @extend .light-input-border; + @extend .alert-error; +} +.disabled { + @apply border-grey-dark text-grey-dark !important; + pointer-events: none !important; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textareaV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textareaV2.scss new file mode 100644 index 00000000000..1be8174b0fe --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/textareaV2.scss @@ -0,0 +1,11 @@ +.digit-card-textarea, +.digit-employee-card-textarea { + @apply block outline-none mt-md mb-lg border w-full border-input-border border-solid bg-white h-24 text-form-field text-text-primary p-sm; + @extend .light-input-border; +} +.digit-employee-card-textarea { + @apply w-full; +} +.digit-cell-text { + color: theme(colors.text.secondary); +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/uploadFileV2.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/uploadFileV2.scss new file mode 100644 index 00000000000..8ebd72365bc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/components/uploadFileV2.scss @@ -0,0 +1,146 @@ +.digit-upload-wrap { + @apply flex w-full h-40 bg-grey-light relative mb-lg px-sm border border-border border-dashed; + max-width: 540px; + min-height: 50px; + padding: 0.5rem; + + img { + display: block; + margin-top: 58px; + margin-left: calc(50% - 23px); + height: 42px; + width: 46px; + } + + svg { + display: block; + margin-top: 58px; + margin-left: calc(50% - 23px); + height: 42px; + width: 46px; + } + + input { + @apply absolute w-full h-full opacity-0 top-0; + } + .digit-cell-text { + color: theme(colors.text.secondary); + padding-top: 3px; + } +} + +.digit-multi-upload-wrap { + @apply flex mb-lg; + + div { + display: block; + position: relative; + background-color: theme(colors.grey.light); + width: calc((100% - 16px) / 3); + margin-right: 8px; + + .digit-delete { + position: absolute; + height: 24px; + width: 24px; + border-radius: 100%; + top: 2px; + right: 2px; + } + } + + .digit-upload-img-container { + border: 1px dashed theme(colors.border); + margin: 0 !important; + + img { + margin-left: auto; + margin-right: auto; + padding-top: calc(33% - 21px); + } + + svg { + @apply flex; + margin: auto; + } + + svg { + margin-left: auto; + margin-right: auto; + top: calc(50% - 21px); + position: relative; + } + + input { + @apply absolute w-full h-full opacity-0 top-0; + } + } +} + +.digit-upload-file-max-width { + max-width: 540px; +} + +.digit-upload-file { + min-height: 56px; + @apply relative border border-input-border w-full; + + div { + @apply flex flex-row h-full items-center pl-md mt-sm flex-wrap; + + .file-upload-status { + @apply text-body-s-dt ml-sm; + } + } + input { + width: 160px; + @apply absolute top-0 left-0 opacity-0 h-full; + } +} + +@screen dt { + .digit-multi-upload-wrap img { + width: 100%; + height: 158px; + } +} + +.digit-upload-file-button-wrap { + display: flex; + justify-content: flex-start; + align-items: center; + flex-wrap: wrap; + margin: 0px; + padding: 0px; + button { + height: auto; + min-height: 40px; + width: 43%; + max-height: 40px; + margin: 5px; + padding: 0px; + h2 { + word-break: break-all; + height: auto; + line-height: 16px; + overflow: hidden; + max-height: 34px; + max-width: 100%; + } + } + .digit-tag-container { + margin: 0px; + padding: 0px; + } +} +.digit-input-mirror-selector-button { + @apply h-16 bg-border text-center border-b-2 border-input-border border-solid outline-none px-lg !important; + + &:focus { + @apply outline-none; + } + + h2 { + @apply font-rc font-medium text-legend text-text-primary; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/index.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/index.scss new file mode 100644 index 00000000000..9713106cfd7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/index.scss @@ -0,0 +1,168 @@ +@import url("./components/actionbarV2.scss"); +/* + TODO NABEEL/ANIL Removed these since it creates issues in search screen and home screen +@import url("./components/cardV2.scss"); +*/ + +@import url("./components/checkboxV2.scss"); +@import url("./components/FormComposerV2.scss"); +@import url("./components/radiobtnV2.scss"); +@import url("./components/selectdropdownV2.scss"); +@import url("./typography.scss"); +@import url("./components/actionLinkV2.scss"); +@import url("./components/appContainerV2.scss"); +@import url("./components/bodyContainerV2.scss"); +@import url("./components/breadCrumbV2.scss"); +@import url("./components/bannerV2.scss"); +@import url("./components/breakLineV2.scss"); +@import url("./components/loaderV2.scss"); +@import url("./components/headerV2.scss"); +@import url("./components/checkpointV2.scss"); +@import url("./components/backButtonV2.scss"); +@import url("./components/buttonsV2.scss"); +@import url("./components/infoBannerV2.scss"); +@import url("./components/displayPhotosV2.scss"); +@import url("./components/collapseAndExpandGroups.scss"); +@import url("./components/dateWrapV2.scss"); +@import url("./components/ErrorMessage.scss"); +@import url("./components/ratingV2.scss"); +@import url("./components/noresultsfoundV2.scss"); +@import url("./components/mobileNumberV2.scss"); +@import url("./components/tagV2.scss"); +@import url("./components/popUpV2.scss"); +@import url("./components/telephoneV2.scss"); +@import url("./components/textareaV2.scss"); +@import url("./components/textInputV2.scss"); +@import url("./components/otpInputV2.scss"); +@import url("./components/multiSelectDropdownV2.scss"); +@import url("./components/uploadFileV2.scss"); + +/* pages */ +@import url("./pages/employee/index.scss"); + +/* important to be remove after fixing the components */ +.light { + &-primary { + color: theme(digitv2.lightTheme.primary) !important; + + &-button { + background-color: theme(digitv2.lightTheme.primary) !important; + } + + &-bg { + background-color: theme(digitv2.lightTheme.primary-bg) !important; + } + } + + &-text-color { + &-primary { + color: theme(digitv2.lightTheme.text-color-primary) !important; + } + + &-secondary { + color: theme(digitv2.lightTheme.text-color-secondary) !important; + } + + &-disabled { + color: theme(digitv2.lightTheme.text-color-disabled) !important; + } + } + + &-background { + background-color: theme(digitv2.lightTheme.background) !important; + } + + &-paper { + &-primary { + background-color: theme(digitv2.lightTheme.paper) !important; + + &-color { + color: theme(digitv2.lightTheme.paper) !important; + } + } + + &-secondary { + background-color: theme(digitv2.lightTheme.paper-secondary) !important; + } + + &-border { + border-radius: 4px; + border-style: solid; + border-width: 1px; + border-color: theme(digitv2.lightTheme.divider); + } + } + + &-divider { + background-color: theme(digitv2.lightTheme.divider) !important; + } + + &-header-sidenav { + color: theme(digitv2.lightTheme.header-sidenav) !important; + } + + &-input-border { + /* TODO Check why important added here @ANIL/NABEEL */ + border-color: theme(digitv2.lightTheme.input-border); + } +} + +.alert { + &-error { + color: theme(digitv2.alert.error) !important; + + &-bg { + background-color: theme(digitv2.alert.error-bg) !important; + } + + &-border { + border-color: theme(digitv2.alert.error) !important; + } + } + + &-success { + color: theme(digitv2.alert.success) !important; + + &-bg { + background-color: theme(digitv2.alert.success-bg) !important; + } + } + + &-info { + color: theme(digitv2.alert.info) !important; + + &-bg { + background-color: theme(digitv2.alert.info-bg) !important; + } + } +} + +.chart { + &-item-1 { + color: theme(digitv2.chart.chart-1) !important; + } + + &-item-1-gradient { + color: theme(digitv2.chart.chart-1-gradient) !important; + } + + &-item-2 { + color: theme(digitv2.chart.chart-2) !important; + } + + &-item-2-gradient { + color: theme(digitv2.chart.chart-2-gradient) !important; + } + + &-item-3 { + color: theme(digitv2.chart.chart-3) !important; + } + + &-item-4 { + color: theme(digitv2.chart.chart-4) !important; + } + + &-item-5 { + color: theme(digitv2.chart.chart-5) !important; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/index.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/index.scss new file mode 100644 index 00000000000..99435b650be --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/index.scss @@ -0,0 +1 @@ +@import url("./workbench.scss"); diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/workbench.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/workbench.scss new file mode 100644 index 00000000000..2e6f685f512 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/pages/employee/workbench.scss @@ -0,0 +1,615 @@ +@import url("../../index.scss"); + +.bread-crumb.workbench-bredcrumb{ +a{ + color: theme(digitv2.lightTheme.primary); +} +} +.workbench{ +.workbench-create-form { + display: inherit; + padding-top: 1.5rem; + .digit-form-composer-sub-header { + @extend .typography.text-heading-m; + padding-left: 1rem; + @media (max-width: theme(digitv2.screens.mobile)) { + padding-left: 0; + } + } + + form { + #label_digit_root { + display: none; + } + + #digit_root { + width: 100%; + + .field-wrapper { + .form-group.field { + display: flex; + padding: 1em 0 0 1em; + + @media (max-width: theme(digitv2.screens.mobile)) { + flex-direction: column; + } + + &.field-error.has-error.has-danger { + .control-label { + @extend .alert-error; + } + + .form-control { + @extend .alert-error-border; + } + + .card-label-error { + display: inline; + position: relative; + margin: 0px; + padding: 0px; + top: -0.7rem; + font-weight: normal; + + } + } + + &.field-boolean.field-error.has-error.has-danger { + + .card-label-error { + position: initial; + display: block; + margin-top: 0.5rem; + + } + } + + .control-label { + max-width: 12.5rem; + margin-right: 2.5rem; + @extend .card-label; + display: inline-flex; + /* align-self: center; */ + line-height: 3rem; + @extend .typography.text-heading-s; + /* web view*/ + @apply w-1/3; + + /* tablet view*/ + + @media (max-width: theme(digitv2.screens.tablet)) { + max-width: 11rem; + margin-right: 1.5rem; + + } + + /* mobile view*/ + + @media (max-width: theme(digitv2.screens.mobile)) { + /*max-width: 10.2rem;*/ + @apply w-full; + + } + + } + + .all-input-field-wrapper { + + @apply w-3/5; + @media (max-width: theme(digitv2.screens.mobile)) { + @apply w-full; + } + + .form-control { + @extend .light-input-border; + @extend .employee-card-input; + font-style: inherit; + font-family: inherit; + /* web view*/ + max-width: 37.5rem; + min-width: 20.5rem; + margin-bottom: 1rem; + /* tablet view*/ + + @media (max-width: theme(digitv2.screens.tablet)) { + max-width: 27.5rem; + min-width: 12.5rem; + + } + + /* mobile view*/ + + @media (max-width: theme(digitv2.screens.mobile)) { + max-width: 20.5rem; + min-width: 9.5rem; + @apply w-full; + + } + + &.form-select { + padding: 0%; + border: 0px; + + .digit__control { + @apply outline-none; + + .digit__value-container:in-range { + border-color: unset; + box-shadow: none; + box-sizing: unset; + @apply outline-none; + } + } + + .digit__control--is-focused { + border-color: theme(digitv2.lightTheme.primary) !important; + box-shadow: none; + box-sizing: unset; + @apply outline-none; + } + + + .digit__control:hover { + + border-color: unset; + box-shadow: none; + box-sizing: unset; + @apply outline-none; + } + + .digit__control:focus { + border-color: theme(digitv2.lightTheme.primary); + + .digit__value-container:focus { + border-color: theme(digitv2.lightTheme.primary); + + } + } + } + + &.form-select:focus { + @apply outline-none; + border-color: theme(digitv2.lightTheme.primary); + + } + } + + .form-control:read-only { + background-color: theme(digitv2.lightTheme.background); + color: theme(digitv2.lightTheme["text-color-secondary"]); + } + + .form-control:focus { + + @apply outline-none; + border-color: theme(digitv2.lightTheme.primary); + } + + textarea.form-control { + height: 5rem; + } + } + + &.field-string { + align-self: center; + } + + &.field-boolean { + padding-top: 0rem; + padding-bottom: 1rem; + + .custom-checkbox { + display: inline-flex; + align-items: end; + + &.custom-checkbox-disabled { + pointer-events: none; + opacity: 0.6; + } + + .custom-checkbox-label { + @extend .typography.text-body-s; + @apply pl-sm; + } + } + + .checkbox { + width: 28rem; + + label { + float: left; + + /* display: flex; + flex-direction: row-reverse; + */ + span { + width: 17rem; + display: none; + @extend .card-label; + } + + input[type="checkbox"] { + @extend .light-input-border; + @extend .employee-card-input; + height: 1.5rem; + /* @apply ml-sm;*/ + } + + input[type="checkbox"]#digit_root_active { + accent-color: theme(digitv2.lightTheme.primary); + } + + input:checked, + input:hover { + @apply border-2; + @extend .light-input-border; + } + } + } + + .field-radio-group { + display: inline-flex; + height: 2.5rem; + align-items: center; + + .radio { + @apply mr-sm; + } + } + + + + } + + + + &.field-object>.control-label { + margin-left: 0.5rem; + } + + &.field-object { + display: block; + @extend .light-background; + @extend .light-paper-border; + padding: 1rem; + margin: 1rem; + + .digit-expand-collapse-wrapper { + margin-top: 0px; + } + + .digit-icon-toggle { + top: -1.5rem; + right: 1.5em; + } + + .object-wrapper { + .array-remove-button-wrapper { + position: relative; + } + } + + /* have to revisit for objects + [id^="root_"] { + @extend .light-background; + } + */ + } + + &.field-array { + display: block; + @extend .light-paper-secondary; + @extend .light-paper-border; + padding: 2rem; + margin: 1rem; + padding-top: 1rem; + + .array-wrapper .array-item { + &.jk-array-objects>.array-remove-button-wrapper { + display: block; + } + + &.jk-array-objects { + margin-bottom: 2rem; + + .array-children>span .form-group.field.field-object { + padding-bottom: 3rem; + } + + .array-obj { + position: absolute; + bottom: 1.5rem; + left: 2rem; + + >.array-remove-button-wrapper { + position: unset; + } + } + + } + + &.jk-array-of-non-objects>.array-remove-button-wrapper { + display: inline; + left: 38.5rem; + right: unset; + top: 0.7rem; + } + + &.jk-array-of-non-objects .array-children { + span .form-group { + padding-left: 0%; + + .control-label { + display: none; + } + + } + } + + /* it has been removed since we dont need diff color for array items @extend .light-background;*/ + position: relative; + + .field-object { + margin-left: 0; + margin-right: 0; + } + + + .array-remove-button-wrapper { + position: absolute; + right: 1.3em; + top: 1.3em; + background-color: inherit !important; + + .array-remove-button { + cursor: pointer; + background-color: inherit !important; + @media (max-width: theme(digitv2.screens.mobile)) { + padding:0px; + } + h2{ + @media (max-width: theme(digitv2.screens.mobile)) { + display: none; + } + } + + } + } + + span.all-input-field-wrapper { + @apply w-3/5; + + .form-control { + @apply w-full; + } + } + + .control-label { + @apply w-1/3; + + } + } + + + .jk-digit-secondary-btn { + height: 1.7em; + margin-top: 0.5rem; + + @media (max-width: theme(digitv2.screens.mobile)) { + height: auto; + width: 100%; + } + + h2 { + font-size: 1rem; + } + } + + .all-input-field-wrapper { + .card-label-error { + position: unset !important; + } + } + + } + + .digit-expand-collapse-header { + border: 0; + background-color: inherit; + padding: 0; + } + } + } + } + } + + div.action-bar-wrap { + @extend .action-bar-wrap; + + .submit-bar { + @extend .submit-bar; + cursor: pointer; + @apply font-rc font-medium text-legend text-white leading-10; + } + } +} + +.workbench-no-schema-found { + @apply flex justify-items-center flex-col; + align-items: center; +} + +.jk-digit-loader { + position: absolute; + z-index: 10000; + width: 100vw; + background-color: rgba(189, 189, 189, 0.5); + height: 100vh; + left: 0; + top: 0; + + .jk-spinner-wrapper { + width: 100%; + display: flex; + align-items: center; + justify-content: center; + height: 100%; + + .jk-spinner { + border: 0.4em solid #fe7a51; + border-radius: 50%; + border-top: 0.4em solid #ffffff; + width: 4em; + height: 4em; + -webkit-animation: spin 2s linear infinite; + /* Safari */ + animation: spin 1s linear infinite; + } + } +} + +.jk-sm-inbox-loader { + border: 0.2em solid #fe7a51; + border-radius: 50%; + border-top: 0.2em solid #ffffff; + width: 2em; + height: 2em; + -webkit-animation: spin 2s linear infinite; + /* Safari */ + animation: spin 1s linear infinite; +} + +/* Safari */ +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} + +.no-data-found { + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + .digit-error-msg { + margin-top: 2rem; + } +} + + +.tooltip .tooltiptext { + + top: 2rem; + left: 0; + margin-left: 0rem; + width: fit-content; + height: max-content; + white-space: normal; + + .tooltiptextvalue { + font-size: 14px; + font-weight: 400px; + color: white; + } +} +.employeeCard.manage-master-wrapper { + width: 100%; + display: flex; + padding-top: 2.1rem; + @media (max-width: theme(digitv2.screens.mobile)) { + flex-direction: column; + } + .employee-select-wrap.form-field{ + @apply w-1/4; + margin-right:1rem ; + @media (max-width: theme(digitv2.screens.mobile)) { + @apply w-full; + } + } +} + +.table{ + padding-left:0.8rem ; + padding-right:0.8rem ; + &-row-mdms:hover{ + background-color: theme(digitv2.lightTheme.primary-bg); /* Change this to the desired hover color */ + cursor: pointer; + } +} +} + +.header-btn{ + width: 12rem; +} + +.drag-drop-container { + background-color: #FAFAFA; + border: 1.5px dashed #D6D5D4; + border-radius: 5px; + margin:-1rem 1rem 1rem 1rem; + padding: 1rem 1rem 1rem 1rem; + display: flex; + align-items: center; + flex-direction: column; + + .drag-drop-text { + text-decoration: none; + .browse-text { + text-decoration: none; + color: #F47738; + transition: color 0.3s; + } + .browse-text:hover { + color: #F47738; + text-decoration: underline; + cursor: pointer; + } + } + +} + +.uploaded-file-container { + background-color: #FAFAFA; + border: 1.5px solid #D6D5D4; + border-radius: 5px; + margin:0.5rem 1rem 2rem 1rem; + display: flex; + flex-direction: row; + align-items: center; + padding: 0.6rem; + justify-content: space-between; + + .uploaded-file-container-sub { + display: flex; + align-items: center; + + .icon:hover { + cursor: pointer; + } + } +} + +button:hover { + cursor: pointer; +} + +.popup-header-fix { + margin-top: -0.5rem !important; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/typography.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/typography.scss new file mode 100644 index 00000000000..4f428d7c654 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/digitv2/typography.scss @@ -0,0 +1,241 @@ +@import url("../index.scss"); + +.typography { + &.text-heading-xl { + font-family: theme(digitv2.fontFamily.rc); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.bold); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.heading-xl.desktop); + } + + @media (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.heading-xl.tablet); + } + + @media (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.heading-xl.mobile); + } + } + + &.text-heading-l { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.bold); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.heading-l.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.heading-l.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.heading-l.mobile); + } + } + &.text-heading-m { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.bold); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.heading-m.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.heading-m.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.heading-m.desktop); + } + } + &.text-heading-s { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.bold); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.heading-s.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.heading-s.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.heading-s.mobile); + } + } + &.text-heading-xs { + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.heading-xs.mobile); + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.bold); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + } + } + &.text-caption-l { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.medium); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.caption-l.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.caption-l.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.caption-l.mobile); + } + } + + &.text-caption-m { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.medium); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.caption-m.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.caption-m.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.caption-m.mobile); + } + } + + &.text-caption-s { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.medium); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.caption-s.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.caption-s.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.caption-s.desktop); + } + } + &.text-body-l { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.regular); + color: theme(digitv2.lightTheme.text-color-primary); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.body-l.desktop); + line-height: theme(digitv2.lineHeight.line-height-body-l.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.body-l.tablet); + line-height: theme(digitv2.lineHeight.line-height-body-l.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.body-l.mobile); + line-height: theme(digitv2.lineHeight.line-height-body-l.mobile); + } + } + &.text-body-s { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.regular); + color: theme(digitv2.lightTheme.text-color-primary); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.body-s.desktop); + line-height: theme(digitv2.lineHeight.line-height-body-s.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.body-s.tablet); + line-height: theme(digitv2.lineHeight.line-height-body-s.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.body-s.mobile); + line-height: theme(digitv2.lineHeight.line-height-body-s.mobile); + } + } + &.text-body-xs { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.regular); + color: theme(digitv2.lightTheme.text-color-primary); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.body-xs.desktop); + line-height: theme(digitv2.lineHeight.line-height-body-xs.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.body-xs.tablet); + line-height: theme(digitv2.lineHeight.line-height-body-xs.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.body-xs.mobile); + line-height: theme(digitv2.lineHeight.line-height-body-xs.mobile); + } + } + &.text-label { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.italic); + font-weight: theme(digitv2.fontWeight.regular); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.label.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.label.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.label.mobile); + } + } + &.text-link { + font-family: theme(digitv2.fontFamily.sans); + font-style: theme(digitv2.fontStyle.normal); + font-weight: theme(digitv2.fontWeight.regular); + color: theme(digitv2.lightTheme.text-color-primary); + line-height: theme(digitv2.lineHeight.normal); + text-decoration: theme(digitv2.textDecorationLine.underline); + + @media screen and (min-width: theme(digitv2.screens.desktop)) { + font-size: theme(digitv2.fontSize.link.desktop); + } + @media screen and (min-width: theme(digitv2.screens.tablet)) { + font-size: theme(digitv2.fontSize.link.tablet); + } + + @media screen and (min-width: theme(digitv2.screens.mobile)) { + font-size: theme(digitv2.fontSize.link.mobile); + } + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/index.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/index.scss new file mode 100644 index 00000000000..0e68dddc547 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/index.scss @@ -0,0 +1,762 @@ +/*@import 'normalize.css';*/ + +/*@import url("https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap");*/ + +@import "tailwindcss/base"; + +@import "tailwindcss/components"; + +@import "tailwindcss/utilities"; + +@import "react-date-range/dist/styles.css"; +@import "react-date-range/dist/theme/default.css"; + +@import "./components/loader.scss"; + +@import "./components/body.scss"; +@import "./components/navbar.scss"; +@import "./components/card.scss"; +@import "./components/buttons.scss"; +@import "./components/radiobtn.scss"; +@import "./components/selectdropdown.scss"; +@import "./components/textfields.scss"; +@import "./components/bannercomponents.scss"; +@import "./components/datewrap.scss"; +@import "./components/datatable.scss"; +@import "./components/checkpoint.scss"; +@import "./components/checkbox.scss"; +@import "./components/inputotp.scss"; +@import "./components/map.scss"; +@import "./pages/employee/tooltip.scss"; +@import "./components/menu.scss"; +@import "./components/submiterrors.scss"; +@import "./components/ratingstar.scss"; +@import "./components/keynote.scss"; +@import "./components/statushighlight.scss"; +@import "./components/imageviewer.scss"; +@import "./components/actionbar.scss"; +@import "./components/table.scss"; +@import "./components/popup.scss"; +@import "./components/uploadcomponents.scss"; +@import "./components/toast.scss"; +@import "./components/detailscontainer.scss"; +@import "./components/telephone.scss"; +@import "./components/grey.scss"; +@import "./components/actionLink.scss"; +@import "./components/sectionalDropdown.scss"; +@import "./components/detailscard.scss"; +@import "./components/searchAction.scss"; +@import "./components/tag.scss"; +@import "./components/topbar.scss"; +@import "./components/languageSelector.scss"; +@import "./components/custombtn.scss"; +@import "./components/citizenInfoLabel.scss"; +@import "./components/roundedLabel.scss"; +@import "./components/changeLanguage.scss"; +@import "./components//metricsTable.scss"; +@import "./components/filters.scss"; +@import "./components//charts.scss"; +@import "./components/summary.scss"; +@import "./components/multiLink.scss"; +@import "./components/info-banner.scss"; +@import "./components/multiSelectDropdown.scss"; +@import "./components/EllipsisMenu.scss"; +@import "./components/CitizenHomeCard.scss"; +@import "./components/PropertySearchForm.scss"; +@import "./components/SearchForm.scss"; +@import "./components/cardHeaderWithOptions.scss"; +@import "./components/TimeLine.scss"; +@import "./components/PageBasedInput.scss"; +@import "./components/StandaloneSearchBar.scss"; +@import "./components/CardBasedOptions.scss"; +@import "./components/WhatsNewCard.scss"; +@import "./components/SearchOnRadioButton.scss"; +@import "./components/EventCalendarView.scss"; +@import "./components/OnGroundEventCard.scss"; +@import "./components/PopupHeadingLabel.scss"; +@import "./components/staticSideBar.scss"; +@import "./components/hoc/index.scss"; +@import "./components/FAQ.scss"; +@import "./components//howItWorks.scss"; +@import "./components/staticDynamicMessages.scss"; +@import "./components/toggleSwitch.scss"; +@import "./components/plusMinus.scss"; + +@import "./pages/employee/index.scss"; +@import "./pages/employee/cardfix.scss"; +@import "./pages/employee/popupmodule.scss"; +@import "./pages/employee/container.scss"; +@import "./pages/employee/inbox.scss"; +@import "./pages/employee/response.scss"; +@import "./pages/employee/form-fields.scss"; +@import "./pages/employee/scroll-table.scss"; +@import "./pages/employee/EmployeeLogin.scss"; +@import "./pages/employee/updateNumber.scss"; +@import "./pages/employee/oldMobileInbox.scss"; +@import "./pages/employee/dss.scss"; +@import "./pages/employee/iframe.scss"; + +@import "./pages/citizen/payment/payment-type.scss"; +@import "./pages/citizen/container.scss"; +@import "./pages/citizen/HomePageWrapper.scss"; +@import "./pages/citizen/CitizenEngagementNotificationWrapper.scss"; +@import "./pages/citizen/Events.scss"; +@import "./pages/citizen/DocumentList.scss"; +@import "./pages/citizen/SurveyList.scss"; +@import "./pages/citizen/updatePropertyNumber.scss"; +@import "./pages/citizen/citizenDocument.scss"; +@import "./pages/employee/surveys.scss"; +@import "./digitv2/index.scss"; +/* @import "./digitv2/typography.scss"; */ +@import "./components/inboxv2/index.scss"; +@import "./components//sidebar.scss"; + +.display-none { + display: none; +} + +.p-unset { + padding: unset !important; +} + +h1, h2, h3, h4, h5, h6 { + font-size: inherit; + font-weight: inherit; } + + +.flex-one { + @apply flex-1; +} + +.display-flex-gap-2 { + @apply flex gap-3; +} +.rm-mb { + margin-bottom: unset !important; +} + +.w-fullwidth { + @apply w-full; +} + +.margin-unset { + margin: unset !important; +} + +.text-align-center { + @apply text-center; +} + +.desktop-only { + @apply hidden; +} + +@screen dt { + .desktop-only { + @apply block; + } +} + +.mobile-only { + @apply block; +} + +@screen dt { + .mobile-only { + @apply hidden; + } +} + +.dark { + @apply text-text-primary; +} + +.mrlg { + @apply mr-lg; +} + +.mrsm { + @apply mr-sm; +} + +.mbsm { + @apply mb-sm; +} + +.employeeCard { + /* TODO need to revisit that we need mx-md NABEEL/ANIL + @apply mb-md mx-md !important; + */ + @apply mb-md !important; +} + +.home-link { + margin-left: 16px; + margin-bottom: 16px; + + a { + color: theme(colors.link.normal); + } +} + +.clear-search-label { + color: theme(colors.primary.main); + cursor: pointer; +} + +.search-submit-bar { + margin-top: 32; + margin-left: auto; +} + +.application-details-link-button { + @apply flex justify-between items-center; + + .download-button { + color: theme(colors.primary.main); + margin-left: 8px; + } +} + +.response-download-button { + @apply flex mb-sm; + + .download-button { + color: theme(colors.primary.main); + margin-left: 8px; + } +} + +.check-page-link-button { + color: theme(colors.primary.main) !important; +} + +.pt-application-download-btn { + display: flex; + justify-content: flex-end; + margin: 0px 8px; +} + +.form-pt-dropdown-only { + .options-card { + position: unset; + } +} +.application-table-container { + @apply mt-lg ml-lg flex-1; +} + +.primary-label-btn { + @apply flex; + gap: 10px; + + svg { + fill: theme(colors.primary.main); + } + + color: theme(colors.primary.main); + + cursor: pointer; + font-weight: 500; + width: fit-content; +} + +.primaryColor { + color: theme(colors.text.primary) !important; +} + +input[readonly] { + @apply border-grey-dark !important; + background-color: theme(digitv2.lightTheme.background); + border-color: theme(digitv2.lightTheme.text-color-secondary); + color: theme(digitv2.lightTheme.text-color-secondary); +} + +.hide-input-type-file { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none !important; +} + +@media (hover: hover) { + .primary-label-btn { + &:hover { + color: #000; + + svg { + fill: #000; + } + } + } +} + +.disabled { + @apply border-grey-dark text-grey-dark !important; + pointer-events: none !important; +} + +.card-date-input { + @apply absolute top-0 left-0 w-3/4 bg-white pl-sm border border-input-border border-solid border-r-0; + outline: transparent solid 1px; + height: 2.5rem; +} + +.h4 { + @apply mb-sm; +} + +.react-time-picker { + width: 194px; + height: 2.5rem; + &__wrapper { + border: 2px solid theme(colors.text.primary); + padding-left: 16px; + } + &__inputGroup__input { + @apply px-sm; + line-height: 2.5rem; + min-width: 16px; + &:focus { + outline: 2px solid black; + } + } +} + +.border-none { + border: none; + justify-content: space-between; +} + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} +input[type="number"] { + -moz-appearance: textfield; +} + + +.static { + @apply flex flex-col; + min-height: 85vh; + + &-wrapper { + flex: 1; + max-height: 75vh; + overflow: scroll; + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ + + &::-webkit-scrollbar { + display: none; + } + } +} + +.bill-summary { + border: #e8e7e6 solid 1px; + @apply bg-grey-light w-full; + + .bill-account-details { + @apply flex mb-md; + padding: 5px; + + .label { + @apply w-1/2 font-bold; + } + + .value { + @apply w-1/2 text-right; + } + } + + .amount-details { + @apply flex mb-md items-center; + padding: 5px; + + .label { + @apply w-1/2 font-bold; + } + + .value { + @apply w-1/2 font-bold text-right; + font-size: 18px; + } + } +} + +.bill-payment-amount { + @apply sticky bottom-0 bg-white; + padding-bottom: 32px; + + .payment-amount-front { + @apply absolute z-10 w-10 flex justify-center items-center; + background-color: #efefef; + padding: 7px 12px; + color: #9a9a9a; + } +} + +.text-indent-xl input { + text-indent: 40px; +} + +.select-payment-type { + @apply flex justify-center font-bold items-center; + padding-top: 10px; + padding-bottom: 25px; + + .value { + font-size: 20px; + } +} + +.cheque-date { + @apply flex items-center mb-lg; + border: 2px solid theme(colors.text.primary); + border-radius: 2px; + + input { + @apply outline-none w-full; + border: 0px; + background: transparent; + text-indent: 5px; + padding: 6px 0px; + } + + button { + @apply outline-none; + border: 0px; + background: transparent; + text-indent: 2px; + } +} + +.w-half { + @apply w-1/2; +} + +.ifsc-field { + @apply flex items-center mb-lg; + border: 2px solid theme(colors.text.primary); + border-radius: 2px; + + input { + @apply outline-none w-full; + border: 0px; + background: transparent; + text-indent: 5px; + padding: 6px 0px; + } + button { + @apply outline-none; + border: 0px; + background: transparent; + text-indent: 2px; + } +} + +.text-input { + @apply relative w-full; + input { + &:hover { + @apply border-2 border-solid border-primary-main; + } + } +} + +.text-input-width { + max-width: 540px; +} + +.text-mobile-input-width { + max-width: 500px; +} + +.custom-time-picker { + @apply w-full; + max-width: 200px; +} + +.sla-cell { + @apply text-text-secondary; +} + +.submit-bar-search { + margin-top: 32px; + margin-left: 16px; + max-width: 256px; +} + +.clear-search-container { + @apply flex justify-between items-center; +} + +.card-label-smaller { + @apply w-1/3; + margin-bottom: revert; +} + +.card-label-APK { + @apply w-1/3; + margin-bottom: revert; + width: 100%; +} + +.underline { + border-color: #e7e6e6; + @apply mb-sm; +} + +.box-shadow-none { + box-shadow: none; +} + +.component-in-front { + @apply flex justify-center items-center; +} + +.subform-composer { + @apply flex; +} + +.inbox-search-container { + .result { + @apply mt-lg; + } +} + +.payment-form-text-input-correction { + width: 100% !important; +} + +.edcr-citizen-inbox { + thead th:first-child { + min-width: 155px; + } +} + +.error-boundary { + width: 100vw; + height: 100vh; + font-size: 16px; + font-family: sans-serif; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + .error-container { + display: flex; + width: 400px; + justify-content: center; + align-items: center; + flex-direction: column; + h1 { + font-size: 32px; + font-weight: bold; + } + button { + height: 40px; + width: 153px; + border-radius: 0px; + padding: 8px 24px; + color: white; + cursor: pointer; + background-color: theme(colors.primary.main); + } + } +} + +.error-boundary summary, +.error-boundary details { + width: 300px; + background-color: rgb(218, 100, 100); + margin: 5px; + border: 2px solid #222; + border-radius: 3px; + padding: 3px; +} + +.full-width-card { + width: 92vw !important; +} +.full-employee-card-link { + width: 100% !important; + margin: 7px 0px; + a { + color: inherit; + text-decoration: inherit; + } +} +.full-employee-card-height { + height: unset !important; +} + +@media (min-width: 640px) { + .full-employee-card-height { + height: 196px !important; + } + .full-employee-card-link { + width: 30% !important; + } + .full-width-card { + @apply w-full !important; + } +} +.applications-list-container { +} +.complaint-summary { + @media (min-width: 780px) { + flex: 1 0 auto; + margin-left: 1rem; + margin-top: 1rem; + } +} + +@media (min-width: 780px) { + .citizen-form-wrapper { + width: calc(100% - 219px); + display: flex; + justify-content: center; + margin-top: 1rem; + padding-left: 16px; + padding-right: 16px; + } +} +@media (min-width: 780px) { + .citizen-card-container { + padding-left: 15px; + padding-right: 15px; + margin-top: 1rem; + } +} + +@media (min-width: 780px) { + .citizen-obps-wrapper, + .selection-card-wrapper, + .pgr-citizen-wrapper, + .pt-citizen, + .bill-citizen, + .bills-citizen-wrapper, + .payer-bills-citizen-wrapper, + .engagement-citizen-wrapper, + .citizen-all-services-wrapper, + .mcollect-citizen, + .ws-citizen-wrapper, + .tl-citizen { + width: calc(100% - 219px); + padding-left: 16px; + padding-right: 16px; + margin-top: 1rem; + } +} +@media only screen and (max-width: 768px) { + /* For mobile phones: */ + .error-boundary { + height: 75vh; + } +} +.employee-app-wrapper { + min-height: calc(100vh - 8em); +} + +.ws-custom-wrapper { + .submit { + display: flex !important; + flex-direction: row-reverse !important; + width: 100% !important; + align-items: center; + button { + width: 240px !important; + } + p { + width: unset; + margin-right: 1rem; + } + } +} + +.plumber-details-new-value-wrapper { + flex: 2 1 auto; +} + +.connection-details-new-value-wrapper { + flex: 1 1 auto; +} + +.connection-details-old-value-wrapper, +.plumber-details-old-value-wrapper { + flex: 1 1 auto; + + .old-value-null-wrapper { + visibility: hidden; + padding-bottom: 8px; + margin-bottom: 8px; + } + .row { + color: #b1b4b6; + font-weight: 700; + font-size: 16px; + } +} + +.plumber-details-new-value-wrapper { + flex: 2 1 auto; +} + +.connection-details-new-value-wrapper { + flex: 1 1 auto; +} + +.connection-details-old-value-wrapper, +.plumber-details-old-value-wrapper { + flex: 1 1 auto; + .old-value-null-wrapper { + visibility: hidden; + padding-bottom: 8px; + margin-bottom: 8px; + } + .row { + color: #b1b4b6; + font-weight: 700; + font-size: 16px; + } +} + +.modal-header-ws { + padding: 1rem; + font-weight: 400; +} +.modal-body-ws { + padding: 1rem; + font-weight: 700; + color: theme(colors.text.primary); + font-size: 24px; + margin-bottom: 1rem; +} +.privacy-icon { + cursor: pointer; +} +.privacy-icon:hover { + path { + fill: rgba(244, 119, 56, 1); + } +} + +.privacy-icon-2 { + cursor: pointer; +} +.privacy-icon-2:hover { + path { + fill: none; + } +} + +.audit-card { + width: 80%; + margin-left: -260px; + margin-right: -27%; + max-height: 120px; + margin-top: 90px; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/CitizenEngagementNotificationWrapper.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/CitizenEngagementNotificationWrapper.scss new file mode 100644 index 00000000000..ea048c9f278 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/CitizenEngagementNotificationWrapper.scss @@ -0,0 +1,8 @@ +.CitizenEngagementNotificationWrapper { + .h1 { + margin: 15px; + } + .WhatsNewCard { + @apply mx-md mb-md; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/DocumentList.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/DocumentList.scss new file mode 100644 index 00000000000..e48d487f9c2 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/DocumentList.scss @@ -0,0 +1,305 @@ +.wrapper { + margin: 20px auto; +} +.accordion-wrapper { + & + * { + margin-top: 0.5em; + } +} +.accordion-item { + overflow: hidden; + transition: max-height 0.3s cubic-bezier(1, 0, 1, 0); + height: auto; + max-height: 9999px; +} +.accordion-item.collapsed { + max-height: 0; + transition: max-height 0.35s cubic-bezier(0, 1, 0, 1); +} +.accordion-title { + font-weight: 600; + cursor: pointer; + color: #666; + padding: 0.5em 0em; + border-radius: 1.5em; + display: flex; + justify-content: space-between; + align-items: center; + &.open svg { + transform: rotate(-90deg); + } + &:hover, + &.open { + color: black; + } +} +.accordion-content { + padding: 1em 0em; +} +.document_list_searchbar { + border: 1px solid theme(colors.text.secondary) !important; + border-radius: 0px !important; + margin: 20px 0; +} +.notices_circular_searchbox { + margin-top: 50px; +} +.notice_and_circular_main { + @apply flex bg-white my-md px-md pt-md pb-lg shadow-card relative; + border-radius: 4px; +} +.gap-ten { + @apply gap-10; +} +.notice_and_circular_heading_mb { + display: flex; + justify-content: space-between; + padding: 2px; +} +.notice_and_circular_heading_mb header { + font-weight: bold; + font-size: 16px !important; + line-height: 24px; + margin-right: 50px; +} +.notice_and_circular_heading_mb .card-caption { + padding-left: 30px; + font-weight: normal; + font-size: 12px; + line-height: 24px; + color: theme(colors.text.secondary); + padding-right: 5px; + padding-left: 15px; + min-width: 80px; + position: absolute; + right: 20px; +} +.notice_and_circular_text { + padding-bottom: 20px; +} +.notice_and_circular_text p { + font-weight: normal; + font-size: 12px; + line-height: 14px; + color: theme(colors.text.secondary); +} +.notice_and_circular_caption { + margin-top: 10px; + margin-bottom: 10px; +} +.notice_and_circular_caption .card-caption { + font-weight: normal; + font-size: 10px; + line-height: 18px; + color: #A3A3A3; +} +.view_download_main { + display: flex; + flex-wrap: wrap; + gap:8px; + align-items: end; + span { + padding-right: 20px; + & .views { + display: flex; + justify-content: space-between; + align-items: center; + p { + padding-left: 10px; + font-weight: normal; + font-size: 16px; + line-height: 19px; + color: theme(colors.primary.main); + } + } + } + & .download_views_padding{ + padding-top: 8px; + } +} +@screen dt{ + .view_download_main { + span{ + & .views { + display: flex; + justify-content: space-between; + align-items: center; + p { + padding-left: 10px; + font-weight: normal; + font-size: 16px; + line-height: 19px; + color: theme(colors.primary.main); + } + } + } + } + + .notice_and_circular_heading_mb .card-caption { + font-size: 16px; + line-height: 24px; + min-width : 150px; + padding-left: 50px; + } + + .view_download_main span{ + padding-right: 30px; + } + .view_download_main span .views p { + padding-left: 8px; + font-size: 16px; + } + .notice_and_circular_text p { + font-size: 16px !important; + line-height : 24px; + } + .documentDetails_row { + grid-gap: 0 !important; + gap: 0 !important; + } + .notice_and_circular_heading_mb header{ + font-size: 24px !important; + line-height: 28px; + margin-right : 100px; + } + .notice_and_circular_caption .card-caption { + font-size: 14px; + line-height: 21px; + } + +} +.documentDetails { + &_wrapper { + @apply flex flex-col gap-10 items-start; + } + &_row { + @apply flex gap-20; + } + &_title { + @apply w-48 font-bold; + } + &_description { + @apply max-w-lg; + text-overflow: clip; + } + &_pdf { + @apply flex flex-col gap-5; + } + &_subheader { + @apply font-bold; + font-size: large; + } +} + +.documentDetails_pdf { + @apply flex gap-10 cursor-pointer; +} +.grid_section { + @apply grid grid-cols-4 gap-4; + & .document_notification_form_section { + @apply col-span-3; + } +} +.document_notification_first_grid { + @apply grid grid-cols-4 gap-4; + & .form_section, + .document_notification_table_section { + @apply col-span-3; + } +} +.new_document_section_flex { + @apply flex items-center; + & .card-section-header { + @apply pl-lg; + } +} +.new_document_para_color { + @apply text-primary-light; + margin-bottom: 42px; +} +.document_notification_second_grid { + @apply grid grid-cols-3 gap-4; +} +.document_notification_clear_search_btn { + display: flex; + justify-content: flex-end; + align-items: center; + & .document_notification_clear_search_btn_align { + display: flex; + align-items: center; + } +} +.new_document_clear_search_alignment { + @apply mb-md mr-lg; +} +.document_notification_filter_header { + @apply flex justify-between items-center; +} +.document_notification_filter_icon { + @apply flex items-center; + & .card-caption { + @apply ml-lg; + } +} +.document-table-docs-columns { + @apply flex items-center gap-5; +} +.filter_section_main { + padding-bottom: 300px; +} +.new_document_card { + @apply w-full h-56 bg-white p-xl; +} +.filter_table_section_margin { + margin-top: 30px; +} +.filter_card_employee { + @apply w-full h-auto bg-white p-xl; + padding-bottom: 100px; +} +.filter_section_document_categories { + padding-top: 20px; +} +.new_document_card_table { + @apply w-full h-auto bg-white p-xl; +} +.employee_document_inbox_table_main { + .table { + tbody { + tr { + @apply py-md; + } + } + } +} +.confirmation_box { + height: 130px; + display: flex; + align-items: center; + padding-left: 8px; + gap: 10px; + overflow: hidden; + text-overflow: ellipsis; +} + +.Docs_CardWrapper{ + @apply bg-white m-sm px-md pt-md pb-lg shadow-card; + border-radius: 4px; +} + +.mobileInbox_attachments{ + display:flex; + gap:10px; +} + +.documentDetails_row_items { + display:flex; + flex-direction: row; + align-self: flex-start; +} + +@media screen and (max-width : 768px){ + .documentDetails_row_items{ + @apply grid grid-cols-2 gap-4; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/Events.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/Events.scss new file mode 100644 index 00000000000..edf8c3322d3 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/Events.scss @@ -0,0 +1,47 @@ +.OnGroundEventDetailsCard{ + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16); + @apply bg-white mx-sm mb-md p-md rounded; +} + +.eventAddressAndDirection{ + @apply text-body-s mb-md; + span{ + @apply flex mb-sm; + svg{ + @apply h-5 w-5; + } + div{ + @apply ml-md; + p{ + @apply mb-sm; + } + .direction{ + @apply text-primary-main cursor-pointer; + } + } + } +} + +.eventTimeRange{ + @apply text-body-s flex; + svg{ + @apply h-5 w-5; + } + p{ + @apply ml-md; + } +} + +.cardCaptionBodyS{ + @apply text-body-s text-text-secondary mb-md; +} + +@screen dt{ + .eventAddressAndDirection{ + @apply text-body-s-dt; + } + + .cardCaptionBodyS{ + @apply text-body-s-dt; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/HomePageWrapper.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/HomePageWrapper.scss new file mode 100644 index 00000000000..de3747c67d6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/HomePageWrapper.scss @@ -0,0 +1,158 @@ +.HomePageWrapper { + margin-top: -25px; + + .BannerWithSearch { + margin-bottom: 40px; + width: 100%; + @apply relative; + .Search { + width: calc(100% - 32px); + bottom: -18px; + @apply mx-md absolute; + } + img { + height: 33vw; + @apply w-full object-cover; + } + } + + .ServicesSection { + @apply flex flex-wrap; + padding: 40px 15px 0 15px; + } + + @screen dt { + .ServicesSection { + @apply flex flex-wrap; + padding: 40px 15px 0 15px; + width: 100%; + } + } + + .WhatsNewSection { + @apply m-sm; + padding: 0 15px; + .headSection { + @apply flex mb-sm justify-between; + h2 { + @apply text-heading-s font-bold text-text-primary pl-sm; + } + p { + @apply text-link text-primary-main font-medium cursor-pointer; + } + } + @media (min-width: 780px) { + padding: 0 15px; + } + } + + .WhatsAppBanner{ + width: 100%; + padding: 0px 20px 0px 20px; + margin: auto; + cursor: pointer; + img { + width: 100%; + } + } +} + +@media (min-width: 780px) { + .SideBarStatic { + width: 219px; + background: theme(colors.white); + } +} + +@media (max-width: 780px) { + .SideBarStatic { + display: none; + } +} +.HomePageContainer { + @media (min-width: 780px) { + display: flex; + width: calc(100% - 219px); + height: calc(100%-30px); + } +} + +.moduleLinkHomePage { + @media (min-width: 780px) { + width: calc(100% - 219px); + } + margin-top: -25px; + img { + height: 33vw; + filter: grayscale(100%); + @apply w-full object-cover; + } + h1 { + position: absolute; + top: 100px; + left: 21px; + @apply text-heading-xl text-white font-bold; + } + .moduleLinkHomePageBackButton { + border: none; + top: 76px; + svg { + fill: theme(colors.white); + } + @apply absolute text-white text-heading-s ml-md; + } +} + +.moduleLinkHomePageModuleLinks { + @apply mt-md; + .CitizenHomeCard { + .header { + @apply hidden; + } + } +} + +@screen dt { + .HomePageWrapper { + width: 100%; + .BannerWithSearch { + margin-bottom: 56px; + width: 100% !important; + .Search { + width: 100%; + margin: 0; + padding: 0 15px 0 15px; + } + img { + height: 20vw; + } + } + + .WhatsAppBanner { + width: 100%; + img{ + height: 20vw; + width: 100%; + } + } + + } + .moduleLinkHomePage { + img { + min-width: 100vw; + height: 20vw; + } + h1 { + top: calc(10vw + 40px); + left: 15.8rem; + } + .moduleLinkHomePageBackButton { + top: calc(10vw + 16px); + @apply ml-md; + } + } + + .moduleLinkHomePageModuleLinks { + width: 100%; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/SurveyList.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/SurveyList.scss new file mode 100644 index 00000000000..21994bb1fda --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/SurveyList.scss @@ -0,0 +1,22 @@ +.surveyListclockDiv{ + @apply flex items-center my-lg; +} +.surveyListclockDiv span{ + @apply pl-md text-text-primary; +} +.surveyListstatus{ + @apply flex items-center justify-between; +} +.surveyLisNotResponded{ + @apply text-error; +} +.surveyLisResponded{ + @apply text-success; +} +.surveyListCardMargin{ + @apply mx-md my-lg ; +} +.centered-message{ + @apply flex items-center pl-md py-lg ; + +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/citizenDocument.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/citizenDocument.scss new file mode 100644 index 00000000000..106bde67263 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/citizenDocument.scss @@ -0,0 +1,22 @@ +.notice_and_circular_image svg { + width: 80px; + height: 100px; + } + .notice_and_circular_content { + padding-left: 50px; + } + .back-btn2{ + border: none; + } + @media screen and (max-width: 768px) { + .notice_and_circular_image svg { + width: 53px; + height: 66px; + } + .notice_and_circular_content { + padding-left: 40px; + } + .documentContainerPadding{ + padding: 0 10px; + } + } \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/container.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/container.scss new file mode 100644 index 00000000000..ad7a47a7a1f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/container.scss @@ -0,0 +1,19 @@ +.citizen-home-footer { + @apply flex w-full h-10 bg-grey-bg pb-md pt-sm justify-center; + img { + @apply ml-sm; + } +} + +.employee .citizen-home-footer { + @apply fixed bottom-0; +} +.fill-path-primary-main { + path { + fill: theme(colors.primary.main); + } +} + +.obps-search { + margin: 8px; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/payment/payment-type.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/payment/payment-type.scss new file mode 100644 index 00000000000..2e2698b830c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/payment/payment-type.scss @@ -0,0 +1,3 @@ +.payment-amount-info{ + @apply flex justify-between; +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/updatePropertyNumber.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/updatePropertyNumber.scss new file mode 100644 index 00000000000..9c866b9be8c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/citizen/updatePropertyNumber.scss @@ -0,0 +1,46 @@ +.updatenumber-warper-citizen{ + min-height: 95vh; + height: unset; +} +.updatePropertyNumber { + .pt-update-no-popup-wrapper { + @apply m-md; + } + .search-form-wrapper { + display: inherit; + padding: 16px; + .submit-bar { + position: absolute; + bottom: 25px; + width: 90%; + } + .submit-bar-disabled { + position: absolute; + bottom: 25px; + width: 90%; + } + } +} + +@screen dt { + .updatenumber-warper-citizen{ + min-height: 100vh; + height: unset; + } + .updatePropertyNumber { + .h1 { + @apply m-md; + } + .search-form-wrapper { + .submit-bar { + width: 100% !important; + position: unset !important; + } + .submit-bar-disabled { + position: absolute; + bottom: 25px; + width: 90%; + } + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/EmployeeLogin.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/EmployeeLogin.scss new file mode 100644 index 00000000000..185bd91f9e7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/EmployeeLogin.scss @@ -0,0 +1,7 @@ +.EmployeeLoginFooter{ + margin: auto; + @apply absolute bottom-10; + img{ + @apply h-4 object-contain; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/cardfix.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/cardfix.scss new file mode 100644 index 00000000000..14a0b34383b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/cardfix.scss @@ -0,0 +1,13 @@ +.flex-fit{ + @apply flex w-full border-b border-solid border-border; + padding : 8px 10px; +} +.card-count{ + @apply pr-xl; + div{ + @apply text-link; + span{ + @apply text-link font-bold; + } + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/container.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/container.scss new file mode 100644 index 00000000000..ee8cd235421 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/container.scss @@ -0,0 +1,72 @@ +.icon-bg-secondary { + @apply flex bg-secondary w-12 h-12; + + svg { + margin: auto; + @apply w-6 h-6; + } +} + +.heading-m { + @apply font-bold text-text-primary text-heading-m ml-md pt-sm; +} +.BPAheading-m { + margin-left: 22px; +} + +.break-line { + @apply border-border my-lg; +} + +.employee-home-footer { + @apply flex h-10 pb-md pt-sm justify-center w-full; + img { + height: 100%; + } +} +.employee-login-home-footer{ + @apply flex fixed bottom-0 h-10 bg-grey-bg pb-md pt-sm justify-center w-full; + img{ + @apply ml-sm + } +} +.fieldInspectionWrapper{ + border: 1px solid theme(colors.border); + padding: 16px; + margin-top: 8px; + background: theme(colors.grey.light); +} + +.fieldInsepctionInsideWrapper { + border: 1px solid theme(colors.border); + padding: 16px; + margin-top: 8px; + background: theme(colors.white); + max-width: 70%; + min-width: 280px; +} + +@screen dt { + .ground-container { + margin-bottom: 56px; + @apply p-md; + } + .heading-m { + @apply text-heading-m-dt; + } + .BPAheading-m { + margin-left: 22px; + } + .break-line { + margin-top: 40px; + margin-bottom: 40px; + } + .employee-home-footer { + } + .moduleCardWrapper { + @apply flex flex-row flex-wrap !important; + } + .gridModuleWrapper { + @apply grid grid-cols-4 gap-4; + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/dss.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/dss.scss new file mode 100644 index 00000000000..f211b041697 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/dss.scss @@ -0,0 +1,266 @@ +.dss-switch-tabs{/* Card / Primary */ + +/* Light Theme / Paper */ + +background: theme(colors.white); +/* Card-Shadow */ + +box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16); +border-radius: 4px; +margin-bottom:3%; +margin-right:25px; +} + +.dss-header-label{ + font-weight: 600 !important; + font-size: 22px !important; + white-space: pre-line; +} +.dss-switch-tab-wrapper{ + cursor:pointer; + display: flex; + flex-direction: row; + height: 50px; + align-items: center; +} + +.dss-switch-tab-selected{ + /* Revenue */ + border-bottom: 3px solid theme(colors.primary.main); + font-family: Roboto; + font-style: normal; + font-weight: 500; + font-size: 22px; + color: theme(colors.primary.main); + padding: 7px 24px; + +} +.dss-switch-tab-unselected{ + +font-family: Roboto; +font-style: normal; +font-weight: 500; +font-size: 22px; +color: theme(colors.text.secondary); +padding: 8px 24px; + +} + +.dss-table-subheader{ + position: relative; + top: -7px; + font-size: 13px; + font-weight: 400; + color: rgba(80, 90, 95, 1); +} + +.dss-pie-subheader{ + position: relative; + top: -7px; + font-size: 13px; + font-weight: 400; + color: rgba(80, 90, 95, 1); +} + +.recharts-legend-item{ + margin-bottom: 20px !important; + white-space: pre; +} + +.dss-white-pre{ + white-space: pre; + +} +.dss-white-pre-line{ + white-space: pre-line; + +} +.dss-white-pre-temp{ + white-space: pre-line; + +} + +.multi-select-dropdown-wrap{ + .master{ + .label{ + p{ + white-space:pre; + margin: auto; + margin-left:0px; + padding-left: 1%; + } + } + } +} + +.divToBeHidden{ + display:block; +} + +.divWillGetHidden{ + display:none; +} + +.dss-temp-white-pre{ + white-space: pre; +} + +.dss-input-active-border{ +--border-opacity: 1; +border: 1px solid theme(colors.primary.main) !important; +border-color: rgba(244, 119, 56, var(--border-opacity)); +} + +.dss-card { + display: flex; + flex-wrap: wrap; +} + +.dss-card-parent { + display: flex; + flex-direction: column; + width: 31%; + border-radius: 6px; + padding: 25px; + margin: 15px 11.5px; + box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); + cursor: pointer; +} + +.dss-card-body { + display: flex; + flex-wrap: wrap; + cursor: pointer; +} + +.dss-card-header { + display: flex; + margin-bottom: 30px; + align-items: center; + + p { + font-size: 24px; + font-family: "Roboto", sans-serif; + font-weight: 500; + color: theme(colors.black); + } + + svg { + width: 50px; + height: 50px; + } +} + + +.dss-insight-card { + margin: 10px 0; + + p { + font-family: "Roboto", sans-serif; + } + + .p1 { + font-size: 16px; + color: #585858; + } + + .p3 { + font-size: 16px; + font-weight: 400; + } + + .p2 { + font-size: 24px; + font-weight: 500; + color: theme(colors.black); + } + + .color-green { + color: theme(colors.success); + } + + .color-red { + color: theme(colors.error); + } +} +.w-100 { + width: 100%; +} +.dss-w-100 { + width: 97%; +} + +.h-100{ + width: 100%; + height: 100%; +} + +.dss-h-100{ + width: 97%; + height: 100%; +} + +.tab-rows{ + display: flex; + justify-content:space-between; + height: 30px; + align-items: center; + width: 60%; + margin-left: 13%; +} +.tab-header{ + font-weight: 700; + font-size: 16px; + line-height: 19px; + border-bottom: 1px solid #b1b4b6; + color: #2a3340; +} +.map-status{ + position: relative; + width: 33%; + left: 50%; + bottom: 130px; +} +.map-row{ + display: flex; + align-items: center; + margin-top: 5px; +} +.map-box{ + display: inline-block; + height: 10px; + width: 10px; +} +.map-text{ + margin-left: 5px; + color: #636363; + font-size: 14px; +} + + +@media screen and (max-width: 768px) { + .dss-switch-tabs{/* Card / Primary */ + margin-right:0px; + } + + .dss-card-parent{ + width:100%; + } +} + +.dss-metric-horizontal{ + width: 48%; + max-width: 48%; +} +.dss-primary{ + display: inline; + margin-right: 10px; + path{ + fill:theme(colors.primary.main); + } +} + +.dss-horizontal-v2{ + width: 22.7%; + max-width: 22.7%; +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/form-fields.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/form-fields.scss new file mode 100644 index 00000000000..d5eb9b56939 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/form-fields.scss @@ -0,0 +1,13 @@ +.form-field{ + @apply w-full +} + +@screen dt { + .form-field{ + @apply w-1/2 + } + + .desktop-w-full{ + @apply w-full !important + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/iframe.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/iframe.scss new file mode 100644 index 00000000000..1f3b992c708 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/iframe.scss @@ -0,0 +1,66 @@ +body { + margin: 0; + padding: 0; + font-family: "Roboto"; + background: #f4f7fb; + } + + + .app-container-iframe { + border-width: 0px; + div[class^="MuiCircularProgress"] { + position: sticky; + top: 90%; + left: 50%; + } + div[role^="progressbar"] { + left: 50%; + position: sticky; + } + } + + @media only screen and (min-width: 953px) { + .app-container-iframe { + border-width: 0px; + position: fixed; + width: 83.5%; + height: calc(100vh - 64px); + } + } + + + @media (max-width: 768px) { + .app-container-iframe { + border-width: 0; + width: 100vw; + height: 100vh; + margin: 32px 0 0 0; + } + } + @media (max-width: 375px) { + .app-container-iframe { + border-width: 0; + width: 100vw; + height: 100vh; + margin: 32px 0 0 0; + } + } + +.app-iframe-wrapper{ + left: 64px; + border-width: 0; + position: fixed; + top: 80px; +} + .app-iframe{ + width: 97%; + height: calc(100vh - 90px); + border-width: 0; + position: fixed; + } + @media (max-width: 768px) { + + .app-iframe-wrapper{ + left: 0px; + } + } \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/inbox.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/inbox.scss new file mode 100644 index 00000000000..b19e0b2d12e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/inbox.scss @@ -0,0 +1,585 @@ +.complaint-links-container { + @apply bg-white; + border-radius: 4px; + .header { + @apply flex items-center border-b border-border justify-between; + + .logo { + width: 56px; + height: 56px; + @apply bg-focus; + padding: 12px; + border-radius: 4px; + svg { + @apply w-8 h-8; + } + } + + .text { + @apply pl-md text-heading-m font-bold; + } + } + + .body { + padding: 10px; + @apply flex items-start flex-col; + margin-left: 46px; + + .link { + @apply p-sm text-primary-main items-center; + display: flex !important; + a{ + color: inherit; + text-decoration: inherit + } + } + + .inbox-total { + padding: 4px; + display: table; + @apply whitespace-normal text-center text-white w-8 h-8 bg-primary-main rounded-full ml-xs; + } + } + + .links-wrapper { + @apply pl-md py-sm text-text-btn; + .link { + padding: 0 !important; + padding-bottom: 4px !important; + svg { + @apply ml-sm; + } + } + } +} + +.MobilePopupHeadingWrapper { + @apply flex place-content-between mb-md; + h2 { + @apply text-heading-l font-bold; + } +} + +.filter-button { + @apply text-primary-main; + &:hover { + @apply text-primary-dark cursor-pointer; + } +} + +.employeeCard-info-box { + @apply flex justify-end ml-md; + background-color: theme(colors.grey.light); + div { + margin-right: 32px; + span:nth-child(2) { + @apply font-bold; + color: #4f5a5f; + } + } + .employeeCard-info-data { + display: flex; + flex-direction: column; + } +} + +.filter-form { + .filter-card { + @apply bg-white min-h-full; + padding: 10px; + + .heading { + justify-content: unset; + @apply flex; + + .clearAll { + display: none; + } + } + + .filter-label { + @apply font-bold text-heading-l flex gap-3; + padding-bottom: 6px; + svg { + fill: theme(colors.text.primary); + } + } + .sub-filter-label { + font-weight: 400; + font-size: 16px; + } + } + .filter-form-field { + p { + @apply text-form-field text-text-primary block mb-md; + } + } +} + +.inbox-container { + .filters-container { + .filter { + .filter-card { + @apply bg-white; + padding: 10px; + .filter-card-close-button { + @apply flex flex-row-reverse; + } + .heading { + @apply flex justify-between; + + .clearAll { + display: none; + } + } + + .filter-label { + @apply text-heading-m block flex gap-3 items-center; + padding-bottom: 6px; + svg { + fill: theme(colors.text.primary); + } + } + + .sub-filter-label { + font-weight: 400; + font-size: 16px; + } + } + } + + .search-complaint-container { + @apply items-center bg-white p-md; + + .complaint-input-container { + @apply w-full; + .complaint-input { + @apply flex flex-col; + + .clear-search { + @apply text-focus; + display: none; + &:hover { + color: theme(colors.link.hover); + cursor: pointer; + } + } + } + + .mobile-input { + } + } + } + } + + .status-container { + margin-bottom: 50px; + } +} + +.clear-search, +.clear-search .link-label { + @apply text-focus; + @apply block; + cursor: pointer; + &:hover { + color: #000; + } +} +.button-clear { + @apply text-focus text-body-s-dt; +} + +.inbox-count { + @apply inline ml-sm p-sm bg-primary-main rounded-full text-white text-heading-s align-middle text-center font-regular; +} + +@screen dt { + .complaint-links-container { + @apply bg-white; + + .header { + @apply flex items-center border-b border-border; + + .logo { + @apply bg-focus; + padding: 12px; + border-radius: 4px; + } + + .text { + @apply pl-md text-heading-m-dt font-bold; + } + } + + .body { + padding: 10px; + @apply flex items-start flex-col; + margin-left: 46px; + + .link { + @apply p-sm text-primary-main; + } + } + } + + .inboxLinks { + margin: 0 !important; + padding: 0 !important; + .header { + border: none; + @apply justify-start; + .logo { + @apply bg-white; + svg { + path { + fill: theme(colors.primary.main); + } + } + } + } + .body { + margin-left: 0; + } + } + + .filter-form { + .filter-card { + @apply p-md bg-white; + + .heading { + @apply flex justify-between; + } + + .label { + @apply text-heading-s; + } + } + } + + .inbox-container { + @apply flex; + + .filters-container { + width: 270px; + + .filter { + @apply mt-md; + + .filter-card { + @apply p-md bg-white; + + .heading { + @apply flex justify-between; + } + + .label { + @apply text-heading-s; + } + } + } + .citizen-filter { + margin-top: unset; + } + } + + .search-container { + width: 874px; + + .search-complaint-container { + margin: auto; + @apply flex flex-col items-start mb-md bg-white p-md; + + .complaint-header { + display: flex; + @apply flex justify-between w-full; + margin-bottom: 20px; + } + + .complaint-input-container { + /* display: inline-block !important; */ + display: grid; + grid-template-columns: 33.33% 33.33% 33.33%; + + &.for-pt { + &.for-search { + grid-template-columns: 25% 25% 25% 25%; + + .input-fields:nth-child(3n) { + @apply mr-md !important; + } + + .input-fields:nth-child(4n) { + margin-right: 0 !important; + } + + .search-submit-wrapper { + grid-column: 4/5; + /* margin-top: 56px;*/ + max-width: unset; + margin-left: unset; + } + } + } + + .search-submit-wrapper { + grid-column: 3/4; + margin-left: 50%; + max-width: 50%; + grid-column: 3/4; + @apply flex flex-col justify-center text-center; + + .submit-bar-search { + margin-top: unset; + width: 100%; + margin-bottom: 20px; + margin-left: unset; + max-width: 100%; + width: 100%; + } + } + + .input-fields { + /*width: calc(50% - 16px);*/ + + @apply inline-block mr-md !important; + + .inbox-search-form-error { + padding-top: 0; + margin-top: 0; + @apply absolute; + } + } + + .input-fields:nth-child(3n) { + margin-right: 0 !important; + } + + .complaint-input { + @apply flex flex-col; + + .clear-search { + @apply text-focus; + @apply block; + cursor: pointer; + &:hover { + color: theme(colors.link.hover); + cursor: pointer; + } + } + } + + .mobile-input { + @apply ml-sm; + } + } + + .search-action-wrapper { + width: 33%; + margin-top: 28px; + @apply inline-block align-middle text-center; + button { + margin: 0; + width: 100%; + max-width: 300px !important; + } + } + } + + .search-complaint-container-for-search { + } + } + } +} + +.document-clear-all { + grid-area: 2/2; + display: flex; + justify-content: flex-end; + padding-right: 16px; + align-items: center; +} + +.cell-text { + color: theme(colors.text.secondary); +} + +.sla-cell-error { + color: theme(colors.error); + background-color: rgba(212, 53, 28, 0.12); + padding: 0 24px; + border-radius: 11px; +} + +.sla-cell-success { + color: theme(colors.success); + background-color: rgba(0, 112, 60, 0.12); + padding: 0 24px; + border-radius: 11px; +} + +.complain-no-cell-text { + margin-top: "4px"; + color: "theme(colors.text.secondary)"; +} + +.search-error-label { + @apply font-bold text-legend text-error mb-sm !important; +} + +.inbox-action-container { + display: flex; + justify-content: flex-end; + align-items: flex-start; +} +.complaint-links-container .header .removeHeight { + line-height: 28px; +} + +@screen dt { + .complaint-links-container .header .removeBorderRadiusLogo { + border-radius: 2px !important; + } +} +@screen dt { + .customEmployeeCard { + width: 263px !important; + height: 263px !important; + } +} +.employeeTotalLink { + color: theme(colors.text.secondary); + font-size: 16px; + text-decoration: none; +} + +@screen dt { + .groupBill-custom { + .custom-group-merge-container { + display: flex !important; + justify-content: space-between !important; + .header { + display: flex; + align-items: baseline; + .logo { + margin-right: 1rem; + svg { + path { + fill: theme(colors.primary.main); + } + } + } + .h1 { + font-size: 24px; + line-height: 28px; + font-weight: 400; + color: theme(colors.primary.main); + } + } + } + .inbox-container { + .search-container { + .search-complaint-container { + display: flex; + flex-direction: row; + } + .group-complaint-input-container { + width: 33% !important; + display: flex; + flex-direction: column; + } + } + } + .inbox-action-container { + display: flex; + flex-direction: row-reverse; + .clear-search { + margin-top: 65px; + margin-left: 16px; + padding-top: unset !important; + } + .submit-bar-search { + margin-top: 55px !important; + } + } + } +} + +.plumber-details-new-value-wrapper { + flex: 2 1 auto; +} + +.connection-details-new-value-wrapper { + flex: 1 1 auto; +} + +.connection-details-old-value-wrapper, +.plumber-details-old-value-wrapper { + flex: 1 1 auto; + + .old-value-null-wrapper { + visibility: hidden; + padding-bottom: 8px; + margin-bottom: 8px; + } + .row { + color: #b1b4b6; + font-weight: 700; + font-size: 16px; + } +} + +.search-tabs-container { + border-bottom: 1px solid rgba(0, 0, 0, 0.2); + margin-bottom: 35px; + display: flex; + justify-content: space-between; + + .search-tab-head { + padding: 10px 35px; + } + + .search-tab-head-selected { + padding: 10px 35px; + color: rgb(244, 119, 56); + border-bottom: 4px solid rgb(244, 119, 56); + font-weight: bold; + } + + .search-tab-head-selected:focus { + outline: 0; + } +} + +.card-with-background { + background: rgb(250, 250, 250); + border: 1px solid rgb(214, 213, 212); + + .card-head { + display: flex; + justify-content: space-between; + margin-bottom: 30px; + } + + h2 { + font-size: 16px; + font-weight: 700; + } +} + +.registryTable { + tHead { + tr { + th { + text-align: center; + } + } + } + tBody { + tr { + td { + text-align: center; + } + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss new file mode 100644 index 00000000000..8f41c6938d8 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss @@ -0,0 +1,572 @@ +@import "./login.scss"; +/* TODO: convert using tailwind */ +.employee { + .breadcrumb { + @apply ml-sm mb-lg; + } + .ground-container { + margin-bottom: 56px; + @apply flex flex-col; + } + .card-home { + font-size: 16px; + padding: 0 0 16px 0; + width: 92vw; + display: inline-block; + margin: 8px auto; + } + .home-action-cards { + height: auto !important; + min-height: 263px; + } + .topbar { + position: fixed; + top: 0; + width: 100%; + padding: 16px 24px; + background: white; + box-shadow: rgba(0, 0, 0, 0.24) 0 1px 4px; + z-index: 9999; + + img { + display: inline; + + &.city { + margin-right: 8px; + height: 48px; + width: 48px; + } + + &.state { + height: 20px; + max-height: 20px; + width: auto; + } + } + + .ulb { + font-weight: bold; + } + + .right { + float: right; + margin-top: 12px; + + .user-img-txt { + background: theme(colors.primary.main); + padding: 10px 15px; + border-radius: 50%; + color: white; + font-weight: 700; + } + } + } + + .main { + padding-top: 88px; + } + + .loginContainer { + padding-top: 88px; + } + + .react-time-picker { + width: 100%; + } + + .react-time-picker__wrapper { + border: 1px solid theme(colors.inputBorder); + } + + .react-time-picker__clock { + display: none; + } + + .react-time-picker__inputGroup__leadingZero { + padding-right: 8px; + display: inline !important; + } + + .react-time-picker__inputGroup__input { + padding: 0; + min-width: none; + outline: none !important; + border: none !important; + } + + .react-time-picker__wrapper { + padding-left: 8px; + } +} + +.citizen { + .main { + padding-top: 82px; + min-height: calc(100vh - 90px); + } +} + +.citizen, +.employee { + .sidebar { + position: fixed; + left: 0; + background: #0B4B66; + height: 100%; + color: theme(colors.white); + margin-top: 83px; + z-index: 10000; + transition: 0.3s ease all; + white-space: nowrap; + height: calc(100vh - 36px); + padding-bottom: 5rem; + + .actions { + cursor: pointer; + display: flex; + align-items: center; + .tooltip { + margin-left: 16px; + } + margin-bottom: 0px; + } + + svg { + width: 24px; + height: 24px; + fill: theme(colors.white); + } + a { + display: flex; + } + .sidebar-link { + display: flex; + color: theme(colors.white); + justify-content: space-between; + align-items: center; + padding: 20px; + font-size: 14px; + + &.level-0 { + margin:0 0.3rem 0 0.3rem; + &.select-level{ + border-top: 1px solid; + border-bottom: 1px solid; + } + } + + &.active { + color: theme(colors.primary.main) !important; + + border-right: none; + svg { + fill: theme(colors.primary.main) !important; + } + } + .employee-search-input { + border: none; + outline: none; + background-color: rgba(0, 0, 0, 0); + margin-left: 13px; + } + .custom-link { + .tooltip { + margin-left: 16px; + span { + margin-left: unset !important; + left: unset !important; + } + } + } + + svg { + fill: theme(colors.white) !important; + width: 21px; + height: 21px; + } + + &:hover { + + background-color: #0B4B66; + + cursor: pointer; + + } + .search-icon-wrapper { + border: 2px solid theme(colors.white); + border-radius: 4px; + padding: 5px; + svg { + fill: theme(colors.white) !important; + width: 21px; + height: 21px; + path { + fill: theme(colors.white) !important; + } + } + } + } + .dropdown-link { + height: 40px; + display: flex; + margin-left: 40px; + align-items: center; + text-decoration: none; + color: theme(colors.white); + font-size: 14px; + .actions { + .tooltiptext { + left: unset; + right: 1%; + } + } + svg { + width: 20px; + height: 20px; + fill: theme(colors.white); + } + &:hover { + background-color: #6A8E9D; + opacity: 0.8; + cursor: pointer; + svg { + fill: #fe7a51 !important; + } + } + + + &.active { + border-left: 4px solid theme(colors.primary.main); + &.level-0 { + + } + &.level-1 { + border-left: 8.5px solid theme(colors.primary.main); + } + &.level-2 { + border-left: 4px solid theme(colors.primary.main); + } + + &.level-3{ + + } + color: theme(colors.primary.main) !important; + border-right: none; + svg { + fill: theme(colors.primary.main) !important; + } + } + } + span { + margin-left: 16px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + } + + .wrapperStyles { + margin-top: -5px; + padding-left: 20px; + padding-top: 10px; + + .containerStyles { + border: 1px solid theme(colors.text.secondary); + padding: 16px; + margin-bottom: 20px; + } + + &.leftBorder { + border-left: 2px solid rgba(0, 0, 0, 0.12); + } + } + + .rowContainerStyles { + @apply flex flex-col; + } + + .tableContainerStyles { + border: 1px solid theme(colors.text.secondary); + padding: 16px; + margin-bottom: 20px; + } + + .historyTables { + display: grid; + grid-template-rows: 100px 100px; + grid-template-columns: repeat(5, minmax(100px, 1fr)); + } + + .historyContent { + margin: 0 10px; + position: relative; + padding-bottom: 5px; + } + + .historyCheckpoint { + background-color: #fe7a51; + border-radius: 100%; + width: 18px; + height: 18px; + display: inline-block; + position: relative; + left: -9px; + top: 4px; + + &.zIndex { + z-index: 10; + } + } + + .historyTableDateLabel { + color: rgba(0, 0, 0, 0.87); + font-size: 16px; + font-weight: 700; + line-height: 17px; + text-align: left; + display: inline-block; + padding-top: 5px; + } + + .bottomMargin { + margin-bottom: 0px; + } + + .historyTableDate { + color: rgba(0, 0, 0, 0.87); + font-size: 19px; + font-weight: 400; + line-height: 17px; + text-align: left; + display: inline-block; + padding-top: 10px; + } + + .historyHorizontalBar { + background-color: rgba(0, 0, 0, 0.12); + width: auto; + height: 2px; + margin-left: 16px; + } + + .smallText { + font-weight: 500; + font-size: 14px; + } +} + +.citizen { + .sidebar { + margin-top: 54px; + min-width: 200px; + .actions { + display: flex; + align-items: center; + gap: 10px; + } + } +} + +.link { + @apply text-primary-main cursor-pointer; + + :hover { + @apply text-primary-dark; + } +} + +.RightMostTopBarOptions { + @apply flex; + .EventNotificationWrapper { + @apply relative cursor-pointer ml-md; + span { + top: -10px; + right: -10px; + @apply absolute bg-error h-5 w-5 rounded-full text-center; + p { + line-height: 20px; + } + } + } + .select-wrap { + margin-bottom: unset; + svg { + fill: theme(colors.white); + } + } +} + +@media (min-width: 640px) { + .employee { + .ground-container { + @apply block; + } + .breadcrumb { + @apply mb-lg; + margin-left: 0; + } + .card-home { + width: 270px; + margin-right: 10px; + margin-bottom: 10px; + } + .card-home-hrms { + width: 405px; + padding: 0px; + margin-right: 16px; + margin-bottom: 16px; + } + .main { + display: flex; + flex-direction: column; + padding-top: 80px; + margin-left: 72px; + width: calc(100%-83px); + } + .citizen-home-container { + display: flex; + flex-direction: unset !important; + width: unset !important; + margin-left: unset !important; + padding-top: 58px; + } + } + + .citizen { + .main { + width: 100%; + padding-top: 58px; + height: 100%; + display: flex; + justify-content: center; + } + + .center-container { + } + } +} + +.fullWidth { + width: 100%; +} + +.multi-select-container { + .disposal-text { + @apply font-bold; + } + + .disposal-info { + @apply my-md ml-sm; + } + + .disposal-action-bar { + @apply flex justify-between items-center; + } +} + +@screen dt { + .d-grid { + display: grid; + grid-template-columns: 250px 250px 250px 250px; + column-gap: 10px; + row-gap: 2px; + margin-left: -12px; + } +} + +.m-auto { + margin: auto !important; +} + +.mb-50 { + margin-bottom: 50px; +} +.mb-25 { + margin-bottom: 25px; +} + +.back-wrapper { + display: flex; + justify-content: space-between; + + .top-back-btn { + margin-bottom: 0px; + color: theme(colors.white); + margin-right: 1em; + & svg { + fill: theme(colors.white); + } + } + .hambuger-back-wrapper { + display: flex; + @media (min-width: 780px) { + .hamburger-span { + display: none; + } + } + } +} + +@screen dt { + .back-wrapper { + margin-right: 2rem; + margin-left: 2rem; + } +} + +.user-profile { + @media (min-width: 780px) { + width: calc(100% - 219px); + margin-left: 16px; + margin-right: 16px; + } +} + +.link { + a{ + color: inherit; + text-decoration: inherit + } +} + +.breadcrumb { + a{ + color: inherit; + text-decoration: inherit + } +} + +.sidebar-link.active{ +.custom-link{ + text-decoration: none; + div{ + span{ + color: theme(colors.primary.main) !important; + text-decoration: none; + } + } +} +} +.bread-crumb { + a{ + color: inherit; + text-decoration: inherit + } +} + +.sidebar-link{ + .custom-link{ + text-decoration: none; + div{ + span{ + color: theme(colors.white); + text-decoration: none; + } + } + } + } + +/* TODO fix required NABEEL/ANIL for home screen card */ + .customEmployeeCard { + @apply m-sm !important; + } diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss new file mode 100644 index 00000000000..2ec40a63ca1 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/login.scss @@ -0,0 +1,221 @@ +.loginFormStyleEmployee { + .employeeCard { + .submit-bar { + @apply w-full; + } + } +} +.banner .bannerCard{ + min-width: 420px !important; +} +.employeeForgotPassword .employeeCard .field .field-container .component-in-front { + margin-top: 0; + border: 1px solid; + border-right: none; + padding: 7px; +} +@screen dt { + .employeeForgotPassword .employeeCard .field .field-container .component-in-front { + padding: 7px; + } + .loginFormStyleEmployee .employeeCard, .banner .bannerCard{ + min-width: 420px !important; + } + .employeeForgotPassword .employeeCard, .employeeChangePassword .employeeCard{ + max-width: 420px !important; + min-width: 420px !important; + } +} + +.employeeForgotPassword .employee-card-input { + margin-bottom: 0px; + border-left: none; +} + +.employeeForgotPassword .field-container { + margin: 10px 0; +} +.employeeForgotPassword { + .submit-bar { + @apply w-full; + } +} +.employeeChangePassword .submit-bar { + width: 100% !important; +} +.employeeChangePassword .card-text { + text-align: center; +} +.employeeChangePassword .input-otp-wrap { + text-align: center; +} +.submit-bar { + .submit-bar { + @apply w-full; + } +} +.loginFormStyleEmployee .bannerHeader p, +.employeeForgotPassword .bannerHeader p, +.employeeChangePassword .bannerHeader p { + font-size: 19px; +} +.employeeCard .card-sub-header { + font-size: 24px; +} +.loginFormStyleEmployee .employeeCard .card-label, .employeeForgotPassword .employeeCard .card-label{ + font-weight: normal; + font-size: 16px; + line-height: 19px; + color: theme(colors.text.primary); + margin-top: 20px; +} +.banner .bannerHeader { + margin-bottom: 20px; +} +.employeeCard .card-label{ + font-weight: normal; + font-size: 16px; + line-height: 19px; + color: theme(colors.text.primary); +} +.profile-label-margin{ + margin-top: 10px; +} + +.employeeForgotPassword .employeeCard .card-label-desc { + font-weight: normal; + font-size: 16px; + line-height: 24px; + color: theme(colors.text.secondary); + margin-top: 15px; +} +.employeeChangePassword .employeeCard .card-text { + margin-bottom: 15px; + font-size: 16px; + color: theme(colors.text.secondary); +} +@media screen and (max-width: 768px) { + .employeeChangePassword .employeeCard .card-text { + margin-top: 7px; + } + .employeeCard .card-sub-header { + font-size: 18px; + } +} +.employeeChangePassword .employeeCard .card-text-button { + text-align: center !important; + margin-bottom: 12px !important; +} +.employeeChangePassword .employeeCard .input-otp-wrap { + margin-bottom: 10px; +} +.employee .loginContainer { + padding-top: 0px !important; +} +.banner { + height: calc(100vh ) !important; +} + +.employeeChangePassword .employeeCard .field .field-container{ + margin-bottom: 24px; +} + +.employeeForgotPassword .employeeCard .employee-card-sub-header, .employeeChangePassword .employeeCard .employee-card-sub-header, .loginFormStyleEmployee .employeeCard .employee-card-sub-header{ + font-size: 24px !important; + line-height: 28px !important; + margin-bottom: 0px !important; +} +@media screen and (max-width : 768px){ + .employeeForgotPassword .employeeCard .employee-card-sub-header, .employeeChangePassword .employeeCard .employee-card-sub-header, .loginFormStyleEmployee .employeeCard .employee-card-sub-header{ + font-size: 18px !important; + line-height: 21px !important; + margin-bottom: 0px !important; + } + .loginFormStyleEmployee .employeeCard, .banner .bannerCard{ + min-width: 340px !important; + margin: 10px !important; + } + .employeeForgotPassword .employeeCard, .employeeChangePassword .employeeCard{ + max-width: 360px !important; + min-width: 340px !important; + margin: 10px !important; + } +} +.employeeChangePassword .employeeCard .card-text{ + margin-top: 18px !important; + margin-bottom: 20px !important; +} +.employeeBackbuttonAlign{ + display: none; +} +.resend-otp{ + cursor: pointer; +} + +.employee-select-wrap.login-city-dd { + .options-card{ + max-height: 200px; + } +} +@media screen and (max-width: 768px){ + .employeeBackbuttonAlign{ + display: block; + position: absolute; + top: 20px; + left: 20px; + } + .banner{ + align-items: flex-end; + padding-bottom: 40px; + height: 100vh !important; + } + .topbar{ + background: rgba(34, 57, 77, var(--bg-opacity)) !important; + color: white; + } + .employee .loginContainer{ + padding-top: 0px !important; + } + .removeBottomMargin{ + margin-bottom: 0px !important; + } + .employee-select-wrap.login-city-dd { + .options-card{ + max-height: 160px; + } + } +} + + +.loginFormStyleEmployee { + + .loginCardSubHeaderClassName { + text-align: center !important; + } + .loginCardClassName { + margin: auto !important; + min-width: 408px !important; + header.employee-card-sub-header{ + text-align: center; + margin-top: 10px; + } + } + .buttonClassName { + max-width: 100% !important; + width: 100% !important + } + .field .field-container .text-input input { + margin-bottom: 5px !important; + } + .bannerHeader { + margin-bottom: 0px !important; + } + + .primary-label-btn { + margin: 20px auto 0 auto !important; + } + + .employee-select-wrap .options-card { + max-height: 150px !important; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/oldMobileInbox.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/oldMobileInbox.scss new file mode 100644 index 00000000000..0c8e7812570 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/oldMobileInbox.scss @@ -0,0 +1,5 @@ +.linksWrapperForMobileInbox{ + .header{ + justify-content: initial; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/popupmodule.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/popupmodule.scss new file mode 100644 index 00000000000..b8a99b6f5d7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/popupmodule.scss @@ -0,0 +1,34 @@ +.popup-module { + width: 480px; + margin: 0 auto; + @apply bg-white; + + .popup-module-main { + @apply px-lg pb-lg; + } + + .popup-module-action-bar { + gap: 16px; + @apply flex flex-row justify-end; + } +} + +@screen dt { + .popup-module { + width: 480px; + margin: auto; + @apply bg-white; + + .popup-module-main { + @apply px-lg pb-lg; + } + .popup-module-main { + @apply w-full p-sm h-full; + } + + .popup-module-action-bar { + gap: 16px; + @apply flex flex-row justify-end; + } + } +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/response.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/response.scss new file mode 100644 index 00000000000..31a3993d26a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/response.scss @@ -0,0 +1,3 @@ +.secondary-action{ + @apply inline float-right; +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/scroll-table.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/scroll-table.scss new file mode 100644 index 00000000000..c6637ebbce6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/scroll-table.scss @@ -0,0 +1,119 @@ +.scroll-table-wrapper{ + &::-webkit-scrollbar { + display: none; + } + -ms-overflow-style: none; + scrollbar-width: none; + @apply relative overflow-x-scroll overflow-y-visible pb-sm text-center; + + .scroll-table-width-wrapper{ + &::-webkit-scrollbar { + display: none; + } + -ms-overflow-style: none; + scrollbar-width: none; + width: calc(100% - 110px); + margin: auto; + @apply overflow-x-scroll; + table{ + margin: auto; + } + } + + .first-col{ + width:110px; + @apply absolute left-0; + } + + .last-col{ + width:110px; + @apply absolute right-0; + } +} + +@screen dt{ + .scroll-table-wrapper{ + width: 60%; + } +} +.table-switch-card-chip{ + display: flex; + cursor: pointer; + padding-right: 10px; + width: 100%; +} + +.table-search-wrapper{ + display:flex; + width:100%; + align-items:center; +} +.table-switch-card-inactive{ + /* Frame 58 */ + + +/* Auto layout */ + +display: flex; +flex-direction: row; +align-items: flex-start; +padding: 8px; + +position: static; +height: 40px; +left: 84px; +top: 0px; + +/* Light Theme / Paper */ + +background: theme(colors.white); +box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.1); + +/* Inside auto layout */ + +flex: none; +flex-grow: 0; +margin: 0px 0px; +color: #B1B4B6; +} +.table-switch-card-inactive:hover{ + background: #fffffc; + font-size: 17px; + color: theme(colors.text.secondary); +} + +.table-switch-card-active{/* Frame 57 */ + + + /* Auto layout */ + + display: flex; + flex-direction: row; + align-items: flex-start; + padding: 8px; + + position: static; + height: 40px; + left: 0px; + top: 0px; + + /* Light Theme / Paper */ + + background: theme(colors.white); + /* Light Theme / Primary */ + + border: 1px solid theme(colors.primary.main); + box-sizing: border-box; + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.1); + + /* Inside auto layout */ + + flex: none; + flex-grow: 0; + margin: 0px 0px; +} + +.icon-wrapper { + margin-left:1rem; + cursor:pointer +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/surveys.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/surveys.scss new file mode 100644 index 00000000000..bcfa2aa5eae --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/surveys.scss @@ -0,0 +1,273 @@ +.surveydetailsform-wrapper { + @apply grid gap-6 py-md; + + label { + @apply font-medium; + } + .surveyformfield { + @apply grid gap-4; + } + + .employee-select-wrap, + .employee-card-input { + margin-bottom: 0; + } +} + +.newSurveyForm_wrapper { + @apply grid p-md bg-grey-light border border-border rounded gap-6 ; + .newSurveyForm_questions { + } + .newSurveyForm_answer { + } + .newSurveyForm_actions { + @apply flex justify-end gap-4 py-md; + .checkbox-wrap .label { + margin-left: 40px; + } + } + .newSurveyForm_seprator { + @apply w-px h-6 border border-border; + } +} + +.surveyformslist_wrapper, +.surveydetailsform-wrapper { + .heading { + @apply text-heading-l font-medium py-md; + } +} + +.surveyformslist_wrapper { + @apply grid gap-6 py-md; +} + +.options_checkboxes { + @apply flex flex-col gap-4; +} + +.optioncheckboxwrapper { + @apply flex; +} + +.simple_editable-input { + outline-width: 0; + border: 0; + border-bottom: 2px solid black; +} + +.simple_readonly-input { + outline-width: 0; + border: 0; + background: transparent; +} + +.pointer { + cursor: pointer; +} + +.disabled-btn { + @apply pointer-events-none cursor-not-allowed; +} + +.optionradiobtnwrapper { + @apply flex gap-2; + + .customradiobutton { + @apply w-6 h-6; + } +} + +.edit-action-btn { + @apply flex justify-end; +} + +.surveyQuestion-wrapper{ + @apply grid gap-6; +} + +.question-title { + font-size: 18px; + line-height: 21px; + color: theme(colors.text.primary); + font-weight: 700; +} + +.responses-container { + display: flex; + flex-direction: column; + align-items: flex-start; + padding: 8px 4px; + background-color: theme(colors.grey.light); + border: 1px solid theme(colors.border); + box-sizing: border-box; + border-radius: 4px; + margin-top: 20px; + margin-bottom: 20px; + position: relative; +} + +.responses-container-date { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + padding: 8px 8px 0px 8px; + position: static; + left: 0px; + top: 41px; + background: theme(colors.grey.light); + border: 1px solid theme(colors.border); + box-sizing: border-box; + border-radius: 4px; + margin-top: 20px; + margin-bottom: 20px; +} + +.responses-container-line { + width: 100%; + margin-bottom: -12px; +} + +.date-time{ + margin-top: 10px; + margin-bottom: 10px; +} + +.response-result { + flex: none; + order: 1; + flex-grow: 0; + margin: 0px 0px -20px; + display: inline-block; +} + +.date-container { + display: flex; +flex-direction: column; +justify-content: center; +align-items: center; +padding: 16px 8px; +background: theme(colors.grey.light); +border: 1px solid theme(colors.border); +box-sizing: border-box; +border-radius: 4px; +@apply gap-y-6; +} + +.date-response { +display: flex; +flex-direction: row; +font-weight: bold; +@apply gap-10 ; +} +.divide { + --tw-divide-x-reverse: 0; +border-right-width: calc(2px * var(--tw-divide-x-reverse)); +border-left-width: calc(2px * calc(1 - var(--tw-divide-x-reverse))); +} + +.circle { + background-color:red; + height:40px; + border-radius:50%; + -moz-border-radius:50%; + -webkit-border-radius:50%; + width:40px; +} + +.align-columns{ + @apply grid gap-4; +} + + +@screen dt { + .surveydetailsform-wrapper { + .surveyformfield { + @apply items-center; + grid-template-columns: 1fr 2fr 1fr; + + .radio-wrap { + @apply flex gap-20; + margin-bottom: 0; + } + .radio-wrap div { + @apply flex items-center; + } + + .radio-btn { + @apply w-6 h-6; + } + + .radio-btn-checkmark { + height: 1.75rem; + width: 1.75rem; + --border-opacity: 1; + border: 1px solid theme(colors.inputBorder); + border-color: rgba(70, 70, 70, var(--border-opacity)); + border-radius: 9999px; + display: block; + } + + .radio-wrap .radio-btn-wrap input:checked ~ .radio-btn-checkmark:after { + display: block; + --bg-opacity: 1; + background-color: theme(colors.primary.main); + background-color: rgba(244, 119, 56, var(--bg-opacity)); + height: 1.25rem; + width: 1.25rem; + border-radius: 9999px; + position: absolute; + top: 4px; + left: 4px; + } + } + } + + .newSurveyForm_wrapper { + @apply grid p-md bg-grey-light border border-border rounded; + grid-template-columns: 33% 1fr; + + .newSurveyForm_quesno { + @apply text-heading-m font-medium; + } + + .newSurveyForm_mainsection { + } + .newSurveyForm_questions { + @apply flex gap-4; + + .text-input { + @apply w-3/4; + } + .employee-select-wrap { + @apply flex-1; + } + } + .newSurveyForm_answer { + } + .newSurveyForm_actions { + @apply flex justify-end gap-2; + .checkbox-wrap { + @apply items-center; + margin-bottom: 0; + } + .checkbox-wrap .label { + margin-left: 40px; + } + } + .newSurveyForm_seprator { + @apply w-px h-6 border border-border; + } + } + + .surveyformslist_wrapper { + @apply w-3/4 grid gap-6 py-md; + } +} + +.unstyled-button { + border: none; + padding: 0; + background: none; +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/tooltip.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/tooltip.scss new file mode 100644 index 00000000000..5a4f67caba6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/tooltip.scss @@ -0,0 +1,36 @@ +.tooltip { + position: relative; + display: inline-block; + } + + .tooltip .tooltiptext { + visibility: hidden; + background-color: #555; + color: #fff; + text-align: left; + border-radius: 6px; + padding: 5px; + position: absolute; + z-index: 1; + bottom: 125%; + left: 50%; + margin-left: -60px; + opacity: 0; + transition: opacity 0.3s; + } + + .tooltip .tooltiptext::after { + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: #555 transparent transparent transparent; + } + + .tooltip:hover .tooltiptext { + visibility: visible; + opacity: 1; + cursor: pointer; + } \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/updateNumber.scss b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/updateNumber.scss new file mode 100644 index 00000000000..fbd3294177d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/src/pages/employee/updateNumber.scss @@ -0,0 +1,13 @@ +.updateNumberEmployee{ + width: 100%; + .employee-data-table .row h2{ + font-weight:500; + width: 100%; + } + .submit-bar { + position: relative; + } + .search-form-wrapper { + justify-content: initial; + } +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/arrowdown.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/arrowdown.svg new file mode 100644 index 00000000000..b7456af64e7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/arrowdown.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/arrowleft.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/arrowleft.svg new file mode 100644 index 00000000000..291db649e0a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/arrowleft.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/calendar.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/calendar.svg new file mode 100644 index 00000000000..db8c32d6b24 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/calendar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/camera.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/camera.svg new file mode 100644 index 00000000000..5f0b5297983 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/camera.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/check.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/check.svg new file mode 100644 index 00000000000..88018af3276 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/check.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/close.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/close.svg new file mode 100644 index 00000000000..357ce662494 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/close.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/error.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/error.svg new file mode 100644 index 00000000000..2f3e7d76748 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/error.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/error2.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/error2.svg new file mode 100644 index 00000000000..008d258c3d6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/error2.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/searchicon.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/searchicon.svg new file mode 100644 index 00000000000..bca3b004413 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/searchicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/starempty.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/starempty.svg new file mode 100644 index 00000000000..8d295e7219b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/starempty.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/starfilled.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/starfilled.svg new file mode 100644 index 00000000000..23481e8ccb2 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/starfilled.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/success.svg b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/success.svg new file mode 100644 index 00000000000..e846ff61864 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/svg/success.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/css/tailwind.config.js b/frontend/workbench-ui/web/micro-ui-internals/packages/css/tailwind.config.js new file mode 100644 index 00000000000..673ba2cfaba --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/css/tailwind.config.js @@ -0,0 +1,231 @@ +module.exports = { + future: { + removeDeprecatedGapUtilities: true, + purgeLayersByDefault: true, + }, + purge: { enabled: true, content: ["./example/index.html"] }, + theme: { + screens: { + dt: "780px", + sm: { max: "425px" }, + }, + colors: { + primary: { + light: "#F18F5E", + main: "#F47738", + dark: "#C8602B", + }, + secondary: "#22394D", + text: { + primary: "#0B0C0C", + secondary: "#505A5F", + }, + link: { + normal: "#1D70B8", + hover: "#003078", + }, + border: "#D6D5D4", + inputBorder: "#464646", + "input-border": "#464646", + focus: "#F47738", + error: "#D4351C", + success: "#00703C", + black: "#000000", + grey: { + dark: "#9E9E9E", + mid: "#EEEEEE", + light: "#FAFAFA", + bg: "#E3E3E3", + }, + white: "#FFFFFF", + }, + fontFamily: { + sans: ["Roboto", "sans-serif"], + rc: ['"Roboto Condensed"', "sans-serif"], + }, + fontSize: { + "heading-xl-dt": ["48px", "56px"], + "heading-xl": ["32px", "40px"], + "heading-l-dt": ["36px", "40px"], + "heading-l": ["24px", "32px"], + "heading-m-dt": ["24px", "32px"], + "heading-m": ["18px", "28px"], + "heading-s": ["16px", "24px"], + "caption-xl-dt": ["27px", "32px"], + "caption-xl": ["18px", "26px"], + "caption-l-dt": ["24px", "28px"], + "caption-l": ["18px", "21px"], + "caption-m-dt": ["19px", "23px"], + "caption-m": ["16px", "19px"], + "form-field": ["16px", "20px"], + "body-l-dt": ["19px", "28px"], + "body-l": ["16px", "24px"], + "body-s-dt": ["16px", "24px"], + "body-s": ["14px", "16px"], + legend: ["19px", "23px"], + link: ["16px", "24px"], + "text-btn": ["16px", "24px"], + }, + fontWeight: { + regular: 400, + medium: 500, + bold: 700, + }, + padding: { + sm: "8px", + md: "16px", + lg: "24px", + xl: "36px", + }, + margin: { + xs: "4px", + sm: "8px", + md: "16px", + lg: "24px", + xl: "64px", + }, + borderWidth: { + default: "1px", + 0: "0", + 2: "1px", + 4: "4px", + 10: "10px", + }, + boxShadow: { + card: "0 1px 2px 0 rgba(0, 0, 0, 0.16)", + radiobtn: "0 0 0 5px #F47738", + }, + inset: { + 0: 0, + 6: "6px", + 10: "10px", + }, + extend: {}, + digitv2: { + lightTheme: { + primary: "#F47738", + "text-color-primary": "#0B0C0C", + "text-color-secondary": "#505A5F", + "text-color-disabled": "#B1B4B6", + background: "#EEEEEE", + paper: "#FFFFFF", + "paper-secondary": "#FAFAFA", + divider: "#D6D5D4", + "header-sidenav": "#0B4B66", + "input-border": "#505A5F", + "primary-bg": "#FEEFE7", + }, + alert: { + error: "#D4351C", + "error-bg": "#EFC7C1", + success: "#00703C", + "success-bg": "#BAD6C9", + info: "#3498DB", + "info-bg": "#C7E0F1", + }, + chart: { + "chart-1": "#048BD0", + "chart-1-gradient": "#048BD0", + "chart-2": "#FBC02D", + "chart-2-gradient": "#FBC02D", + "chart-3": "#8E29BF", + "chart-4": "#EA8A3B", + "chart-5": "#0BABDE", + }, + fontSize: { + "heading-xl": { + mobile: "2rem", + tablet: "2.25rem", + desktop: "2.5rem", + }, + "heading-l": { + mobile: "1.5rem", + tablet: "1.75rem", + desktop: "2rem", + }, + "heading-m": { + mobile: "1.25rem", + tablet: "1.375rem", + desktop: "1.5rem", + }, + "heading-s": { + mobile: "1rem", + tablet: "1rem", + desktop: "1rem", + }, + "heading-xs": { + mobile: "0.75rem", + }, + "caption-l": { + mobile: "1.5rem", + tablet: "1.75rem", + desktop: "1.75rem", + }, + "caption-m": { + mobile: "1.25rem", + tablet: "1.5rem", + desktop: "1.5rem", + }, + "caption-s": { + mobile: "1rem", + tablet: "1.25rem", + desktop: "1.25rem", + }, + "body-l": { + mobile: "1rem", + tablet: "1.25rem", + desktop: "1.25rem", + }, + "body-s": { + mobile: "0.875rem", + tablet: "1rem", + desktop: "1rem", + }, + "body-xs": { + mobile: "0.75rem", + tablet: "0.875rem", + desktop: "0.875rem", + }, + label: { + mobile: "1rem", + tablet: "1rem", + desktop: "1rem", + }, + link: { + mobile: "1rem", + tablet: "1rem", + desktop: "1rem", + }, + }, + fontFamily: { + sans: ["Roboto"], + rc: ['"Roboto Condensed"'], + }, + fontStyle: { + normal: "normal", + italic: "italic", + }, + textDecorationLine: { + underline: "underline", + }, + fontWeight: { + regular: 400, + medium: 500, + bold: 700, + }, + lineHeight: { + "line-height-body-l": { mobile: "1.5rem", tablet: "1.75rem", desktop: "1.75rem" }, + "line-height-body-s": { mobile: "1.0938rem", tablet: "1.5rem", desktop: "1.5rem" }, + "line-height-body-xs": { mobile: "1.125rem", tablet: "1.5rem", desktop: "1.5rem" }, + normal: "normal", + }, + screens: { + mobile: "400px", + tablet: "768px", + desktop: "1024px", + }, + }, + }, + variants: {}, + plugins: [], +}; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/README.md b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/README.md new file mode 100644 index 00000000000..39fc8cb4ee5 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/README.md @@ -0,0 +1,32 @@ +# digit-ui-libraries + +> Made with @egovernments/create-ui-library + +## Install + +```bash +npm install --save @egovernments/digit-ui-libraries +``` + +## Usage + +```jsx +import React from "react"; +import initLibraries from "@egovernments/digit-ui-libraries"; + +import defaultConfig from "./config"; + +const App = ({ deltaConfig, stateCode, cityCode, moduleCode }) => { + initLibraries(); + + const store = eGov.Services.useStore(defaultConfig, { deltaConfig, stateCode, cityCode, moduleCode }); + + return

Create React Library Example 😄

; +}; + +export default App; +``` + +## License + +MIT © [](https://github.com/) diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/package.json b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/package.json new file mode 100644 index 00000000000..c8f1cf4de7d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/package.json @@ -0,0 +1,50 @@ +{ + "name": "@egovernments/digit-ui-libraries", + "version": "1.8.0-beta", + "main": "dist/index.js", + "module": "dist/index.modern.js", + "source": "src/index.js", + "license": "MIT", + "files": [ + "dist" + ], + "scripts": { + "build": "microbundle-crl --compress --no-sourcemap --format cjs", + "start": "microbundle-crl watch --no-compress --format modern,cjs", + "prepublish": "yarn build" + }, + "peerDependencies": { + "react": "17.0.2" + }, + "devDependencies": { + "gh-pages": "2.2.0", + "microbundle-crl": "0.13.11", + "react-dom": "17.0.2", + "react-scripts": "^4.0.1" + }, + "dependencies": { + "axios": "0.21.1", + "babel-preset-react": "6.24.1", + "date-fns": "2.28.0", + "html2canvas": "1.4.1", + "dom-to-image": "2.6.0", + "i18next": "19.9.2", + "i18next-react-postprocessor": "3.0.7", + "pdfmake": "0.1.72", + "react": "17.0.2", + "react-i18next": "11.16.2", + "react-query": "3.6.1", + "react-redux": "7.2.8", + "react-router-dom": "5.3.0", + "redux": "4.1.2", + "xlsx": "0.17.5" + }, + "author": "JaganKumar ", + "keywords": [ + "digit", + "egov", + "dpg", + "digit-ui", + "libraries" + ] +} diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/config/configUtils.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/config/configUtils.js new file mode 100644 index 00000000000..05df9e7def6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/config/configUtils.js @@ -0,0 +1,46 @@ +export const getSectionInfo = (formId, sectionId, defaultConfigCopy) => { + let sectionInfo; + let fieldToUpdate = { field: "", fields: [] }; + for (let section of defaultConfigCopy) { + sectionInfo = section.form.find((formDetail) => { + return formDetail.id === sectionId; + }); + if (sectionInfo) { + if (sectionInfo.fields) { + for (let field of sectionInfo.fields) { + if (field.id === formId) { + fieldToUpdate.field = field; + fieldToUpdate.fields = sectionInfo.fields; + break; + } else { + if (field.fields) { + for (let innerField of field.fields) { + if (innerField.id === formId) { + fieldToUpdate.field = innerField; + fieldToUpdate.fields = field.fields; + break; + } + } + } + } + } + } + } + } + return fieldToUpdate; +}; + +export const ifObjectContainsArray = (object) => { + if (Array.isArray(object)) { + return { hasArray: true, value: object }; + } + for (const property in object) { + if (object.hasOwnProperty(property)) { + const element = object[property]; + if (Array.isArray(element)) { + return { hasArray: true, value: element }; + } + } + } + return { hasArray: false, value: [] }; +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/config/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/config/index.js new file mode 100644 index 00000000000..2bc6a46fbfc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/config/index.js @@ -0,0 +1,31 @@ +export const getConfig = (ComponentMap, GetFunction, { config, state, repeatClicked, handlesubmit, register, onSubmit }) => { + if (!config || config.length === 0) return []; + return config.map((item) => { + const { component, name, fields, submit, ...props } = item; + return { + ...props, + // submit: submit ? GetFunction(submit) : undefined, + fields: + fields && fields.length > 0 + ? getConfig(ComponentMap, GetFunction, { + config: fields, + state, + repeatClicked, + handlesubmit, + register, + onSubmit, + }) + : null, + name, + value: state[name], + handlesubmit: component === "form" ? handlesubmit : null, + onSubmit: component === "form" ? onSubmit : null, + repeats: component === "form-section-repeat-group" ? state[name + "-repeats"] || 1 : null, + dorepeat: component === "form-section-repeat-group" ? repeatClicked(name) : null, + ref: component === "input-select" || component === "input-field" || component === "city-mohalla" ? register : null, + register: component === "input-select" || component === "input-field" || component === "city-mohalla" ? register : null, + // onChange: component === 'input-field' ? onChange(name) : null, + component: ComponentMap[component], + }; + }); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/config/mergeConfig.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/config/mergeConfig.js new file mode 100644 index 00000000000..60ecf21491d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/config/mergeConfig.js @@ -0,0 +1,157 @@ +// let defaultConfig = require("./default2.json"); +import { ifObjectContainsArray } from "./configUtils"; + +let defaultConfigCopy = {}; +let sectionToBeUpdated = {}; +let currentUpdatableSection = []; +let selectedProperty = ""; + +const MergeConfigObj = (defaultConfig, deltaConfig) => { + defaultConfigCopy = JSON.parse(JSON.stringify(defaultConfig)); + let deltaConfigCopy = JSON.parse(JSON.stringify(deltaConfig)); + processStateConfig(deltaConfigCopy); + return defaultConfigCopy; +}; + +const processStateConfig = (deltaConfig) => { + if (Array.isArray(deltaConfig)) { + deltaConfig.forEach((forms) => { + sectionToBeUpdated = {}; + InitSectionToUpdate(forms); + }); + } +}; + +const InitSectionToUpdate = (forms) => { + if (forms.id && !forms.__property__) { + GetCurrentUpdatableSection(forms.id, defaultConfigCopy); + } + if (forms.__property__ && forms.__action__) { + selectedProperty = forms.__property__; + currentUpdatableSection = currentUpdatableSection.length === 0 ? defaultConfigCopy : currentUpdatableSection; + findSectionById(selectedProperty, currentUpdatableSection); + seachInDefaultConfig(forms.__property__, forms); + } else if (Array.isArray(forms)) { + forms.forEach((form) => { + InitSectionToUpdate(form); + }); + } else if (ifObjectContainsArray(forms).hasArray) { + let array = ifObjectContainsArray(forms).value; + InitSectionToUpdate(array); + } else { + throw new Error("__property__ or __action__ not found"); + } +}; + +const GetCurrentUpdatableSection = (id, defaultConfigCopy) => { + if (Array.isArray(defaultConfigCopy)) { + for (let i = 0; i < defaultConfigCopy.length; i++) { + if (defaultConfigCopy[i].id === id) { + currentUpdatableSection.push(defaultConfigCopy[i]); + } else if (ifObjectContainsArray(defaultConfigCopy[i]).hasArray) { + let array = ifObjectContainsArray(defaultConfigCopy[i]).value; + GetCurrentUpdatableSection(id, array); + } + } + } +}; + +const findSectionById = (id, currentUpdatableSection) => { + if (Array.isArray(currentUpdatableSection)) { + for (let i = 0; i < currentUpdatableSection.length; i++) { + if (currentUpdatableSection[i].id === id) { + sectionToBeUpdated = currentUpdatableSection; + } else if (ifObjectContainsArray(currentUpdatableSection[i]).hasArray) { + let arr = ifObjectContainsArray(currentUpdatableSection[i]).value; + findSectionById(id, arr); + } + } + } + + return sectionToBeUpdated; +}; + +const seachInDefaultConfig = (id, action) => { + if (!Array.isArray(sectionToBeUpdated) && !sectionToBeUpdated.id) { + throw new Error("id not found"); + } + if (sectionToBeUpdated.id === id) { + actionHandler(action, id, sectionToBeUpdated); + } else if (Array.isArray(sectionToBeUpdated)) { + sectionToBeUpdated.forEach((section) => { + if (section.id === id) { + actionHandler(action, id, sectionToBeUpdated); + } + }); + } else if (ifObjectContainsArray(sectionToBeUpdated).hasArray) { + sectionToBeUpdated = ifObjectContainsArray(sectionToBeUpdated).value; + seachInDefaultConfig(id, action); + } +}; + +const actionHandler = (action, id, fieldList) => { + const index = getIndex(id, fieldList); + if (!action) { + return; + } + if (action.__action__ === "UPDATE") { + updateAt(index, action, fieldList); + deleteExtraKeys(action); + } + if (action.__action__ === "DELETE") { + deleteAt(index, fieldList); + deleteExtraKeys(action); + } + if (["INSERT_AFTER", "INSERT_BEFORE"].includes(action.__action__)) { + handleInsertion(index, action, fieldList); + } +}; + +const handleInsertion = (index, action, fields) => { + index = action.__action__ === "INSERT_BEFORE" ? index : index + 1; + insertAt(index, action, fields); + deleteExtraKeys(action); +}; + +const getIndex = (propertyValue, fields) => { + let index = fields.findIndex((option) => option.id === propertyValue); + + return index; +}; + +const insertAt = (index, data, fields) => { + if (!data.id) { + throw new Error("id is required is required to insert a record"); + } + fields.splice(index, 0, data); +}; + +const updateAt = (index, data, fields) => { + if (fields[index].id !== data.id) { + throw new Error(`id ${data.id} not matched`); + } + fields[index] = { ...fields[index], ...data }; +}; + +const deleteAt = (index, fields) => { + fields.splice(index, 1); +}; + +const deleteExtraKeys = (data) => { + delete data.__action__; + delete data.__property__; +}; + +const getMergedConfig = (defaultConfig, deltaConfig) => { + let mergedConfigObj = defaultConfig; + + for (const key in deltaConfig) { + if (deltaConfig.hasOwnProperty(key)) { + const mergedConfig = MergeConfigObj(defaultConfig[key], deltaConfig[key]); + mergedConfigObj[key] = mergedConfig; + } + } + return mergedConfigObj; +}; + +export default getMergedConfig; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/contexts/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/contexts/index.js new file mode 100644 index 00000000000..202c8fd57bf --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/contexts/index.js @@ -0,0 +1,6 @@ +import React from "react"; + +const ComponentProvider = React.createContext(); +const PrivacyProvider = React.createContext({}); + +export default { ComponentProvider ,PrivacyProvider}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/ConfigActionTypes.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/ConfigActionTypes.js new file mode 100644 index 00000000000..f0d76ead434 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/ConfigActionTypes.js @@ -0,0 +1,5 @@ +const ConfigActionTypes = Object.freeze({ + CONFIG_UPDATE: "CONFIG_UPDATE", +}); + +export default ConfigActionTypes; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/FormFields.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/FormFields.js new file mode 100644 index 00000000000..83ba271d1dc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/FormFields.js @@ -0,0 +1,5 @@ +const FormFields = Object.freeze({ + INPUT: "input-fields", +}); + +export default FormFields; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/Pages.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/Pages.js new file mode 100644 index 00000000000..edba2497c27 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/Pages.js @@ -0,0 +1,7 @@ +const Pages = Object.freeze({ + PGR_LIST: "pgr-list", + PGR_NEW_COMPLAINT: "pgr-new-complaint", + PGR_SEARCH: "pgr-search-complaint", +}); + +export default Pages; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/index.js new file mode 100644 index 00000000000..8dbb59fea95 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/enums/index.js @@ -0,0 +1,7 @@ +import Pages from "./Pages"; +import ConfigActionTypes from "./ConfigActionTypes"; +// import FormFields from "./FormFields;" + +const Enums = { Pages, ConfigActionTypes }; + +export default Enums; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDSSDashboard.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDSSDashboard.js new file mode 100644 index 00000000000..0371e5a5cbc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDSSDashboard.js @@ -0,0 +1,8 @@ +import { useQueries } from "react-query"; +import { getDSSDashboardData } from "../../services/molecules/DSS/getDSSDashboardData"; + +const useDSSDashboard = (stateCode, mdmsType, moduleCode, config) => { + return useQueries(getDSSDashboardData(stateCode, mdmsType, moduleCode, config)); +}; + +export default useDSSDashboard; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDashboardConfig.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDashboardConfig.js new file mode 100644 index 00000000000..82ea22ce7bf --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useDashboardConfig.js @@ -0,0 +1,8 @@ +import { useQuery } from "react-query"; +import { DSSService } from "../../services/elements/DSS"; + +const useDashoardConfig = (moduleCode) => { + return useQuery(`DSS_DASHBOARD_CONFIG_${moduleCode}`, () => DSSService.getDashboardConfig(moduleCode)); +}; + +export default useDashoardConfig; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetChart.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetChart.js new file mode 100644 index 00000000000..20d41f3736d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetChart.js @@ -0,0 +1,56 @@ +import { useQuery } from "react-query"; +import { startOfMonth, endOfMonth, getTime } from "date-fns"; +import { DSSService } from "../../services/elements/DSS"; + +const getRequest = (type, code, requestDate, filters, moduleLevel = "", addlFilter) => { + let newFilter = { ...{ ...filters, ...addlFilter } }; + let updatedFilter = Object.keys(newFilter) + .filter((ele) => newFilter[ele].length > 0) + .reduce((acc, curr) => { + acc[curr] = newFilter[curr]; + return acc; + }, {}); + return { + aggregationRequestDto: { + visualizationType: type.toUpperCase(), + visualizationCode: code, + queryType: "", + filters: updatedFilter, + moduleLevel: moduleLevel, + aggregationFactors: null, + requestDate, + }, + }; +}; +const defaultSelect = (data) => { + if (data?.responseData) { + if (data?.responseData?.data) { + data.responseData.data = data?.responseData?.data?.filter((col) => col) || []; + data.responseData.data?.forEach((row) => { + if (row?.plots) { + row.plots = row?.plots.filter((col) => col) || []; + } + }); + } + } + return data; +}; + +const useGetChart = (args) => { + const { key, type, tenantId, requestDate, filters, moduleLevel, addlFilter } = args; + return useQuery( + [args], + () => + DSSService.getCharts({ + ...getRequest(type, key, requestDate, filters, moduleLevel, addlFilter), + headers: { + tenantId, + }, + }), + { + select: defaultSelect, + } + ); +}; + +export default useGetChart; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterRequestValues.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterRequestValues.js new file mode 100644 index 00000000000..2154e446939 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterRequestValues.js @@ -0,0 +1,8 @@ +import { useQuery } from "react-query"; +import { DSSService } from "../../services/elements/DSS"; + +const useGetCustomFilterRequestValues = (filterConfigs, config={}) => { + return useQuery(`DSS_CUSTOM_FILTER_REQUEST_VAL_${JSON.stringify(filterConfigs)}`, () => DSSService.getCustomFiltersDynamicValues(filterConfigs), config); +}; + +export default useGetCustomFilterRequestValues; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterValues.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterValues.js new file mode 100644 index 00000000000..2620c074f93 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useGetCustomFilterValues.js @@ -0,0 +1,8 @@ +import { useQuery } from "react-query"; +import { DSSService } from "../../services/elements/DSS"; + +const useGetCustomFilterValues = (filterConfigs, config={}) => { + return useQuery(`DSS_CUSTOM_FILTER_CONFIG_${JSON.stringify(filterConfigs)}`, () => DSSService.getFiltersConfigData(filterConfigs), config); +}; + +export default useGetCustomFilterValues; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useMDMS.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useMDMS.js new file mode 100644 index 00000000000..2b420c26019 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/dss/useMDMS.js @@ -0,0 +1,20 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../../services/elements/MDMS"; + +const useDssMDMS = (tenantId, moduleCode, type, config) => { + const useDssDashboard = () => { + return useQuery("DSS_DASHBOARD", () => MdmsService.getDssDashboard(tenantId, moduleCode), config); + }; + const _default = () => { + return useQuery([tenantId, moduleCode, type], () => MdmsService.getMultipleTypes(tenantId, moduleCode, type), config); + }; + + switch (type) { + case "DssDashboard": + return useDssDashboard(); + default: + return _default(); + } +}; + +export default useDssMDMS; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useCreate.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useCreate.js new file mode 100644 index 00000000000..998a5f5c844 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useCreate.js @@ -0,0 +1,8 @@ +import { Engagement } from "../../services/elements/Engagement"; +import { useMutation } from "react-query"; + +const useCreateDocument = (filters, config) => { + return useMutation((filters) => Engagement.create(filters)); +}; + +export default useCreateDocument; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useDelete.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useDelete.js new file mode 100644 index 00000000000..31d3d23b329 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useDelete.js @@ -0,0 +1,8 @@ +import { Engagement } from "../../services/elements/Engagement"; +import { useMutation } from "react-query"; + +const useDelteDocument = (filters, config) => { + return useMutation((filters) => Engagement.delete(filters)); +}; + +export default useDelteDocument; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useMdms.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useMdms.js new file mode 100644 index 00000000000..b29de4cd1cb --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useMdms.js @@ -0,0 +1,19 @@ +import { MdmsService, getGeneralCriteria } from "../../services/elements/MDMS"; +import { useQuery } from "react-query"; + +export const useEngagementMDMS = (tenantId, moduleCode, type, config = {}, payload = []) => { + const useDocumentCategory = () => { + return useQuery(type, () => MdmsService.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode), config); + }; + + const _default = () => { + return useQuery([tenantId, moduleCode, type], () => MdmsService.getMultipleTypes(tenantId, moduleCode, type), config); + }; + + switch (type) { + case "DocumentsCategory": + return useDocumentCategory(); + default: + return _default(); + } +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useSearch.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useSearch.js new file mode 100644 index 00000000000..730737b969a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useSearch.js @@ -0,0 +1,8 @@ +import { Engagement } from "../../services/elements/Engagement"; +import { useMutation, useQuery } from "react-query"; + +const useSearch = (filters, config) => { + return useQuery(["search_engagement", filters?.name, filters?.category, filters?.tenantIds, filters?.postedBy, filters?.offset, filters?.limit ], () => Engagement.search(filters), { ...config }); +}; + +export default useSearch; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useUpdate.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useUpdate.js new file mode 100644 index 00000000000..2c081065831 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/engagement/useUpdate.js @@ -0,0 +1,8 @@ +import { Engagement } from "../../services/elements/Engagement"; +import { useMutation } from "react-query"; + +const useUpdateDocument = (filters, config) => { + return useMutation((filters) => Engagement.update(filters)); +}; + +export default useUpdateDocument; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/index.js new file mode 100644 index 00000000000..1c0bb57bae5 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/index.js @@ -0,0 +1,185 @@ +import { useQuery, useMutation } from "react-query"; + +const tsToDate = (ts) => { + const plus0 = num => `0${num.toString()}`.slice(-2) + const d = new Date(ts) + const month = d.toLocaleString("default", {month: 'short'}).toUpperCase() + const date = plus0(d.getDate()) + const hour = plus0(d.getHours()) + const minute = plus0(d.getMinutes()) + + return { + month, + date, + hour, + minute + } +} + +const isEqual = (from, to) => from === to ? from : `${from} - ${to}` + +const timeStampBreakdown = (fromTS, toTS) => { + const fromDateTime = tsToDate(fromTS) + const toDateTime = tsToDate(toTS) + return { + onGroundEventMonth: isEqual(fromDateTime.month, toDateTime.month), + onGroundEventDate: isEqual(fromDateTime.date, toDateTime.date), + onGroundEventTimeRange: `${fromDateTime.hour}:${fromDateTime.minute} - ${toDateTime.hour}:${toDateTime.minute}` + } +} + +const fetchImageLinksFromFilestoreIds = async (filesArray, tenantId) => { + const ids = filesArray?.map(file => file.fileStoreId) + const res = await Digit.UploadServices.Filefetch(ids, tenantId); + if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) { + return res.data.fileStoreIds.map((o, index) => ({ + actionUrl: o.url.split(",")[0], + code: "VIEW_ATTACHMENT" + })); + } else { + return []; + } + }; + +const getTransformedLocale = label => { + if (typeof label === "number") return label; + label=label?.trim(); + return label && label.toUpperCase().replace(/[.:-\s\/]/g, "_"); +}; +const getTimeFormat = (epochTime) => { + epochTime = new Date(epochTime); + const Period = epochTime.getHours() < 12 ? "AM" : "PM"; + const Format = epochTime.getHours() % 12 > 0 ? epochTime.getHours() % 12 : 12; + return Format.toString() + ":" + epochTime.toString().split(":")[1] + " " + Period; + }; + const getDateFormat = (epochTime) => { + const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "June", + "July", "Aug", "Sep", "Oct", "Nov", "Dec" + ]; + epochTime = new Date(epochTime); + const day = epochTime.getDate(); + const Month = epochTime.getMonth(); + return day.toString() + " " + monthNames[Month]; + }; + + +const getEventSLA = (item) => { + const days = (Date.now() - item.auditDetails.lastModifiedTime) / (1000 * 60 * 60 * 24); + let time; + let unit; + if (item.eventType === "EVENTSONGROUND") { + const disp = getDateFormat(item.eventDetails.fromDate) + " " + getTimeFormat(item.eventDetails.fromDate) + "-" + getDateFormat(item.eventDetails.toDate) + " " + getTimeFormat(item.eventDetails.toDate); + time=""; + unit=disp; + } else { + if (days >= 60){ + time=[Math.floor(days / 30)]; + unit="EV_SLA_MONTH"; + } + else if (days >= 30){ + time=[Math.floor(days / 30)]; + unit="EV_SLA_MONTH_ONE"; + } + else if (days >= 14){ + time=[Math.floor(days / 7)]; + unit="EV_SLA_WEEK"; + } + else if (days >= 7) { + time=[Math.floor(days / 7)]; + unit="EV_SLA_WEEK_ONE"; + } + else if (days >= 2){ + time=[Math.floor(days)]; + unit="CS_SLA_DAY"; + } + else if (days >= 1){ + time=[Math.floor(days)]; + unit="EV_SLA_DAY_ONE"; + } + else if ((days % 1) * 24 >= 2) { + time=[Math.floor((days % 1) * 24)]; + unit="EV_SLA_TIME"; + } + else if ((days % 1) * 24 >= 1){ + time=[Math.floor((days % 1) * 24)]; + unit="EV_SLA_TIME_ONE"; + } + else if ((days % 1) * 24 * 60 >= 2) { + time=[Math.floor((days % 1) * 24 * 60)]; + unit="EV_SLA_MINUTE"; + } + else if ((days % 1) * 24 * 60 >= 1) { + time=[Math.floor((days % 1) * 24 * 60)]; + unit="EV_SLA_MINUTE_ONE"; + + } + else{ + time=""; + unit="CS_SLA_NOW"; + } + } + + return { + time,unit + }; + }; + + + +const filterAllEvents = async(data, variant) => { + const filteredEvents = data.filter(e => e.status === "ACTIVE") + const events = [] + for(const e of filteredEvents){ + const actionDownloadLinks = e?.eventDetails?.documents?.length > 0 && e?.tenantId ? await fetchImageLinksFromFilestoreIds(e?.eventDetails?.documents, e?.tenantId) : [] + const slaDetails=getEventSLA(e); + events.push({ + ...e, + timePastAfterEventCreation: slaDetails.time, + timeApproxiamationInUnits: slaDetails.unit, + //todo + eventNotificationText: e?.description, + header: e?.eventType === "SYSTEMGENERATED" ? getTransformedLocale(e?.name) : e?.name, + eventType: e?.eventType, + actions: [...(e?.actions?.actionUrls ? e?.actions?.actionUrls : []), ...actionDownloadLinks], + ...variant === "events" || e?.eventType === "EVENTSONGROUND" ? timeStampBreakdown(e?.eventDetails?.fromDate, e?.eventDetails?.toDate) : {}, + }) + } + return events +} + +const variantBasedFilter = async(variant, data) =>{ + switch(variant){ + case "whats-new": + const allWhatsNewEvents = await filterAllEvents(data.events, variant) + return allWhatsNewEvents.filter( i => i?.actions?.length ) + case "events": + return await filterAllEvents(data.events, variant) + default: + return await filterAllEvents(data.events, variant) + } +} + +const getEventsData = async (variant, tenantId) => { + const isLoggedIn = Digit.UserService.getUser() + const data = await Digit.EventsServices.Search({tenantId, auth: !!isLoggedIn, ...variant === "events" ? {filter: {eventTypes: "EVENTSONGROUND"}} : {} }) + const allEventsData = await variantBasedFilter(variant, data) + return allEventsData +} + +const useEvents = ({tenantId, variant, config={}}) => useQuery( + ["EVENTS_SEARCH", tenantId, variant], + () => getEventsData(variant, tenantId), + { + ...config + } ) + +const useClearNotifications = () => useMutation(({tenantId}) => Digit.EventsServices.ClearNotification({tenantId})) + +const useNotificationCount = ({tenantId, config={}}) => useQuery( + ["NOTIFICATION_COUNT", tenantId], + () => Digit.EventsServices.NotificationCount({tenantId}), + { + ...config + }) + +export { useEvents, useClearNotifications, useNotificationCount } \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useCreateEvent.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useCreateEvent.js new file mode 100644 index 00000000000..9ba375f166e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useCreateEvent.js @@ -0,0 +1,7 @@ +import { useMutation } from "react-query"; + +const useCreateEvent = () => { + return useMutation(eventData => Digit.EventsServices.Create(eventData)) +} + +export default useCreateEvent; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventDetails.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventDetails.js new file mode 100644 index 00000000000..c1043ce0db1 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventDetails.js @@ -0,0 +1,44 @@ +import { useQuery } from 'react-query'; +import { format } from "date-fns"; + +const useEventDetails = (tenantId, filters, config = {}) => { + return useQuery( + ['EVENT_DETAILS', tenantId, filters], + () => Digit.EventsServices.EventDetails(tenantId, filters), + { + select: (data) => { + const details = [{ + title:" ", + asSectionHeader: true, + values: [ + { title: "EVENTS_ULB_LABEL", value: data?.tenantId }, + { title: "EVENTS_NAME_LABEL", value: data?.name }, + { title: "EVENTS_CATEGORY_LABEL", value: data?.eventCategory }, + { title: "EVENTS_DESCRIPTION_LABEL", value: data?.description }, + { title: "EVENTS_FROM_DATE_LABEL", value: format(new Date(data?.eventDetails?.fromDate), 'dd/MM/yyyy') }, + { title: "EVENTS_TO_DATE_LABEL", value: format(new Date(data?.eventDetails?.toDate), 'dd/MM/yyyy') }, + { title: "EVENTS_FROM_TIME_LABEL", value: format(new Date(data?.eventDetails?.fromDate), 'hh:mm'), skip: true }, + { title: "EVENTS_TO_TIME_LABEL", value: format(new Date(data?.eventDetails?.toDate), 'hh:mm'), skip: true }, + { title: "EVENTS_ADDRESS_LABEL", value: data?.eventDetails?.address }, + { title: "EVENTS_MAP_LABEL", + map: true, + value: data?.eventDetails?.latitude && data?.eventDetails?.longitude ? + Digit.Utils.getStaticMapUrl(data?.eventDetails?.latitude, data?.eventDetails?.longitude) : + 'N/A' + }, + { title: "EVENTS_ORGANIZER_NAME_LABEL", value: data?.eventDetails?.organizer }, + { title: "EVENTS_ENTRY_FEE_INR_LABEL", value: data?.eventDetails?.fees }, + ] + }] + return { + applicationData: data, + applicationDetails: details, + tenantId: tenantId + } + }, + ...config + } + ) +} + +export default useEventDetails; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventInbox.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventInbox.js new file mode 100644 index 00000000000..826e342075c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useEventInbox.js @@ -0,0 +1,23 @@ +import { useQuery } from "react-query" + +const combineResponse = (data, users) => { + data.events = data?.events?.map(event => { + const user = users.find(user => user.uuid === event?.auditDetails?.lastModifiedBy) + return { ...event, user } + }); + return data; +} + + +const useInbox = (tenantId, data, filter = {}, config = {}) => { + return useQuery(["EVENT_INBOX", tenantId, data, filter], async () => { + const eventData = await Digit.EventsServices.Search({ tenantId, data, filter }); + const uuids = [] + eventData?.events?.forEach(event => uuids.push(event?.auditDetails?.lastModifiedBy)); + const usersResponse = await Digit.UserService.userSearch(null, { uuid: uuids }, {}); + return combineResponse(eventData, usersResponse?.user); + }, + config); +} + +export default useInbox; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useUpdateEvent.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useUpdateEvent.js new file mode 100644 index 00000000000..77ddb893464 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/events/useUpdateEvent.js @@ -0,0 +1,7 @@ +import { useMutation } from "react-query"; + +const useUpdateEvent = () => { + return useMutation(eventData => Digit.EventsServices.Update(eventData)) +} + +export default useUpdateEvent; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSCount.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSCount.js new file mode 100644 index 00000000000..50b63dadb63 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSCount.js @@ -0,0 +1,8 @@ +import { useQuery, useQueryClient } from "react-query"; +import HrmsService from "../../services/elements/HRMS"; + +export const useHRMSCount = (tenantId, config = {}) => { + return useQuery(["HRMS_COUNT", tenantId], () => HrmsService.count(tenantId), config); +}; + +export default useHRMSCount; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGender.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGender.js new file mode 100644 index 00000000000..7d7e97b0fbf --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGender.js @@ -0,0 +1,18 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../../services/elements/MDMS"; + +const useHRMSGenderMDMS = (tenantId, moduleCode, type, config = {}) => { + const useHRGenders = () => { + return useQuery("HR_GENDER_DETAILS", () => MdmsService.HRGenderType(tenantId, moduleCode ,type), config); + }; + + + switch (type) { + case "GenderType": + return useHRGenders(); + } +}; + + + +export default useHRMSGenderMDMS; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGenderMDMS.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGenderMDMS.js new file mode 100644 index 00000000000..7d7e97b0fbf --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSGenderMDMS.js @@ -0,0 +1,18 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../../services/elements/MDMS"; + +const useHRMSGenderMDMS = (tenantId, moduleCode, type, config = {}) => { + const useHRGenders = () => { + return useQuery("HR_GENDER_DETAILS", () => MdmsService.HRGenderType(tenantId, moduleCode ,type), config); + }; + + + switch (type) { + case "GenderType": + return useHRGenders(); + } +}; + + + +export default useHRMSGenderMDMS; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSMDMS.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSMDMS.js new file mode 100644 index 00000000000..6616cbe0889 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSMDMS.js @@ -0,0 +1,25 @@ +import { MdmsService } from "../../services/elements/MDMS"; +import { useQuery } from "react-query"; + +const useHrmsMDMS = (tenantId, moduleCode, type, config = {}) => { + const useHrmsRolesandDesignations = () => { + return useQuery(["HRMS_EMP_RD", tenantId], () => MdmsService.getHrmsEmployeeRolesandDesignation(tenantId), config); + }; + const useHrmsEmployeeTypes = () => { + return useQuery(["HRMS_EMP_TYPE", tenantId], () => MdmsService.getHrmsEmployeeTypes(tenantId, moduleCode, type), config); + }; + + const useHrmsEmployeeReasons = () => { + return useQuery(["HRMS_EMP_REASON", tenantId], () => MdmsService.getHrmsEmployeeReason(tenantId, moduleCode, type), config); + }; + + switch (type) { + case "HRMSRolesandDesignation": + return useHrmsRolesandDesignations(); + case "EmployeeType": + return useHrmsEmployeeTypes(); + case "DeactivationReason": + return useHrmsEmployeeReasons(); + } +}; +export default useHrmsMDMS; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSUpdate.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSUpdate.js new file mode 100644 index 00000000000..509462726b8 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSUpdate.js @@ -0,0 +1,8 @@ +import { useQuery, useMutation } from "react-query"; +import HrmsService from "../../services/elements/HRMS"; + +export const useHRMSUpdate = (tenantId, config = {}) => { + return useMutation((data) => HrmsService.update(data, tenantId)); +}; + +export default useHRMSUpdate; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMScreate.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMScreate.js new file mode 100644 index 00000000000..85d0af95e90 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMScreate.js @@ -0,0 +1,8 @@ +import { useQuery, useMutation } from "react-query"; +import HrmsService from "../../services/elements/HRMS"; + +export const useHRMSCreate = (tenantId, config = {}) => { + return useMutation((data) => HrmsService.create(data, tenantId)); +}; + +export default useHRMSCreate; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSsearch.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSsearch.js new file mode 100644 index 00000000000..77822d3a731 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/hrms/useHRMSsearch.js @@ -0,0 +1,8 @@ +import { useQuery, useQueryClient } from "react-query"; +import HrmsService from "../../services/elements/HRMS"; + +export const useHRMSSearch = (searchparams, tenantId, filters, isupdated, config = {}) => { + return useQuery(["HRMS_SEARCH", searchparams, tenantId, filters, isupdated], () => HrmsService.search(tenantId, filters, searchparams), config); +}; + +export default useHRMSSearch; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js new file mode 100644 index 00000000000..49c902d937b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/index.js @@ -0,0 +1,216 @@ +import { useClearNotifications, useEvents, useNotificationCount } from "./events"; +import useCreateEvent from "./events/useCreateEvent"; +import useUpdateEvent from "./events/useUpdateEvent"; +import { + useBulkPdfDetails, useDemandSearch, useFetchBillsForBuissnessService, useFetchCitizenBillsForBuissnessService, useFetchPayment, useGetPaymentRulesForBusinessServices, usePaymentSearch, usePaymentUpdate, useRecieptSearch +} from "./payment"; +import { useInitStore } from "./store"; +import useAccessControl from "./useAccessControl"; +import { useApplicationsForBusinessServiceSearch } from "./useApplicationForBillSearch"; +import useClickOutside from "./useClickOutside"; +import useCustomMDMS from "./useCustomMDMS"; +import useDocumentSearch from "./useDocumentSearch"; +import useDynamicData from "./useDynamicData"; +import useLocation from "./useLocation"; + +import useInboxGeneral from "./useInboxGeneral/useInboxGeneral"; +import useNewInboxGeneral from "./useInboxGeneral/useNewInbox"; +import useBoundaryLocalities from "./useLocalities"; +import useCommonMDMS from "./useMDMS"; +import useWorkflowDetailsV2 from "./useWorkflowDetailsV2"; +import useModuleTenants from "./useModuleTenants"; +import useQueryParams from "./useQueryParams"; +import useRouteSubscription from "./useRouteSubscription"; +import { useUserSearch } from "./userSearch"; +import useSessionStorage from "./useSessionStorage"; +import useApplicationStatusGeneral from "./useStatusGeneral"; +import useStore from "./useStore"; +import { useTenants } from "./useTenants"; +import useWorkflowDetails from "./workflow"; +import useCustomAPIHook from "./useCustomAPIHook"; +import useCustomAPIMutationHook from "./useCustomAPIMutationHook"; +import useUpdateCustom from "./useUpdateCustom"; + + +import useComplaintDetails from "./pgr/useComplaintDetails"; +import { useComplaintsList, useComplaintsListByMobile } from "./pgr/useComplaintList"; +import useComplaintStatus from "./pgr/useComplaintStatus"; +import useComplaintStatusCount from "./pgr/useComplaintStatusWithCount"; +import useComplaintSubType from "./pgr/useComplaintSubType"; +import useComplaintTable from "./pgr/useComplaintTable"; +import useComplaintTypes from "./pgr/useComplaintTypes"; +import useEmployeeFilter from "./pgr/useEmployeeFilter"; +import useInboxData from "./pgr/useInboxData"; +import useLocalities from "./pgr/useLocalities"; +import useServiceDefs from "./pgr/useServiceDefs"; +import usePGRTenants from "./pgr/useTenants"; +import useGenderMDMS from "./useGenderMDMS"; + +import useEmployeeSearch from "./useEmployeeSearch"; + +import useDashboardConfig from "./dss/useDashboardConfig"; +import useDSSDashboard from "./dss/useDSSDashboard"; +import useGetChart from "./dss/useGetChart"; +import useDssMdms from "./dss/useMDMS"; +import useGetCustomFilterValues from "./dss/useGetCustomFilterValues"; +import useGetCustomFilterRequestValues from './dss/useGetCustomFilterRequestValues'; + + +import useHRMSCount from "./hrms/useHRMSCount"; +import useHRMSCreate from "./hrms/useHRMScreate"; +import useHRMSGenderMDMS from "./hrms/useHRMSGender"; +import useHrmsMDMS from "./hrms/useHRMSMDMS"; +import useHRMSSearch from "./hrms/useHRMSsearch"; +import useHRMSUpdate from "./hrms/useHRMSUpdate"; + + + +import useDocCreate from "./engagement/useCreate"; +import useDocDelete from "./engagement/useDelete"; +import { useEngagementMDMS } from "./engagement/useMdms"; +import useDocSearch from "./engagement/useSearch"; +import useDocUpdate from "./engagement/useUpdate"; +import useEventDetails from "./events/useEventDetails"; +import useEventInbox from "./events/useEventInbox"; + +import useSurveyCreate from "./surveys/useCreate"; +import useSurveyDelete from "./surveys/useDelete"; +import useSurveySearch from "./surveys/useSearch"; +import useSurveyShowResults from "./surveys/useShowResults"; +import useSurveySubmitResponse from "./surveys/useSubmitResponse"; +import useSurveyInbox from "./surveys/useSurveyInbox"; +import useSurveyUpdate from "./surveys/useUpdate"; + + + +import useGetDSSAboutJSON from "./useGetDSSAboutJSON"; +import useGetDSSFAQsJSON from "./useGetDSSFAQsJSON"; +import useGetFAQsJSON from "./useGetFAQsJSON"; +import useGetHowItWorksJSON from "./useHowItWorksJSON"; +import { usePrivacyContext } from "./usePrivacyContext"; +import useStaticData from "./useStaticData"; + + + +const pgr = { + useComplaintDetails, + useComplaintsList, + useComplaintsListByMobile, + useComplaintStatus, + useComplaintTable, + useComplaintTypes, + useEmployeeFilter, + useInboxData, + useLocalities, + useServiceDefs, + useTenants: usePGRTenants, + useComplaintSubType, + useComplaintStatusCount, +}; + + +const dss = { + useMDMS: useDssMdms, + useDashboardConfig, + useDSSDashboard, + useGetChart, + useGetCustomFilterValues, + useGetCustomFilterRequestValues +}; + + +const hrms = { + useHRMSSearch, + useHrmsMDMS, + useHRMSCreate, + useHRMSUpdate, + useHRMSCount, + useHRMSGenderMDMS, +}; + + + + +const events = { + useInbox: useEventInbox, + useCreateEvent, + useEventDetails, + useUpdateEvent, +}; + +const engagement = { + useMDMS: useEngagementMDMS, + useDocCreate, + useDocSearch, + useDocDelete, + useDocUpdate, +}; + +const survey = { + useCreate: useSurveyCreate, + useUpdate: useSurveyUpdate, + useDelete: useSurveyDelete, + useSearch: useSurveySearch, + useSubmitResponse: useSurveySubmitResponse, + useShowResults: useSurveyShowResults, + useSurveyInbox, +}; + +const Hooks = { + useSessionStorage, + useQueryParams, + useFetchPayment, + usePaymentUpdate, + useFetchCitizenBillsForBuissnessService, + useFetchBillsForBuissnessService, + useGetPaymentRulesForBusinessServices, + useWorkflowDetails, + useInitStore, + useClickOutside, + useUserSearch, + useApplicationsForBusinessServiceSearch, + useDemandSearch, + useInboxGeneral, + useEmployeeSearch, + useBoundaryLocalities, + useCommonMDMS, + useApplicationStatusGeneral, + useModuleTenants, + useRecieptSearch, + usePaymentSearch, + useNewInboxGeneral, + useEvents, + useClearNotifications, + useNotificationCount, + useStore, + useDocumentSearch, + useTenants, + useAccessControl, + usePrivacyContext, + pgr, + + dss, + + hrms, + + events, + engagement, + survey, + useGenderMDMS, + useRouteSubscription, + useCustomAPIHook, + useCustomAPIMutationHook, + useWorkflowDetailsV2, + useUpdateCustom, + useCustomMDMS, + useGetHowItWorksJSON, + useGetFAQsJSON, + useGetDSSFAQsJSON, + useGetDSSAboutJSON, + useStaticData, + useDynamicData, + useBulkPdfDetails, + useLocation +}; + +export default Hooks; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/payment.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/payment.js new file mode 100644 index 00000000000..255ac45ff95 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/payment.js @@ -0,0 +1,160 @@ +import { useQuery, useQueryClient } from "react-query"; +import { PaymentService } from "../services/elements/Payment"; + +export const useFetchCitizenBillsForBuissnessService = ({ businessService, ...filters }, config = {}) => { + const queryClient = useQueryClient(); + const { mobileNumber, tenantId } = Digit.UserService.getUser()?.info || {}; + const params = { mobileNumber, businessService, ...filters }; + if (!params["mobileNumber"]) delete params["mobileNumber"]; + const { isLoading, error, isError, data, status } = useQuery( + ["citizenBillsForBuisnessService", businessService, { ...params }], + () => Digit.PaymentService.fetchBill(tenantId, { ...params }), + { + refetchOnMount: true, + retry: false, + ...config, + } + ); + return { + isLoading, + error, + isError, + data, + status, + revalidate: () => queryClient.invalidateQueries(["citizenBillsForBuisnessService", businessService]), + }; +}; + +export const useFetchBillsForBuissnessService = ({ tenantId, businessService, ...filters }, config = {}) => { + const queryClient = useQueryClient(); + let isPTAccessDone = sessionStorage.getItem("IsPTAccessDone"); + const params = { businessService, ...filters }; + const _tenantId = tenantId || Digit.UserService.getUser()?.info?.tenantId; + const { isLoading, error, isError, data, status } = useQuery( + ["billsForBuisnessService", businessService, { ...filters }, config, isPTAccessDone], + () => Digit.PaymentService.fetchBill(_tenantId, params), + { + retry: (count, err) => { + return false; + }, + ...config, + } + ); + return { + isLoading, + error, + isError, + data, + status, + revalidate: () => queryClient.invalidateQueries(["billsForBuisnessService", businessService]), + }; +}; + +export const useFetchPayment = ({ tenantId, consumerCode, businessService }, config) => { + const queryClient = useQueryClient(); + + const fetchBill = async () => { + /* Currently enabled the logic to get bill no and expiry date for PT Module */ + if (businessService?.includes("PT") || businessService?.includes("SW") || businessService?.includes("WS")) { + const fetchedBill = await Digit.PaymentService.fetchBill(tenantId, { consumerCode, businessService }); + const billdetail = fetchedBill?.Bill?.[0]?.billDetails?.sort((a, b) => b.fromPeriod - a.fromPeriod)?.[0] || {}; + fetchedBill.Bill[0].billDetails = fetchedBill?.Bill[0]?.billDetails?.map((ele) => ({ + ...ele, + currentBillNo: fetchedBill?.Bill?.[0]?.billNumber, + currentExpiryDate: billdetail?.expiryDate, + })); + if (fetchedBill && fetchedBill?.Bill?.[0]?.billDetails?.length > 1) { + fetchedBill?.Bill?.[0]?.billDetails?.map(async (billdet) => { + const searchBill = await Digit.PaymentService.searchBill(tenantId, { + consumerCode, + fromPeriod: billdet?.fromPeriod, + toPeriod: billdet?.toPeriod, + service: businessService, + retrieveOldest: true, + }); + billdet.expiryDate = searchBill?.Bill?.[0]?.billDetails?.[0]?.expiryDate; + billdet.billNumber = searchBill?.Bill?.[0]?.billNumber; + }); + } + return fetchedBill; + } else { + return Digit.PaymentService.fetchBill(tenantId, { consumerCode, businessService }); + } + }; + + const retry = (failureCount, error) => { + if (error?.response?.data?.Errors?.[0]?.code === "EG_BS_BILL_NO_DEMANDS_FOUND") return false; + else return failureCount < 3; + }; + + const queryData = useQuery(["paymentFetchDetails", tenantId, consumerCode, businessService], () => fetchBill(), { retry, ...config }); + + return { + ...queryData, + revalidate: () => queryClient.invalidateQueries(["paymentFetchDetails", tenantId, consumerCode, businessService]), + }; +}; + +export const usePaymentUpdate = ({ egId }, businessService, config) => { + const getPaymentData = async (egId) => { + const transaction = await Digit.PaymentService.updateCitizenReciept(egId); + const payments = await Digit.PaymentService.getReciept(transaction.Transaction[0].tenantId, businessService, { + consumerCodes: transaction.Transaction[0].consumerCode, + }); + return { payments, applicationNo: transaction.Transaction[0].consumerCode, txnStatus: transaction.Transaction[0].txnStatus }; + }; + + return useQuery(["paymentUpdate", egId], () => getPaymentData(egId), config); +}; + +export const useGetPaymentRulesForBusinessServices = (tenantId) => { + return useQuery(["getPaymentRules", tenantId], () => Digit.MDMSService.getPaymentRules(tenantId)); +}; + +export const usePaymentSearch = (tenantId, filters, config = {}) => { + return useQuery(["PAYMENT_SERACH", tenantId], () => Digit.PaymentService.searchBill(tenantId, filters), { + select: (data) => { + return data?.Bill?.[0]?.billDetails?.[0]?.billAccountDetails.filter((e) => { + switch (e.taxHeadCode) { + case "WS_CHARGE": + case "WS_TIME_PENALTY": + case "WS_TIME_INTEREST": + case "SW_TIME_INTEREST": + case "SW_TIME_PENALTY": + case "SW_CHARGE": + case "WS_WATER_CESS": + case "WS_TIME_ADHOC_PENALTY": + case "WS_TIME_ADHOC_REBATE": + case "SW_TIME_ADHOC_PENALTY": + case "SW_TIME_ADHOC_REBATE": + return true; + default: + return false; + } + }); + }, + ...config, + }); +}; + +export const useDemandSearch = ({ consumerCode, businessService, tenantId }, config = {}) => { + if (!tenantId) tenantId = Digit.ULBService.getCurrentTenantId(); + const queryFn = () => Digit.PaymentService.demandSearch(tenantId, consumerCode, businessService); + const queryData = useQuery(["demand_search", { consumerCode, businessService, tenantId }], queryFn, { refetchOnMount: "always", ...config }); + return queryData; +}; + +export const useRecieptSearch = ({ tenantId, businessService, ...params }, config = {}) => { + return useQuery( + ["reciept_search", { tenantId, businessService, params },config], + () => Digit.PaymentService.recieptSearch(tenantId, businessService, params), + { + refetchOnMount: false, + ...config, + } + ); +}; + +export const useBulkPdfDetails = ({ filters }) => { + return useQuery(["BULK_PDF_DETAILS", filters], async () => await PaymentService.getBulkPdfRecordsDetails(filters)); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintDetails.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintDetails.js new file mode 100644 index 00000000000..ee40baaf459 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintDetails.js @@ -0,0 +1,76 @@ +import { useQuery, useQueryClient } from "react-query"; + +// TODO: move to service +const getThumbnails = async (ids, tenantId) => { + const res = await Digit.UploadServices.Filefetch(ids, tenantId); + if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) { + return { thumbs: res.data.fileStoreIds.map((o) => o.url.split(",")[3]), images: res.data.fileStoreIds.map((o) => Digit.Utils.getFileUrl(o.url)) }; + } else { + return null; + } +}; + +const getDetailsRow = ({ id, service, complaintType }) => ({ + CS_COMPLAINT_DETAILS_COMPLAINT_NO: id, + CS_COMPLAINT_DETAILS_APPLICATION_STATUS: `CS_COMMON_${service.applicationStatus}`, + CS_ADDCOMPLAINT_COMPLAINT_TYPE: complaintType === "" ? `SERVICEDEFS.OTHERS` : `SERVICEDEFS.${complaintType}`, + CS_ADDCOMPLAINT_COMPLAINT_SUB_TYPE: `SERVICEDEFS.${service.serviceCode.toUpperCase()}`, + CS_COMPLAINT_ADDTIONAL_DETAILS: service.description, + CS_COMPLAINT_FILED_DATE: Digit.DateUtils.ConvertTimestampToDate(service.auditDetails.createdTime), + ES_CREATECOMPLAINT_ADDRESS: [ + service.address.landmark, + Digit.Utils.locale.getLocalityCode(service.address.locality, service.tenantId), + service.address.city, + service.address.pincode, + ], +}); + +const isEmptyOrNull = (obj) => obj === undefined || obj === null || Object.keys(obj).length === 0; + +const transformDetails = ({ id, service, workflow, thumbnails, complaintType }) => { + const { Customizations, SessionStorage } = window.Digit; + const role = (SessionStorage.get("user_type") || "CITIZEN").toUpperCase(); + const customDetails = Customizations?.PGR?.getComplaintDetailsTableRows + ? Customizations.PGR.getComplaintDetailsTableRows({ id, service, role }) + : {}; + return { + details: !isEmptyOrNull(customDetails) ? customDetails : getDetailsRow({ id, service, complaintType }), + thumbnails: thumbnails?.thumbs, + images: thumbnails?.images, + workflow: workflow, + service, + audit: { + citizen: service.citizen, + details: service.auditDetails, + source: service.source, + rating: service.rating, + serviceCode: service.serviceCode, + }, + service: service, + }; +}; + +const fetchComplaintDetails = async (tenantId, id) => { + var serviceDefs = await Digit.MDMSService.getServiceDefs(tenantId, "PGR"); + const { service, workflow } = (await Digit.PGRService.search(tenantId, { serviceRequestId: id })).ServiceWrappers[0] || {}; + Digit.SessionStorage.set("complaintDetails", { service, workflow }); + if (service && workflow && serviceDefs) { + const complaintType = serviceDefs.filter((def) => def.serviceCode === service.serviceCode)[0].menuPath.toUpperCase(); + const ids = workflow.verificationDocuments + ? workflow.verificationDocuments.filter((doc) => doc.documentType === "PHOTO").map((photo) => photo.fileStoreId || photo.id) + : null; + const thumbnails = ids ? await getThumbnails(ids, service.tenantId) : null; + const details = transformDetails({ id, service, workflow, thumbnails, complaintType }); + return details; + } else { + return {}; + } +}; + +const useComplaintDetails = ({ tenantId, id }) => { + const queryClient = useQueryClient(); + const { isLoading, error, data } = useQuery(["complaintDetails", tenantId, id], () => fetchComplaintDetails(tenantId, id)); + return { isLoading, error, complaintDetails: data, revalidate: () => queryClient.invalidateQueries(["complaintDetails", tenantId, id]) }; +}; + +export default useComplaintDetails; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintList.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintList.js new file mode 100644 index 00000000000..33f3a5c23bb --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintList.js @@ -0,0 +1,12 @@ +import { useQuery, useQueryClient } from "react-query"; + +export const useComplaintsList = (tenantId, filters) => { + // TODO: move city to state + const client = useQueryClient(); + const { isLoading, error, data } = useQuery(["complaintsList", filters], () => Digit.PGRService.search(tenantId, filters), {}); + return { isLoading, error, data, revalidate: () => client.invalidateQueries(["complaintsList", filters]) }; +}; + +export const useComplaintsListByMobile = (tenantId, mobileNumber) => { + return useComplaintsList(tenantId, { mobileNumber }); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatus.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatus.js new file mode 100644 index 00000000000..f75ec847554 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatus.js @@ -0,0 +1,31 @@ +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; + +const useComplaintStatus = () => { + const { t } = useTranslation(); + const [complaintStatus, setComplaintStatus] = useState([]); + const tenantId = Digit.ULBService.getCurrentTenantId(); + + useEffect(() => { + let WorkflowService = null; + // const user = Digit.UserService.getUser(); + // const tenantId = user?.info?.tenantId; + (async () => { + // let stateCode = + // Digit.SessionStorage.get("userType") == "employee" + // ? Digit.SessionStorage.get("Employee.tenantId") + // : Digit.SessionStorage.get("Citizen.tenantId"); + WorkflowService = await Digit.WorkflowService.init(tenantId, "PGR"); + let applicationStatus = WorkflowService.BusinessServices[0].states + .filter((state) => state.applicationStatus) + .map((state) => ({ + name: t(`CS_COMMON_${state.applicationStatus}`), + code: state.applicationStatus, + })); + setComplaintStatus(applicationStatus); + })(); + }, [t, tenantId]); + + return complaintStatus; +}; +export default useComplaintStatus; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatusWithCount.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatusWithCount.js new file mode 100644 index 00000000000..c2337fcf21f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintStatusWithCount.js @@ -0,0 +1,27 @@ +import { useEffect, useState } from "react"; +import useComplaintStatus from "./useComplaintStatus"; + +const useComplaintStatusCount = (complaints) => { + const [complaintStatusWithCount, setcomplaintStatusWithCount] = useState([]); + let complaintStatus = useComplaintStatus(); + let tenantId = Digit.ULBService.getCurrentTenantId(); + + const getCount = async (value) => { + let response = await Digit.PGRService.count(tenantId, { applicationStatus: value }); + return response?.count || ""; + }; + + useEffect(() => { + let getStatusWithCount = async () => { + let statusWithCount = complaintStatus.map(async (status) => ({ + ...status, + count: await getCount(status.code), + })); + setcomplaintStatusWithCount(await Promise.all(statusWithCount)); + }; + getStatusWithCount(); + }, [complaints, complaintStatus]); + return complaintStatusWithCount; +}; + +export default useComplaintStatusCount; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js new file mode 100644 index 00000000000..6aa59a02340 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js @@ -0,0 +1,18 @@ +import React, { useEffect, useState } from "react"; + +const useComplaintSubType = (complaintType, t) => { + const [subTypeMenu, setSubTypeMenu] = useState([]); + + useEffect(() => { + (async () => { + if (complaintType) { + const menu = await Digit.GetServiceDefinitions.getSubMenu(Digit.ULBService.getCurrentTenantId(), complaintType, t); + setSubTypeMenu(menu); + } + })(); + }, [complaintType]); + + return subTypeMenu; +}; + +export default useComplaintSubType; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTable.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTable.js new file mode 100644 index 00000000000..9716bb3415b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTable.js @@ -0,0 +1,23 @@ +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; + +const useComplaintTable = ({ data }) => { + const { t } = useTranslation(); + const [details, setDetails] = useState([]); + + useEffect(() => { + const details = { + CS_COMPLAINT_DETAILS_COMPLAINT_NO: data.serviceRequestId, + CS_COMPLAINT_DETAILS_COMPLAINT_SUBTYPE: t(data.complaintSubType), + CS_COMPLAINT_DETAILS_APPLICATION_STATUS: data.applicationStatus, + CS_COMPLAINT_DETAILS_LOCALITY: t(data.locality), + CS_COMPLAINT_DETAILS_TASK_OWNER: "task owner", + CS_COMPLAINT_SLA_REMAINING: "", + }; + setDetails(details); + }, []); + + return details; +}; + +export default useComplaintTable; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTypes.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTypes.js new file mode 100644 index 00000000000..6110a9549d7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintTypes.js @@ -0,0 +1,20 @@ +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; + +const useComplaintTypes = ({ stateCode }) => { + const [complaintTypes, setComplaintTypes] = useState(null); + const { t } = useTranslation(); + + useEffect(() => { + (async () => { + const res = await Digit.GetServiceDefinitions.getMenu(stateCode, t); + let menu = res.filter((o) => o.key !== ""); + menu.push({ key: "Others", name: t("SERVICEDEFS.OTHERS") }); + setComplaintTypes(menu); + })(); + }, [t, stateCode]); + + return complaintTypes; +}; + +export default useComplaintTypes; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useEmployeeFilter.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useEmployeeFilter.js new file mode 100644 index 00000000000..8249a076645 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useEmployeeFilter.js @@ -0,0 +1,35 @@ +import React, { useState, useEffect } from "react"; +import { useTranslation } from "react-i18next"; + +const useEmployeeFilter = (tenantId, roles, complaintDetails) => { + const [employeeDetails, setEmployeeDetails] = useState(null); + const { t } = useTranslation(); + useEffect(() => { + (async () => { + // const _roles = roles.join(","); + const searchResponse = await Digit.PGRService.employeeSearch(tenantId, roles); + + const serviceDefs = await Digit.MDMSService.getServiceDefs(tenantId, "PGR"); + const serviceCode = complaintDetails.service.serviceCode; + const service = serviceDefs?.find((def) => def.serviceCode === serviceCode); + const department = service?.department; + const employees = searchResponse.Employees.filter((employee) => + employee.assignments.map((assignment) => assignment.department).includes(department) + ); + + //emplpoyess data sholld only conatin name uuid dept + setEmployeeDetails([ + { + department: t(`COMMON_MASTERS_DEPARTMENT_${department}`), + employees: employees.map((employee) => { + return { uuid: employee.user.uuid, name: employee.user.name }; + }), + }, + ]); + })(); + }, [tenantId, roles, t, complaintDetails]); + + return employeeDetails; +}; + +export default useEmployeeFilter; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useInboxData.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useInboxData.js new file mode 100644 index 00000000000..c07c024b46b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useInboxData.js @@ -0,0 +1,61 @@ +import { useQuery, useQueryClient } from "react-query"; + +const useInboxData = (searchParams) => { + const client = useQueryClient(); + // const [complaintList, setcomplaintList] = useState([]); + // const user = Digit.UserService.getUser(); + // const tenantId = user?.info?.tenantId; + + + const fetchInboxData = async () => { + const tenantId = Digit.ULBService.getCurrentTenantId(); + let serviceIds = []; + let commonFilters = { start: 1, end: 10 }; + const { limit, offset } = searchParams; + let appFilters = { ...commonFilters, ...searchParams.filters.pgrQuery, ...searchParams.search, limit, offset }; + let wfFilters = { ...commonFilters, ...searchParams.filters.wfQuery }; + let complaintDetailsResponse = null; + let combinedRes = []; + complaintDetailsResponse = await Digit.PGRService.search(tenantId, appFilters); + complaintDetailsResponse.ServiceWrappers.forEach((service) => serviceIds.push(service.service.serviceRequestId)); + const serviceIdParams = serviceIds.join(); + const workflowInstances = await Digit.WorkflowService.getByBusinessId(tenantId, serviceIdParams, wfFilters, false); + if (workflowInstances.ProcessInstances.length) { + combinedRes = combineResponses(complaintDetailsResponse, workflowInstances).map((data) => ({ + ...data, + sla: Math.round(data.sla / (24 * 60 * 60 * 1000)), + })); + } + return combinedRes; + }; + + const result = useQuery(["fetchInboxData", + ...Object.keys(searchParams).map(i => + typeof searchParams[i] === "object" ? Object.keys(searchParams[i]).map(e => searchParams[i][e]) : searchParams[i] + )], + fetchInboxData, + { staleTime: Infinity } + ); + return { ...result, revalidate: () => client.refetchQueries(["fetchInboxData"]) }; +}; + +const mapWfBybusinessId = (wfs) => { + return wfs.reduce((object, item) => { + return { ...object, [item["businessId"]]: item }; + }, {}); +}; + +const combineResponses = (complaintDetailsResponse, workflowInstances) => { + let wfMap = mapWfBybusinessId(workflowInstances.ProcessInstances); + return complaintDetailsResponse.ServiceWrappers.map((complaint) => ({ + serviceRequestId: complaint.service.serviceRequestId, + complaintSubType: complaint.service.serviceCode, + locality: complaint.service.address.locality.code, + status: complaint.service.applicationStatus, + taskOwner: wfMap[complaint.service.serviceRequestId]?.assignes?.[0]?.name || "-", + sla: wfMap[complaint.service.serviceRequestId]?.businesssServiceSla, + tenantId: complaint.service.tenantId, + })); +}; + +export default useInboxData; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useLocalities.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useLocalities.js new file mode 100644 index 00000000000..560f0823fe8 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useLocalities.js @@ -0,0 +1,34 @@ +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; + +const useLocalities = ({ city }) => { + const { t } = useTranslation(); + let locality = []; + const [localityList, setLocalityList] = useState(null); + const [localities, setLocalities] = useState(null); + useEffect(() => { + (async () => { + let tenantId = Digit.ULBService.getCurrentTenantId(); + let response = await Digit.LocationService.getLocalities(tenantId); + let __localityList = []; + if (response && response.TenantBoundary.length > 0) { + __localityList = Digit.LocalityService.get(response.TenantBoundary[0]); + } + setLocalityList(__localityList); + })(); + }, [city]); + + useEffect(() => { + if (localityList) { + const __localities = localityList; + __localities.forEach((element) => { + locality.push({ name: t(element.code), code: element.code }); + }); + setLocalities(locality); + } + }, [localityList]); + + return localities; +}; + +export default useLocalities; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useServiceDefs.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useServiceDefs.js new file mode 100644 index 00000000000..ceea6438ce6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useServiceDefs.js @@ -0,0 +1,23 @@ +import { useTranslation } from "react-i18next"; + +const { useState, useEffect } = require("react"); + +const useServiceDefs = (tenantId, moduleCode) => { + const [localMenu, setLocalMenu] = useState([]); + const SessionStorage = Digit.SessionStorage; + let { t } = useTranslation(); + + useEffect(() => { + (async () => { + const serviceDefs = await Digit.MDMSService.getServiceDefs(tenantId, moduleCode); + SessionStorage.set("serviceDefs", serviceDefs); + + const serviceDefsWithKeys = serviceDefs.map((def) => ({ ...def, i18nKey: t("SERVICEDEFS." + def.serviceCode.toUpperCase()) })); + setLocalMenu(serviceDefsWithKeys); + })(); + }, [t, tenantId, moduleCode]); + + return localMenu; +}; + +export default useServiceDefs; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useTenants.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useTenants.js new file mode 100644 index 00000000000..0c2f394c93c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useTenants.js @@ -0,0 +1,9 @@ +import React, { useEffect, useState } from "react"; + +const useTenants = () => { + const tenantInfo = Digit.SessionStorage.get("PGR_TENANTS"); + const [tenants, setTenants] = useState(tenantInfo ? tenantInfo : null); + return tenants; +}; + +export default useTenants; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/revalidateQuery.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/revalidateQuery.js new file mode 100644 index 00000000000..3514b6779f4 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/revalidateQuery.js @@ -0,0 +1,6 @@ +import { useQueryClient } from "react-query"; + +export const useRevalidateQuery = async (key) => { + const client = useQueryClient(); + return client.refetchQueries(key); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/store.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/store.js new file mode 100644 index 00000000000..477ee4bd39e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/store.js @@ -0,0 +1,19 @@ +import { useState, useEffect } from "react"; +import { useQuery } from "react-query"; +// import mergeConfig from "../../config/mergeConfig"; +import { StoreService } from "../services/molecules/Store/service"; + +export const useStore = ({ stateCode, moduleCode, language }) => { + return useQuery(["store", stateCode, moduleCode, language], () => StoreService.defaultData(stateCode, moduleCode, language)); +}; + +export const useInitStore = (stateCode, enabledModules) => { + const { isLoading, error, isError, data } = useQuery( + ["initStore", stateCode, enabledModules], + () => StoreService.digitInitData(stateCode, enabledModules), + { + staleTime: Infinity, + } + ); + return { isLoading, error, isError, data }; +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCreate.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCreate.js new file mode 100644 index 00000000000..c645dea3064 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useCreate.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useCreateSurveys = (filters, config) => { + return useMutation((filters) => Surveys.create(filters)); +}; + +export default useCreateSurveys; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useDelete.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useDelete.js new file mode 100644 index 00000000000..91c94a0d037 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useDelete.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useDeleteSurveys = (filters, config) => { + return useMutation((filters) => Surveys.delete(filters)); +}; + +export default useDeleteSurveys; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSearch.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSearch.js new file mode 100644 index 00000000000..ca2c937407a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSearch.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useQuery } from "react-query"; + +const useSearch = (filters, config) => { + return useQuery(["search_surveys", filters?.uuid, filters?.title, filters?.tenantIds, filters?.postedBy, filters?.offset, filters?.limit], () => Surveys.search(filters), { ...config }); +}; + +export default useSearch; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useShowResults.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useShowResults.js new file mode 100644 index 00000000000..331baa79ed8 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useShowResults.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useShowResults = (filters, config) => { + return useMutation((filters) => Surveys.showResults(filters)); +}; + +export default useShowResults; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSubmitResponse.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSubmitResponse.js new file mode 100644 index 00000000000..a4351dd2f45 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSubmitResponse.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useSubmitResponse = (filters, config) => { + return useMutation((filters) => Surveys.submitResponse(filters)); +}; + +export default useSubmitResponse; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSurveyInbox.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSurveyInbox.js new file mode 100644 index 00000000000..16712efea31 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useSurveyInbox.js @@ -0,0 +1,33 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation, useQuery } from "react-query"; +/* import { isObject, isObjectLike } from "lodash"; */ + +const useSearch = (filters, config) => { + const { filterForm, searchForm, tableForm } = filters + const { status } = filterForm + const { title, tenantIds, postedBy } = searchForm + const { sortBy, limit, offset, sortOrder } = tableForm; + const validTenantId = typeof tenantIds === 'object' ? tenantIds.code : tenantIds; + const validStatus = typeof status === 'object' ? status.code : status; + + const finalFilters = { + tenantIds: validTenantId, + status: validStatus === "ALL" ? "" : validStatus, + title, + postedBy, + limit, + offset + } + + //clearing out empty string params from payload + Object.keys(finalFilters).forEach(key => { + if (finalFilters[key] === '') { + delete finalFilters[key]; + } + }); + + + return useQuery(["search_surveys", title, tenantIds, postedBy, status, offset, limit], () => Surveys.search(finalFilters), { ...config, refetchInterval: 6000 }); +}; + +export default useSearch; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useUpdate.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useUpdate.js new file mode 100644 index 00000000000..770a88047a5 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/surveys/useUpdate.js @@ -0,0 +1,8 @@ +import { Surveys } from "../../services/elements/Surveys"; +import { useMutation } from "react-query"; + +const useUpdateSurvey = (filters, config) => { + return useMutation((filters) => Surveys.update(filters)); +}; + +export default useUpdateSurvey; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useAccessControl.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useAccessControl.js new file mode 100644 index 00000000000..df030439b9e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useAccessControl.js @@ -0,0 +1,13 @@ +import { useQuery } from "react-query"; +import AccessControlService from "../services/elements/Access"; +const useAccessControl = (tenantId) => { + const getUserRoles = Digit.SessionStorage.get("User")?.info?.roles; + + const roles = getUserRoles?.map((role) => { + return role.code; + }); + + const response = useQuery(["ACCESS_CONTROL", tenantId], async () => await AccessControlService.getAccessControl(roles),{enabled:roles?true:false}); + return response; +}; +export default useAccessControl; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useApplicationForBillSearch.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useApplicationForBillSearch.js new file mode 100644 index 00000000000..158535e45c7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useApplicationForBillSearch.js @@ -0,0 +1,37 @@ + +import { useQuery } from "react-query"; + + + +const refObj = (tenantId, filters) => { + let consumerCodes = filters?.consumerCodes; + // delete filters.consumerCodes; + + return { + + }; +}; + +export const useApplicationsForBusinessServiceSearch = ({ tenantId, businessService, filters }, config = {}) => { + let _key = businessService?.toLowerCase().split(".")[0]; + if (window.location.href.includes("mcollect")) { + _key = "mcollect"; + } + if (window.location.href.includes("TL")) { + _key = "TL"; + } + if (window.location.href.includes("BPAREG")) { + _key = businessService + } + if (window.location.href.includes("BPA.")) { + _key = "BPA" + } + + /* key from application ie being used as consumer code in bill */ + const { searchFn, key, label } = refObj(tenantId, filters)[_key]; + const applications = useQuery(["applicationsForBillDetails", { tenantId, businessService, filters, searchFn }], searchFn, { + ...config, + }); + + return { ...applications, key, label }; +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useClickOutside.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useClickOutside.js new file mode 100644 index 00000000000..dedb9c215a2 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useClickOutside.js @@ -0,0 +1,23 @@ +import { useEffect } from "react"; + +const useOnClickOutside = (ref, handler, isActive, eventParam = false) => { + useEffect(() => { + if (isActive) { + document.addEventListener("click", handleClickOutSide, eventParam); + } else { + document.removeEventListener("click", handleClickOutSide, eventParam); + } + return () => { + document.removeEventListener("click", handleClickOutSide, eventParam); + }; + }, [isActive]); + + const handleClickOutSide = (event) => { + if (ref.current && ref.current.contains(event.target)) { + return; + } + handler(event); + } +}; + +export default useOnClickOutside; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIHook.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIHook.js new file mode 100644 index 00000000000..1458a426486 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIHook.js @@ -0,0 +1,56 @@ +import { useQuery, useQueryClient } from "react-query"; +import { CustomService } from "../services/elements/CustomService"; + +/** + * Custom hook which can make api call and format response + * + * @author jagankumar-egov + * + * + * @example + * + const requestCriteria = [ + "/user/_search", // API details + {}, //requestParam + {data : {uuid:[Useruuid]}}, // requestBody + {} , // privacy value + { // other configs + enabled: privacyState, + cacheTime: 100, + select: (data) => { + // format data + return _.get(data, loadData?.jsonPath, value); + }, + }, + ]; + const { isLoading, data, revalidate } = Digit.Hooks.useCustomAPIHook(...requestCriteria); + + * + * @returns {Object} Returns the object which contains data and isLoading flag + */ + + +const useCustomAPIHook = ({ url, params, body, config = {}, plainAccessRequest,changeQueryName="Random" }) => { + const client = useQueryClient(); + + const { isLoading, data, isFetching,refetch } = useQuery( + [url,changeQueryName].filter((e) => e), + () => CustomService.getResponse({ url, params, body, plainAccessRequest }), + { + cacheTime:0, + ...config, + } + ); + + return { + isLoading, + isFetching, + data, + refetch, + revalidate: () => { + data && client.invalidateQueries({ queryKey: [url].filter((e) => e) }); + }, + }; +}; + +export default useCustomAPIHook; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIMutationHook.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIMutationHook.js new file mode 100644 index 00000000000..6afcfe74d49 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomAPIMutationHook.js @@ -0,0 +1,68 @@ +import { useQueryClient, useMutation } from "react-query"; +import { CustomService } from "../services/elements/CustomService"; + +/** + * Custom hook which can make api call and format response + * + * @author jagankumar-egov + * + * + * @example + * + const requestCriteria = [ + "/user/_search", // API details + {}, //requestParam + {data : {uuid:[Useruuid]}}, // requestBody + {} , // privacy value + { // other configs + enabled: privacyState, + cacheTime: 100, + select: (data) => { + // format data + return _.get(data, loadData?.jsonPath, value); + }, + }, + ]; + const mutation = Digit.Hooks.useCustomAPIMutationHook(...requestCriteria); + + +while mutating use the following format + +mutation.mutate({ + params: {}, + body: { "payload": { + // custom data + } + }}, + { + onError : ()=> { // custom logic}, + onSuccess : ()=> { // custom logic} + } + ); + + * + * @returns {Object} Returns the object which contains data and isLoading flag + */ + +const useCustomAPIMutationHook = ({ url, params, body, config = {}, plainAccessRequest, changeQueryName = "Random" }) => { + const client = useQueryClient(); + + const { isLoading, data, isFetching, ...rest } = useMutation( + (data) => CustomService.getResponse({ url, params: { ...params, ...data?.params }, body: { ...body, ...data?.body }, plainAccessRequest }), + { + cacheTime: 0, + ...config, + } + ); + return { + ...rest, + isLoading, + isFetching, + data, + revalidate: () => { + data && client.invalidateQueries({ queryKey: [url].filter((e) => e) }); + }, + }; +}; + +export default useCustomAPIMutationHook; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomMDMS.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomMDMS.js new file mode 100644 index 00000000000..523bcf41593 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useCustomMDMS.js @@ -0,0 +1,32 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../services/elements/MDMS"; + +/** + * Custom hook which can be used to + * make a single hook a module to get multiple masterdetails with/without filter + * + * @author jagankumar-egov + * + * @example + * // returns useQuery object + * Digit.Hooks.useCustomMDMS( + * "stateid", + * "modulename", + * [ + * { name:"masterdetail1",filter:"[?(@.active == true)]"}, + * { name:"masterdetail2" } + * ], + * { // all configs supported by the usequery + * default:(data)=>{ + * format + * return formattedData; + * } + * }) + * + * @returns {Object} Returns the object of the useQuery from react-query. + */ +const useCustomMDMS = (tenantId, moduleName, masterDetails = [], config = {}) => { + return useQuery([tenantId, moduleName, masterDetails], () => MdmsService.getMultipleTypesWithFilter(tenantId, moduleName, masterDetails), config); +}; + +export default useCustomMDMS; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDocumentSearch.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDocumentSearch.js new file mode 100644 index 00000000000..e121f159550 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDocumentSearch.js @@ -0,0 +1,47 @@ +import { useQuery, useQueryClient } from "react-query"; +import PropTypes from "prop-types"; + + +const useDocumentSearch = (documents=[], config = {}) => { + const client = useQueryClient(); + const tenant = Digit.ULBService.getStateId(); + const filesArray = documents?.map((value) => value?.fileStoreId); + + const { isLoading, error, data } = useQuery([filesArray.join('')], () => Digit.UploadServices.Filefetch(filesArray, tenant),{enabled:filesArray&&filesArray.length>0, + /* It will return back the same document object with fileUrl link and response */ + select: (data) => { + return documents.map(document=>{ + return { + ...document, + fileURL:data?.data?.[document?.fileStoreId]&&Digit.Utils.getFileUrl(data.data[document?.fileStoreId]), + url:data?.data?.[document?.fileStoreId]&&Digit.Utils.getFileUrl(data.data[document?.fileStoreId]), + fileResponse:data?.data?.[document?.fileStoreId]||"" + } + }) + }, + ...config}); + return { isLoading, error, data: { pdfFiles: data }, revalidate: () => client.invalidateQueries([filesArray.join('')]) }; +}; + +/** + * Used to get the documents file url based on the given documents array + */ +export default useDocumentSearch; + + +useDocumentSearch.propTypes = { + /** + * document array for which we get file urls + */ + documents: PropTypes.array, + /** + * any config to use query + */ + config: PropTypes.object, +}; + +useDocumentSearch.defaultProps = { + documents: [], + config: {} +}; + diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDynamicData.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDynamicData.js new file mode 100644 index 00000000000..64dc9eb1857 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useDynamicData.js @@ -0,0 +1,17 @@ +import { useQuery } from "react-query"; +import { endOfToday, start } from "date-fns"; + +import { format, subMonths } from "date-fns"; + +const useDynamicData = ({moduleCode ,tenantId, filters, t }) => { + + + switch(moduleCode){ + + default: + return {isLoading: false, error: false, data: null, isSuccess: false}; + } + + }; + +export default useDynamicData; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useEmployeeSearch.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useEmployeeSearch.js new file mode 100644 index 00000000000..93651fcd599 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useEmployeeSearch.js @@ -0,0 +1,10 @@ +import { useQuery } from "react-query"; + +const useEmployeeSearch = (tenantId, filters, config = {}) => { + if (filters.roles) { + filters.roles = filters.roles.map((role) => role.code).join(","); + } + return useQuery(["EMPLOYEE_SEARCH", filters], () => Digit.UserService.employeeSearch(tenantId, filters), config); +}; + +export default useEmployeeSearch; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGenderMDMS.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGenderMDMS.js new file mode 100644 index 00000000000..6eaa892f9ec --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGenderMDMS.js @@ -0,0 +1,18 @@ +import { useQuery } from "react-query"; +import { MdmsService } from "../services/elements/MDMS"; + +const useGenderMDMS = (tenantId, moduleCode, type, config = {}) => { + const useGenderDetails = () => { + return useQuery("GENDER_DETAILS", () => MdmsService.getGenderType(tenantId, moduleCode ,type), config); + }; + + + switch (type) { + case "GenderType": + return useGenderDetails(); + } +}; + + + +export default useGenderMDMS; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSAboutJSON.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSAboutJSON.js new file mode 100644 index 00000000000..d9cac815d52 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSAboutJSON.js @@ -0,0 +1,7 @@ +import { useQuery } from "react-query"; + +const useGetDSSAboutJSON = (tenantId) => { + return useQuery(["About", tenantId], () => Digit.MDMSService.getDSSAboutJSONData(tenantId)); + }; + +export default useGetDSSAboutJSON; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSFAQsJSON.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSFAQsJSON.js new file mode 100644 index 00000000000..ae096a594d9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetDSSFAQsJSON.js @@ -0,0 +1,7 @@ +import { useQuery } from "react-query"; + +const useGetDSSFAQsJSON = (tenantId) => { + return useQuery(["FAQS", tenantId], () => Digit.MDMSService.getDSSFAQsJSONData(tenantId)); + }; + +export default useGetDSSFAQsJSON; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetFAQsJSON.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetFAQsJSON.js new file mode 100644 index 00000000000..7ea9d25bb33 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useGetFAQsJSON.js @@ -0,0 +1,7 @@ +import { useQuery } from "react-query"; + +const useGetFAQsJSON = (tenantId) => { + return useQuery(["FAQ_S", tenantId], () => Digit.MDMSService.getFAQsJSONData(tenantId)); + }; + +export default useGetFAQsJSON; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useHowItWorksJSON.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useHowItWorksJSON.js new file mode 100644 index 00000000000..2f20e699334 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useHowItWorksJSON.js @@ -0,0 +1,7 @@ +import { useQuery } from "react-query"; + +const useGetHowItWorksJSON = (tenantId) => { + return useQuery(["HOW_IT_WORKS", tenantId], () => Digit.MDMSService.getHowItWorksJSONData(tenantId)); + }; + +export default useGetHowItWorksJSON; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInbox.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInbox.js new file mode 100644 index 00000000000..2f6bed8496b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInbox.js @@ -0,0 +1,11 @@ +import React from "react"; +import { useQuery } from "react-query"; +import { InboxGeneral } from "../services/elements/InboxService" + +const useInbox = ({tenantId, filters, config}) => useQuery( + ["INBOX_DATA",tenantId, ...Object.keys(filters)?.map( e => filters?.[e] )], + () => InboxGeneral.Search({inbox: {...filters}}), + { ...config } + ) + +export default useInbox; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/filterFn.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/filterFn.js new file mode 100644 index 00000000000..7736e52c1af --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/filterFn.js @@ -0,0 +1,108 @@ +export const filterFunctions = { + PT: (filtersArg) => { + let { uuid } = Digit.UserService.getUser()?.info || {}; + + const searchFilters = {}; + const workflowFilters = {}; + + const { propertyIds, mobileNumber, limit, offset, sortBy, sortOrder, total, applicationStatus, services } = filtersArg || {}; + + if (filtersArg?.acknowledgementIds) { + searchFilters.acknowledgementIds = filtersArg?.acknowledgementIds; + } + if (filtersArg?.propertyIds) { + searchFilters.propertyIds = propertyIds; + } + if (filtersArg?.oldpropertyids) { + searchFilters.oldpropertyids = filtersArg?.oldpropertyids; + } + if (applicationStatus && applicationStatus?.[0]) { + workflowFilters.applicationStatus = applicationStatus.map((status) => status.code).join(","); + } + if (filtersArg?.locality?.length) { + searchFilters.locality = filtersArg?.locality.map((item) => item.code.split("_").pop()).join(","); + } + + if (filtersArg?.locality?.code) { + searchFilters.locality = filtersArg?.locality?.code; + } + + if (filtersArg?.uuid && filtersArg?.uuid.code === "ASSIGNED_TO_ME") { + workflowFilters.assignee = uuid; + } + if (mobileNumber) { + searchFilters.mobileNumber = mobileNumber; + } + if (propertyIds) { + searchFilters.propertyIds = propertyIds; + } + if (sortBy) { + searchFilters.sortBy = sortBy; + } + if (sortOrder) { + searchFilters.sortOrder = sortOrder; + } + if (services) { + workflowFilters.businessServices = services.join(); + } + if (limit) { + searchFilters.limit = limit; + } + if (offset) { + searchFilters.offset = offset; + } + + return { searchFilters, workflowFilters }; + }, + TL: (filtersArg) => { + let { uuid } = Digit.UserService.getUser()?.info || {}; + + const searchFilters = {}; + const workflowFilters = {}; + + const { propertyIds, mobileNumber, limit, offset, sortBy, sortOrder, total, applicationStatus, services } = filtersArg || {}; + + if (filtersArg?.acknowledgementIds) { + searchFilters.acknowledgementIds = filtersArg?.acknowledgementIds; + } + if (filtersArg?.propertyIds) { + searchFilters.propertyIds = propertyIds; + } + if (filtersArg?.oldpropertyids) { + searchFilters.oldpropertyids = filtersArg?.oldpropertyids; + } + if (applicationStatus && applicationStatus?.[0]) { + workflowFilters.applicationStatus = applicationStatus.map((status) => status.code).join(","); + } + if (filtersArg?.locality?.length) { + searchFilters.locality = filtersArg?.locality.map((item) => item.code.split("_").pop()).join(","); + } + + if (filtersArg?.uuid && filtersArg?.uuid.code === "ASSIGNED_TO_ME") { + workflowFilters.assignee = uuid; + } + if (mobileNumber) { + searchFilters.mobileNumber = mobileNumber; + } + if (propertyIds) { + searchFilters.propertyIds = propertyIds; + } + if (sortBy) { + searchFilters.sortBy = sortBy; + } + if (sortOrder) { + searchFilters.sortOrder = sortOrder; + } + if (services) { + workflowFilters.businessServices = services.join(); + } + if (limit) { + searchFilters.limit = limit; + } + if (offset) { + searchFilters.offset = offset; + } + + return { searchFilters, workflowFilters }; + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/newFilterFn.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/newFilterFn.js new file mode 100644 index 00000000000..33242762bf9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/newFilterFn.js @@ -0,0 +1,52 @@ +export const filterFunctions = { + PT: (filtersArg) => { + let { uuid } = Digit.UserService.getUser()?.info || {}; + + const searchFilters = {}; + const workflowFilters = {}; + + const { propertyIds, mobileNumber, limit, offset, sortBy, sortOrder, total, applicationStatus, services } = filtersArg || {}; + + if (filtersArg?.acknowledgementIds) { + searchFilters.applicationNumber = filtersArg?.acknowledgementIds; + } + if (filtersArg?.propertyIds) { + searchFilters.propertyId = propertyIds; + } + if (filtersArg?.oldpropertyids) { + searchFilters.oldpropertyids = filtersArg?.oldpropertyids; + } + if (applicationStatus && applicationStatus?.[0]) { + workflowFilters.status = applicationStatus.map((status) => status.uuid); + if (applicationStatus?.some((e) => e.nonActionableRole)) { + searchFilters.fetchNonActionableRecords = true; + } + } + if (filtersArg?.locality?.length) { + searchFilters.locality = filtersArg?.locality.map((item) => item.code.split("_").pop()); + } + if (filtersArg?.uuid && filtersArg?.uuid.code === "ASSIGNED_TO_ME") { + workflowFilters.assignee = uuid; + } + if (mobileNumber) { + searchFilters.mobileNumber = mobileNumber; + } + if (services) { + workflowFilters.businessService = services; + } + searchFilters["isInboxSearch"] = true; + searchFilters["creationReason"] = ["CREATE", "MUTATION", "UPDATE"]; + workflowFilters["moduleName"] = "PT"; + + // if (limit) { + // searchFilters.limit = limit; + // } + // if (offset) { + // searchFilters.offset = offset; + // } + + // workflowFilters.businessService = "PT.CREATE"; + // searchFilters.mobileNumber = "9898568989"; + return { searchFilters, workflowFilters, limit, offset, sortBy, sortOrder }; + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/searchFields.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/searchFields.js new file mode 100644 index 00000000000..05cd3d163db --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/searchFields.js @@ -0,0 +1,67 @@ +const inboxSearchFields = { + PT: [ + { + label: "PT_PROPERTY_APPLICATION_NO", + name: "acknowledgementIds", + roles: [], + }, + { + label: "ES_SEARCH_UNIQUE_PROPERTY_ID", + name: "propertyIds", + // minLength: "10", + roles: [], + }, + { + label: "ES_SEARCH_APPLICATION_MOBILE_NO", + name: "mobileNumber", + type: "mobileNumber", + maxLength: 10, + minLength: 0, + roles: [], + pattern: "^$|[6-9][0-9]{9}", + errorMessages: { + pattern: "", + minLength: "", + maxLength: "", + }, + }, + ], +}; + +const searchFieldsForSearch = { + PT: [ + { + label: "ES_INBOX_LOCALITY", + name: "locality", + type: "Locality", + isMendatory: true, + }, + { + label: "ES_INBOX_UNIQUE_PROPERTY_ID", + name: "propertyIds", + roles: [], + }, + { + label: "ES_SEARCH_EXISTING_PROPERTY_ID", + name: "oldpropertyids", + title: "ES_SEARCH_APPLICATION_MOBILE_INVALID", + roles: [], + }, + { + label: "ES_SEARCH_APPLICATION_MOBILE_NO", + name: "mobileNumber", + type: "mobileNumber", + maxLength: 10, + minLength: 0, + roles: [], + pattern: "^$|[6-9][0-9]{9}", + errorMessages: { + pattern: "", + minLength: "", + maxLength: "", + }, + }, + ], +}; + +export const getSearchFields = (isInbox) => (isInbox ? inboxSearchFields : searchFieldsForSearch); diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useInboxGeneral.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useInboxGeneral.js new file mode 100644 index 00000000000..c8c9b04d71d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useInboxGeneral.js @@ -0,0 +1,148 @@ +import { useTranslation } from "react-i18next"; +import { useQuery, useQueryClient } from "react-query"; + +import { filterFunctions } from "./filterFn"; +import { getSearchFields } from "./searchFields"; + +const inboxConfig = (tenantId, filters) => ({ + +}); + +const defaultCombineResponse = ({ totalCount, ...d }, wf) => { + return { totalCount, searchData: { ...d }, workflowData: { ...wf } }; +}; + +const defaultRawSearchHandler = ({ totalCount, ...data }, searchKey, businessIdAlias) => { + return { [searchKey]: data[searchKey].map((e) => ({ totalCount, ...e })) }; +}; + +const defaultCatchSearch = (Err) => { + if ( + Err?.response?.data?.Errors?.some( + (e) => + e.code === "EG_PT_INVALID_SEARCH" && + e.message === " Search is not allowed on empty Criteria, Atleast one criteria should be provided with tenantId for EMPLOYEE" + ) + ) + return []; + throw Err; +}; + +/** + * + * @param {*} data + * @param {Array of Objects containing async or pure functions} middlewares + * @returns {object} + */ + +const callMiddlewares = async (data, middlewares) => { + let applyBreak = false; + let itr = -1; + let _break = () => (applyBreak = true); + let _next = async (data) => { + if (!applyBreak && ++itr < middlewares.length) { + let key = Object.keys(middlewares[itr])[0]; + let nextMiddleware = middlewares[itr][key]; + let isAsync = nextMiddleware.constructor.name === "AsyncFunction"; + if (isAsync) return await nextMiddleware(data, _break, _next); + else return nextMiddleware(data, _break, _next); + } else return data; + }; + let ret = await _next(data); + return ret || []; +}; + +const useInboxGeneral = ({ + tenantId, + businessService, + filters, + rawWfHandler = (d) => d, + rawSearchHandler = defaultRawSearchHandler, + combineResponse = defaultCombineResponse, + isInbox = true, + wfConfig = {}, + searchConfig = {}, + middlewaresWf = [], + middlewareSearch = [], + catchSearch = defaultCatchSearch, +}) => { + const client = useQueryClient(); + const { t } = useTranslation(); + + const { services, fetchFilters, searchResponseKey, businessIdAliasForSearch, businessIdsParamForSearch } = inboxConfig()[businessService]; + + let { workflowFilters, searchFilters } = fetchFilters(filters); + + const { data: processInstances, isFetching: wfFetching, isFetched, isSuccess: wfSuccess } = useQuery( + ["WORKFLOW_INBOX", businessService, workflowFilters], + () => + Digit.WorkflowService.getAllApplication(tenantId, { businessServices: services.join(), ...workflowFilters }) + .then(rawWfHandler) + .then((data) => callMiddlewares(data.ProcessInstances, middlewaresWf)), + { + enabled: isInbox, + select: (d) => { + return d; + }, + ...wfConfig, + } + ); + + const applicationNoFromWF = processInstances?.map((e) => e.businessId).join() || ""; + + if (isInbox && applicationNoFromWF && !searchFilters[businessIdAliasForSearch]) + searchFilters = { [businessIdsParamForSearch]: applicationNoFromWF, ...searchFilters }; + + const { _searchFn } = inboxConfig(tenantId, { ...searchFilters })[businessService]; + + /** + * Convert Wf Array to Object + */ + + const processInstanceBuisnessIdMap = processInstances?.reduce((object, item) => { + return { ...object, [item?.["businessId"]]: item }; + }, {}); + + const allowSearch = isInbox ? isFetched && wfSuccess && !!searchFilters[businessIdsParamForSearch] : true; + + const searchResult = useQuery( + ["SEARCH_INBOX", businessService, searchFilters, workflowFilters, isInbox], + () => { + if (allowSearch) + return _searchFn() + .then((d) => rawSearchHandler(d, searchResponseKey, businessIdAliasForSearch)) + .then((data) => callMiddlewares(data[searchResponseKey], middlewareSearch)) + .catch(catchSearch); + }, + { + enabled: allowSearch, + select: (d) => { + return d.map((searchResult) => ({ + totalCount: d.totalCount, + ...combineResponse(searchResult, processInstanceBuisnessIdMap?.[searchResult?.[businessIdAliasForSearch]]), + })); + }, + ...searchConfig, + } + ); + + const revalidate = () => { + client.refetchQueries(["WORKFLOW_INBOX"]); + client.refetchQueries(["SEARCH_INBOX"]); + }; + + client.setQueryData(`FUNCTION_RESET_INBOX_${businessService}`, { revalidate }); + + return { + ...searchResult, + revalidate, + searchResponseKey, + businessIdsParamForSearch, + businessIdAliasForSearch, + + searchFields: getSearchFields(isInbox)[businessService], + wfFetching, + }; +}; + +export default useInboxGeneral; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useNewInbox.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useNewInbox.js new file mode 100644 index 00000000000..71e31c0f483 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useInboxGeneral/useNewInbox.js @@ -0,0 +1,76 @@ +import { useTranslation } from "react-i18next"; +import { useQuery, useQueryClient } from "react-query"; + +import { filterFunctions } from "./newFilterFn"; +import { getSearchFields } from "./searchFields"; +import { InboxGeneral } from "../../services/elements/InboxService"; + +const inboxConfig = (tenantId, filters) => ({ + +}); + +const callMiddlewares = async (data, middlewares) => { + let applyBreak = false; + let itr = -1; + let _break = () => (applyBreak = true); + let _next = async (data) => { + if (!applyBreak && ++itr < middlewares.length) { + let key = Object.keys(middlewares[itr])[0]; + let nextMiddleware = middlewares[itr][key]; + let isAsync = nextMiddleware.constructor.name === "AsyncFunction"; + if (isAsync) return await nextMiddleware(data, _break, _next); + else return nextMiddleware(data, _break, _next); + } else return data; + }; + let ret = await _next(data); + return ret || []; +}; + +const useNewInboxGeneral = ({ tenantId, ModuleCode, filters, middleware = [], config = {} }) => { + const client = useQueryClient(); + const { t } = useTranslation(); + const { fetchFilters, searchResponseKey, businessIdAliasForSearch, businessIdsParamForSearch } = inboxConfig()[ModuleCode]; + let { workflowFilters, searchFilters, limit, offset, sortBy, sortOrder } = fetchFilters(filters); + + const query = useQuery( + ["INBOX", workflowFilters, searchFilters, ModuleCode, limit, offset, sortBy, sortOrder], + () => + InboxGeneral.Search({ + inbox: { tenantId, processSearchCriteria: workflowFilters, moduleSearchCriteria: { ...searchFilters, sortBy, sortOrder }, limit, offset }, + }), + { + select: (data) => { + const { statusMap, totalCount } = data; + // client.setQueryData(`INBOX_STATUS_MAP_${ModuleCode}`, (oldStatusMap) => { + // if (!oldStatusMap) return statusMap; + // else return [...oldStatusMap.filter((e) => statusMap.some((f) => f.stateId === e.stateId))]; + // }); + + client.setQueryData(`INBOX_STATUS_MAP_${ModuleCode}`, statusMap); + + if (data.items.length) { + return data.items?.map((obj) => ({ + searchData: obj.businessObject, + workflowData: obj.ProcessInstance, + statusMap, + totalCount, + })); + } else { + return [{ statusMap, totalCount, dataEmpty: true }]; + } + }, + retry: false, + ...config, + } + ); + + return { + ...query, + searchResponseKey, + businessIdsParamForSearch, + businessIdAliasForSearch, + searchFields: getSearchFields(true)[ModuleCode], + }; +}; + +export default useNewInboxGeneral; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocalities.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocalities.js new file mode 100644 index 00000000000..8c550eb22fb --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocalities.js @@ -0,0 +1,17 @@ +import { useQuery } from "react-query"; +import { getLocalities } from "../services/molecules/getLocalities"; +import { LocalityService } from "../services/elements/Localities"; + +const useLocalities = (tenant, boundaryType = "admin", config, t) => { + return useQuery(["BOUNDARY_DATA", tenant, boundaryType], () => getLocalities[boundaryType.toLowerCase()](tenant), { + select: (data) => { + return LocalityService.get(data).map((key) => { + return { ...key, i18nkey: t(key.i18nkey) }; + }); + }, + staleTime: Infinity, + ...config, + }); +}; + +export default useLocalities; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocation.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocation.js new file mode 100644 index 00000000000..0e5cfa320e5 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocation.js @@ -0,0 +1,15 @@ +import { useQuery } from 'react-query'; +import { LocationService } from "../services/elements/Location"; + +const useLocation = (tenantId, locationType, config = {}) => { + switch(locationType) { + case 'Locality': + return useQuery(["LOCALITY_DETAILS", tenantId ], () => LocationService.getLocalities(tenantId), config); + case 'Ward': + return useQuery(["WARD_DETAILS", tenantId ], () => LocationService.getWards(tenantId), config); + default: + break + } +} + +export default useLocation; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useMDMS.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useMDMS.js new file mode 100644 index 00000000000..ec3579d93a6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useMDMS.js @@ -0,0 +1,44 @@ +import { MdmsService } from "../services/elements/MDMS"; +import { useQuery } from "react-query"; + +const useMDMS = (tenantId, moduleCode, type, config = {}, payload = []) => { + const usePaymentGateway = () => { + return useQuery("PAYMENT_GATEWAY", () => MdmsService.getPaymentGateway(tenantId, moduleCode, type), { + select: (data) => { + return data?.[moduleCode]?.[type].filter((e) => e.active).map(({ gateway }) => gateway); + }, + ...config, + }); + }; + + const useReceiptKey = () => { + return useQuery("RECEIPT_KEY", () => MdmsService.getReceiptKey(tenantId, moduleCode, type), config); + }; + + const useBillsGenieKey = () => { + return useQuery("BILLS_GENIE_KEY", () => MdmsService.getBillsGenieKey(tenantId, moduleCode, type), config); + }; + + const useFSTPPlantInfo = () => { + return useQuery("FSTP_PLANTINFO", () => MdmsService.getFSTPPlantInfo(tenantId, moduleCode, type), config); + }; + + const _default = () => { + return useQuery([tenantId, moduleCode, type], () => MdmsService.getMultipleTypes(tenantId, moduleCode, type), config); + }; + + switch (type) { + case "PaymentGateway": + return usePaymentGateway(); + case "ReceiptKey": + return useReceiptKey(); + case "FSTPPlantInfo": + return useFSTPPlantInfo(); + case "BillsGenieKey": + return useBillsGenieKey(); + default: + return _default(); + } +}; + +export default useMDMS; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js new file mode 100644 index 00000000000..25e51a94e97 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js @@ -0,0 +1,39 @@ +import React from "react"; +import { useQuery } from "react-query"; +import { useTranslation } from "react-i18next"; + +const useModuleTenants = (module, config = {}) => { + const { t } = useTranslation(); + + return useQuery(["ULB_TENANTS", module], () => Digit.SessionStorage.get("initData"), { + select: (data) => ({ + ddr: data.modules + .find((e) => e.module === module) + .tenants.map((tenant) => ({ + ...tenant, + ulbKey: t(`TENANT_TENANTS_${tenant?.code?.toUpperCase?.()?.replace(".", "_")}`), + ddrKey: t( + `DDR_${data.tenants + .filter((t) => t.code === tenant.code)?.[0] + .city?.districtTenantCode?.toUpperCase?.() + .replace(".", "_")}` + ), + })) + .filter((item, i, arr) => i === arr.findIndex((t) => t.ddrKey === item.ddrKey)), + ulb: data.modules + .find((e) => e.module === module) + .tenants.map((tenant) => ({ + ...tenant, + ulbKey: t(`TENANT_TENANTS_${tenant?.code?.toUpperCase?.()?.replace(".", "_")}`), + ddrKey: t( + `DDR_${data.tenants + .filter((t) => t.code === tenant.code)?.[0] + .city?.districtTenantCode?.toUpperCase?.() + .replace(".", "_")}` + ), + })), + }), + ...config, + }); +}; +export default useModuleTenants; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/usePrivacyContext.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/usePrivacyContext.js new file mode 100644 index 00000000000..fea0afdfd01 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/usePrivacyContext.js @@ -0,0 +1,18 @@ +import React, { useContext } from "react"; + +/** + * Custom hook which can gives the privacy functions to access + * + * @author jagankumar-egov + * + * Feature :: Privacy + * + * @example + * const { privacy , updatePrivacy } = Digit.Hooks.usePrivacyContext() + * + * @returns {Object} Returns the object which contains privacy value and updatePrivacy method + */ +export const usePrivacyContext = () => { + const { privacy, updatePrivacy, ...rest } = useContext(Digit.Contexts.PrivacyProvider); + return { privacy, updatePrivacy, ...rest }; +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useQueryParams.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useQueryParams.js new file mode 100644 index 00000000000..b4275c4d56b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useQueryParams.js @@ -0,0 +1,11 @@ +const useQueryParams = () => { + const queryString = window.location.search; + const urlParams = new URLSearchParams(queryString); + const params = {}; + urlParams.forEach((value, key) => { + params[key] = value; + }); + return params; +}; + +export default useQueryParams; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useRouteSubscription.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useRouteSubscription.js new file mode 100644 index 00000000000..dd586b5cb83 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useRouteSubscription.js @@ -0,0 +1,17 @@ +import React, { useEffect, useState } from "react"; + +const useRouteSubscription = (pathname) => { + const [classname, setClassname] = useState("citizen"); + useEffect(() => { + const isEmployeeUrl = Digit.Utils.detectDsoRoute(pathname); + if (isEmployeeUrl && classname === "citizen") { + setClassname("employee"); + } else if (!isEmployeeUrl && classname === "employee") { + setClassname("citizen"); + } + }, [pathname]); + + return classname; +}; + +export default useRouteSubscription; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useSessionStorage.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useSessionStorage.js new file mode 100644 index 00000000000..b6860376a31 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useSessionStorage.js @@ -0,0 +1,30 @@ +import { useState } from "react"; + +const useSessionStorage = (key, initialValue) => { + const [storedValue, setStoredValue] = useState(() => { + try { + const data = Digit.SessionStorage.get(key); + return data ? data : initialValue; + } catch (err) { + return initialValue; + } + }); + + const setValue = (value) => { + try { + const valueToStore = value instanceof Function ? value(storedValue) : value; + setStoredValue(valueToStore); + Digit.SessionStorage.set(key, valueToStore); + } catch (err) { + } + }; + + const clearValue = () => { + setStoredValue(initialValue); + Digit.SessionStorage.set(key, initialValue); + }; + + return [storedValue, setValue, clearValue]; +}; + +export default useSessionStorage; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStaticData.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStaticData.js new file mode 100644 index 00000000000..f777480903e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStaticData.js @@ -0,0 +1,7 @@ +import { useQuery } from "react-query"; + +const useStaticData = (tenantId) => { + return useQuery(["MODULE_LEVEL_HOME_PAGE_STATIC_DATA", tenantId], () => Digit.MDMSService.getStaticDataJSON(tenantId)); + }; + +export default useStaticData; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStatusGeneral.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStatusGeneral.js new file mode 100644 index 00000000000..aff17dcc6e6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStatusGeneral.js @@ -0,0 +1,42 @@ +import { useQuery } from "react-query"; + +const useApplicationStatusGeneral = ({ businessServices = [], tenantId }, config) => { + tenantId = tenantId || Digit.ULBService.getCurrentTenantId(); + + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo.info.roles.map((roleData) => roleData.code); + + const fetch = async () => + await Digit.WorkflowService.init(tenantId, businessServices.join()).then((res) => { + const { BusinessServices: data } = res; + return data; + }); + + const select = (data) => { + let states = []; + const filteredData = data.filter((e) => businessServices.includes(e.businessService)); + filteredData.forEach((service) => { + states = [...states, ...service.states.map((e) => ({ ...e, stateBusinessService: service.businessService }))]; + }); + + const addRoleToState = (state) => { + const roles = state.actions?.map((act) => act.roles).flat(); + return { ...state, roles }; + }; + + const roleStateMapArray = states?.map(addRoleToState).filter((e) => !!e.state); + + const userRoleStates = roleStateMapArray.filter(({ roles }) => roles?.some((role) => userRoles.includes(role))); + const otherRoleStates = roleStateMapArray + .filter(({ roles }) => !roles?.some((role) => userRoles.includes(role))) + .map((e) => ({ ...e, nonActionableRole: true })); + + return { userRoleStates, otherRoleStates }; + }; + + const queryData = useQuery(["workflow_states", tenantId, ...businessServices], () => fetch(), { select, ...config }); + + return queryData; +}; + +export default useApplicationStatusGeneral; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStore.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStore.js new file mode 100644 index 00000000000..27d4ccc135f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useStore.js @@ -0,0 +1,11 @@ +import { useQuery } from "react-query"; +import StoreData from "../services/molecules/StoreData"; + +const useStore = { + getInitData: () => + useQuery(["STORE_DATA"], () => StoreData.getInitData(), { + staleTime: Infinity, + }), +}; + +export default useStore; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useTenants.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useTenants.js new file mode 100644 index 00000000000..c3e8acd1fd7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useTenants.js @@ -0,0 +1,13 @@ +import { useQuery } from "react-query"; + +const alphabeticalSortFunctionForTenantsBasedOnName = (firstEl, secondEl) =>{ + if (firstEl.name.toUpperCase() < secondEl.name.toUpperCase() ) { + return -1 + } + if (firstEl.name.toUpperCase() > secondEl.name.toUpperCase() ) { + return 1 + } + return 0 +} + +export const useTenants = () => useQuery(["ALL_TENANTS"], () => Digit.SessionStorage.get("initData").tenants.sort(alphabeticalSortFunctionForTenantsBasedOnName)) diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useUpdateCustom.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useUpdateCustom.js new file mode 100644 index 00000000000..83c298bd9a7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useUpdateCustom.js @@ -0,0 +1,17 @@ +import { useMutation } from "react-query"; +import ApplicationUpdateActionsCustom from "../services/elements/ApplicationUpdateActionsCustom"; + +/** + * Custom hook which can make api call to update API of any module + * + * @author nipunarora-eGov + * + * returns data from update api call + */ + + +const useUpdateCustom = ( url ) => { + return useMutation((applicationData) => ApplicationUpdateActionsCustom({url,body:applicationData})); +}; + +export default useUpdateCustom; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkflowDetailsV2.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkflowDetailsV2.js new file mode 100644 index 00000000000..d6388d3c6f0 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/useWorkflowDetailsV2.js @@ -0,0 +1,19 @@ +import { useQuery, useQueryClient } from "react-query"; + +const useWorkflowDetailsV2 = ({ tenantId, id, moduleCode, role = "CITIZEN", serviceData = {}, getStaleData, getTripData = false, config }) => { + const queryClient = useQueryClient(); + + const staleDataConfig = { staleTime: Infinity }; + + const { isLoading, error, isError, data } = useQuery( + ["workFlowDetailsWorks", tenantId, id, moduleCode, role, config], + () => Digit.WorkflowService.getDetailsByIdV2({ tenantId, id, moduleCode, role, getTripData }), + getStaleData ? { ...staleDataConfig, ...config } : config + ); + + if (getStaleData) return { isLoading, error, isError, data }; + + return { isLoading, error, isError, data, revalidate: () => queryClient.invalidateQueries(["workFlowDetailsWorks", tenantId, id, moduleCode, role]) }; +}; + +export default useWorkflowDetailsV2; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/userSearch.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/userSearch.js new file mode 100644 index 00000000000..0506a95227f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/userSearch.js @@ -0,0 +1,8 @@ +import { useQuery, useQueryClient } from "react-query"; +import { UserService } from "../services/elements/User"; + +export const useUserSearch = (tenantId, data, filters, options = {}) => { + const client = useQueryClient(); + const queryData = useQuery(["USER_SEARCH", filters, data], () => UserService.userSearch(tenantId, data, filters), options); + return { ...queryData, revalidate: () => client.invalidateQueries(["USER_SEARCH", filters, data]) }; +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/workflow.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/workflow.js new file mode 100644 index 00000000000..2549ed5d027 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/hooks/workflow.js @@ -0,0 +1,19 @@ +import { useQuery, useQueryClient } from "react-query"; + +const useWorkflowDetails = ({ tenantId, id, moduleCode, role = "CITIZEN", serviceData = {}, getStaleData, getTripData = false,config }) => { + const queryClient = useQueryClient(); + + const staleDataConfig = { staleTime: Infinity }; + + const { isLoading, error, isError, data } = useQuery( + ["workFlowDetails", tenantId, id, moduleCode, role, config], + () => Digit.WorkflowService.getDetailsById({ tenantId, id, moduleCode, role, getTripData }), + getStaleData ? { ...staleDataConfig, ...config } : config + ); + + if (getStaleData) return { isLoading, error, isError, data }; + + return { isLoading, error, isError, data, revalidate: () => queryClient.invalidateQueries(["workFlowDetails", tenantId, id, moduleCode, role]) }; +}; + +export default useWorkflowDetails; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/index.js new file mode 100644 index 00000000000..5a7d61a4d9f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/index.js @@ -0,0 +1,90 @@ +import i18next from "i18next"; +import Enums from "./enums/index"; +import mergeConfig from "./config/mergeConfig"; +import { useStore } from "./services/index"; +import { initI18n } from "./translations/index"; + +import { Storage, PersistantStorage } from "./services/atoms/Utils/Storage"; +import { UploadServices } from "./services/atoms/UploadServices"; +import JsDictionary from "./services/atoms/JsDictionary"; + +import { LocationService } from "./services/elements/Location"; +import { LocalityService } from "./services/elements/Localities"; +import { CustomService } from "./services/elements/CustomService"; +import { LocalizationService } from "./services/elements/Localization/service"; +import { LoginService } from "./services/elements/Login"; +import { PGRService } from "./services/elements/PGR"; +import { PaymentService } from "./services/elements/Payment"; +import * as dateUtils from "./services/atoms/Utils/Date"; +import Download from "./services/atoms/Download"; +import { WorkflowService } from "./services/elements/WorkFlow"; +import { MdmsService } from "./services/elements/MDMS"; +import { Complaint } from "./services/elements/Complaint"; +import { UserService } from "./services/elements/User"; +import HrmsService from "./services/elements/HRMS"; +import { InboxGeneral } from "./services/elements/InboxService"; +import EventsServices from "./services/elements/Events"; + + +import ShareFiles from "./services/molecules/ShareFiles"; +import { GetServiceDefinitions } from "./services/molecules/ServiceDefinitions"; +import { ULBService } from "./services/molecules/Ulb"; +import { ComponentRegistryService } from "./services/elements/ComponentRegistry"; +import StoreData from "./services/molecules/StoreData"; + +import Contexts from "./contexts"; +import Hooks from "./hooks"; +import Utils from "./utils"; +import { subFormRegistry } from "./subFormRegistry"; +import AccessControlService from "./services/elements/Access"; + +const setupLibraries = (Library, props) => { + window.Digit = window.Digit || {}; + window.Digit[Library] = window.Digit[Library] || {}; + window.Digit[Library] = { ...window.Digit[Library], ...props }; +}; + +const initLibraries = () => { + setupLibraries("SessionStorage", Storage); + setupLibraries("PersistantStorage", PersistantStorage); + setupLibraries("UserService", UserService); + setupLibraries("ULBService", ULBService); + + setupLibraries("Config", { mergeConfig }); + setupLibraries("Services", { useStore }); + setupLibraries("Enums", Enums); + setupLibraries("LocationService", LocationService); + setupLibraries("CustomService",CustomService) + setupLibraries("LocalityService", LocalityService); + setupLibraries("LoginService", LoginService); + setupLibraries("LocalizationService", LocalizationService); + setupLibraries("PGRService", PGRService); + setupLibraries("HRMSService", HrmsService); + setupLibraries("PaymentService", PaymentService); + setupLibraries("DateUtils", dateUtils); + setupLibraries("WorkflowService", WorkflowService); + setupLibraries("MDMSService", MdmsService); + setupLibraries("UploadServices", UploadServices); + setupLibraries("JsDictionary", JsDictionary); + setupLibraries("GetServiceDefinitions", GetServiceDefinitions); + setupLibraries("Complaint", Complaint); + setupLibraries("ComponentRegistryService", ComponentRegistryService); + setupLibraries("StoreData", StoreData); + setupLibraries("EventsServices", EventsServices); + + setupLibraries("InboxGeneral", InboxGeneral); + setupLibraries("ShareFiles", ShareFiles); + setupLibraries("Contexts", Contexts); + setupLibraries("Hooks", Hooks); + setupLibraries("Customizations", {}); + setupLibraries("Utils", Utils); + setupLibraries("Download", Download); + + setupLibraries("AccessControlService", AccessControlService); + + return new Promise((resolve) => { + initI18n(resolve); + }); +}; + +export { initLibraries, Enums, Hooks, subFormRegistry }; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/ApiCacheService.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/ApiCacheService.js new file mode 100644 index 00000000000..31bbe25c694 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/ApiCacheService.js @@ -0,0 +1,64 @@ +import { PersistantStorage } from "./Utils/Storage"; + +const defaultApiCachingSettings = [ + { + serviceName: "localization", + cacheTimeInSecs: 86400, + }, + { + serviceName: "access/v1/actions", + cacheTimeInSecs: 86400, + }, + { + serviceName: "user/_search", + cacheTimeInSecs: 86400, + }, + { + serviceName: "egov-mdms-service", + cacheTimeInSecs: 3600, + debounceTimeInMS: 100, + moduleSettings: [ + { + moduleName: "FSM", + cacheTimeInSecs: 7200, + }, + ], + }, +]; + +const storageKey = "cachingService"; +const getCachedSetting = () => { + if (Digit.ApiCacheSetting) { + return Digit.ApiCacheSetting; + } + const setting = PersistantStorage.get(storageKey) || defaultApiCachingSettings; + Digit.ApiCacheSetting = setting; + return setting; +}; +const getSetting = (serviceName, moduleName) => { + const setting = getCachedSetting(); + const serviceSetting = setting.find((item) => item.serviceName === serviceName); + const responseSetting = { + cacheTimeInSecs: serviceSetting.cacheTimeInSecs, + debounceTimeInMS: serviceSetting.debounceTimeInMS || 100, + }; + if (!moduleName) { + return responseSetting; + } + const moduleSettings = serviceSetting?.moduleSettings?.find((item) => item.moduleName === moduleName); + if (!moduleSettings) { + return responseSetting; + } + return { + cacheTimeInSecs: moduleSettings.cacheTimeInSecs || responseSetting.cacheTimeInSecs, + debounceTimeInMS: moduleSettings.debounceTimeInMS || responseSetting.debounceTimeInMS, + }; +}; +export const ApiCacheService = { + saveSetting: (setting) => { + PersistantStorage.set(storageKey, setting || defaultApiCachingSettings); + }, + getSettingByServiceUrl: (serviceUrl, moduleName) => { + return getSetting(serviceUrl.split("/")[1], moduleName); + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Download.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Download.js new file mode 100644 index 00000000000..9e044c47da0 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Download.js @@ -0,0 +1,208 @@ +import ReactDOM from "react-dom"; +import html2canvas from "html2canvas"; +import XLSX from "xlsx"; +import domtoimage from "dom-to-image"; + +const changeClasses=(class1,class2)=>{ + var elements = document.getElementsByClassName(class1) + Array.prototype.map.call(elements, function(testElement){ + testElement.classList.add(class2); + testElement.classList.remove(class1); + }); +} + +const revertCss=()=>{ + changeClasses("dss-white-pre-temp",'dss-white-pre-line'); +} + +const applyCss=()=>{ + changeClasses('dss-white-pre-line',"dss-white-pre-temp"); +} + +const Download = { + Image: (node, fileName, share, resolve = null) => { + const saveAs = (uri, filename) => { + const link = document.createElement("a"); + + if (typeof link.download === "string") { + link.href = uri; + link.download = filename; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } else { + window.open(uri); + } + }; + + const element = ReactDOM.findDOMNode(node.current); + html2canvas(element, { + scrollY: -window.scrollY, + scrollX: 0, + useCORS: true, + scale: 1.5, + }).then((canvas) => { + return share + ? canvas.toBlob((blob) => resolve(new File([blob], `${fileName}.jpeg`, { type: "image/jpeg" })), "image/jpeg", 1) + : saveAs(canvas.toDataURL("image/jpeg", 1), `${fileName}.jpeg`); + }); + }, + + Excel: (data, filename) => { + const file = filename.substring(0,30); + const wb = XLSX.utils.book_new(); + let ws = null; + ws = XLSX.utils.json_to_sheet(data) + wb.SheetNames.push(file); + wb.Sheets[file] = ws; + XLSX.writeFile(wb, `${file}.xlsx`); + }, + + PDF: (node, fileName, share, resolve = null) => { + + + + const saveAs = (uri, filename) => { + if(window.mSewaApp && window.mSewaApp.isMsewaApp()){ + window.mSewaApp.downloadBase64File(uri, filename); + } + const link = document.createElement("a"); + + if (typeof link.download === "string") { + link.href = uri; + link.download = filename; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } else { + window.open(uri); + } + }; + const dataURItoBlob = (dataURI) => { + var binary = atob(dataURI.split(',')[1]); + var array = []; + for (var i = 0; i < binary.length; i++) { + array.push(binary.charCodeAt(i)); + } + return new Blob([new Uint8Array(array)], { type: 'image/jpeg' }); + }; + changeClasses('dss-white-pre-line',"dss-white-pre-temp"); + + applyCss(); + const element = ReactDOM.findDOMNode(node.current); + + + return domtoimage.toJpeg(element, { + quality: 1, + bgcolor: 'white', + filter:node=>!node?.className?.includes?.("divToBeHidden"), + style:{ + margin:'25px' + } + }).then(function (dataUrl) { +/* to enable pdf + var htmlImage = new Image(); + htmlImage.src = dataUrl; + var pdf = new jsPDF( 'l', 'pt', [element.offsetWidth, element.offsetHeight] ); + pdf.setFontStyle?.("Bold"); + pdf.setFontSize?.(30); + pdf.text?.(325, 40, 'Certificate'); + // e(imageData, format, x, y, width, height, alias, compression, rotation) + pdf.addImage?.( htmlImage, 25, 50, 50, element.offsetWidth, element.offsetHeight ); + pdf.save?.( fileName +'.pdf' ); + */ + changeClasses("dss-white-pre-temp",'dss-white-pre-line'); + + revertCss(); + var blobData = dataURItoBlob(dataUrl); + revertCss(); + return share + ? resolve(new File([blobData], `${fileName}.jpeg`, { type: "image/jpeg" })) + : saveAs(dataUrl, `${fileName}.jpeg`) + }); + + + /* + const getPDF = (canvas) => { + const width = canvas.width; + const height = canvas.height; + const o = width > height ? "l" : "p"; + const format = "a4"; + + return new jsPDF(o, "mm", format); + }; + + const element = ReactDOM.findDOMNode(node.current); + return html2canvas(element, { + scrollY: -window.scrollY, + scrollX: 0, + useCORS: true, + scale: 1.5, + windowWidth: document.documentElement.offsetWidth, + windowHeight: document.documentElement.offsetHeight, + }).then((canvas) => { + const pdf = getPDF(canvas); + const jpegImage = canvas.toDataURL("image/jpeg"); + const imgProps = pdf.getImageProperties(jpegImage); + const margin = 0.1; + const pageHeight = 295; + // const pdfWidth = pdf.internal.pageSize.width * (1 - margin); + const pdfWidth = (imgProps.width * pageHeight) / (imgProps.height * 1.2) + const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width; + const x = (pdf.internal.pageSize.width - pdfWidth) / 2; + let position = 5; + // let heightLeft = pdfHeight; + pdf.addImage(jpegImage, "JPEG", x, position, pdfWidth, pdfHeight, "a", "FAST"); + // heightLeft -= pageHeight; + // while (heightLeft > 0) { + // position += heightLeft - pdfHeight; + // pdf.addPage(); + // pdf.addImage(jpegImage, "JPEG", x, position, pdfWidth, pdfHeight, "a", "FAST"); + // heightLeft -= pageHeight; + // } + return share ? new File([pdf.output("blob")], `${fileName}.pdf`, { type: "application/pdf" }) : pdf.save(`${fileName}.pdf`); + }); + */ + }, + + IndividualChartImage: (node, fileName, share, resolve = null) => { + const saveAs = (uri, filename) => { + if(window.mSewaApp && window.mSewaApp.isMsewaApp()){ + window.mSewaApp.downloadBase64File(uri, filename); + } + const link = document.createElement("a"); + + if (typeof link.download === "string") { + link.href = uri; + link.download = filename; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } else { + window.open(uri); + } + }; + const dataURItoBlob = (dataURI) => { + var binary = atob(dataURI.split(',')[1]); + var array = []; + for (var i = 0; i < binary.length; i++) { + array.push(binary.charCodeAt(i)); + } + return new Blob([new Uint8Array(array)], { type: 'image/jpeg' }); + }; + changeClasses('dss-white-pre-line',"dss-white-pre-temp"); + const element = ReactDOM.findDOMNode(node.current); + return domtoimage.toJpeg(element, { + quality: 1, + bgcolor: 'white' + }).then(function (dataUrl) { + var blobData = dataURItoBlob(dataUrl); + changeClasses("dss-white-pre-temp",'dss-white-pre-line'); + return share + ? resolve(new File([blobData], `${fileName}.jpeg`, { type: "image/jpeg" })) + : saveAs(dataUrl, `${fileName}.jpeg`) + }); + + }, +}; +export default Download; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/JsDictionary.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/JsDictionary.js new file mode 100644 index 00000000000..45d3a347fd1 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/JsDictionary.js @@ -0,0 +1,24 @@ +class JsDictionary { + constructor(defaultFiller){ + this.defaultFiller = defaultFiller || [] + // [["key1", "valu1"],["key2", "value2"]] + } + + set(key, value){ + const __mutatedMap = this.defaultFiller.push([key, value]) + return __mutatedMap + } + + get(){ + + } + + delete(key){ + const __indexofKeyToDelete = this.defaultFiller.findIndex( e => e[0] === key ) + const __mutatedMap = this.defaultFiller.splice(__indexofKeyToDelete, 1) + return __mutatedMap + } + +} + +export default new JsDictionary([]) \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/UploadServices.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/UploadServices.js new file mode 100644 index 00000000000..493b743342e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/UploadServices.js @@ -0,0 +1,51 @@ +import Axios from "axios"; +import Urls from "./urls"; +export const UploadServices = { + Filestorage: async (module, filedata, tenantId) => { + const formData = new FormData(); + + formData.append("file", filedata, filedata.name); + formData.append("tenantId", tenantId); + formData.append("module", module); + let tenantInfo=window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE")?`?tenantId=${tenantId}`:""; + var config = { + method: "post", + url:`${Urls.FileStore}${tenantInfo}`, + data: formData, + headers: { "auth-token": Digit.UserService.getUser() ? Digit.UserService.getUser()?.access_token : null}, + }; + + return Axios(config); + }, + + MultipleFilesStorage: async (module, filesData, tenantId) => { + const formData = new FormData(); + const filesArray = Array.from(filesData) + filesArray?.forEach((fileData, index) => fileData ? formData.append("file", fileData, fileData.name) : null); + formData.append("tenantId", tenantId); + formData.append("module", module); + let tenantInfo=window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE")?`?tenantId=${tenantId}`:""; + var config = { + method: "post", + url:`${Urls.FileStore}${tenantInfo}`, + data: formData, + headers: { 'Content-Type': 'multipart/form-data',"auth-token": Digit.UserService.getUser().access_token }, + }; + + return Axios(config); + }, + + Filefetch: async (filesArray, tenantId) => { + let tenantInfo=window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE")?`?tenantId=${tenantId}`:""; + var config = { + method: "get", + url:`${Urls.FileFetch}${tenantInfo}`, + params: { + tenantId: tenantId, + fileStoreIds: filesArray?.join(","), + }, + }; + const res = await Axios(config); + return res; + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Date.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Date.js new file mode 100644 index 00000000000..3b3cfc5bc0d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Date.js @@ -0,0 +1,39 @@ +import { format, toDate } from "date-fns"; + +export const ConvertTimestampToDate = (timestamp, dateFormat = "d-MMM-yyyy") => { + return timestamp ? format(toDate(timestamp), dateFormat) : null; +}; + +export const ConvertEpochToDate = (dateEpoch) => { + if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") { + return "NA"; + } + const dateFromApi = new Date(dateEpoch); + let month = dateFromApi.getMonth() + 1; + let day = dateFromApi.getDate(); + let year = dateFromApi.getFullYear(); + month = (month > 9 ? "" : "0") + month; + day = (day > 9 ? "" : "0") + day; + return `${day}/${month}/${year}`; +}; + +export const ConvertEpochToTimeInHours = (dateEpoch) => { + if (dateEpoch == null || dateEpoch == undefined || dateEpoch == "") { + return "NA"; + } + const dateFromApi = new Date(dateEpoch); + let hour = dateFromApi.getHours(); + let min = dateFromApi.getMinutes(); + let period = hour > 12 ? "PM" : "AM"; + hour = hour > 12 ? hour - 12 : hour; + hour = (hour > 9 ? "" : "0") + hour; + min = (min > 9 ? "" : "0") + min; + return `${hour}:${min} ${period}`; +}; + +export const getDayfromTimeStamp = (timestamp) => { + var a = new Date(timestamp); + var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; + var dayOfWeek = days[a.getDay()] + return dayOfWeek +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/ParsingUtils.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/ParsingUtils.js new file mode 100644 index 00000000000..f056008748c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/ParsingUtils.js @@ -0,0 +1,53 @@ +import XLSX from 'xlsx'; + +export const parseXlsToJson = (event,setter) => { + event.preventDefault() + + const file = event.target.files[0]; + const reader = new FileReader(); + reader.onload = (e) => { + const data = new Uint8Array(e.target.result); + const workbook = XLSX.read(data, { type: 'array' }); + const sheetName = workbook.SheetNames[0]; // Assuming you want the first sheet + + const result = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName]); + setter(()=>result) + }; + + reader.readAsArrayBuffer(file); +} + +export const parseXlsToJsonMultipleSheets = (uploadEvent) => { + const allowedFileTypes = ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel']; + + return new Promise((resolve, reject) => { + const uploadedFile = uploadEvent.target.files[0]; + + if (!allowedFileTypes.includes(uploadedFile.type)) { + reject(new Error('WBH_LOC_INAVLID_FILY_TYPE')); + return; + } + const reader = new FileReader(); + + reader.onload = function(event) { + const arrayBuffer = event.target.result; + const workbook = XLSX.read(arrayBuffer, { type: 'arraybuffer' }); + const jsonData = {}; + + workbook.SheetNames.forEach(sheetName => { + const worksheet = workbook.Sheets[sheetName]; + const jsonSheetData = XLSX.utils.sheet_to_json(worksheet); + jsonData[sheetName] = jsonSheetData; + }); + + resolve(jsonData); + }; + + reader.onerror = function(error) { + reject(error); + }; + + reader.readAsArrayBuffer(uploadEvent.target.files[0]); + }); +} + diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Request.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Request.js new file mode 100644 index 00000000000..93e927cfa1f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Request.js @@ -0,0 +1,211 @@ +import Axios from "axios"; + +/** + * Custom Request to make all api calls + * + * @author jagankumar-egov + * + */ + +Axios.interceptors.response.use( + (res) => res, + (err) => { + const isEmployee = window.location.pathname.split("/").includes("employee"); + if (err?.response?.data?.Errors) { + for (const error of err.response.data.Errors) { + if (error.message.includes("InvalidAccessTokenException")) { + localStorage.clear(); + sessionStorage.clear(); + window.location.href = + (isEmployee ? `/${window?.contextPath}/employee/user/login` : `/${window?.contextPath}/citizen/login`) + + `?from=${encodeURIComponent(window.location.pathname + window.location.search)}`; + } else if ( + error?.message?.toLowerCase()?.includes("internal server error") || + error?.message?.toLowerCase()?.includes("some error occured") + ) { + window.location.href = + (isEmployee ? `/${window?.contextPath}/employee/user/error` : `/${window?.contextPath}/citizen/error`) + + `?type=maintenance&from=${encodeURIComponent(window.location.pathname + window.location.search)}`; + } else if (error.message.includes("ZuulRuntimeException")) { + window.location.href = + (isEmployee ? `/${window?.contextPath}/employee/user/error` : `/${window?.contextPath}/citizen/error`) + + `?type=notfound&from=${encodeURIComponent(window.location.pathname + window.location.search)}`; + } + } + } + throw err; + } +); + +const requestInfo = () => ({ + authToken: Digit.UserService.getUser()?.access_token || null, +}); + +const authHeaders = () => ({ + "auth-token": Digit.UserService.getUser()?.access_token || null, +}); + +const userServiceData = () => ({ userInfo: Digit.UserService.getUser()?.info }); + +window.Digit = window.Digit || {}; +window.Digit = { ...window.Digit, RequestCache: window.Digit.RequestCache || {} }; +export const Request = async ({ + method = "POST", + url, + data = {}, + headers = {}, + useCache = false, + params = {}, + auth, + urlParams = {}, + userService, + locale = true, + authHeader = false, + setTimeParam = true, + userDownload = false, + noRequestInfo = false, + multipartFormData = false, + multipartData = {}, + reqTimestamp = false, +}) => { + const ts = new Date().getTime(); + if (method.toUpperCase() === "POST") { + + data.RequestInfo = { + apiId: "Rainmaker", + }; + if (auth || !!Digit.UserService.getUser()?.access_token) { + data.RequestInfo = { ...data.RequestInfo, ...requestInfo() }; + } + if (userService) { + data.RequestInfo = { ...data.RequestInfo, ...userServiceData() }; + } + if (locale) { + data.RequestInfo = { ...data.RequestInfo, msgId: `${ts}|${Digit.StoreData.getCurrentLanguage()}` }; + } + + if (noRequestInfo) { + delete data.RequestInfo; + } + + /* + Feature :: Privacy + + Desc :: To send additional field in HTTP Requests inside RequestInfo Object as plainAccessRequest + */ + const privacy = Digit.Utils.getPrivacyObject(); + if (privacy && !url.includes("/edcr/rest/dcr/")) { + if(!noRequestInfo){ + data.RequestInfo = { ...data.RequestInfo, plainAccessRequest: { ...privacy } }; + } + } + } + + const headers1 = { + "Content-Type": "application/json", + Accept: window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE") ? "application/pdf,application/json" : "application/pdf", + }; + + if (authHeader) headers = { ...headers, ...authHeaders() }; + + if (userDownload) headers = { ...headers, ...headers1 }; + + let key = ""; + if (useCache) { + key = `${method.toUpperCase()}.${url}.${btoa(escape(JSON.stringify(params, null, 0)))}.${btoa(escape(JSON.stringify(data, null, 0)))}`; + const value = window.Digit.RequestCache[key]; + if (value) { + return value; + } + } else if (setTimeParam) { + params._ = Date.now(); + } + if (reqTimestamp) { + data.RequestInfo = { ...data.RequestInfo, ts: Number(ts) }; + } + + let _url = url + .split("/") + .map((path) => { + let key = path.split(":")?.[1]; + return urlParams[key] ? urlParams[key] : path; + }) + .join("/"); + + if (multipartFormData) { + const multipartFormDataRes = await Axios({ + method, + url: _url, + data: multipartData.data, + params, + headers: { "Content-Type": "multipart/form-data", "auth-token": Digit.UserService.getUser()?.access_token || null }, + }); + return multipartFormDataRes; + } + /* + Feature :: Single Instance + + Desc :: Fix for central instance to send tenantID in all query params + */ + const tenantInfo = + Digit.SessionStorage.get("userType") === "citizen" + ? Digit.ULBService.getStateId() + : Digit.ULBService.getCurrentTenantId() || Digit.ULBService.getStateId(); + if (!params["tenantId"] && window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE")) { + params["tenantId"] = tenantInfo; + } + + const res = userDownload + ? await Axios({ method, url: _url, data, params, headers, responseType: "arraybuffer" }) + : await Axios({ method, url: _url, data, params, headers }); + + if (userDownload) return res; + + const returnData = res?.data || res?.response?.data || {}; + if (useCache && res?.data && Object.keys(returnData).length !== 0) { + window.Digit.RequestCache[key] = returnData; + } + return returnData; +}; + +/** + * + * @param {*} serviceName + * + * preHook: + * ({params, data}) => ({params, data}) + * + * postHook: + * ({resData}) => ({resData}) + * + */ + +export const ServiceRequest = async ({ + serviceName, + method = "POST", + url, + data = {}, + headers = {}, + useCache = false, + params = {}, + auth, + reqTimestamp, + userService, +}) => { + const preHookName = `${serviceName}Pre`; + const postHookName = `${serviceName}Post`; + + let reqParams = params; + let reqData = data; + if (window[preHookName] && typeof window[preHookName] === "function") { + let preHookRes = await window[preHookName]({ params, data }); + reqParams = preHookRes.params; + reqData = preHookRes.data; + } + const resData = await Request({ method, url, data: reqData, headers, useCache, params: reqParams, auth, userService,reqTimestamp }); + + if (window[postHookName] && typeof window[postHookName] === "function") { + return await window[postHookName](resData); + } + return resData; +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Storage.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Storage.js new file mode 100644 index 00000000000..e53725bb611 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/Utils/Storage.js @@ -0,0 +1,55 @@ +const localStoreSupport = () => { + try { + return "sessionStorage" in window && window["sessionStorage"] !== null; + } catch (e) { + return false; + } +}; + +const k = (key) => `Digit.${key}`; +const getStorage = (storageClass) => ({ + get: (key) => { + if (localStoreSupport() && key) { + let valueInStorage = storageClass.getItem(k(key)); + if (!valueInStorage || valueInStorage === "undefined") { + return null; + } + const item = JSON.parse(valueInStorage); + if (Date.now() > item.expiry) { + storageClass.removeItem(k(key)); + return null; + } + return item.value; + } else if (typeof window !== "undefined") { + return window?.eGov?.Storage && window.eGov.Storage[k(key)].value; + } else { + return null; + } + }, + set: (key, value, ttl = 86400) => { + const item = { + value, + ttl, + expiry: Date.now() + ttl * 1000, + }; + if (localStoreSupport()) { + storageClass.setItem(k(key), JSON.stringify(item)); + } else if (typeof window !== "undefined") { + window.eGov = window.eGov || {}; + window.eGov.Storage = window.eGov.Storage || {}; + window.eGov.Storage[k(key)] = item; + } + }, + del: (key) => { + if (localStoreSupport()) { + storageClass.removeItem(k(key)); + } else if (typeof window !== "undefined") { + window.eGov = window.eGov || {}; + window.eGov.Storage = window.eGov.Storage || {}; + delete window.eGov.Storage[k(key)]; + } + }, +}); + +export const Storage = getStorage(window.sessionStorage); +export const PersistantStorage = getStorage(window.localStorage); diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js new file mode 100644 index 00000000000..8f48cc54f81 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js @@ -0,0 +1,225 @@ +const Urls = { + MDMS: `/egov-mdms-service/v1/_search`, + WorkFlow: `/egov-workflow-v2/egov-wf/businessservice/_search`, + WorkFlowProcessSearch: `/egov-workflow-v2/egov-wf/process/_search`, + localization: `/localization/messages/v1/_search`, + location: { + localities: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=ADMIN&boundaryType=Locality`, + wards: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=ADMIN&boundaryType=Ward`, + revenue_localities: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=REVENUE&boundaryType=Locality`, + }, + + pgr_search: `/pgr-services/v2/request/_search`, + pgr_update: `/pgr-services/v2/request/_update`, + filter_data: `https://run.mocky.io/v3/597a50a0-90e5-4a45-b82e-8a2186b760bd`, + FileStore: "/filestore/v1/files", + + FileFetch: "/filestore/v1/files/url", + PGR_Create: `/pgr-services/v2/request/_create`, + pgr_count: `/pgr-services/v2/request/_count`, + + OTP_Send: "/user-otp/v1/_send", + Authenticate: "/user/oauth/token", + RegisterUser: "/user/citizen/_create", + ChangePassword: "/user/password/nologin/_update", + ChangePassword1: "/user/password/_update", + UserProfileUpdate: "/user/profile/_update", + EmployeeSearch: "/egov-hrms/employees/_search", + + InboxSearch: "/works-inbox-service/v2/_search", + + UserSearch: "/user/_search", + UserLogout: "/user/_logout", + + Shortener: "/egov-url-shortening/shortener", + + works: { + create:"/loi-service/v1/_create", + estimateSearch:"/estimate-service/estimate/v1/_search", + loiSearch:"/loi-service/v1/_search", + createEstimate:"/estimate-service/estimate/v1/_create", + approvedEstimateSearch:"/estimate-service/estimate/v1/_search", + searchEstimate:"/estimate-service/estimate/v1/_search", + updateLOI:"/loi-service/v1/_update", + updateEstimate:"/estimate-service/estimate/v1/_update", + download_pdf:"/egov-pdf/download/WORKSESTIMATE/estimatepdf" + }, + + fsm: { + search: "/fsm/v1/_search", + create: "/fsm/v1/_create", + update: "/fsm/v1/_update", + vendorSearch: "/vendor/v1/_search", + vehicleSearch: "/vehicle/v1/_search", + audit: "/fsm/v1/_audit", + vehicleTripSearch: "/vehicle/trip/v1/_search", + billingSlabSearch: "/fsm-calculator/v1/billingSlab/_search", + vehilceUpdate: "/vehicle/trip/v1/_update", + createVendor: "/vendor/v1/_create", + updateVendor: "/vendor/v1/_update", + createVehicle: "/vehicle/v1/_create", + updateVehicle: "/vehicle/v1/_update", + driverSearch: "/vendor/driver/v1/_search", + createDriver: "/vendor/driver/v1/_create", + updateDriver: "/vendor/driver/v1/_update", + vehicleTripCreate: "/vehicle/trip/v1/_create", + }, + + payment: { + fetch_bill: "/billing-service/bill/v2/_fetchbill", + demandSearch: "/billing-service/demand/_search", + create_reciept: "/collection-services/payments/_create", + print_reciept: "/collection-services/payments", + generate_pdf: "/pdf-service/v1/_create", + create_citizen_reciept: "/pg-service/transaction/v1/_create", + update_citizen_reciept: "/pg-service/transaction/v1/_update", + search_bill: "/billing-service/bill/v2/_search", + reciept_search: "/collection-services/payments/:buisnessService/_search", + obps_Reciept_Search: "/collection-services/payments/_search", + billAmendmentSearch: "/billing-service/amendment/_search", + getBulkPdfRecordsDetails: "/pdf-service/v1/_getBulkPdfRecordsDetails", + }, + + pt: { + fectch_property: "/property-services/property/_search", + fetch_payment_details: "/billing-service/bill/v2/_fetchbill", + create: "/property-services/property/_create", + search: "/property-services/property/_search", + update: "/property-services/property/_update", + pt_calculation_estimate: "/pt-calculator-v2/propertytax/v2/_estimate", + assessment_create: "/property-services/assessment/_create", + assessment_search: "/property-services/assessment/_search", + payment_search: "/collection-services/payments/PT/_search", + pt_calculate_mutation: "/pt-calculator-v2/propertytax/mutation/_calculate", + }, + + dss: { + dashboardConfig: "/dashboard-analytics/dashboard/getDashboardConfig", + getCharts: "/dashboard-analytics/dashboard/getChartV2", + }, + + mcollect: { + search: "/echallan-services/eChallan/v1/_search", + create: "/echallan-services/eChallan/v1/_create?", + fetch_bill: "/billing-service/bill/v2/_fetchbill?", + search_bill: "/egov-searcher/bill-genie/mcollectbills/_get", + search_bill_pt: "/egov-searcher/bill-genie/billswithaddranduser/_get", + update: "/echallan-services/eChallan/v1/_update", + download_pdf: "/egov-pdf/download/UC/mcollect-challan", + receipt_download: "/egov-pdf/download/PAYMENT/consolidatedreceipt", + bill_download: "/egov-pdf/download/BILL/consolidatedbill", + count: "/echallan-services/eChallan/v1/_count", + }, + hrms: { + search: "/egov-hrms/employees/_search", + count: "/egov-hrms/employees/_count", + create: "/egov-hrms/employees/_create", + update: "/egov-hrms/employees/_update", + }, + tl: { + create: "/tl-services/v1/_create", + search: "/tl-services/v1/_search", + fetch_payment_details: "/billing-service/bill/v2/_fetchbill", + download_pdf: "/egov-pdf/download/TL/", + update: "/tl-services/v1/_update", + billingslab: "/tl-calculator/billingslab/_search", + }, + receipts: { + receipt_download: "/egov-pdf/download/PAYMENT/consolidatedreceipt", + payments: "/collection-services/payments", + count: "/egov-hrms/employees/_count", + }, + obps: { + scrutinyDetails: "/edcr/rest/dcr/scrutinydetails", + comparisionReport: "/edcr/rest/dcr/occomparison", + create: "/bpa-services/v1/bpa/_create", + nocSearch: "/noc-services/v1/noc/_search", + updateNOC: "/noc-services/v1/noc/_update", + update: "/bpa-services/v1/bpa/_update", + bpaSearch: "/bpa-services/v1/bpa/_search", + bpaRegSearch: "/tl-services/v1/BPAREG/_search", + bpaRegCreate: "/tl-services/v1/BPAREG/_create", + bpaRegGetBill: "/tl-calculator/v1/BPAREG/_getbill", + bpaRegUpdate: "/tl-services/v1/BPAREG/_update", + receipt_download: "/egov-pdf/download/PAYMENT/consolidatedreceipt", + edcrreportdownload: "/bpa-services/v1/bpa/_permitorderedcr", + getSearchDetails: "/inbox/v1/dss/_search" + }, + + edcr: { + create: "/edcr/rest/dcr/scrutinize", + }, + + events: { + search: "/egov-user-event/v1/events/_search", + update: "/egov-user-event/v1/events/lat/_update", + updateEvent: "/egov-user-event/v1/events/_update", + updateEventCDG: "/egov-user-event/v1/events/lat/_update", + count: "/egov-user-event/v1/events/notifications/_count", + create: "/egov-user-event/v1/events/_create", + }, + + ws: { + water_create: "/ws-services/wc/_create", + sewarage_create: "/sw-services/swc/_create", + water_search: "/ws-services/wc/_search", + sewarage_search: "/sw-services/swc/_search", + water_update: "/ws-services/wc/_update", + sewarage_update: "/sw-services/swc/_update", + ws_calculation_estimate: "/ws-calculator/waterCalculator/_estimate", + sw_calculation_estimate: "/sw-calculator/sewerageCalculator/_estimate", + ws_connection_search: "/ws-calculator/meterConnection/_search", + sw_payment_search: "/collection-services/payments/SW/_search", + ws_payment_search: "/collection-services/payments/WS/_search", + billAmendmentCreate: "/billing-service/amendment/_create", + billAmendmentUpdate: "/billing-service/amendment/_update", + ws_meter_conncetion_create: "/ws-calculator/meterConnection/_create", + sw_meter_conncetion_create: "/sw-calculator/meterConnection/_create", + wns_group_bill: "/egov-pdf/download/WNS/wnsgroupbill", + cancel_group_bill: "/pdf-service/v1/_cancelProcess", + wns_generate_pdf: "/egov-pdf/download/WNS/wnsbill", + water_applyAdhocTax : "/ws-calculator/waterCalculator/_applyAdhocTax", + sewerage_applyAdhocTax: "/sw-calculator/sewerageCalculator/_applyAdhocTax", + getSearchDetails: "/inbox/v1/dss/_search", + }, + + engagement: { + document: { + search: "/egov-document-uploader/egov-du/document/_search", + create: "/egov-document-uploader/egov-du/document/_create", + delete: "/egov-document-uploader/egov-du/document/_delete", + update: "/egov-document-uploader/egov-du/document/_update", + }, + surveys: { + create: "/egov-survey-services/egov-ss/survey/_create", + update: "/egov-survey-services/egov-ss/survey/_update", + search: "/egov-survey-services/egov-ss/survey/_search", + delete: "/egov-survey-services/egov-ss/survey/_delete", + submitResponse: "/egov-survey-services/egov-ss/survey/response/_submit", + showResults: "/egov-survey-services/egov-ss/survey/response/_results", + }, + }, + + attendencemgmt: { + mustorRoll: { + estimate: "/muster-roll/v1/_estimate", + create: "/muster-roll/v1/_create", + update: "/muster-roll/v1/_update", + search: "/muster-roll/v1/_search" + } + }, + + noc: { + nocSearch: "/noc-services/v1/noc/_search", + }, + reports: { + reportSearch: "/report/", + }, + bills:{ + cancelBill:"/billing-service/bill/v2/_cancelbill" + }, + access_control: "/access/v1/actions/mdms/_get", + billgenie: "/egov-searcher", +}; + +export default Urls; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Access.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Access.js new file mode 100644 index 00000000000..cbc74bc6fdd --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Access.js @@ -0,0 +1,21 @@ +import { ServiceRequest } from "../atoms/Utils/Request"; +import Urls from "../atoms/urls"; + +const AccessControlService = { + getAccessControl: (roles = []) => + ServiceRequest({ + url: Urls.access_control, + method: "POST", + auth: true, + useCache: true, + userService: true, + data: { + roleCodes: roles, + tenantId: Digit.ULBService.getStateId(), + actionMaster: "actions-test", + enabled: true, + }, + reqTimestamp: true, + }), +}; +export default AccessControlService; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ApplicationUpdateActionsCustom.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ApplicationUpdateActionsCustom.js new file mode 100644 index 00000000000..1477fc981fe --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ApplicationUpdateActionsCustom.js @@ -0,0 +1,14 @@ +import { CustomService } from "./CustomService"; + + +const ApplicationUpdateActionsCustom = async ({ url, body }) => { + try { + //here need to update this object to send + const response = await CustomService.getResponse({ url, body,useCache:false,setTimeParam:false }); + return response; + } catch (error) { + throw new Error(error?.response?.data?.Errors[0].message); + } +}; + +export default ApplicationUpdateActionsCustom; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Bill.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Bill.js new file mode 100644 index 00000000000..37c198bfa60 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Bill.js @@ -0,0 +1,34 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +const BillingService = { + search_bill: ({ tenantId, filters }) => + Request({ + url: `${Urls.billgenie}${filters.url}`, + useCache: false, + method: "POST", + data: { + searchCriteria: { + tenantId: tenantId, + ...filters, + }, + }, + auth: true, + userService: false, + }), + cancel_bill:(filters) => + Request({ + url: Urls?.bills?.cancelBill, + useCache: false, + method: "POST", + data: { + UpdateBillCriteria: { + ...filters, + }, + }, + auth: true, + userService: false, + }), +} + +export default BillingService diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Complaint.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Complaint.js new file mode 100644 index 00000000000..6fc521f467f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Complaint.js @@ -0,0 +1,87 @@ +export const Complaint = { + create: async ({ + cityCode, + complaintType, + description, + landmark, + city, + district, + region, + state, + pincode, + localityCode, + localityName, + uploadedImages, + mobileNumber, + name, + }) => { + const tenantId = Digit.ULBService.getCurrentTenantId(); + const defaultData = { + service: { + tenantId: cityCode, + serviceCode: complaintType, + description: description, + additionalDetail: {}, + source: Digit.Utils.browser.isWebview() ? "mobile" : "web", + address: { + landmark: landmark, + city: city, + district: district, + region: region, + state: state, + pincode: pincode, + locality: { + code: localityCode, + name: localityName, + }, + geoLocation: {}, + }, + }, + workflow: { + action: "APPLY", + verificationDocuments: uploadedImages, + }, + }; + + if (Digit.SessionStorage.get("user_type") === "employee") { + defaultData.service.citizen = { + name: name, + type: "CITIZEN", + mobileNumber: mobileNumber, + roles: [ + { + id: null, + name: "Citizen", + code: "CITIZEN", + tenantId: tenantId, + }, + ], + tenantId: tenantId, + }; + } + const response = await Digit.PGRService.create(defaultData, cityCode); + return response; + }, + + assign: async (complaintDetails, action, employeeData, comments, uploadedDocument, tenantId) => { + complaintDetails.workflow.action = action; + complaintDetails.workflow.assignes = employeeData ? [employeeData.uuid] : null; + complaintDetails.workflow.comments = comments; + uploadedDocument + ? (complaintDetails.workflow.verificationDocuments = [ + { + documentType: "PHOTO", + fileStoreId: uploadedDocument, + documentUid: "", + additionalDetails: {}, + }, + ]) + : null; + + if (!uploadedDocument) complaintDetails.workflow.verificationDocuments = []; + + //TODO: get tenant id + const response = await Digit.PGRService.update(complaintDetails, tenantId); + return response; + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ComponentRegistry.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ComponentRegistry.js new file mode 100644 index 00000000000..2d8c5c23d63 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/ComponentRegistry.js @@ -0,0 +1,19 @@ +import ComponentRegistry from "../../utils/componentRegistry"; +const componentRegistry = new ComponentRegistry(); + +export const ComponentRegistryService = { + getComponent: (id) => { + return componentRegistry.getComponent(id); + }, + + setComponent: (id, component = {}) => { + return componentRegistry.setComponent(id, component); + }, + + setupRegistry: (components) => { + // should be call only once at the starting + return componentRegistry.setAllComponents(components); + }, + + getRegistry: () => componentRegistry, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/CustomService.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/CustomService.js new file mode 100644 index 00000000000..994b087f137 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/CustomService.js @@ -0,0 +1,19 @@ +import { Request } from "../atoms/Utils/Request"; + +export const CustomService = { + getResponse: ({ url, params, body, plainAccessRequest,useCache=true,userService=true,setTimeParam=true,userDownload=false}) => + Request({ + url: url, + data: body, + useCache, + userService, + method: "POST", + auth: true, + params: params, + plainAccessRequest: plainAccessRequest, + userDownload:userDownload, + setTimeParam + }) +}; + + diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/DSS.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/DSS.js new file mode 100644 index 00000000000..fe9f2cf0a7b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/DSS.js @@ -0,0 +1,45 @@ +import { getCustomFiltersDynamicValues, getFilterOptionsForConfig } from "../../utils/dss"; +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; +import { MdmsService } from "./MDMS"; + +export const DSSService = { + getDashboardConfig: (moduleCode) => + Request({ + url: Urls.dss.dashboardConfig + `/${moduleCode}`, + useCache: false, + userService: false, + method: "GET", + authHeader: true, + }), + getCharts: (data) => + Request({ + url: Urls.dss.getCharts, + useCache: false, + userService: false, + method: "POST", + auth: true, + data, + }), + getFiltersConfigData: (data) => getFilterOptionsForConfig(data), + getCustomFiltersDynamicValues: async (data) => { + let tenantId = Digit.ULBService.getCurrentTenantId() || Digit.ULBService.getStateId(); + let mdmsResp = await MdmsService.call(tenantId, { + moduleDetails: [ + { + moduleName: "dss-dashboard", + masterDetails: [ + { + name: "CustomFilterValues", + }, + ], + }, + ] + }) + if (!mdmsResp) mdmsResp = {}; + if (!mdmsResp?.tenantId) { + _.set(mdmsResp, 'tenantId', tenantId) + } + return getCustomFiltersDynamicValues(data, mdmsResp); + } +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Engagement.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Engagement.js new file mode 100644 index 00000000000..e0f1bdfac79 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Engagement.js @@ -0,0 +1,42 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const Engagement = { + search: (filters = {}) => + Request({ + url: Urls.engagement.document.search, + useCache: false, + method: "POST", + auth: true, + userService: false, + params: { ...filters }, + }), + create: (details) => + Request({ + url: Urls.engagement.document.create, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + locale: true + }), + delete: (details) => + Request({ + url: Urls.engagement.document.delete, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + }), + update: (details) => + Request({ + url: Urls.engagement.document.update, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + }), +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Events.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Events.js new file mode 100644 index 00000000000..047b4fe33e7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Events.js @@ -0,0 +1,64 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +const Events = { + Search: ({tenantId, data, filter= {}, auth = false}) => { + // const userType = Digit.UserService.getType(); + // if(userType==="employee") auth = true + // else auth = false + //reverting these changes as it is working fine without sending authToken + return Request({ + url: Urls.events.search, + useCache: false, + data: data, + method: "POST", + auth, + userService: false, + params: { tenantId, ...filter }, + }) + }, + ClearNotification: ({tenantId}) => Request({ + url: Urls.events.update, + useCache: false, + method: "POST", + auth: true, + userService: false, + params: { tenantId }, + }), + NotificationCount: ({tenantId}) => Request({ + url: Urls.events.count, + useCache: false, + method: "POST", + auth: true, + userService: false, + params: { tenantId }, + }), + Create: (data) => + Request({ + url: Urls.events.create, + useCache: false, + method: "POST", + auth: true, + data: data, + userService: false, + }), + Update: (data) => + Request({ + url: window?.globalConfigs?.getConfig("ENABLE_SINGLEINSTANCE") ? Urls.events.updateEventCDG : Urls.events.updateEvent , + useCache: false, + method: "POST", + auth: true, + data: data, + userService: false, + }), + EventDetails: async (tenantId, filter) => { + const eventRes = await Events.Search({ tenantId, filter }); + if (eventRes?.events?.length < 1) return; + const [event] = eventRes?.events; + const fileStoresIds = event?.eventDetails?.documents?.map(document => document?.fileStoreId); + const uploadedFilesData = fileStoresIds?.length > 0 ? await Digit.UploadServices.Filefetch(fileStoresIds, tenantId) : null + return {...event, uploadedFilesData} + } +} + +export default Events \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/HRMS.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/HRMS.js new file mode 100644 index 00000000000..1fe9a3f4267 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/HRMS.js @@ -0,0 +1,46 @@ +import { roundToNearestMinutes } from "date-fns/esm"; +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +const HrmsService = { + search: (tenantId, filters, searchParams) => + Request({ + url: Urls.hrms.search, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId, ...filters, ...searchParams }, + }), + create: (data, tenantId) => + Request({ + data: data, + url: Urls.hrms.create, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId }, + }), + update: (data, tenantId) => + Request({ + data: data, + url: Urls.hrms.update, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId }, + }), + count: (tenantId) => + Request({ + url: Urls.hrms.count, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId }, + }), +}; + +export default HrmsService; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/InboxService.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/InboxService.js new file mode 100644 index 00000000000..6b6b45e8d51 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/InboxService.js @@ -0,0 +1,15 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const InboxGeneral = { + Search: ({ ...filters }) =>{ + return Request({ + url: Urls.InboxSearch, + useCache: false, + method: "POST", + auth: true, + userService: true, + data: { ...filters }, + }) + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localities.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localities.js new file mode 100644 index 00000000000..0ef16e7acaf --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localities.js @@ -0,0 +1,25 @@ +import { LocalizationService } from "./Localization/service"; + +const ADMIN_CODE = ({ tenantId, hierarchyType }) => { + return tenantId.replace(".", "_").toUpperCase() + "_" + hierarchyType.code; +}; + +const getI18nKeys = (localitiesWithLocalizationKeys) => { + return localitiesWithLocalizationKeys.map((locality) => ({ + code: locality.code, + message: locality.name, + })); +}; + +const getLocalities = (tenantBoundry) => { + const adminCode = ADMIN_CODE(tenantBoundry); + const localitiesWithLocalizationKeys = tenantBoundry.boundary.map((boundaryObj) => ({ + ...boundaryObj, + i18nkey: adminCode + "_" + boundaryObj.code, + })); + return localitiesWithLocalizationKeys; +}; + +export const LocalityService = { + get: (tenantBoundry) => getLocalities(tenantBoundry), +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localization/service.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localization/service.js new file mode 100644 index 00000000000..993767db43e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Localization/service.js @@ -0,0 +1,93 @@ +import Urls from "../../atoms/urls"; +import { PersistantStorage } from "../../atoms/Utils/Storage"; +import i18next from "i18next"; +import { Request } from "../../atoms/Utils/Request"; +import { ApiCacheService } from "../../atoms/ApiCacheService"; + +const LOCALE_LIST = (locale) => `Locale.${locale}.List`; +const LOCALE_ALL_LIST = () => `Locale.List`; +const LOCALE_MODULE = (locale, module) => `Locale.${locale}.${module}`; + +const TransformArrayToObj = (traslationList) => { + return traslationList.reduce( + // eslint-disable-next-line + (obj, item) => ((obj[item.code] = item.message), obj), + {} + ); + // return trasformedTraslation; +}; + +const getUnique = (arr) => { + return arr.filter((value, index, self) => self.indexOf(value) === index); +}; + +const LocalizationStore = { + getCaheData: (key) => PersistantStorage.get(key), + setCacheData: (key, value) => { + const cacheSetting = ApiCacheService.getSettingByServiceUrl(Urls.localization); + PersistantStorage.set(key, value, cacheSetting.cacheTimeInSecs); + }, + getList: (locale) => LocalizationStore.getCaheData(LOCALE_LIST(locale)) || [], + setList: (locale, namespaces) => LocalizationStore.setCacheData(LOCALE_LIST(locale), namespaces), + getAllList: () => LocalizationStore.getCaheData(LOCALE_ALL_LIST()) || [], + setAllList: (namespaces) => LocalizationStore.setCacheData(LOCALE_ALL_LIST(), namespaces), + store: (locale, modules, messages) => { + const AllNamespaces = LocalizationStore.getAllList(); + const Namespaces = LocalizationStore.getList(locale); + modules.forEach((module) => { + if (!Namespaces.includes(module)) { + Namespaces.push(module); + const moduleMessages = messages.filter((message) => message.module === module); + LocalizationStore.setCacheData(LOCALE_MODULE(locale, module), moduleMessages); + } + }); + LocalizationStore.setCacheData(LOCALE_LIST(locale), Namespaces); + LocalizationStore.setAllList(getUnique([...AllNamespaces, ...Namespaces])); + }, + get: (locale, modules) => { + const storedModules = LocalizationStore.getList(locale); + const newModules = modules.filter((module) => !storedModules.includes(module)); + const messages = []; + storedModules.forEach((module) => { + messages.push(...LocalizationStore.getCaheData(LOCALE_MODULE(locale, module))); + }); + return [newModules, messages]; + }, + + updateResources: (locale, messages) => { + let locales = TransformArrayToObj(messages); + i18next.addResources(locale, "translations", locales); + }, +}; + +export const LocalizationService = { + getLocale: async ({ modules = [], locale = Digit.Utils.getDefaultLanguage(), tenantId }) => { + if (locale.indexOf(Digit.Utils.getLocaleRegion()) === -1) { + locale += Digit.Utils.getLocaleRegion(); + } + const [newModules, messages] = LocalizationStore.get(locale, modules); + if (newModules.length > 0) { + const data = await Request({ url: Urls.localization, params: { module: newModules.join(","), locale, tenantId }, useCache: false }); + messages.push(...data.messages); + setTimeout(() => LocalizationStore.store(locale, newModules, data.messages), 100); + } + LocalizationStore.updateResources(locale, messages); + return messages; + }, + changeLanguage: (locale, tenantId) => { + const modules = LocalizationStore.getList(locale); + const allModules = LocalizationStore.getAllList(); + const uniqueModules = allModules.filter((module) => !modules.includes(module)); + LocalizationService.getLocale({ modules: uniqueModules, locale, tenantId }); + localStorage.setItem("Employee.locale", locale); + localStorage.setItem("Citizen.locale", locale); + Digit.SessionStorage.set("locale", locale); + i18next.changeLanguage(locale); + }, + updateResources: (locale = Digit.Utils.getDefaultLanguage(), messages) => { + if (locale.indexOf(Digit.Utils.getLocaleRegion()) === -1) { + locale += Digit.Utils.getLocaleRegion(); + } + LocalizationStore.updateResources(locale, messages); + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Location.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Location.js new file mode 100644 index 00000000000..02634225055 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Location.js @@ -0,0 +1,30 @@ +import Urls from "../atoms/urls"; +import { ServiceRequest } from "../atoms/Utils/Request"; + +export const LocationService = { + getLocalities: (tenantId) => { + return ServiceRequest({ + serviceName: "getLocalities", + url: Urls.location.localities, + params: { tenantId: tenantId }, + useCache: true, + }); + }, + getRevenueLocalities: async (tenantId) => { + const response = await ServiceRequest({ + serviceName: "getRevenueLocalities", + url: Urls.location.revenue_localities, + params: { tenantId: tenantId }, + useCache: true, + }); + return response; + }, + getWards: (tenantId) => { + return ServiceRequest({ + serviceName: "getWards", + url: Urls.location.wards, + params: { tenantId: tenantId }, + useCache: true, + }); + } +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Login.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Login.js new file mode 100644 index 00000000000..c02ecf6c01b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Login.js @@ -0,0 +1,50 @@ +import Axios from "axios"; +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const LoginService = { + sendOtp: (details, stateCode) => + Request({ + url: Urls.OTP_Send, + data: details, + auth: false, + method: "POST", + params: { tenantId: stateCode }, + }), + authenticate: async (details, stateCode) => { + const params = new URLSearchParams(); + Object.entries(details).forEach(([key, value]) => params.append(key, value)); + params.append("scope", "read"); + params.append("grant_type", "password"); + const config = { + url: Urls.Authenticate, + method: "post", + params, + headers: { + authorization: `Basic ${window?.globalConfigs?.getConfig("JWT_TOKEN")||"ZWdvdi11c2VyLWNsaWVudDo="}`, + "Content-Type": "application/x-www-form-urlencoded", + }, + }; + + return Axios(config); + }, + registerUser: async (details, stateCode) => + Request({ + url: Urls.Register_User, + data: { + User: details, + }, + method: "POST", + params: { tenantId: stateCode }, + }), + updateUser: async (details, stateCode) => + Request({ + url: Urls.UserProfileUpdate, + auth: true, + data: { + user: details, + }, + method: "POST", + params: { tenantId: stateCode }, + }), +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js new file mode 100644 index 00000000000..8f791f7503f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/MDMS.js @@ -0,0 +1,1730 @@ +//HAVE TO CHANGE THI +import { ApiCacheService } from "../atoms/ApiCacheService"; +import Urls from "../atoms/urls"; +import { Request, ServiceRequest } from "../atoms/Utils/Request"; +import { PersistantStorage } from "../atoms/Utils/Storage"; + +// export const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { +// if (searcher == "") return str; +// while (str.includes(searcher)) { +// str = str.replace(searcher, replaceWith); +// } +// return str; +// }; + +const SortByName = (na, nb) => { + if (na < nb) { + return -1; + } + if (na > nb) { + return 1; + } + return 0; +}; + +const GetCitiesWithi18nKeys = (MdmsRes, moduleCode) => { + const cityList = (MdmsRes.tenant.citymodule && MdmsRes.tenant.citymodule.find((module) => module.code === moduleCode).tenants) || []; + const citiesMap = cityList.map((city) => city.code); + const cities = MdmsRes.tenant.tenants + .filter((city) => citiesMap.includes(city.code)) + .map(({ code, name, logoId, emailId, address, contactNumber }) => ({ + code, + name, + logoId, + emailId, + address, + contactNumber, + i18nKey: "TENANT_TENANTS_" + code.replace(".", "_").toUpperCase(), + })) + .sort((cityA, cityB) => { + const na = cityA.name.toLowerCase(), + nb = cityB.name.toLowerCase(); + return SortByName(na, nb); + }); + return cities; +}; + +const initRequestBody = (tenantId) => ({ + MdmsCriteria: { + tenantId, + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [{ name: "Department" }, { name: "Designation" }, { name: "StateInfo" }, { name: "wfSlaConfig" }, { name: "uiHomePage" }], + }, + { + moduleName: "tenant", + masterDetails: [{ name: "tenants" }, { name: "citymodule" }], + }, + { + moduleName: "DIGIT-UI", + masterDetails: [{ name: "ApiCachingSettings" }], + }, + ], + }, +}); + +const getCriteria = (tenantId, moduleDetails) => { + return { + MdmsCriteria: { + tenantId, + ...moduleDetails, + }, + }; +}; + +export const getGeneralCriteria = (tenantId, moduleCode, type) => ({ + details: { + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: type, + }, + ], + }, + ], + }, +}); + +export const getMultipleTypes = (tenantId, moduleCode, types) => ({ + details: { + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: types.map((type) => ({ name: type })), + }, + ], + }, +}); +export const getMultipleTypesWithFilter = (moduleCode, masterDetails) => ({ + details: { + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: masterDetails, + }, + ], + }, +}); + +const getReceiptKey = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "uiCommonPay", + }, + ], + }, + ], + }, +}); + +const getBillsGenieKey = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "BusinessService", + }, + ], + }, + { + moduleName: "tenant", + masterDetails: [{ name: "tenants" }, { name: "citymodule" }], + }, + { + moduleName: "common-masters", + masterDetails: [{name: "uiCommonPay"}] + } + ], + }, +}); + +const getModuleServiceDefsCriteria = (tenantId, moduleCode) => ({ + type: "serviceDefs", + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: `RAINMAKER-${moduleCode}`, + masterDetails: [ + { + name: "ServiceDefs", + }, + ], + }, + ], + }, +}); + +const getSanitationTypeCriteria = (tenantId, moduleCode) => ({ + type: "SanitationType", + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "SanitationType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPitTypeCriteria = (tenantId, moduleCode) => ({ + type: "PitType", + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PitType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getApplicationChannelCriteria = (tenantId, moduleCode) => ({ + type: "ApplicationChannel", + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "ApplicationChannel", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPropertyTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PropertyType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPropertyUsageCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PropertyType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getCommonFieldsCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "CommonFieldsConfig", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPreFieldsCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PreFieldsConfig", + filter: null, + }, + ], + }, + ], + }, +}); + +const getPostFieldsCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PostFieldsConfig", + filter: null, + }, + ], + }, + ], + }, +}); + +const getConfig = (tenantId, moduleCode) => ({ + type: "Config", + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "Config", + }, + ], + }, + ], + }, +}); + +const getVehicleTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "VehicleMakeModel", + filter: null, + }, + ], + }, + ], + }, +}); + +const getChecklistCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "CheckList", + filter: null, + }, + ], + }, + ], + }, +}); + +const getSlumLocalityCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "Slum", + }, + ], + }, + ], + }, +}); +const getPropertyOwnerTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "OwnerType" }], + }, + ], + }, +}); + +const getSubPropertyOwnerShipCategoryCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "SubOwnerShipCategory" }], + }, + ], + }, +}); +const getPropertyOwnerShipCategoryCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "OwnerShipCategory" }], + }, + ], + }, +}); + +const getTradeOwnerShipCategoryCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "OwnerShipCategory" }], + }, + ], + }, +}); + +const getDocumentRequiredScreenCategory = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "Documents", + }, + ], + }, + ], + }, +}); + +const getDefaultMapConfig = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "MapConfig", + }, + ], + }, + ], + }, +}); + +const getUsageCategoryList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "UsageCategory" }], + }, + ], + }, +}); + +const getPTPropertyTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "PropertyType" }], + }, + ], + }, +}); + +const getTLStructureTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "StructureType" }], + }, + ], + }, +}); + +const getTLAccessoriesTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "AccessoriesCategory" }], + }, + ], + }, +}); + +const getTLFinancialYearList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "FinancialYear", filter: `[?(@.module == "TL")]` }], + }, + ], + }, +}); + +const getPTFloorList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "Floor" }], + }, + ], + }, +}); + +const getReasonCriteria = (tenantId, moduleCode, type, payload) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: payload.map((mdmsLoad) => ({ + name: mdmsLoad, + })), + }, + ], + }, +}); + +const getBillingServiceForBusinessServiceCriteria = (filter) => ({ + moduleDetails: [ + { + moduleName: "BillingService", + masterDetails: [ + { name: "BusinessService", filter }, + { + name: "TaxHeadMaster", + }, + { + name: "TaxPeriod", + }, + ], + }, + ], +}); + +const getRoleStatusCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "RoleStatusMapping", + filter: null, + }, + ], + }, + ], + }, +}); +const getRentalDetailsCategoryCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "RentalDetails", + }, + ], + }, + ], + }, +}); + +const getChargeSlabsCategoryCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "ChargeSlabs", + }, + ], + }, + ], + }, +}); + +const getGenderTypeList = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "GenderType", + }, + ], + }, + ], + }, +}); + +const getMeterStatusTypeList = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "ws-services-calculation", + masterDetails: [ + { + name: "MeterStatus", + filter: `$.*.name` + }, + ], + }, + ], + +}); + +const getBillingPeriodValidation = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "ws-services-masters", + masterDetails: [ + { + name: "billingPeriod", + filter: "*" + }, + ], + }, + ], +}); + +const getDssDashboardCriteria = (tenantId, moduleCode) => ({ + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "dashboard-config", + }, + ], + }, + ], + }, +}); + +const getMCollectBillingServiceCriteria = (tenantId, moduleCode, type, filter) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "BusinessService", filter: filter }], + }, + ], + }, +}); + +const getTradeUnitsDataList = (tenantId, moduleCode, type, filter) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "TradeType", filter: filter }], + }, + ], + }, +}); + +const getMCollectApplicationStatusCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "applicationStatus" }], + }, + ], + }, +}); + +const getHrmsEmployeeRolesandDesignations = () => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { name: "Department", filter: "[?(@.active == true)]" }, + { name: "Designation", filter: "[?(@.active == true)]" }, + ], + }, + { + moduleName: "tenant", + masterDetails: [{ name: "tenants" }], + }, + { + moduleName: "ACCESSCONTROL-ROLES", + masterDetails: [{ name: "roles", filter: "$.[?(@.code!='CITIZEN')]" }], + }, + { moduleName: "egov-location", masterDetails: [{ name: "TenantBoundary" }] }, + ], +}); +const getFSTPPlantCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "FSTPPlantInfo" }], + }, + ], + }, +}); +const getCancelReceiptReason = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "CancelReceiptReason" }], + }, + ], + }, +}); +const getReceiptStatus = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "ReceiptStatus" }], + }, + ], + }, +}); +const getCancelReceiptReasonAndStatus = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [{ name: "ReceiptStatus" }, { name: "uiCommonPay" }], + }, + ], + }, +}); + +const getDocumentTypesCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "DocTypeMapping", + }, + ], + }, + ], + }, +}); + +const getTradeTypeRoleCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "TradeTypetoRoleMapping", + }, + ], + }, + ], + }, +}); + +const getFSTPORejectionReasonCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "FSTPORejectionReason", + filter: null, + }, + ], + }, + ], + }, +}); + +const getFSMPaymentTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "PaymentType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getFSMTripNumberCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "TripNumber", + filter: null, + }, + ], + }, + ], + }, +}); + +const getFSMReceivedPaymentTypeCriteria = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: moduleCode, + masterDetails: [ + { + name: "ReceivedPaymentType", + filter: null, + }, + ], + }, + ], + }, +}); + +const getWSTaxHeadMasterCritera = (tenantId, moduleCode, type) => ({ + type, + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: "BillingService", + masterDetails: [ + { + name: "TaxHeadMaster", + filter: null, + }, + ], + }, + ], + }, +}); + +const getHowItWorksJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "howItWorks", + }, + ], + }, + ], +}); + +const getFAQsJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "faqs", + }, + ], + }, +], +}); +const getDSSFAQsJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "dss-dashboard", + masterDetails: [ + { + name: "FAQs", + }, + ], + }, +], +}); +const getDSSAboutJSON = (tenantId) => ({ + moduleDetails: [ + { + moduleName: "dss-dashboard", + masterDetails: [ + { + name: "About", + }, + ], + }, +], +}); + +const getStaticData = () => ({ + moduleDetails: [ + { + moduleName: "common-masters", + masterDetails: [ + { + name: "StaticData", + }, + ], + }, + ], +}); + +const GetEgovLocations = (MdmsRes) => { + return MdmsRes["egov-location"].TenantBoundary[0].boundary.children.map((obj) => ({ + name: obj.localname, + i18nKey: obj.localname, + })); +}; + +const GetServiceDefs = (MdmsRes, moduleCode) => MdmsRes[`RAINMAKER-${moduleCode}`].ServiceDefs.filter((def) => def.active); + +const GetSanitationType = (MdmsRes) => MdmsRes["FSM"].SanitationType.filter((type) => type.active); + +const GetPitType = (MdmsRes) => + MdmsRes["FSM"].PitType.filter((item) => item.active).map((type) => ({ ...type, i18nKey: `PITTYPE_MASTERS_${type.code}` })); + +const GetApplicationChannel = (MdmsRes) => + MdmsRes["FSM"].ApplicationChannel.filter((type) => type.active).map((channel) => ({ + ...channel, + i18nKey: `ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_${channel.code}`, + })); + +const GetPropertyType = (MdmsRes) => + MdmsRes["FSM"].PropertyType.filter((property) => property.active && !property.propertyType).map((item) => ({ + ...item, + i18nKey: `PROPERTYTYPE_MASTERS_${item.code}`, + code: item.code, + })); + +const GetPropertySubtype = (MdmsRes) => + MdmsRes["FSM"].PropertyType.filter((property) => property.active && property.propertyType).map((item) => ({ + ...item, + i18nKey: `PROPERTYTYPE_MASTERS_${item.code}`, + code: item.code, + })); + +const GetVehicleType = (MdmsRes) => + MdmsRes["Vehicle"].VehicleMakeModel.filter((vehicle) => vehicle.active) + .filter((vehicle) => vehicle.make) + .map((vehicleDetails) => { + return { + ...vehicleDetails, + i18nKey: `COMMON_MASTER_VEHICLE_${vehicleDetails.code}`, + }; + }); + +const GetVehicleMakeModel = (MdmsRes) => + MdmsRes["Vehicle"].VehicleMakeModel.filter((vehicle) => vehicle.active) + .map((vehicleDetails) => { + return { + ...vehicleDetails, + i18nKey: `COMMON_MASTER_VEHICLE_${vehicleDetails.code}`, + }; + }); + +const GetSlumLocalityMapping = (MdmsRes, tenantId) => + MdmsRes["FSM"].Slum.filter((type) => type.active).reduce((prev, curr) => { + return prev[curr.locality] + ? { + ...prev, + [curr.locality]: [ + ...prev[curr.locality], + { + ...curr, + i18nKey: `${tenantId.toUpperCase().replace(".", "_")}_${curr.locality}_${curr.code}`, + }, + ], + } + : { + ...prev, + [curr.locality]: [ + { + ...curr, + i18nKey: `${tenantId.toUpperCase().replace(".", "_")}_${curr.locality}_${curr.code}`, + }, + ], + }; + }, {}); + +const GetPropertyOwnerShipCategory = (MdmsRes) => + MdmsRes["PropertyTax"].OwnerShipCategory.filter((ownerShip) => ownerShip.active).map((ownerShipDetails) => { + return { + ...ownerShipDetails, + i18nKey: `COMMON_MASTER_OWNER_TYPE_${ownerShipDetails.code}`, + }; + }); + +const GetTradeOwnerShipCategory = (MdmsRes) => + MdmsRes["common-masters"].OwnerShipCategory.filter((ownerShip) => ownerShip.active).map((ownerShipDetails) => { + return { + ...ownerShipDetails, + i18nKey: `COMMON_MASTER_OWNER_TYPE_${ownerShipDetails.code}`, + }; + }); + +const GetPropertyOwnerType = (MdmsRes) => + MdmsRes["PropertyTax"].OwnerType.filter((owner) => owner.active).map((ownerDetails) => { + return { + ...ownerDetails, + i18nKey: `PROPERTYTAX_OWNERTYPE_${ownerDetails.code}`, + }; + }); + +const getSubPropertyOwnerShipCategory = (MdmsRes) => { + MdmsRes["PropertyTax"].SubOwnerShipCategory.filter((category) => category.active).map((subOwnerShipDetails) => { + return { + ...subOwnerShipDetails, + i18nKey: `PROPERTYTAX_BILLING_SLAB_${subOwnerShipDetails.code}`, + }; + }); + sessionStorage.setItem("getSubPropertyOwnerShipCategory", JSON.stringify(MdmsRes)); +}; + +const getDocumentRequiredScreen = (MdmsRes) => { + MdmsRes["PropertyTax"].Documents.filter((Documents) => Documents.active).map((dropdownData) => { + return { + ...Documents, + i18nKey: `${dropdownData.code}`, + }; + }); +}; + +const getTLDocumentRequiredScreen = (MdmsRes) => { + MdmsRes["TradeLicense"].Documents.filter((Documents) => Documents.active).map((dropdownData) => { + return { + ...Documents, + i18nKey: `${dropdownData.code}`, + }; + }); +}; + +const getMapConfig = (MdmsRes) => { + MdmsRes["PropertyTax"].MapConfig.filter((MapConfig) => MapConfig).map((MapData) => { + return { + ...MapConfig, + defaultconfig: MapData.defaultConfig, + }; + }); +}; + +const getUsageCategory = (MdmsRes) => + MdmsRes["PropertyTax"].UsageCategory.filter((UsageCategory) => UsageCategory.active).map((UsageCategorylist) => { + return { + ...UsageCategorylist, + i18nKey: `PROPERTYTAX_BILLING_SLAB_${UsageCategorylist.code}`, + }; + }); + +const getPTPropertyType = (MdmsRes) => + MdmsRes["PropertyTax"].UsageCategory.filter((PropertyType) => PropertyType.active).map((PTPropertyTypelist) => { + return { + ...UsageCategorylist, + i18nKey: `COMMON_PROPTYPE_${Digit.Utils.locale.stringReplaceAll(PTPropertyTypelist.code, ".", "_")}`, + }; + }); + +const getTLStructureType = (MdmsRes) => + MdmsRes["common-masters"].StructureType.filter((StructureType) => StructureType.active).map((TLStructureTypeList) => { + return { + ...TLStructureTypeList, + i18nKey: `COMMON_MASTERS_STRUCTURETYPE_${Digit.Utils.locale.stringReplaceAll(TLStructureTypeList.code, ".", "_")}`, + }; + }); + +const getTLAccessoriesType = (MdmsRes) => + MdmsRes["TradeLicense"].AccessoriesCategory.filter((AccessoriesCategory) => AccessoriesCategory.active).map((TLAccessoryTypeList) => { + return { + ...TLAccessoryTypeList, + i18nKey: `TRADELICENSE_ACCESSORIESCATEGORY_${Digit.Utils.locale.stringReplaceAll(TLAccessoryTypeList.code, ".", "_")}`, + }; + }); + +const getTLFinancialYear = (MdmsRes) => + MdmsRes["egf-master"].FinancialYear.filter((FinancialYear) => FinancialYear.active && FinancialYear.module === "TL").map((FinancialYearList) => { + return { + ...FinancialYearList, + //i18nKey: `TRADELICENSE_ACCESSORIESCATEGORY_${stringReplaceAll(TLAccessoryTypeList.code, ".", "_")}`, + }; + }); +const getFloorList = (MdmsRes) => + MdmsRes["PropertyTax"].Floor.filter((PTFloor) => PTFloor.active).map((PTFloorlist) => { + return { + ...PTFloorlist, + i18nKey: `PROPERTYTAX_FLOOR_${PTFloorlist.code}`, + }; + }); + +const GetReasonType = (MdmsRes, type, moduleCode) => + Object.assign( + {}, + ...Object.keys(MdmsRes[moduleCode]).map((collection) => ({ + [collection]: MdmsRes[moduleCode][collection] + .filter((reason) => reason.active) + .map((reason) => ({ + ...reason, + i18nKey: `ES_ACTION_REASON_${reason.code}`, + })), + })) + ); + +const getRentalDetailsCategory = (MdmsRes) => { + MdmsRes["PropertyTax"].RentalDetails.filter((category) => category.active).map((RentalDetailsInfo) => { + return { + ...RentalDetailsInfo, + i18nKey: `PROPERTYTAX_BILLING_SLAB_${RentalDetailsInfo.code}`, + }; + }); +}; + +const getChargeSlabsCategory = (MdmsRes) => { + MdmsRes["PropertyTax"].ChargeSlabs.filter((category) => category.active).map((ChargeSlabsInfo) => { + return { + ...ChargeSlabsInfo, + }; + }); +}; + +const getGenderType = (MdmsRes) => { + return MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((genderDetails) => { + return { + ...genderDetails, + i18nKey: `PT_COMMON_GENDER_${genderDetails.code}`, + }; + }); + //return MdmsRes; +}; + +const TLGenderType = (MdmsRes) => { + MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((genders) => { + return { + ...genders, + i18nKey: `TL_GENDER_${genders.code}`, + }; + }); +}; + +const PTGenderType = (MdmsRes) => { + MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((formGender) => { + return { + ...formGender, + i18nKey: `PT_FORM3_${formGender.code}`, + }; + }); +}; + +const HRGenderType = (MdmsRes) => { + MdmsRes["common-masters"].GenderType.filter((GenderType) => GenderType.active).map((comGender) => { + return { + ...comGender, + i18nKey: `COMMON_GENDER_${comGender.code}`, + }; + }); +}; + +const GetMCollectBusinessService = (MdmsRes) => + MdmsRes["BillingService"].BusinessService.map((businesServiceDetails) => { + return { + ...businesServiceDetails, + i18nKey: `BILLINGSERVICE_BUSINESSSERVICE_${businesServiceDetails.code}`, + }; + }); + +const GetMCollectApplicationStatus = (MdmsRes) => + MdmsRes["mCollect"].applcationStatus.map((appStatusDetails) => { + return { + ...appStatusDetails, + i18nKey: `BILLINGSERVICE_BUSINESSSERVICE_${appStatusDetails.code}`, + }; + }); + +const getFSMGenderType = (MdmsRes) => { + return MdmsRes["common-masters"].GenderType.map((genderDetails) => { + return { + ...genderDetails, + i18nKey: `COMMON_GENDER_${genderDetails.code}`, + }; + }); +}; + +const GetFSTPORejectionReason = (MdmsRes) => { + return MdmsRes["Vehicle"].FSTPORejectionReason.filter((reason) => reason.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_REASON_${reasonDetails.code}`, + }; + }); +}; + +const GetPaymentType = (MdmsRes) => { + return MdmsRes["FSM"].PaymentType.filter((option) => option.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_${reasonDetails.code}`, + }; + }); +}; + +const GetTripNumber = (MdmsRes) => { + return MdmsRes["FSM"].TripNumber.filter((option) => option.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_TRIP_${reasonDetails.code}`, + }; + }); +}; + +const GetReceivedPaymentType = (MdmsRes) => { + return MdmsRes["FSM"].ReceivedPaymentType.filter((option) => option.active).map((reasonDetails) => { + return { + ...reasonDetails, + i18nKey: `ES_ACTION_${reasonDetails.code}`, + }; + }); +}; + +const getDssDashboard = (MdmsRes) => MdmsRes["dss-dashboard"]["dashboard-config"]; + +const GetRoleStatusMapping = (MdmsRes) => MdmsRes["DIGIT-UI"].RoleStatusMapping; +const GetCommonFields = (MdmsRes, moduleCode) => + moduleCode.toUpperCase() === "PROPERTYTAX" ? MdmsRes["PropertyTax"].CommonFieldsConfig : MdmsRes["FSM"].CommonFieldsConfig; + +const GetPreFields = (MdmsRes) => MdmsRes["FSM"].PreFieldsConfig; + +const GetPostFields = (MdmsRes) => MdmsRes["FSM"].PostFieldsConfig; + +const GetFSTPPlantInfo = (MdmsRes) => MdmsRes["FSM"]?.FSTPPlantInfo; + +const GetDocumentsTypes = (MdmsRes) => MdmsRes["BPA"].DocTypeMapping; + +const GetChecklist = (MdmsRes) => MdmsRes["BPA"].CheckList; + +const transformResponse = (type, MdmsRes, moduleCode, tenantId) => { + switch (type) { + case "citymodule": + return GetCitiesWithi18nKeys(MdmsRes, moduleCode); + case "egovLocation": + return GetEgovLocations(MdmsRes); + case "serviceDefs": + return GetServiceDefs(MdmsRes, moduleCode); + case "ApplicationChannel": + return GetApplicationChannel(MdmsRes); + case "SanitationType": + return GetSanitationType(MdmsRes); + case "PropertyType": + return GetPropertyType(MdmsRes); + case "PropertySubtype": + return GetPropertySubtype(MdmsRes); + case "PitType": + return GetPitType(MdmsRes); + case "VehicleType": + return GetVehicleType(MdmsRes); + case "VehicleMakeModel": + return GetVehicleMakeModel(MdmsRes); + case "Slum": + return GetSlumLocalityMapping(MdmsRes, tenantId); + case "OwnerShipCategory": + return GetPropertyOwnerShipCategory(MdmsRes); + case "TLOwnerShipCategory": + return GetTradeOwnerShipCategory(MdmsRes); + case "OwnerType": + return GetPropertyOwnerType(MdmsRes); + case "SubOwnerShipCategory": + return getSubPropertyOwnerShipCategory(MdmsRes); + case "Documents": + return getDocumentRequiredScreen(MdmsRes); + case "TLDocuments": + return getTLDocumentRequiredScreen(MdmsRes); + case "MapConfig": + return getMapConfig(MdmsRes); + case "UsageCategory": + return getUsageCategory(MdmsRes); + case "PTPropertyType": + return getPTPropertyType(MdmsRes); + case "StructureType": + return getTLStructureType(MdmsRes); + case "AccessoryCategory": + return getTLAccessoriesType(MdmsRes); + case "FinancialYear": + return getTLFinancialYear(MdmsRes); + case "Floor": + return getFloorList(MdmsRes); + case "Reason": + return GetReasonType(MdmsRes, type, moduleCode); + case "RoleStatusMapping": + return GetRoleStatusMapping(MdmsRes); + case "CommonFieldsConfig": + return GetCommonFields(MdmsRes, moduleCode); + case "PreFieldsConfig": + return GetPreFields(MdmsRes); + case "PostFieldsConfig": + return GetPostFields(MdmsRes); + case "RentalDeatils": + return getRentalDetailsCategory(MdmsRes); + case "ChargeSlabs": + return getChargeSlabsCategory(MdmsRes); + case "DssDashboard": + return getDssDashboard(MdmsRes); + case "BusinessService": + return GetMCollectBusinessService(MdmsRes); + case "applcatonStatus": + return GetMCollectApplicationStatus(MdmsRes); + case "FSTPPlantInfo": + return GetFSTPPlantInfo(MdmsRes); + case "GenderType": + return getGenderType(MdmsRes); + case "TLGendertype": + return TLGenderType(MdmsRes); + case "PTGenderType": + return PTGenderType(MdmsRes); + case "HRGenderType": + return HRGenderType(MdmsRes); + case "DocumentTypes": + return GetDocumentsTypes(MdmsRes); + case "CheckList": + return GetChecklist(MdmsRes); + case "FSMGenderType": + return getFSMGenderType(MdmsRes); + case "FSTPORejectionReason": + return GetFSTPORejectionReason(MdmsRes); + case "PaymentType": + return GetPaymentType(MdmsRes); + case "TripNumber": + return GetTripNumber(MdmsRes); + case "ReceivedPaymentType": + return GetReceivedPaymentType(MdmsRes); + default: + return MdmsRes; + } +}; + +const getCacheSetting = (moduleName) => { + return ApiCacheService.getSettingByServiceUrl(Urls.MDMS, moduleName); +}; + +const mergedData = {}; +const mergedPromises = {}; +const callAllPromises = (success, promises = [], resData) => { + promises.forEach((promise) => { + if (success) { + promise.resolve(resData); + } else { + promise.reject(resData); + } + }); +}; +const mergeMDMSData = (data, tenantId) => { + if (!mergedData[tenantId] || Object.keys(mergedData[tenantId]).length === 0) { + mergedData[tenantId] = data; + } else { + data.MdmsCriteria.moduleDetails.forEach((dataModuleDetails) => { + const moduleName = dataModuleDetails.moduleName; + const masterDetails = dataModuleDetails.masterDetails; + let found = false; + mergedData[tenantId].MdmsCriteria.moduleDetails.forEach((moduleDetail) => { + if (moduleDetail.moduleName === moduleName) { + found = true; + moduleDetail.masterDetails = [...moduleDetail.masterDetails, ...masterDetails]; + } + }); + if (!found) { + mergedData[tenantId].MdmsCriteria.moduleDetails.push(dataModuleDetails); + } + }); + } +}; +const debouncedCall = ({ serviceName, url, data, useCache, params }, resolve, reject) => { + if (!mergedPromises[params.tenantId] || mergedPromises[params.tenantId].length === 0) { + const cacheSetting = getCacheSetting(); + setTimeout(() => { + let callData = JSON.parse(JSON.stringify(mergedData[params.tenantId])); + mergedData[params.tenantId] = {}; + let callPromises = [...mergedPromises[params.tenantId]]; + mergedPromises[params.tenantId] = []; + ServiceRequest({ + serviceName, + url, + data: callData, + useCache, + params, + }) + .then((data) => { + callAllPromises(true, callPromises, data); + }) + .catch((err) => { + callAllPromises(false, callPromises, err); + }); + }, cacheSetting.debounceTimeInMS || 500); + } + mergeMDMSData(data, params.tenantId); + if (!mergedPromises[params.tenantId]) { + mergedPromises[params.tenantId] = []; + } + mergedPromises[params.tenantId].push({ resolve, reject }); +}; + +export const MdmsService = { + init: (stateCode) => + ServiceRequest({ + serviceName: "mdmsInit", + url: Urls.MDMS, + data: initRequestBody(stateCode), + useCache: true, + params: { tenantId: stateCode }, + }), + call: (tenantId, details) => { + return new Promise((resolve, reject) => + debouncedCall( + { + serviceName: "mdmsCall", + url: Urls.MDMS, + data: getCriteria(tenantId, details), + useCache: true, + params: { tenantId }, + }, + resolve, + reject + ) + ); + }, + getDataByCriteria: async (tenantId, mdmsDetails, moduleCode) => { + const key = `MDMS.${tenantId}.${moduleCode}.${mdmsDetails.type}.${JSON.stringify(mdmsDetails.details)}`; + const inStoreValue = PersistantStorage.get(key); + if (inStoreValue) { + return inStoreValue; + } + const { MdmsRes } = await MdmsService.call(tenantId, mdmsDetails.details); + const responseValue = transformResponse(mdmsDetails.type, MdmsRes, moduleCode.toUpperCase(), tenantId); + const cacheSetting = getCacheSetting(mdmsDetails.details.moduleDetails[0].moduleName); + PersistantStorage.set(key, responseValue, cacheSetting.cacheTimeInSecs); + return responseValue; + }, + getServiceDefs: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getModuleServiceDefsCriteria(tenantId, moduleCode), moduleCode); + }, + getSanitationType: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getSanitationTypeCriteria(tenantId, moduleCode), moduleCode); + }, + getApplicationChannel: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getApplicationChannelCriteria(tenantId, moduleCode), moduleCode); + }, + getPropertyType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPropertyTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPropertyUsage: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPropertyUsageCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPropertySubtype: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPropertyTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPitType: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getPitTypeCriteria(tenantId, moduleCode), moduleCode); + }, + getVehicleType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getVehicleTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getChecklist: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getChecklistCriteria(tenantId, moduleCode), moduleCode); + }, + getPaymentRules: (tenantId, filter) => { + return MdmsService.call(tenantId, getBillingServiceForBusinessServiceCriteria(filter)); + }, + + getCustomizationConfig: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getConfig(tenantId, moduleCode), moduleCode); + }, + getSlumLocalityMapping: (tenantId, moduleCode, type) => + MdmsService.getDataByCriteria(tenantId, getSlumLocalityCriteria(tenantId, moduleCode, type), moduleCode), + + getReason: (tenantId, moduleCode, type, payload) => + MdmsService.getDataByCriteria(tenantId, getReasonCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getRoleStatus: (tenantId, moduleCode, type) => + MdmsService.getDataByCriteria(tenantId, getRoleStatusCriteria(tenantId, moduleCode, type), moduleCode), + + getCommonFieldsConfig: (tenantId, moduleCode, type, payload) => + MdmsService.getDataByCriteria(tenantId, getCommonFieldsCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getPreFieldsConfig: (tenantId, moduleCode, type, payload) => + MdmsService.getDataByCriteria(tenantId, getPreFieldsCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getPostFieldsConfig: (tenantId, moduleCode, type, payload) => + MdmsService.getDataByCriteria(tenantId, getPostFieldsCriteria(tenantId, moduleCode, type, payload), moduleCode), + + getPropertyOwnerShipCategory: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPropertyOwnerShipCategoryCriteria(tenantId, moduleCode, type), moduleCode); + }, + + GetTradeOwnerShipCategory: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getTradeOwnerShipCategoryCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getPropertyOwnerType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPropertyOwnerTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getPropertySubOwnerShipCategory: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getSubPropertyOwnerShipCategoryCriteria(tenantId, moduleCode, type), moduleCode); + }, + getDocumentRequiredScreen: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getDocumentRequiredScreenCategory(tenantId, moduleCode), moduleCode); + }, + getTLDocumentRequiredScreen: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getDocumentRequiredScreenCategory(tenantId, moduleCode), moduleCode); + }, + getTradeUnitsData: (tenantId, moduleCode, type, filter) => { + return MdmsService.getDataByCriteria(tenantId, getTradeUnitsDataList(tenantId, moduleCode, type, filter), moduleCode); + }, + getMapConfig: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getDefaultMapConfig(tenantId, moduleCode), moduleCode); + }, + getUsageCategory: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getUsageCategoryList(tenantId, moduleCode), moduleCode); + }, + getPTPropertyType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPTPropertyTypeList(tenantId, moduleCode), moduleCode); + }, + getTLStructureType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getTLStructureTypeList(tenantId, moduleCode), moduleCode); + }, + getTLAccessoriesType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getTLAccessoriesTypeList(tenantId, moduleCode), moduleCode); + }, + getTLFinancialYear: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getTLFinancialYearList(tenantId, moduleCode), moduleCode); + }, + getFloorList: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getPTFloorList(tenantId, moduleCode, type), moduleCode); + }, + getRentalDetails: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getRentalDetailsCategoryCriteria(tenantId, moduleCode), moduleCode); + }, + getChargeSlabs: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getChargeSlabsCategoryCriteria(tenantId, moduleCode), moduleCode); + }, + getDssDashboard: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getDssDashboardCriteria(tenantId, moduleCode), moduleCode); + }, + getPaymentGateway: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getReceiptKey: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getReceiptKey(tenantId, moduleCode), moduleCode); + }, + getHelpText: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getMCollectBillingService: (tenantId, moduleCode, type, filter) => { + return MdmsService.getDataByCriteria(tenantId, getMCollectBillingServiceCriteria(tenantId, moduleCode, type, filter), moduleCode); + }, + getMCollectApplcationStatus: (tenantId, moduleCode, type, filter) => { + return MdmsService.getDataByCriteria(tenantId, getMCollectApplicationStatusCriteria(tenantId, moduleCode, type, filter), moduleCode); + }, + getHrmsEmployeeRolesandDesignation: (tenantId) => { + return MdmsService.call(tenantId, getHrmsEmployeeRolesandDesignations()); + }, + getHrmsEmployeeTypes: (tenantId, moduleCode, type, filter) => { + return MdmsService.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getHrmsEmployeeReason: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGeneralCriteria(tenantId, moduleCode, type), moduleCode); + }, + getMultipleTypes: (tenantId, moduleCode, types) => { + return MdmsService.getDataByCriteria(tenantId, getMultipleTypes(tenantId, moduleCode, types), moduleCode); + }, + getMultipleTypesWithFilter: (tenantId, moduleCode, types) => { + return MdmsService.getDataByCriteria(tenantId, getMultipleTypesWithFilter(moduleCode, types), moduleCode); + }, + getFSTPPlantInfo: (tenantId, moduleCode, types) => { + return MdmsService.getDataByCriteria(tenantId, getFSTPPlantCriteria(tenantId, moduleCode, types), moduleCode); + }, + getCancelReceiptReason: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getCancelReceiptReason(tenantId, moduleCode), moduleCode); + }, + getReceiptStatus: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getReceiptStatus(tenantId, moduleCode), moduleCode); + }, + getCancelReceiptReasonAndStatus: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getCancelReceiptReasonAndStatus(tenantId, moduleCode), moduleCode); + }, + + getGenderType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + TLGenderType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + PTGenderType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + HRGenderType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + getDocumentTypes: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getDocumentTypesCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getTradeTypeRoleTypes: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getTradeTypeRoleCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getFSMGenderType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getGenderTypeList(tenantId, moduleCode, type), moduleCode); + }, + + getFSTPORejectionReason: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getFSTPORejectionReasonCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getFSMPaymentType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getFSMPaymentTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getBillsGenieKey: (tenantId, moduleCode) => { + return MdmsService.getDataByCriteria(tenantId, getBillsGenieKey(tenantId, moduleCode), moduleCode); + }, + + getFSMTripNumber: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getFSMTripNumberCriteria(tenantId, moduleCode, type), moduleCode); + }, + + getFSMReceivedPaymentType: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getFSMReceivedPaymentTypeCriteria(tenantId, moduleCode, type), moduleCode); + }, + getWSTaxHeadMaster: (tenantId, moduleCode, type) => { + return MdmsService.getDataByCriteria(tenantId, getWSTaxHeadMasterCritera(tenantId, moduleCode, type), moduleCode); + }, + + getMeterStatusType: (tenantId) => { + return MdmsService.call(tenantId, getMeterStatusTypeList(tenantId)); + }, + + getBillingPeriod: (tenantId) => { + return MdmsService.call(tenantId, getBillingPeriodValidation(tenantId)); + }, + getHowItWorksJSONData: (tenantId) => { + return MdmsService.call(tenantId, getHowItWorksJSON(tenantId)); + }, + getFAQsJSONData: (tenantId) => { + return MdmsService.call(tenantId, getFAQsJSON(tenantId)); + }, + getDSSFAQsJSONData: (tenantId) => { + return MdmsService.call(tenantId, getDSSFAQsJSON(tenantId)); + }, + + getDSSAboutJSONData: (tenantId) => { + return MdmsService.call(tenantId, getDSSAboutJSON(tenantId)); + }, + getStaticDataJSON: (tenantId) => { + return MdmsService.call(tenantId, getStaticData()); + } +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/PGR.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/PGR.js new file mode 100644 index 00000000000..d0bce116930 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/PGR.js @@ -0,0 +1,61 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const PGRService = { + search: (tenantId, filters = {}) => { + return Request({ + url: Urls.pgr_search, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId: tenantId, ...filters }, + }); + }, + create: (details, tenantId) => + Request({ + url: Urls.PGR_Create, + data: details, + useCache: true, + method: "POST", + params: { tenantId }, + auth: true, + userService: true, + }), + update: (details) => + Request({ + url: Urls.pgr_update, + data: details, + useCache: true, + auth: true, + method: "POST", + params: { tenantId: details.tenantId }, + userService: true, + }), + count: (tenantId, params) => + Request({ + url: Urls.pgr_count, + useCache: true, + auth: true, + method: "POST", + params: { tenantId, ...params }, + }), + + employeeSearch: (tenantId, roles) => { + return Request({ + url: Urls.EmployeeSearch, + params: { tenantId, roles }, + auth: true, + }); + }, + + PGROpensearch: ({ tenantId, filters }) => + Request({ + url: Urls.pgr_search, + useCache: false, + method: "POST", + auth: false , + userService: false, + params: { tenantId, ...filters }, + }), +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Payment.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Payment.js new file mode 100644 index 00000000000..d54d5a62a08 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Payment.js @@ -0,0 +1,143 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const PaymentService = { + fetchBill: (tenantId, filters = {}) => + Request({ + url: Urls.payment.fetch_bill, + useCache: false, + method: "POST", + auth: false, + userService: false, + params: { tenantId, ...filters }, + }) + .then((d) => { + return d; + }) + .catch((err) => { + if (err?.response?.data?.Errors?.[0]?.code === "EG_BS_BILL_NO_DEMANDS_FOUND") return { Bill: [] }; + else throw err; + }), + searchBill: (tenantId, filters = {}) => + Request({ + url: Urls.payment.search_bill, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId, ...filters }, + }), + searchAmendment: (tenantId, filters = {}) => { + return Request({ + url: Urls.payment.billAmendmentSearch, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId, ...filters }, + }); + }, + createReciept: (tenantId, details = {}) => + Request({ + url: Urls.payment.create_reciept, + useCache: false, + method: "POST", + auth: true, + userService: true, + locale: true, + params: { tenantId }, + data: { ...details }, + }), + + getReciept: (tenantId, businessservice, filters = {}) => + Request({ + url: + businessservice && businessservice !== "BPAREG" + ? `${Urls.payment.print_reciept}/${businessservice}/_search` + : `${Urls.payment.print_reciept}/_search`, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId, ...filters }, + }), + + generatePdf: (tenantId, data = {}, key) => + Request({ + url: Urls.payment.generate_pdf, + useCache: false, + method: "POST", + auth: true, + userService: true, + locale: true, + params: { tenantId, key }, + data: data, + }), + + printReciept: (tenantId, filters = {}) => + Request({ + url: Urls.FileFetch, + useCache: false, + method: "GET", + auth: true, + userService: true, + params: { tenantId, ...filters }, + }), + + createCitizenReciept: (tenantId, details = {}) => + Request({ + url: Urls.payment.create_citizen_reciept, + useCache: false, + method: "POST", + auth: false, + userService: false, + params: { tenantId }, + data: { ...details }, + }), + + updateCitizenReciept: (transactionId) => + Request({ + url: Urls.payment.update_citizen_reciept, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { transactionId }, + }), + + demandSearch: (tenantId, consumerCode, businessService) => + Request({ + url: Urls.payment.demandSearch, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { tenantId, consumerCode, businessService }, + }), + + recieptSearch: (tenantId, businessService, params) => + Request({ + url: + businessService === "BPAREG" && !params?.isEmployee /* || businessService.includes("BPA.") && !params?.isEmployee ) */ + ? Urls.payment.obps_Reciept_Search + : Urls.payment.reciept_search, + urlParams: + businessService === "BPAREG" && !params?.isEmployee /* || businessService.includes("BPA.") && !params?.isEmployee) */ + ? {} + : { buisnessService: businessService }, + method: "POST", + // do not change this directly add a param if needed + auth: true, + params: { tenantId, ...params }, + }), + + getBulkPdfRecordsDetails: (filters) => + Request({ + url: Urls.payment.getBulkPdfRecordsDetails, + useCache: false, + method: "POST", + auth: true, + userService: true, + params: { ...filters }, + }), +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Surveys.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Surveys.js new file mode 100644 index 00000000000..e887d760cf8 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/Surveys.js @@ -0,0 +1,61 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; + +export const Surveys = { + search: (filters = {}) => + Request({ + url: Urls.engagement.surveys.search, + useCache: false, + method: "POST", + auth: true, + userService: false, + params: { ...filters }, + }), + create: (details) => + Request({ + url: Urls.engagement.surveys.create, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + locale: true + }), + delete: (details) => + Request({ + url: Urls.engagement.surveys.delete, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + }), + update: (details) => + Request({ + url: Urls.engagement.surveys.update, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + }), + submitResponse: (details) => + Request({ + url: Urls.engagement.surveys.submitResponse, + data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + }), + showResults: (details) => + Request({ + url: Urls.engagement.surveys.showResults, + // data: details, + useCache: true, + userService: true, + method: "POST", + auth: true, + params:{surveyId:details.surveyId} + }), +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/UrlShortener.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/UrlShortener.js new file mode 100644 index 00000000000..3886b332aa9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/UrlShortener.js @@ -0,0 +1,15 @@ +import { Request } from "../atoms/Utils/Request"; +import Urls from "../atoms/urls"; + +const UrlShortener = (fileStoreId) => + Request({ + data: { url: fileStoreId }, + url: Urls.Shortener, + useCache: false, + method: "POST", + auth: false, + userService: false, + noRequestInfo: true, + }); + +export default UrlShortener; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/User/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/User/index.js new file mode 100644 index 00000000000..3cac213ee44 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/User/index.js @@ -0,0 +1,139 @@ +import Urls from "../../atoms/urls"; +import { Request, ServiceRequest } from "../../atoms/Utils/Request"; +import { Storage } from "../../atoms/Utils/Storage"; + +export const UserService = { + authenticate: async(details) => { + const data = new URLSearchParams(); + Object.entries(details).forEach(([key, value]) => data.append(key, value)); + data.append("scope", "read"); + data.append("grant_type", "password"); + + let authResponse= await ServiceRequest({ + serviceName: "authenticate", + url: Urls.Authenticate, + data, + headers: { + authorization: `Basic ${window?.globalConfigs?.getConfig("JWT_TOKEN")||"ZWdvdi11c2VyLWNsaWVudDo="}`, + "Content-Type": "application/x-www-form-urlencoded", + }, + }); + const invalidRoles = window?.globalConfigs?.getConfig("INVALIDROLES") || []; + if (invalidRoles && invalidRoles.length > 0 && authResponse && authResponse?.UserRequest?.roles?.some((role) => invalidRoles.includes(role.code))) { + throw new Error("ES_ERROR_USER_NOT_PERMITTED"); + } + return authResponse; + }, + logoutUser: () => { + let user = UserService.getUser(); + if (!user || !user.info || !user.access_token) return false; + const { type } = user.info; + return ServiceRequest({ + serviceName: "logoutUser", + url: Urls.UserLogout, + data: { access_token: user?.access_token }, + auth: true, + params: { tenantId: type === "CITIZEN" ? Digit.ULBService.getStateId() : Digit.ULBService.getCurrentTenantId() }, + }); + }, + getType: () => { + return Storage.get("userType") || "citizen"; + }, + setType: (userType) => { + Storage.set("userType", userType); + Storage.set("user_type", userType); + }, + getUser: () => { + return Digit.SessionStorage.get("User"); + }, + logout: async () => { + const userType = UserService.getType(); + try { + await UserService.logoutUser(); + } catch (e) { + } + finally{ + window.localStorage.clear(); + window.sessionStorage.clear(); + if (userType === "citizen") { + window.location.replace(`/${window?.contextPath}/citizen`); + } else { + window.location.replace(`/${window?.contextPath}/employee/user/language-selection`); + } + } + }, + sendOtp: (details, stateCode) => + ServiceRequest({ + serviceName: "sendOtp", + url: Urls.OTP_Send, + data: details, + auth: false, + params: { tenantId: stateCode }, + }), + setUser: (data) => { + return Digit.SessionStorage.set("User", data); + }, + setExtraRoleDetails: (data) => { + const userDetails = Digit.SessionStorage.get("User"); + return Digit.SessionStorage.set("User", { ...userDetails, extraRoleInfo: data }); + }, + getExtraRoleDetails: () => { + return Digit.SessionStorage.get("User")?.extraRoleInfo; + }, + registerUser: (details, stateCode) => + ServiceRequest({ + serviceName: "registerUser", + url: Urls.RegisterUser, + data: { + User: details, + }, + params: { tenantId: stateCode }, + }), + updateUser: async (details, stateCode) => + ServiceRequest({ + serviceName: "updateUser", + url: Urls.UserProfileUpdate, + auth: true, + data: { + user: details, + }, + params: { tenantId: stateCode }, + }), + hasAccess: (accessTo) => { + const user = Digit.UserService.getUser(); + if (!user || !user.info) return false; + const { roles } = user.info; + return roles && Array.isArray(roles) && roles.filter((role) => accessTo.includes(role.code)).length; + }, + + changePassword: (details, stateCode) => + ServiceRequest({ + serviceName: "changePassword", + url: Digit.SessionStorage.get("User")?.info ? Urls.ChangePassword1 : Urls.ChangePassword, + data: { + ...details, + }, + auth: true, + params: { tenantId: stateCode }, + }), + + employeeSearch: (tenantId, filters) => { + return Request({ + url: Urls.EmployeeSearch, + params: { tenantId, ...filters }, + auth: true, + }); + }, + userSearch: async (tenantId, data, filters) => { + + return ServiceRequest({ + url: Urls.UserSearch, + params: { ...filters }, + method: "POST", + auth: true, + useCache: true, + userService: true, + data: data.pageSize ? { tenantId, ...data } : { tenantId, ...data, pageSize: "100" }, + }); + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/WorkFlow.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/WorkFlow.js new file mode 100644 index 00000000000..6f00237c305 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/elements/WorkFlow.js @@ -0,0 +1,410 @@ +import Urls from "../atoms/urls"; +import { Request } from "../atoms/Utils/Request"; +import cloneDeep from "lodash/cloneDeep"; + +const getThumbnails = async (ids, tenantId, documents = []) => { + + + const res = await Digit.UploadServices.Filefetch(ids, tenantId); + if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) { + return { + thumbs: res.data.fileStoreIds.map((o) => o.url.split(",")[3] || o.url.split(",")[0]), + images: res.data.fileStoreIds.map((o) => Digit.Utils.getFileUrl(o.url)) + }; + } else { + return null; + } + +}; + +const makeCommentsSubsidariesOfPreviousActions = async (wf) => { + const TimelineMap = new Map(); + const tenantId = wf?.[0]?.tenantId; + let fileStoreIdsList = []; + let res = {}; + + for (const eventHappened of wf) { + if (eventHappened?.documents) { + eventHappened.thumbnailsToShow = await getThumbnails(eventHappened?.documents?.map(e => e?.fileStoreId), eventHappened?.tenantId, eventHappened?.documents) + } + if (eventHappened.action === "COMMENT") { + const commentAccumulator = TimelineMap.get("tlCommentStack") || [] + TimelineMap.set("tlCommentStack", [...commentAccumulator, eventHappened]) + } + else { + const eventAccumulator = TimelineMap.get("tlActions") || [] + const commentAccumulator = TimelineMap.get("tlCommentStack") || [] + eventHappened.wfComments = [...commentAccumulator, ...eventHappened.comment ? [eventHappened] : []] + TimelineMap.set("tlActions", [...eventAccumulator, eventHappened]) + TimelineMap.delete("tlCommentStack") + } + } + const response = TimelineMap.get("tlActions") + return response +} + +const getThumbnailsV2 = async (ids, tenantId, documents = []) => { + + const res = await Digit.UploadServices.Filefetch(ids, tenantId); + if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) { + return { + thumbs: res.data.fileStoreIds.map((o) => o.url.split(",")[3] || o.url.split(",")[0]), + images: res.data.fileStoreIds.map((o) => Digit.Utils.getFileUrl(o.url)) + }; + } else { + return null; + } +}; + +const makeCommentsSubsidariesOfPreviousActionsV2 = async (wf) => { + const TimelineMap = new Map(); + // const tenantId = window.location.href.includes("/obps/") ? Digit.ULBService.getStateId() : wf?.[0]?.tenantId; + + + for (const eventHappened of wf) { + + //currenlty in workflow documentUid is getting populated so while update we are sending fileStoreId in documentUid field + if (eventHappened?.documents) { + eventHappened.thumbnailsToShow = await getThumbnailsV2(eventHappened?.documents?.map(e => e?.documentUid || e?.fileStoreId), eventHappened?.tenantId, eventHappened?.documents) + } + + + } + +} + +const getAssignerDetails = (instance, nextStep, moduleCode) => { + let assigner = instance?.assigner + if (moduleCode === "FSM" || moduleCode === "FSM_POST_PAY_SERVICE") { + if (instance.state.applicationStatus === "CREATED") { + assigner = instance?.assigner + } else { + assigner = nextStep?.assigner || instance?.assigner + } + } else { + assigner = instance?.assigner + } + return assigner +} + +export const WorkflowService = { + init: (stateCode, businessServices) => { + return Request({ + url: Urls.WorkFlow, + useCache: true, + method: "POST", + params: { tenantId: stateCode, businessServices }, + auth: true, + }); + }, + + getByBusinessId: (stateCode, businessIds, params = {}, history = true) => { + return Request({ + url: Urls.WorkFlowProcessSearch, + useCache: false, + method: "POST", + params: { tenantId: stateCode, businessIds: businessIds, ...params, history }, + auth: true, + }); + }, + getDetailsByIdV2: async ({ tenantId, id, moduleCode }) => { + + //process instance search + const workflow = await Digit.WorkflowService.getByBusinessId(tenantId, id); + const applicationProcessInstance = cloneDeep(workflow?.ProcessInstances); + //business service search + const businessServiceResponse = (await Digit.WorkflowService.init(tenantId, moduleCode))?.BusinessServices[0]?.states; + + if (workflow && workflow.ProcessInstances) { + const processInstances = workflow.ProcessInstances; + const nextStates = processInstances[0]?.nextActions.map((action) => ({ action: action?.action, nextState: processInstances[0]?.state.uuid })); + const nextActions = nextStates.map((id) => ({ + action: id.action, + state: businessServiceResponse?.find((state) => state.uuid === id.nextState), + })); + + /* To check state is updatable and provide edit option*/ + const currentState = businessServiceResponse?.find((state) => state.uuid === processInstances[0]?.state.uuid); + + // if current state is editable then we manually append an edit action + //(doing only for muster) + //beacuse in other module edit action is defined in workflow + + // if (currentState && currentState?.isStateUpdatable && moduleCode==="muster-roll-approval" ) { + // nextActions.push({ action: "EDIT", state: currentState }); + // } + // Check when to add Edit action(In Estimate only when send back to originator action is taken) + + const getStateForUUID = (uuid) => businessServiceResponse?.find((state) => state.uuid === uuid); + + //this actionState is used in WorkflowActions component + const actionState = businessServiceResponse + ?.filter((state) => state.uuid === processInstances[0]?.state.uuid) + .map((state) => { + let _nextActions = state.actions?.map?.((ac) => { + let actionResultantState = getStateForUUID(ac.nextState); + let assignees = actionResultantState?.actions?.reduce?.((acc, act) => { + return [...acc, ...act.roles]; + }, []); + return { ...actionResultantState, assigneeRoles: assignees, action: ac.action, roles: ac.roles }; + }); + // if (state?.isStateUpdatable && moduleCode==="MR") { + // _nextActions.push({ action: "RE-SUBMIT", ...state, roles: state?.actions?.[0]?.roles }) + // } + //CHECK WHEN EDIT ACTION TO BE SHOWN + return { ...state, nextActions: _nextActions, roles: state?.action, roles: state?.actions?.reduce((acc, el) => [...acc, ...el.roles], []) }; + })?.[0]; + + + //mapping nextActions with suitable roles + const actionRolePair = nextActions?.map((action) => ({ + action: action?.action, + roles: action.state?.actions?.map((action) => action.roles).join(","), + })); + + + if (processInstances.length > 0) { + // const EnrichedWfData = await makeCommentsSubsidariesOfPreviousActions(processInstances) + //if any documents are there this fn will add thumbnails to show + + await makeCommentsSubsidariesOfPreviousActionsV2(processInstances) + + let timeline = processInstances.map((instance, ind) => { + let checkPoint = { + performedAction: instance.action, + status: instance.state.applicationStatus, + state: instance.state.state, + assigner: instance?.assigner, + rating: instance?.rating, + // wfComment: instance?.wfComments?.map(e => e?.comment), + comment:instance?.comment, + wfDocuments: instance?.documents, + thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, + assignes: instance.assignes, + caption: instance.assignes ? instance.assignes?.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) : null, + auditDetails: { + created: Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime), + lastModified: Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime), + lastModifiedEpoch: instance.auditDetails.lastModifiedTime, + }, + isTerminateState : instance?.state?.isTerminateState + }; + return checkPoint; + }); + + + const details = { + timeline, + nextActions:actionRolePair, + actionState, + applicationBusinessService: workflow?.ProcessInstances?.[0]?.businessService, + processInstances: applicationProcessInstance, + }; + + + return details; + } + } else { + throw new Error("error fetching workflow services"); + } + return {}; + }, + getDetailsById: async ({ tenantId, id, moduleCode, role, getTripData }) => { + const workflow = await Digit.WorkflowService.getByBusinessId(tenantId, id); + const applicationProcessInstance = cloneDeep(workflow?.ProcessInstances); + const getLocationDetails = window.location.href.includes("/obps/") || window.location.href.includes("noc/inbox"); + const moduleCodeData = getLocationDetails ? applicationProcessInstance?.[0]?.businessService : moduleCode; + const businessServiceResponse = (await Digit.WorkflowService.init(tenantId, moduleCodeData))?.BusinessServices[0]?.states; + if (workflow && workflow.ProcessInstances) { + const processInstances = workflow.ProcessInstances; + const nextStates = processInstances[0]?.nextActions.map((action) => ({ action: action?.action, nextState: processInstances[0]?.state.uuid })); + const nextActions = nextStates.map((id) => ({ + action: id.action, + state: businessServiceResponse?.find((state) => state.uuid === id.nextState), + })); + + /* To check state is updatable and provide edit option*/ + const currentState = businessServiceResponse?.find((state) => state.uuid === processInstances[0]?.state.uuid); + if (currentState && currentState?.isStateUpdatable) { + if (moduleCode === "FSM" || moduleCode === "FSM_POST_PAY_SERVICE" || moduleCode === "FSM_VEHICLE_TRIP" || moduleCode === "PGR" || moduleCode === "OBPS") null; + else nextActions.push({ action: "EDIT", state: currentState }); + } + + const getStateForUUID = (uuid) => businessServiceResponse?.find((state) => state.uuid === uuid); + + const actionState = businessServiceResponse + ?.filter((state) => state.uuid === processInstances[0]?.state.uuid) + .map((state) => { + let _nextActions = state.actions?.map?.((ac) => { + let actionResultantState = getStateForUUID(ac.nextState); + let assignees = actionResultantState?.actions?.reduce?.((acc, act) => { + return [...acc, ...act.roles]; + }, []); + return { ...actionResultantState, assigneeRoles: assignees, action: ac.action, roles: ac.roles }; + }); + if(state?.isStateUpdatable) { + _nextActions.push({ action: "EDIT", ...state, roles: state?.actions?.[0]?.roles}) + } + return { ...state, nextActions: _nextActions, roles: state?.action, roles: state?.actions?.reduce((acc, el) => [...acc, ...el.roles], []) }; + })?.[0]; + + // HANDLING ACTION for NEW VEHICLE LOG FROM UI SIDE + const action_newVehicle = [{ + "action": "READY_FOR_DISPOSAL", + "roles": "FSM_EMP_FSTPO,FSM_EMP_FSTPO" + }] + + const actionRolePair = nextActions?.map((action) => ({ + action: action?.action, + roles: action.state?.actions?.map((action) => action.roles).join(","), + })); + + if (processInstances.length > 0) { + const TLEnrichedWithWorflowData = await makeCommentsSubsidariesOfPreviousActions(processInstances) + let timeline = TLEnrichedWithWorflowData.map((instance, ind) => { + let checkPoint = { + performedAction: instance.action, + status: moduleCode === "BS.AMENDMENT" ? instance.state.state :instance.state.applicationStatus, + state: instance.state.state, + assigner: getAssignerDetails(instance, TLEnrichedWithWorflowData[ind - 1], moduleCode), + rating: instance?.rating, + wfComment: instance?.wfComments.map(e => e?.comment), + wfDocuments: instance?.documents, + thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, + assignes: instance.assignes, + caption: instance.assignes ? instance.assignes.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) : null, + auditDetails: { + created: Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime), + lastModified: Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime), + lastModifiedEpoch: instance.auditDetails.lastModifiedTime, + }, + timeLineActions: instance.nextActions + ? instance.nextActions.filter((action) => action.roles.includes(role)).map((action) => action?.action) + : null, + }; + return checkPoint; + }); + + if (getTripData) { + try { + const filters = { + businessService: 'FSM_VEHICLE_TRIP', + refernceNos: id + }; + const tripSearchResp = await Digit.FSMService.vehicleSearch(tenantId, filters) + if (tripSearchResp && tripSearchResp.vehicleTrip && tripSearchResp.vehicleTrip.length) { + const numberOfTrips = tripSearchResp.vehicleTrip.length + let cretaedTime = 0 + let lastModifiedTime = 0 + let waitingForDisposedCount = 0 + let disposedCount = 0 + let waitingForDisposedAction = [] + let disposedAction = [] + for (const data of tripSearchResp.vehicleTrip) { + const resp = await Digit.WorkflowService.getByBusinessId(tenantId, data.applicationNo) + resp?.ProcessInstances?.map((instance, ind) => { + if (instance.state.applicationStatus === "WAITING_FOR_DISPOSAL") { + waitingForDisposedCount++ + cretaedTime = Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime) + lastModifiedTime = Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime) + waitingForDisposedAction = [{ + performedAction: instance.action, + status: instance.state.applicationStatus, + state: instance.state.state, + assigner: instance?.assigner, + rating: instance?.rating, + thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, + assignes: instance.assignes, + caption: instance.assignes ? instance.assignes.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) : null, + auditDetails: { + created: cretaedTime, + lastModified: lastModifiedTime, + }, + numberOfTrips: numberOfTrips + }] + } + if (instance.state.applicationStatus === "DISPOSED") { + disposedCount++ + cretaedTime = instance.auditDetails.createdTime > cretaedTime ? Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.createdTime) : cretaedTime + lastModifiedTime = instance.auditDetails.lastModifiedTime > lastModifiedTime ? Digit.DateUtils.ConvertEpochToDate(instance.auditDetails.lastModifiedTime) : lastModifiedTime + disposedAction = [{ + performedAction: instance.action, + status: instance.state.applicationStatus, + state: instance.state.state, + assigner: instance?.assigner, + rating: instance?.rating, + thumbnailsToShow: { thumbs: instance?.thumbnailsToShow?.thumbs, fullImage: instance?.thumbnailsToShow?.images }, + assignes: instance.assignes, + caption: instance.assignes ? instance.assignes.map((assignee) => ({ name: assignee.name, mobileNumber: assignee.mobileNumber })) : null, + auditDetails: { + created: cretaedTime, + lastModified: lastModifiedTime, + }, + numberOfTrips: disposedCount + }] + } + }) + } + + let tripTimeline = [] + const disposalInProgressPosition = timeline.findIndex((data) => data.status === "DISPOSAL_IN_PROGRESS") + if (disposalInProgressPosition !== -1) { + timeline[disposalInProgressPosition].numberOfTrips = numberOfTrips + timeline.splice(disposalInProgressPosition + 1, 0, ...waitingForDisposedAction) + tripTimeline = disposedAction + } else { + tripTimeline = disposedAction.concat(waitingForDisposedAction) + } + const feedbackPosition = timeline.findIndex((data) => data.status === "CITIZEN_FEEDBACK_PENDING") + if (feedbackPosition !== -1) { + timeline.splice(feedbackPosition + 1, 0, ...tripTimeline) + } else { + timeline = tripTimeline.concat(timeline) + } + } + } catch (err) { } + } + + // HANDLING ACTION FOR NEW VEHICLE LOG FROM UI SIDE + const nextActions = location.pathname.includes("new-vehicle-entry") ? action_newVehicle : actionRolePair; + + if (role !== "CITIZEN" && moduleCode === "PGR") { + const onlyPendingForAssignmentStatusArray = timeline?.filter(e => e?.status === "PENDINGFORASSIGNMENT") + const duplicateCheckpointOfPendingForAssignment = onlyPendingForAssignmentStatusArray.at(-1) + // const duplicateCheckpointOfPendingForAssignment = timeline?.find( e => e?.status === "PENDINGFORASSIGNMENT") + timeline.push({ + ...duplicateCheckpointOfPendingForAssignment, + status: "COMPLAINT_FILED", + }); + } + + if (timeline[timeline.length - 1].status !== "CREATED" && (moduleCode === "FSM" || moduleCode === "FSM_POST_PAY_SERVICE")) + timeline.push({ + status: "CREATED", + }); + + const details = { + timeline, + nextActions, + actionState, + applicationBusinessService: workflow?.ProcessInstances?.[0]?.businessService, + processInstances: applicationProcessInstance, + }; + return details; + } + } else { + throw new Error("error fetching workflow services"); + } + return {}; + }, + + getAllApplication: (tenantId, filters) => { + return Request({ + url: Urls.WorkFlowProcessSearch, + useCache: false, + method: "POST", + params: { tenantId, ...filters }, + auth: true, + }); + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/index.js new file mode 100644 index 00000000000..d74d967a9de --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/index.js @@ -0,0 +1,3 @@ +import { useStore, useInitStore } from "../hooks/store"; + +export { useStore, useInitStore }; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/DSS/getDSSDashboardData.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/DSS/getDSSDashboardData.js new file mode 100644 index 00000000000..cdc4605ad33 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/DSS/getDSSDashboardData.js @@ -0,0 +1,11 @@ +import useDssMDMS from "../../../hooks/dss/useMDMS"; + +export const getDSSDashboardData = (stateCode, mdmsType, moduleCode) => { + const { data: dssConfig, isLoading: configLoading, isSuccess: configLoaded } = useDssMDMS(stateCode, mdmsType, moduleCode); + return [ + { + queryKey: ["DSS_DASHBOARD_DATA", mdmsType, moduleCode], + queryFn: () => dssConfig, + }, + ]; +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ServiceDefinitions.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ServiceDefinitions.js new file mode 100644 index 00000000000..17c076705d8 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ServiceDefinitions.js @@ -0,0 +1,57 @@ +import { MdmsService } from "../elements/MDMS"; +import { Storage } from "../atoms/Utils/Storage"; + +export const GetServiceDefinitions = { + get: async (tenantId) => { + const criteria = { + type: "serviceDefs", + details: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: "RAINMAKER-PGR", + masterDetails: [ + { + name: "ServiceDefs", + }, + ], + }, + ], + }, + }; + + const serviceDefs = await MdmsService.getDataByCriteria(tenantId, criteria, "PGR"); + Storage.set("serviceDefinitions", serviceDefs); + return serviceDefs; + }, + getMenu: async (stateCode, t) => { + var Menu = []; + const response = await GetServiceDefinitions.get(stateCode); + await Promise.all( + response.map((def) => { + if (!Menu.find((e) => e.key === def.menuPath)) { + def.menuPath === "" + ? Menu.push({ + name: t("SERVICEDEFS.OTHERS"), + key: def.menuPath, + }) + : Menu.push({ + name: t("SERVICEDEFS." + def.menuPath.toUpperCase()), + key: def.menuPath, + }); + } + }) + ); + return Menu; + }, + + getSubMenu: async (tenantId, selectedType, t) => { + const fetchServiceDefs = await GetServiceDefinitions.get(tenantId); + return fetchServiceDefs + .filter((def) => def.menuPath === selectedType.key) + .map((id) => ({ + key: id.serviceCode, + name: t("SERVICEDEFS." + id.serviceCode.toUpperCase()), + })); + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ShareFiles.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ShareFiles.js new file mode 100644 index 00000000000..99988a0d525 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/ShareFiles.js @@ -0,0 +1,75 @@ +import Download from "../atoms/Download"; +import { UploadServices } from "../atoms/UploadServices"; +import UrlShortener from "../elements/UrlShortener"; + +const isMobileOrTablet = () => { + return (/(android|iphone|ipad|mobile)/i.test(navigator.userAgent)); +} + +const ShareFiles = { + targetLink: (target, shortUrl) => { + switch (target) { + case "mail": + return window.open(`mailto:?body=${encodeURIComponent(shortUrl)}`, "_blank"); + case "whatsapp": + return window.open('https://' + (isMobileOrTablet() ? 'api' : 'web') + '.whatsapp.com/send?text=' + encodeURIComponent(shortUrl), "_blank"); + default: + return window.open(shortUrl, "_blank"); + } + }, + + getShortener: async (tenantId, data) => { + const fileUploadId = await UploadServices.Filestorage("DSS", data, tenantId); + const fileUrl = await UploadServices.Filefetch([fileUploadId.data.files[0].fileStoreId], fileUploadId.data.files[0].tenantId); + return UrlShortener(Digit.Utils.getFileUrl(fileUrl.data[fileUploadId.data.files[0].fileStoreId])); + }, + + PDF: async (tenantId, node, filename, target) => { + const pdfData = await Download.PDF(node, filename, true); + if (!target && navigator.share) { + return navigator.share({ + files: [pdfData], + title: filename, + }); + } + const shortUrl = await ShareFiles.getShortener(tenantId, pdfData); + return ShareFiles.targetLink(target, shortUrl); + }, + + Image: async (tenantId, node, filename, target) => { + const imageData = await new Promise((resolve) => Download.Image(node, filename, true, resolve)); + if (!target && navigator.share) { + return navigator.share({ + files: [imageData], + title: filename, + }); + } + const shortUrl = await ShareFiles.getShortener(tenantId, imageData); + return ShareFiles.targetLink(target, shortUrl); + }, + + IndividualChartImage: async (tenantId, node, filename, target) => { + const imageData = await new Promise((resolve) => Download.IndividualChartImage(node, filename, true, resolve)); + if (!target && navigator.share) { + return navigator.share({ + files: [imageData], + title: filename, + }); + } + const shortUrl = await ShareFiles.getShortener(tenantId, imageData); + return ShareFiles.targetLink(target, shortUrl); + }, + DownloadImage: async (tenantId, node, filename, target) => { + const imageData = await new Promise((resolve) => Download.PDF(node, filename, true, resolve)); + if (!target && navigator.share) { + return navigator.share({ + files: [imageData], + title: filename, + }); + } + const shortUrl = await ShareFiles.getShortener(tenantId, imageData); + return ShareFiles.targetLink(target, shortUrl); + }, +}; + +export default ShareFiles; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js new file mode 100644 index 00000000000..c8dacd95506 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js @@ -0,0 +1,119 @@ +import { LocalizationService } from "../../elements/Localization/service"; +import { MdmsService } from "../../elements/MDMS"; +import { Storage } from "../../atoms/Utils/Storage"; +import { ApiCacheService } from "../../atoms/ApiCacheService"; + +const getImgUrl = (url, fallbackUrl) => { + if (!url && fallbackUrl) { + return fallbackUrl; + } + if (url?.includes("s3.ap-south-1.amazonaws.com")) { + const baseDomain = window?.location?.origin; + return url.replace("https://s3.ap-south-1.amazonaws.com", baseDomain); + } + return url; +}; +const addLogo = (id, url, fallbackUrl = "") => { + const containerDivId = "logo-img-container"; + let containerDiv = document.getElementById(containerDivId); + if (!containerDiv) { + containerDiv = document.createElement("div"); + containerDiv.id = containerDivId; + containerDiv.style = "position: absolute; top: 0; left: -9999px;"; + document.body.appendChild(containerDiv); + } + const img = document.createElement("img"); + img.src = getImgUrl(url, fallbackUrl); + img.id = `logo-${id}`; + containerDiv.appendChild(img); +}; + +const renderTenantLogos = (stateInfo, tenants) => { + addLogo(stateInfo.code, stateInfo.logoUrl); + tenants.forEach((tenant) => { + addLogo(tenant.code, tenant.logoId, stateInfo.logoUrl); + }); +}; + +export const StoreService = { + getInitData: () => { + return Storage.get("initData"); + }, + + getBoundries: async (tenants) => { + let allBoundries = []; + allBoundries = tenants.map((tenant) => { + return Digit.LocationService.getLocalities(tenant.code); + }); + return await Promise.all(allBoundries); + }, + getRevenueBoundries: async (tenants) => { + let allBoundries = []; + allBoundries = tenants.map((tenant) => { + return Digit.LocationService.getRevenueLocalities(tenant.code); + }); + return await Promise.all(allBoundries); + }, + digitInitData: async (stateCode, enabledModules) => { + const { MdmsRes } = await MdmsService.init(stateCode); + const stateInfo = MdmsRes["common-masters"]?.StateInfo?.[0]||{}; + const uiHomePage = MdmsRes["common-masters"]?.uiHomePage?.[0]||{}; + const localities = {}; + const revenue_localities = {}; + const initData = { + languages: stateInfo.hasLocalisation ? stateInfo.languages : [{ label: "ENGLISH", value: Digit.Utils.getDefaultLanguage() }], + stateInfo: { + code: stateInfo.code, + name: stateInfo.name, + logoUrl: stateInfo.logoUrl, + statelogo: stateInfo.statelogo, + logoUrlWhite: stateInfo.logoUrlWhite, + bannerUrl: stateInfo.bannerUrl, + }, + localizationModules: stateInfo.localizationModules, + modules: MdmsRes?.tenant?.citymodule?.filter((module) => module?.active)?.filter((module) => enabledModules?.includes(module?.code))?.sort((x,y)=>x?.order-y?.order), + uiHomePage: uiHomePage + }; + + + initData.selectedLanguage = Digit.SessionStorage.get("locale") || initData.languages[0].value; + + ApiCacheService.saveSetting(MdmsRes["DIGIT-UI"]?.ApiCachingSettings); + + const moduleTenants = initData.modules + .map((module) => module.tenants) + .flat() + .reduce((unique, ele) => (unique.find((item) => item.code === ele.code) ? unique : [...unique, ele]), []); + initData.tenants = MdmsRes?.tenant?.tenants + .map((tenant) => ({ i18nKey: `TENANT_TENANTS_${tenant.code.replace(".", "_").toUpperCase()}`, ...tenant })); + // .filter((item) => !!moduleTenants.find((mt) => mt.code === item.code)) + // .map((tenant) => ({ i18nKey: `TENANT_TENANTS_${tenant.code.replace(".", "_").toUpperCase()}`, ...tenant })); + + await LocalizationService.getLocale({ + modules: [ + `rainmaker-common`, + `rainmaker-${stateCode.toLowerCase()}` + ], + locale: initData.selectedLanguage, + tenantId: stateCode, + }); + Storage.set("initData", initData); + initData.revenue_localities = revenue_localities; + initData.localities = localities; + setTimeout(() => { + renderTenantLogos(stateInfo, initData.tenants); + }, 0); + return initData; + }, + defaultData: async (stateCode, moduleCode, language) => { + let moduleCodes = []; + if(typeof moduleCode !== "string") moduleCode.forEach(code => { moduleCodes.push(`rainmaker-${code.toLowerCase()}`) }); + const LocalePromise = LocalizationService.getLocale({ + modules: typeof moduleCode == "string" ? [`rainmaker-${moduleCode.toLowerCase()}`] : moduleCodes, + locale: language, + tenantId: stateCode, + }); + await LocalePromise; + return {}; + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/StoreData.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/StoreData.js new file mode 100644 index 00000000000..dcc5e2f8475 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/StoreData.js @@ -0,0 +1,8 @@ +import { StoreService } from "./Store/service"; + +const StoreData = { + getInitData: () => StoreService.getInitData(), + getCurrentLanguage: () => Digit.SessionStorage.get("locale") || Digit.Utils.getDefaultLanguage(), +}; + +export default StoreData; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js new file mode 100644 index 00000000000..e5249335b20 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js @@ -0,0 +1,148 @@ +import { StoreService } from "../Store/service"; +import { UserService } from "../../elements/User"; + +/** + * Custom service which can be used to + * get current tenantId + * get state tenant + * get current ulb + * get citizen selected tenant + * get all ulbs of employee + * + * @author jagankumar-egov + * + * @example + * Digit.ULBService.getCurrentTenantId() + * + * @returns {Object} Returns based on the called function + */ +export const ULBService = { + /** + * Custom method to get employee's current selected city + * + * @author jagankumar-egov + * + * @example + * Digit.ULBService.getCurrentTenantId() + * + * @returns {String} + */ + getCurrentTenantId: () => { + // TODO: change when setter is done. + const user = UserService.getUser(); + if (user?.extraRoleInfo) { + const isDsoRoute = Digit.Utils.detectDsoRoute(window.location.pathname); + if (isDsoRoute) { + return user.extraRoleInfo?.tenantId; + } + } + //TODO: fix tenant id from userinfo + const tenantId = + user?.info?.type === "EMPLOYEE" && user?.info?.tenantId ? user?.info?.tenantId : window?.globalConfigs.getConfig("STATE_LEVEL_TENANT_ID"); + return tenantId; + }, + /** + * Custom method to get current environment home / state tenant + * + * @author jagankumar-egov + * + * @example + * Digit.ULBService.getStateId() + * + * @returns {String} + */ + getStateId: () => { + return window?.globalConfigs?.getConfig("STATE_LEVEL_TENANT_ID"); + }, + /** + * Custom method to get employee's current ulb object + * + * @author jagankumar-egov + * + * @example + * Digit.ULBService.getCurrentUlb() + * + * @returns {Object} + */ + getCurrentUlb: () => { + const initData = StoreService.getInitData(); + const tenantId = ULBService.getCurrentTenantId(); + return initData.tenants.find((tenant) => tenant.code === tenantId); + } + /** + * Custom method to get citizen's current selected city + * + * @author jagankumar-egov + * + * @example + * Digit.ULBService.getCitizenCurrentTenant() -> will return selected home city if not loggedin users city if not state tenant + * + * Digit.ULBService.getCitizenCurrentTenant(true) -> will return selected home city + * + * @returns {String} + */, + getCitizenCurrentTenant: (selectedCity=false) => { + const homeCity=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; + if(selectedCity){ + return homeCity; + } + return homeCity|| Digit.UserService.getUser()?.info?.permanentCity || ULBService.getStateId(); + }, + /** + * Custom method to get all ulb's which the loggedin employee has access to + * + * + * @example + * Digit.ULBService.getUserUlbs() + * + * @returns {Array} array of objects in the following structure + * + * [ { + * i18nKey:"", + * value:"", + * code:"", + * name:"" + * }] + */ + getUserUlbs: (userRole = "") => { + const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { + if (searcher == "") return str; + while (str?.includes(searcher)) { + str = str?.replace(searcher, replaceWith); + } + return str; + }; + + const userloggedValues = Digit.SessionStorage.get("citizen.userRequestObject"); + let teantsArray = [], + filteredArray = []; + if (userRole === "") { + userloggedValues?.info?.roles?.forEach((role) => teantsArray.push(role.tenantId)); + let unique = teantsArray.filter((item, i, ar) => ar.indexOf(item) === i); + + unique?.forEach((uniCode) => { + filteredArray.push({ + i18nKey: `TENANT_TENANTS_${stringReplaceAll(uniCode, ".", "_")?.toUpperCase()}`, + value: uniCode, + code: uniCode, + name: uniCode.substring(uniCode.indexOf(".") + 1), + }); + }); + return filteredArray; + } else { + userloggedValues?.info?.roles?.forEach((role) => { + if (userRole === role.code) teantsArray.push(role.tenantId); + }); + let unique = teantsArray.filter((item, i, ar) => ar.indexOf(item) === i); + unique?.forEach((uniCode) => { + filteredArray.push({ + i18nKey: `TENANT_TENANTS_${stringReplaceAll(uniCode, ".", "_")?.toUpperCase()}`, + value: uniCode, + code: uniCode, + name: uniCode.substring(uniCode.indexOf(".") + 1), + }); + }); + return filteredArray; + } + } +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/getLocalities.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/getLocalities.js new file mode 100644 index 00000000000..84c713e4e48 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/getLocalities.js @@ -0,0 +1,13 @@ +import { LocationService } from "../elements/Location"; +import { StoreService } from "./Store/service"; + +export const getLocalities = { + admin: async (tenant) => { + await StoreService.defaultData(tenant, tenant, Digit.StoreData.getCurrentLanguage()); + return (await LocationService.getLocalities(tenant)).TenantBoundary[0]; + }, + revenue: async (tenant) => { + await StoreService.defaultData(tenant, tenant, Digit.StoreData.getCurrentLanguage()); + return (await LocationService.getRevenueLocalities(tenant)).TenantBoundary[0]; + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/subFormRegistry.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/subFormRegistry.js new file mode 100644 index 00000000000..0ffa4ecd055 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/subFormRegistry.js @@ -0,0 +1,43 @@ +export class SubformRegistry { + constructor(registry = {}) { + this._registry = registry; + } + + getSubform = (key) => this._registry[key]; + + addSubForm = (key, config) => (this._registry[key] = config); + + changeConfig = async (key, callBack) => { + let config = this.getSubform(key); + let newConfig = await callBack(config); + this._registry[key] = newConfig; + }; + + addMiddleware = ( + subFormKey, + middlewareKey, + middlewareFn, + { functionName, preceedingName = "", preceedingIndex = null, exceedingName = "", exceedingIndex = null } + ) => { + let config = this.getSubform(subFormKey); + let { middlewares } = config; + const setPreceedingIndex = (preceedingIndex) => { + let firstChunk = middlewares.splice(0, preceedingIndex + 1); + middlewares = [...firstChunk, { [functionName]: middlewareFn }, ...middlewares]; + }; + + const setExceedingIndex = (exceedingIndex) => { + let firstChunk = middlewares.splice(0, exceedingIndex); + middlewares = [...firstChunk, { [functionName]: middlewareFn }, ...middlewares]; + }; + + if (preceedingIndex) setPreceedingIndex(preceedingIndex); + else if (exceedingIndex) setExceedingIndex(exceedingIndex); + else if (preceedingName) { + let element = middlewares.filter((e) => Object.keys(e)[0] === preceedingName)[0] || null; + } else if (exceedingName) { + } + }; +} + +export const subFormRegistry = new SubformRegistry({}); diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/translations/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/translations/index.js new file mode 100644 index 00000000000..9c54bbea397 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/translations/index.js @@ -0,0 +1,61 @@ +import i18next from "i18next"; +import { initReactI18next } from "react-i18next"; +import ReactPostprocessor from "i18next-react-postprocessor"; + +const i18nextConfig = () => ({ + lng: Digit.StoreData.getCurrentLanguage(), + fallbackLng: Digit.Utils.getDefaultLanguage(), + debug: false, + ns: ["translations"], + defaultNS: "translations", + keySeparator: false, + saveMissing: false, + saveMissingTo: "current", + interpolation: { + escapeValue: false, + formatSeparator: ",", + }, + postProcess: [`reactPostprocessor`, "templatePostprocessor"], + react: { + useSuspense: true, + bindI18n: "loaded", + bindI18nStore: "added", + }, + resources: { + [Digit.Utils.getDefaultLanguage()]: { + translations: { + welcome: "Welcome", + }, + }, + }, +}); + +function replaceLiterals(text = "", dynamicValues = {}) { + let returnText = text; + const regex = /[^\{\{][\{]\w+/; + if (regex.exec(text) !== null) { + Object.keys(dynamicValues).forEach((key) => { + returnText = returnText.replace(`{${key.toUpperCase()}}`, dynamicValues[key]); + }); + } + return returnText; +} + +const templatePostprocessor = { + type: "postProcessor", + name: "templatePostprocessor", + process: function (value, key, options, translator) { + return replaceLiterals(value, options); + }, +}; + +export const initI18n = (callback) => { + return i18next + .use(new ReactPostprocessor()) + .use(templatePostprocessor) + .use(initReactI18next) + .init(i18nextConfig(), () => { + window.i18next = i18next; + callback(); + }); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/browser.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/browser.js new file mode 100644 index 00000000000..56074b71c90 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/browser.js @@ -0,0 +1,35 @@ +const checkWebview = () => { + const ua = navigator.userAgent; + let rules = [ + // if it says it's a webview, let's go with that + "WebView", + // iOS webview will be the same as safari but missing "Safari" + "(iPhone|iPod|iPad)(?!.*Safari)", + // Android Lollipop and Above: webview will be the same as native but it will contain "wv" + // Android KitKat to lollipop webview will put {version}.0.0.0 + "Android.*(wv|.0.0.0)", + // old chrome android webview agent + "Linux; U; Android", + ]; + + const webviewRegExp = new RegExp("(" + rules.join("|") + ")", "ig"); + return !!ua.match(webviewRegExp); +}; + +const mobileCheck = () => { + let check = false; + (function (a) { + if ( + /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test( + a + ) || + /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( + a.substr(0, 4) + ) + ) + check = true; + })(navigator.userAgent || navigator.vendor || window.opera); + return check; +}; + +export default { isWebview: checkWebview, isMobile: mobileCheck }; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/componentRegistry.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/componentRegistry.js new file mode 100644 index 00000000000..8c1a5a2bbec --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/componentRegistry.js @@ -0,0 +1,23 @@ +class ComponentRegistry { + constructor() { + this._registry = {}; + } + + getComponent(id) { + return this._registry[id]; + } + + setComponent(id, component) { + this._registry[id] = component; + return true; + } + + setAllComponents(components) { + Object.entries(components).forEach(([key, value]) => { + this.setComponent(key, value); + }); + return this._registry; + } +} + +export default ComponentRegistry; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/date.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/date.js new file mode 100644 index 00000000000..c6a547946a3 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/date.js @@ -0,0 +1,20 @@ +function getDate(timestamp) { + const dt = timestamp ? new Date(timestamp) : new Date(); + let dd = dt.getDate(); + let mm = dt.getMonth() + 1; + var yyyy = dt.getFullYear(); + + if (dd < 10) { + dd = "0" + dd; + } + + if (mm < 10) { + mm = "0" + mm; + } + + return yyyy + "-" + mm + "-" + dd; +} + +const monthNames = ["Jan", "Feb", "March", "Apr", "May", "June", "July", "Aug", "Sep", "Oct", "Nov", "Dec"]; + +export { getDate, monthNames }; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/dynamicRequestGenerator.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/dynamicRequestGenerator.js new file mode 100644 index 00000000000..9d5d4b2a820 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/dss/dynamicRequestGenerator.js @@ -0,0 +1,101 @@ +import { Request } from "../../services/atoms/Utils/Request"; +export const getFilterValue = (filter) => { + if (filter?.source?.type == 'request') { + return getRequestFilterValues(filter); + } else if (filter?.source?.type == 'list') { + return getListFilterValues(filter); + } else return; +} + +const getRequestFilterValues = (filter) => { + return new Promise((resolve, reject) => { + try { + let request = getRequestPayload(filter.source); + Request(request).then((res) => { + var jp = require('jsonpath'); + let keys = jp.query(res, filter.source.keyPath); + let values = jp.query(res, filter.source.valuesPath); + let filtersValues = []; + if (keys && values && keys.length && values.length && keys.length == values.length) { + keys.forEach((key, idx) => { + filtersValues.push({'key': key, 'value': values[idx]}) + }) + } + resolve({'id': filter.id, 'values': filtersValues}) + }).catch(err => { + resolve({'id': filter.id, 'values': null}) + }) + } catch (error) { + reject(error); + } + }) +} + +const getListFilterValues = (filter) => { + return new Promise((resolve, reject) => { + let listValue = filter.source.list; + var jp = require('jsonpath'); + let keys = jp.query(listValue, filter.source.keyPath); + let values = jp.query(listValue, filter.source.valuesPath); + let filtersValues = []; + if (keys && values && keys.length && values.length && keys.length == values.length) { + keys.forEach((key, idx) => { + filtersValues.push({'key': key, 'value': values[idx]}) + }) + } + resolve({'id': filter.id, 'values': filtersValues}) + }) +} + +const getRequestPayload = (filterConfig) => { + let request = {}; + request["method"] = filterConfig?.requestMethod ? filterConfig.requestMethod : "POST"; + request["url"] = filterConfig?.hostUrl ? filterConfig.hostUrl + filterConfig.requestUrl : filterConfig.requestUrl; + request["authHeader"] = true; + request["useCache"] = true; + request["userService"] = true; + request["locale"] = true; + if (filterConfig?.requestBody && filterConfig.requestBody.length) { + request["data"] = JSON.parse(filterConfig.requestBody); + } + return request; +} + +export const getParsedRequest = (filterSource, filterValues) => { + var jp = require('jsonpath'); + if (filterSource?.requestUrl && filterSource?.requestUrl.length) { + let replacableList = getReplacableValues(filterSource.requestUrl); + replacableList.forEach((str) => { + let value = jp.query(filterValues, str); + filterSource.requestUrl = filterSource.requestUrl.replace(`{${str}}`, value) + }) + } + if (filterSource?.requestBody && filterSource?.requestBody.length) { + let replacableList = getReplacableValues(filterSource.requestBody); + replacableList.forEach((str) => { + let value = jp.query(filterValues, str); + filterSource.requestBody = filterSource.requestBody.replace(`{${str}}`, value) + }) + } + return filterSource; +} + +const getReplacableValues = (requestString) => { + let replacableValues = []; + let isReplacable = false; + let replacableStr = ""; + for (let idx=0; idx { + const currencyFormatter = new Intl.NumberFormat("en-IN", { currency: "INR" }); + + switch (denomination) { + case "Lac": + return `₹ ${currencyFormatter.format((value / 100000).toFixed(2) || 0)} ${t("ES_DSS_LAC")}`; + case "Cr": + return `₹ ${currencyFormatter.format((value / 10000000).toFixed(2) || 0)} ${t("ES_DSS_CR")}`; + case "Unit": + return `₹ ${currencyFormatter.format(value?.toFixed(2) || 0)}`; + default: + return ""; + } +}; + +export const formatter = (value, symbol, unit, commaSeparated = true, t) => { + if (!value && value !== 0) return ""; + switch (symbol) { + case "amount": + return amountFormatter(value, unit, t); + //this case needs to be removed as backend should handle case sensitiviy from their end + case "Amount": + return amountFormatter(value, unit, t); + case "number": + if (!commaSeparated) { + return parseInt(value); + } + const Nformatter = new Intl.NumberFormat("en-IN"); + return Nformatter.format(value); + case "percentage": + const Pformatter = new Intl.NumberFormat("en-IN", { maximumSignificantDigits: 3 }); + return `${Pformatter.format(value.toFixed(2))} %`; + default: + return ""; + } +}; + +export const getDuration = (startDate, endDate) => { + let noOfDays = (new Date(endDate).getTime() - new Date(startDate).getTime()) / (1000 * 3600 * 24); + if (noOfDays > 91) { + return "month"; + } + if (noOfDays < 90 && noOfDays >= 14) { + return "week"; + } + if (noOfDays <= 14) { + return "day"; + } +}; + +export const getInitialRange = () => { + const startDate = addMonths(startOfYear(new Date()), 3); + const endDate = addMonths(endOfYear(new Date()), 3); + const title = `${format(startDate, "MMM d, yy")} - ${format(endDate, "MMM d, yy")}`; + const duration = Digit.Utils.dss.getDuration(startDate, endDate); + return { startDate, endDate, title, duration }; +}; + +export const getDatesBackFromToday = (numberOfDays) => { + const endDate = endOfDay(new Date()); + const startDate = startOfDay(addDays(new Date(), - (numberOfDays-1))); + const title = `${format(startDate, "MMM d, yy")} - ${format(endDate, "MMM d, yy")}`; + const duration = Digit.Utils.dss.getDuration(startDate, endDate); + return { startDate, endDate, title, duration }; +}; + +export const getDateDiffrenence = (startDate, endDate) => { + return differenceInDays(startDate, endDate); +} + +export const getDefaultFinacialYear = () => { + const currDate = new Date().getMonth(); + if (currDate < 3) { + return { + startDate: subYears(addMonths(startOfYear(new Date()), 3), 1), + endDate: endOfToday(new Date()), + // endDate: subYears(addMonths(endOfYear(new Date()), 3), 1), RAIN-5752 : to keep date till current date and not a financial year + + }; + } else { + return { + startDate: addMonths(startOfYear(new Date()), 3), + endDate: endOfToday(new Date()), +// endDate: addMonths(endOfYear(new Date()), 3), + + }; + } +}; + +/* Used in DSS to get the current module id */ +export const getCurrentModuleName=()=>{ + const allPaths= window.location.pathname.split('/'); + return allPaths[allPaths.length-1]; +} + +/* Used in DSS to get the filtered ulbs for selected city */ +export const checkSelected = (e, selectedDDRs) => { + if (!selectedDDRs || selectedDDRs?.length == 0) { + return true; + } else if (selectedDDRs.find((ddr) => ddr.ddrKey == e.ddrKey)) { + return true; + } else { + return false; + } +}; + + +/* Used in DSS to get the filtered ulbs for selected city for global filter*/ +export const getCitiesAvailable = (e, selectedDDRs) => { + if (!selectedDDRs || selectedDDRs?.length == 0) { + return true; + } else if (selectedDDRs.find((ddr) => ddr == e.ddrKey)) { + return true; + } else { + return false; + } +}; + +export const getCustomFiltersDynamicValues = async (filterConfig, dynamicValues) => { + if (filterConfig && dynamicValues) { + filterConfig = filterConfig.map((filter) => { + if (filter?.source?.type == 'request') { + filter.source = getParsedRequest(filter.source, dynamicValues); + } + return filter; + }) + } + return filterConfig; +} + +export const getFilterOptionsForConfig = async (filterConfig) => { + let filtersData = {}; + if (filterConfig) { + let requests = []; + filterConfig.forEach((filter) => { + if (filter?.source) { + requests.push(getFilterValue(filter)) + } + }) + await Promise.all(requests).then((res) => { + if (res && res.length) { + res.forEach((filterRes) => { + if (filterRes?.id && filterRes?.values) + filtersData[filterRes.id] = filterRes?.values; + }) + } + }); + } + return filtersData; +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/fileType.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/fileType.js new file mode 100644 index 00000000000..1eb15cfa65d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/fileType.js @@ -0,0 +1,7 @@ +const getFileTypeFromFileStoreURL = (filestoreURL) => { + if(filestoreURL.includes(".pdf")) return "pdf" + if(filestoreURL.includes(".jpg") || filestoreURL.includes(".jpeg") || filestoreURL.includes(".png") || filestoreURL.includes(".webp")) return "image" + else return "image" +} + +export default getFileTypeFromFileStoreURL \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/fonts.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/fonts.js new file mode 100644 index 00000000000..da43efdb324 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/fonts.js @@ -0,0 +1,2 @@ +export const Fonts = { + }; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/fsm/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/fsm/index.js new file mode 100644 index 00000000000..8f93bafae51 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/fsm/index.js @@ -0,0 +1,94 @@ +export const getPropertyTypeLocale = (value) => { + return `PROPERTYTYPE_MASTERS_${value?.split(".")[0]}`; +}; + +export const getPropertySubtypeLocale = (value) => `PROPERTYTYPE_MASTERS_${value}`; + +export const getVehicleType = (vehicle, t) => { + return (vehicle?.i18nKey && vehicle?.capacity && `${t(vehicle.i18nKey)} - ${vehicle.capacity} ${t("CS_COMMON_CAPACITY_LTRS")}`) || null; +}; + +export const updateConfiguration = ({ config, defaultConfig, detailsConfig, customConfiguration, isDefaultConfig }) => { + const fieldSectionNamesInsideConfig = []; + const detailsConfigCopy = { ...detailsConfig }; + + customConfiguration.forEach((detail) => { + // Adding custom fields to FieldSection fields array (body) + if (detailsConfigCopy[detail.name] && detail.addFields) { + detailsConfigCopy[detail.name].body.push(...detail.addFields); + } + + let body = []; + + // adding fields to body array + if (detail?.fieldsOrder?.length > 0) { + // fields order + detail.fieldsOrder.forEach((fieldName) => { + if (detailsConfigCopy[detail.name]) { + body.push(detailsConfigCopy[detail.name].body.find((value) => value.name === fieldName)); + } + }); + + // adding remaining fields to the body array which are not in detail?.fieldsOrder + if (detail?.allFields) { + detailsConfigCopy[detail.name]?.body?.forEach((field) => { + if (!detail?.fieldsOrder?.includes(field.name)) { + body.push(detailsConfigCopy[detail.name].body.find((value) => value.name === field.name)); + } + }); + } + } else { + body = detailsConfigCopy[detail.name].body; + } + + // remove fields + if (detail?.removeFields) { + detail?.removeFields?.forEach((fieldName) => { + body = body.filter((field) => field.name !== fieldName); + }); + } + + // adding FieldSection to config + if (detailsConfigCopy[detail.name]) { + config.push({ + head: detailsConfigCopy[detail.name].head, + body, + }); + fieldSectionNamesInsideConfig.push(detail.name); + } + }); + + // adding remaining FieldSection to config + if (isDefaultConfig) { + defaultConfig?.forEach((fieldSectionName) => { + if (!fieldSectionNamesInsideConfig.includes(fieldSectionName) && detailsConfigCopy[fieldSectionName]) { + config.push(detailsConfigCopy[fieldSectionName]); + fieldSectionNamesInsideConfig.push(fieldSectionName); + } + }); + } +}; + +// How to use above updateConfiguration function +// let config = []; + +// const defaultConfig = ["applicationDetails", "propertyDetails", "locationDetails", "paymentDetails"]; + +// const { Customizations } = window.Digit; +// let employeeCustomizations = false; + +// if (Customizations?.FSM?.getEmployeeApplicationCustomization) { +// employeeCustomizations = Customizations?.FSM?.getEmployeeApplicationCustomization(defaultConfig, t); +// } + +// if (employeeCustomizations?.config?.length > 0) { +// updateConfiguration({ +// config, +// defaultConfig, +// detailsConfig, +// customConfiguration: employeeCustomizations?.config, +// isDefaultConfig: employeeCustomizations?.defaultConfig, +// }); +// } else { +// defaultConfig.forEach((fieldSectionName) => config.push(detailsConfig[fieldSectionName])); +// } diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js new file mode 100644 index 00000000000..460e4d7d599 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js @@ -0,0 +1,382 @@ +import BrowserUtil from "./browser"; +import * as date from "./date"; +import * as dss from "./dss"; +import * as locale from "./locale"; +import * as obps from "./obps"; +import * as pt from "./pt"; +import * as privacy from "./privacy"; +import PDFUtil, { downloadReceipt ,downloadPDFFromLink,downloadBill ,getFileUrl} from "./pdf"; +import getFileTypeFromFileStoreURL from "./fileType"; +import preProcessMDMSConfig from "./preProcessMDMSConfig"; +import preProcessMDMSConfigInboxSearch from "./preProcessMDMSConfigInboxSearch"; +import * as parsingUtils from "../services/atoms/Utils/ParsingUtils" +const GetParamFromUrl = (key, fallback, search) => { + if (typeof window !== "undefined") { + search = search || window.location.search; + const params = new URLSearchParams(search); + return params.has(key) ? params.get(key) : fallback; + } + return fallback; +}; + +const getPattern = (type) => { + switch (type) { + case "Name": + return /^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i; + case "SearchOwnerName": + return /^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{3,50}$/i; + case "MobileNo": + return /^[6789][0-9]{9}$/i; + case "Amount": + return /^[0-9]{0,8}$/i; + case "NonZeroAmount": + return /^[1-9][0-9]{0,7}$/i; + case "DecimalNumber": + return /^\d{0,8}(\.\d{1,2})?$/i; + case "Email": + return /^(?=^.{1,64}$)((([^<>()\[\]\\.,;:\s$*@'"]+(\.[^<>()\[\]\\.,;:\s@'"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))$/i; + case "Address": + return /^[^\$\"<>?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,500}$/i; + case "PAN": + return /^[A-Za-z]{5}\d{4}[A-Za-z]{1}$/i; + case "TradeName": + return /^[-@.\/#&+\w\s]*$/; + case "Date": + return /^[12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/i; + case "UOMValue": + return /^(0)*[1-9][0-9]{0,5}$/i; + case "OperationalArea": + return /^(0)*[1-9][0-9]{0,6}$/i; + case "NoOfEmp": + return /^(0)*[1-9][0-9]{0,6}$/i; + case "GSTNo": + return /^\d{2}[A-Z]{5}\d{4}[A-Z]{1}\d[Z]{1}[A-Z\d]{1}$/i; + case "DoorHouseNo": + return /^[^\$\"'<>?~`!@$%^={}\[\]*:;“”‘’]{1,50}$/i; + case "BuildingStreet": + return /^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,64}$/i; + case "Pincode": + return /^[1-9][0-9]{5}$/i; + case "Landline": + return /^[0-9]{11}$/i; + case "PropertyID": + return /^[a-zA-z0-9\s\\/\-]$/i; + case "ElectricityConnNo": + return /^.{1,15}$/i; + case "DocumentNo": + return /^[0-9]{1,15}$/i; + case "eventName": + return /^[^\$\"<>?\\\\~`!@#$%^()+={}\[\]*,.:;“”]{1,65}$/i; + case "eventDescription": + return /^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,500}$/i; + case "cancelChallan": + return /^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,100}$/i; + case "FireNOCNo": + return /^[a-zA-Z0-9-]*$/i; + case "consumerNo": + return /^[a-zA-Z0-9/-]*$/i; + case "AadharNo": + return /^([0-9]){12}$/; + case "ChequeNo": + return /^(?!0{6})[0-9]{6}$/; + case "Comments": + return /^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,50}$/i; + case "OldLicenceNo": + return /^[a-zA-Z0-9-/]{0,64}$/; + case "bankAccountNo": + return /^\d{9,18}$/; + case "IFSC": + return /^[A-Z]{4}0[A-Z0-9]{6}$/; + case "ApplicationNo": + return /^[a-zA-z0-9\s\\/\-]$/i; + } +}; +/* +Digit.Utils.getUnique() +get unique elements from an array */ +const getUnique = (arr) => { + return arr.filter((value, index, self) => self.indexOf(value) === index); +}; + +/* +Digit.Utils.createFunction() +get function from a string */ +const createFunction = (functionAsString) => { + return Function("return " + functionAsString)(); +}; + +const getStaticMapUrl = (latitude, longitude) => { + const key = globalConfigs?.getConfig("GMAPS_API_KEY"); + return `https://maps.googleapis.com/maps/api/staticmap?markers=${latitude},${longitude}&zoom=15&size=400x400&key=${key}&style=element:geometry%7Ccolor:0xf5f5f5&style=element:labels.icon%7Cvisibility:off&style=element:labels.text.fill%7Ccolor:0x616161&style=element:labels.text.stroke%7Ccolor:0xf5f5f5&style=feature:administrative.land_parcel%7Celement:labels.text.fill%7Ccolor:0xbdbdbd&style=feature:poi%7Celement:geometry%7Ccolor:0xeeeeee&style=feature:poi%7Celement:labels.text.fill%7Ccolor:0x757575&style=feature:poi.park%7Celement:geometry%7Ccolor:0xe5e5e5&style=feature:poi.park%7Celement:labels.text.fill%7Ccolor:0x9e9e9e&style=feature:road%7Celement:geometry%7Ccolor:0xffffff&style=feature:road.arterial%7Celement:labels.text.fill%7Ccolor:0x757575&style=feature:road.highway%7Celement:geometry%7Ccolor:0xdadada&style=feature:road.highway%7Celement:labels.text.fill%7Ccolor:0x616161&style=feature:road.local%7Celement:labels.text.fill%7Ccolor:0x9e9e9e&style=feature:transit.line%7Celement:geometry%7Ccolor:0xe5e5e5&style=feature:transit.station%7Celement:geometry%7Ccolor:0xeeeeee&style=feature:water%7Celement:geometry%7Ccolor:0xc9c9c9&style=feature:water%7Celement:labels.text.fill%7Ccolor:0x9e9e9e`; +}; + +/** + * Custom util to get the default region + * + * @author jagankumar-egov + * + * @example + * Digit.Hooks.Utils.getLocaleRegion() + * + * @returns {string} + */ +const getLocaleRegion = () => { + return window?.globalConfigs?.getConfig("LOCALE_REGION") || "IN"; +}; +/** + * Custom util to get the default locale + * + * @author jagankumar-egov + * + * @example + * Digit.Hooks.Utils.getLocaleDefault() + * + * @returns {string} + */ +const getLocaleDefault = () => { + return globalConfigs?.getConfig("LOCALE_DEFAULT") || "en"; +}; + +/** + * Custom util to get the default language + * + * @author jagankumar-egov + * + * @example + * Digit.Hooks.Utils.getDefaultLanguage() + * + * @returns {string} + */ +const getDefaultLanguage = () => { + return `${getLocaleDefault()}_${getLocaleRegion()}`; +}; + +const detectDsoRoute = (pathname) => { + const employeePages = ["search", "inbox", "dso-dashboard", "dso-application-details", "user"]; + + return employeePages.some((url) => pathname.split("/").includes(url)); +}; + +const routeSubscription = (pathname) => { + let classname = "citizen"; + const isEmployeeUrl = detectDsoRoute(pathname); + if (isEmployeeUrl && classname === "citizen") { + return (classname = "employee"); + } else if (!isEmployeeUrl && classname === "employee") { + return (classname = "citizen"); + } +}; + + +/* to check the employee (loggedin user ) has given role */ +const didEmployeeHasRole = (role = "") => { + const tenantId = Digit.ULBService.getCurrentTenantId(); + const userInfo = Digit.UserService.getUser(); + const rolearray = userInfo?.info?.roles.filter((item) => { + if (item.code === role && item.tenantId === tenantId) return true; + }); + return rolearray?.length > 0; +}; + +/* to check the employee (loggedin user ) has given roles */ +const didEmployeeHasAtleastOneRole = (roles = []) => { + return roles.some((role) => didEmployeeHasRole(role)); +}; + +const pgrAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const pgrRoles = ["PGR_LME", "PGR-ADMIN", "CSR", "CEMP", "FEMP", "DGRO", "ULB Operator", "GRO", "GO", "RO", "GA"]; + + const PGR_ACCESS = userRoles?.filter((role) => pgrRoles.includes(role)); + + return PGR_ACCESS?.length > 0; +}; + +const fsmAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const fsmRoles = [ + "FSM_CREATOR_EMP", + "FSM_EDITOR_EMP", + "FSM_VIEW_EMP", + "FSM_REPORT_VIEWER", + "FSM_DASHBOARD_VIEWER", + "FSM_ADMIN", + "FSM_DSO", + "FSM_DRIVER", + "FSM_EMP_FSTPO", + "FSM_COLLECTOR", + ]; + + const FSM_ACCESS = userRoles?.filter((role) => fsmRoles?.includes(role)); + + return FSM_ACCESS?.length > 0; +}; + +const NOCAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + + const NOC_ROLES = [ + "FIRE_NOC_APPROVER" + ] + + const NOC_ACCESS = userRoles?.filter((role) => NOC_ROLES?.includes(role)); + + return NOC_ACCESS?.length > 0; +}; + +const BPAREGAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + + const BPAREG_ROLES = ["BPAREG_APPROVER", "BPAREG_DOC_VERIFIER"]; + + const BPAREG_ACCESS = userRoles?.filter((role) => BPAREG_ROLES?.includes(role)); + + return BPAREG_ACCESS?.length > 0; +}; + +const BPAAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + + const BPA_ROLES = [ + "BPA_VERIFIER", + "CEMP", + "BPA_APPROVER", + "BPA_FIELD_INSPECTOR", + "BPA_NOC_VERIFIER", + "AIRPORT_AUTHORITY_APPROVER", + "FIRE_NOC_APPROVER", + "NOC_DEPT_APPROVER", + "BPA_NOC_VERIFIER", + "BPA_TOWNPLANNER", + "BPA_ENGINEER", + "BPA_BUILDER", + "BPA_STRUCTURALENGINEER", + "BPA_SUPERVISOR", + "BPA_DOC_VERIFIER", + "EMPLOYEE", + ]; + + const BPA_ACCESS = userRoles?.filter((role) => BPA_ROLES?.includes(role)); + + return BPA_ACCESS?.length > 0; +}; + +const ptAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const ptRoles = ["PT_APPROVER", "PT_CEMP", "PT_DOC_VERIFIER", "PT_FIELD_INSPECTOR"]; + + const PT_ACCESS = userRoles?.filter((role) => ptRoles?.includes(role)); + + return PT_ACCESS?.length > 0; +}; + +const tlAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const tlRoles = ["TL_CEMP", "TL_APPROVER", "TL_FIELD_INSPECTOR", "TL_DOC_VERIFIER"]; + + const TL_ACCESS = userRoles?.filter((role) => tlRoles?.includes(role)); + + return TL_ACCESS?.length > 0; +}; + +const mCollectAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const mCollectRoles = ["UC_EMP"]; + + const MCOLLECT_ACCESS = userRoles?.filter((role) => mCollectRoles?.includes(role)); + + return MCOLLECT_ACCESS?.length > 0; +}; + +const receiptsAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles.map((roleData) => roleData?.code); + const receiptsRoles = ["CR_PT"]; + const RECEIPTS_ACCESS = userRoles?.filter((role) => receiptsRoles?.includes(role)); + return RECEIPTS_ACCESS?.length > 0; +}; +const hrmsRoles = ["HRMS_ADMIN"]; +const hrmsAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const HRMS_ACCESS = userRoles?.filter((role) => hrmsRoles?.includes(role)); + return HRMS_ACCESS?.length > 0; +}; + +const wsAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const waterRoles = ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER","WS_CLERK"]; + + const WS_ACCESS = userRoles?.filter((role) => waterRoles?.includes(role)); + + return WS_ACCESS?.length > 0; +}; + +const swAccess = () => { + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + const sewerageRoles = ["SW_CEMP", "SW_APPROVER", "SW_FIELD_INSPECTOR", "SW_DOC_VERIFIER","SW_CLERK"]; + + const SW_ACCESS = userRoles?.filter((role) => sewerageRoles?.includes(role)); + + return SW_ACCESS?.length > 0; +}; + +/* to get the MDMS config module name */ +const getConfigModuleName = () => { + return window?.globalConfigs?.getConfig("UICONFIG_MODULENAME") || "commonUiConfig"; +}; +export default { + pdf: PDFUtil, + createFunction, + downloadReceipt, + downloadBill, + downloadPDFFromLink, + downloadBill, + getFileUrl, + getFileTypeFromFileStoreURL, + browser: BrowserUtil, + locale, + date, + GetParamFromUrl, + getStaticMapUrl, + detectDsoRoute, + routeSubscription, + pgrAccess, + fsmAccess, + BPAREGAccess, + BPAAccess, + dss, + obps, + pt, + ptAccess, + NOCAccess, + mCollectAccess, + receiptsAccess, + didEmployeeHasRole, + didEmployeeHasAtleastOneRole, + hrmsAccess, + getPattern, + hrmsRoles, + getUnique, + tlAccess, + wsAccess, + swAccess, + getConfigModuleName, + preProcessMDMSConfig, + preProcessMDMSConfigInboxSearch, + parsingUtils, + ...privacy, + getDefaultLanguage, + getLocaleDefault, + getLocaleRegion +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/locale.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/locale.js new file mode 100644 index 00000000000..fc21d805373 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/locale.js @@ -0,0 +1,110 @@ +/** + * Custom utils related for all locale related items + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.locale. ** () + * + * + */ + +export const getLocalityCode = (locality, tenantId) => { + if (typeof locality === "string") return locality.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality}`; + else if (locality.code) return locality.code.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality.code}`; +}; + +export const getRevenueLocalityCode = (locality, tenantId) => { + if (typeof locality === "string") return locality.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_REVENUE_${locality}`; + else if (locality.code) return locality.code.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_REVENUE_${locality.code}`; +}; + +export const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { + if (searcher === "") return str; + while (str.includes(searcher)) { + str = str.replace(searcher, replaceWith); + } + return str; +}; + +/* method to check not null if not returns false*/ +export const checkForNotNull = (value = "") => { + return value && value != null && value != undefined && value != "" ? true : false; +}; + +export const convertDotValues = (value = "") => { + return ( + (checkForNotNull(value) && ((value.replaceAll && value.replaceAll(".", "_")) || (value.replace && stringReplaceAll(value, ".", "_")))) || "NA" + ); +}; + +export const convertToLocale = (value = "", key = "") => { + let convertedValue = convertDotValues(value)?.toUpperCase(); + if (convertedValue == "NA") { + return "COMMON_NA"; + } + return `${key}_${convertedValue}`; +}; + +export const getMohallaLocale = (value = "", tenantId = "") => { + let convertedValue = convertDotValues(tenantId); + if (convertedValue == "NA" || !checkForNotNull(value)) { + return "COMMON_NA"; + } + convertedValue = convertedValue.toUpperCase(); + return convertToLocale(value, `${convertedValue}_REVENUE`); +}; + +export const getCityLocale = (value = "") => { + let convertedValue = convertDotValues(value); + if (convertedValue == "NA" || !checkForNotNull(value)) { + return "COMMON_NA"; + } + convertedValue = convertedValue.toUpperCase(); + return convertToLocale(convertedValue, `TENANT_TENANTS`); +}; + +/* to convert the dropdown data to locale data */ +export const convertToLocaleData = (dropdownValues = [], key = "", t) => { + return dropdownValues.map((ele) => { + ele["i18text"] = convertToLocale(ele.code, key); + if (t) { + ele["i18text"] = t(ele["i18text"]); + } + return ele; + }); +}; + +/** + * Custom util to format the code for localisation + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.locale.getTransformedLocale( + * code) + * + * @returns {Array} Returns the Array of object + */ +export const getTransformedLocale = (label) => { + if (typeof label === "number") return label; + label = label?.trim(); + return label && label.toUpperCase().replace(/[.:-\s\/]/g, "_"); +}; + +/** + * Custom util to sort the dropdowns based on Alphabeticaly order by localising the codes + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.locale.sortDropdownNames( + * options, + * optionKey, + * t) + * + * @returns {Array} Returns the Array of object + */ +export const sortDropdownNames = (options = [], optionkey = "i18nKey", t) => { + return options?.sort((a, b) => t(a?.[optionkey])?.localeCompare?.(t(b?.[optionkey]))); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/obps/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/obps/index.js new file mode 100644 index 00000000000..e1da9d150c6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/obps/index.js @@ -0,0 +1,23 @@ +export const calculateRiskType = (riskTypes, plotArea, blocks) => { + const buildingHeight = blocks?.reduce((acc, block) => { + return Math.max(acc, block.building.buildingHeight) + }, Number.NEGATIVE_INFINITY); + + const risk = riskTypes?.find(riskType => { + if (riskType.riskType === "HIGH" && (plotArea > riskType?.fromPlotArea || buildingHeight >= riskType?.fromBuildingHeight)) { + return true; + } + + if (riskType.riskType === "MEDIUM" && ((plotArea >= riskType?.fromPlotArea && plotArea <= riskType?.toPlotArea) || + (buildingHeight >= riskType?.fromBuildingHeight && buildingHeight <= riskType?.toBuildingHeight))) { + return true; + } + + if (riskType?.riskType === "LOW" && plotArea < riskType.toPlotArea && buildingHeight < riskType.toBuildingHeight) { + return true; + } + + return false; + }) + return risk?.riskType; +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/pdf.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/pdf.js new file mode 100644 index 00000000000..5b7442d1482 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/pdf.js @@ -0,0 +1,1083 @@ +import { Fonts } from "./fonts"; + +const pdfMake = require("pdfmake/build/pdfmake.js"); +// const pdfFonts = require("pdfmake/build/vfs_fonts.js"); +// pdfMake.vfs = pdfFonts.pdfMake.vfs; + +let pdfFonts = { + // Roboto: { + // normal: "https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-Regular.ttf", + // bold: "https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-Medium.ttf" + // }, + Hind: { + normal: "Hind-Regular.ttf", + bold: "Hind-Bold.ttf", + }, + en_IN: { + normal: "Hind-Regular.ttf", + bold: "Hind-Bold.ttf", + }, + pn_IN: { + normal: "BalooPaaji2-Regular.ttf", + bold: "BalooPaaji2-Bold.ttf", + }, + od_IN: { + normal: "BalooBhaina2-Regular.ttf", + bold: "BalooBhaina2-Bold.ttf", + }, + hi_IN: { + normal: "Hind-Regular.ttf", + bold: "Hind-Bold.ttf", + }, +}; +pdfMake.vfs = Fonts; + +pdfMake.fonts = pdfFonts; + +const downloadPDFFileUsingBase64 = (receiptPDF, filename) => { + if ( + window && + window.mSewaApp && + window.mSewaApp.isMsewaApp && + window.mSewaApp.isMsewaApp() && + window.mSewaApp.downloadBase64File && + window.Digit.Utils.browser.isMobile() + ) { + // we are running under webview + receiptPDF.getBase64((data) => { + window.mSewaApp.downloadBase64File(data, filename); + }); + } else { + // we are running in browser + receiptPDF.download(filename); + } +}; + +function getBase64Image(tenantId) { + try { + const img = document.getElementById(`logo-${tenantId}`); + var canvas = document.createElement("canvas"); + canvas.width = img.width; + canvas.height = img.height; + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); + return canvas.toDataURL("image/png"); + } catch (e) { + return ""; + } +} + +const defaultLogo = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABBtJREFUWAntV11oVEcUnjN3mzXm111toQ8lWOtLTbIG0YgpMdQ05CEv0iTU1hhR7EMRWYuKSkteVExJBRGkpaUk0ChRSYtpKam4sbE0ia7RSNaS0uIfWtT4E8Xs5u7O8Vy7c3f27t2fh4W+ZF7OmfN9c86Ze2bOvZex/3mAGv/RIU9xJCL2IWIdAS7C/Nyhtbm8l39XeVKfOrLcHZoOHmCA7zJkC6VdSmAQRoYBAHbCXZBzED726xKT0kwgGnyUgpdI0JBEEMD4B+4dV3pU+9Mvyl4NMTZKAV5X7cl0APC5P127BqBNqBwuJ5Gw2G8NbmDIGEcQR+9/u6pAcg0ZYtiRaXCDT75rHnT0bjF0dZgJkLP3VEDVEakcj58ti7MBJOWrPFUHJurUuaGbCVCd5llBdQ4Yw7GnUaM9Fal4JjptJCGGmQA964upnPBXHCYOTSciDMGcp1qnYpzBBXVu6LEEGHxOByViJURJX7m2+W+qmKax3cn4Kk/qdJgnnXOdHXIupZnA/B1jw5TP+wzgngSpLEhX6ahLy/dKm5Su7WODBK4l/I60JZPkJ0DcuvxPLvxr5ZjXUAL45crchxD00A12OR3apTyv/67E7CQerndOztwto9uymPI1N2RwOcMwgBYorigah5qBsN36WVtCCZI9kqqu8Td0DG2mhlJKdb8JGvQOrV86YMevPDZagjpuQoFLqPY3gDtOjawvH7TjZpRAZeelesHwON3jQtUJtej2kdalu1RbZZe/QSB0U6L5ph0AObB9wy0Vn5m2qJI2geWd19yI09eo8SywLjbmdMgaRjZ4+gx9RffV13BGD1BXNV5kCYMzrW641dOvAnGnVgVMHYLUPu2DGxxk4iPJFeFwfbLgL7lcfCi5UqZNgK7WIkm2k4AxHARLyaUSJuBpE6AtBuwCmzaAGM5Tc6neMW7UQdoEcnOdv9Cpv24GjFNAAPCvpalwTuFP1J5vy7kqqRtGOGjfqDZDT5vAQNPbzzTgzQmOAWZotXe4xXNeOj3T9OYTjUMzHU1Le4YQImwdaimndh8/0t4CSV/T83fR1PRUI9W8lALc4jla3x/ryv6UuCqrvh+bp+t6IwL81weQn6abMqFyZnX5BDIugVyQifT52hxD7HyVAFFKb8nreVg46K354bHd2qwn0H6u9i0dI9S2scIMSN8YHHDjnmrfz6YtqmQ1gZ7xxpyJ+5MX6ROYDqplADzPAc2zs/rXv1Qk7TVUyen0iclHDbbBjYWIc3UR3mb1kdUEQGC5NYA6p1dzAp7VBKjulgakhjf+sqwNKoNOGO8i9Uxz8H6KEkzKAvzRimX1Cex+58w/9O2/nT4S4v7/jKDUyo/vrfZ1WxPI6i2Qzvf/VrtKRMJbKewSeiI3aJcn96w++53EVfkCw79XQZYr/EsAAAAASUVORK5CYII="; +const jsPdfGenerator = async ({ breakPageLimit = null, tenantId, logo, name, email, phoneNumber, heading, details, t = (text) => text }) => { + + const emailLeftMargin = + email.length <= 15 + ? 190 + : email.length <= 20 + ? 150 + : email.length <= 25 + ? 130 + : email.length <= 30 + ? 90 + : email.length <= 35 + ? 50 + : email.length <= 40 + ? 10 + : email.length <= 45 + ? 0 + : email.length <= 50 + ? -20 + : email.length <= 55 + ? -70 + : email.length <= 60 + ? -100 + : -60; + + const dd = { + pageMargins: [40, 80, 40, 30], + header: { + columns: [ + { + image: logo || getBase64Image(tenantId) || defaultLogo, + width: 50, + margin: [10, 10], + }, + { + text: name, + margin: [20, 25], + font: "Hind", + fontSize: 14, + bold: true, + }, + { + text: email, + margin: [emailLeftMargin, 25, 0, 25], + font: "Hind", + fontSize: 11, + color: "#464747", + }, + { + text: phoneNumber, + color: "#6f777c", + font: "Hind", + fontSize: 11, + margin: [-65, 45, 0, 25], + }, + ], + }, + + footer: function (currentPage, pageCount) { + return { + columns: [ + { text: `${name} / ${heading}`, margin: [15, 0, 0, 0], fontSize: 11, color: "#6f777c", width: 400, font: "Hind" }, + { text: `Page ${currentPage}`, alignment: "right", margin: [0, 0, 25, 0], fontSize: 11, color: "#6f777c", font: "Hind" }, + ], + }; + }, + content: [ + { + text: heading, + font: "Hind", + fontSize: 24, + bold: true, + margin: [-25, 5, 0, 0], + }, + ...createContent(details, phoneNumber, breakPageLimit), + { + text: t("PDF_SYSTEM_GENERATED_ACKNOWLEDGEMENT"), + font: "Hind", + fontSize: 11, + color: "#6f777c", + margin: [-25, 32], + }, + ], + defaultStyle: { + font: "Hind", + }, + }; + pdfMake.vfs = Fonts; + let locale = Digit.SessionStorage.get("locale") || Digit.Utils.getDefaultLanguage(); + let Hind = pdfFonts[locale] || pdfFonts["Hind"]; + pdfMake.fonts = { Hind: { ...Hind } }; + const generatedPDF = pdfMake.createPdf(dd); + downloadPDFFileUsingBase64(generatedPDF, "acknowledgement.pdf"); +}; + + +/** + * Util function that can be used + * to download WS connection acknowledgement pdfs + * Data is passed to this function from this file + * packages\modules\ws\src\utils\getWSAcknowledgementData.js + * @author nipunarora-egov + * + * @example + * Digit.Utils.pdf.generatev1() + * + * @returns Downloads a pdf + */ +const jsPdfGeneratorv1 = async ({ breakPageLimit = null, tenantId, logo, name, email, phoneNumber, heading, details, headerDetails, t = (text) => text }) => { + const emailLeftMargin = + email.length <= 15 + ? 190 + : email.length <= 20 + ? 150 + : email.length <= 25 + ? 130 + : email.length <= 30 + ? 90 + : email.length <= 35 + ? 50 + : email.length <= 40 + ? 10 + : email.length <= 45 + ? 0 + : email.length <= 50 + ? -20 + : email.length <= 55 + ? -70 + : email.length <= 60 + ? -100 + : -60; + + const dd = { + pageMargins: [40, 40, 40, 30], + header: {}, + footer: function (currentPage, pageCount) { + return { + columns: [ + { text: `${name} / ${heading}`, margin: [15, 0, 0, 0], fontSize: 11, color: "#6f777c", width: 400, font: "Hind" }, + { text: `Page ${currentPage}`, alignment: "right", margin: [0, 0, 25, 0], fontSize: 11, color: "#6f777c", font: "Hind" }, + ], + }; + }, + content: [ + ...createHeader(headerDetails,logo,tenantId), + // { + // text: heading, + // font: "Hind", + // fontSize: 24, + // bold: true, + // margin: [-25, 5, 0, 0], + // }, + ...createContentDetails(details), + { + text: t("PDF_SYSTEM_GENERATED_ACKNOWLEDGEMENT"), + font: "Hind", + fontSize: 11, + color: "#6f777c", + margin: [-25, 32], + }, + ], + defaultStyle: { + font: "Hind", + }, + }; + + pdfMake.vfs = Fonts; + let locale = Digit.SessionStorage.get("locale") || Digit.Utils.getDefaultLanguage(); + let Hind = pdfFonts[locale] || pdfFonts["Hind"]; + pdfMake.fonts = { Hind: { ...Hind } }; + const generatedPDF = pdfMake.createPdf(dd); + downloadPDFFileUsingBase64(generatedPDF, "acknowledgement.pdf"); +}; + +export default { generate: jsPdfGenerator ,generatev1:jsPdfGeneratorv1}; + +const createBodyContentBillAmend = (table,t) => { + let bodyData = [] + bodyData.push({ + text: t(table?.title), + color: "#F47738", + style: "header", + fontSize: 14, + bold: true, + margin: [0, 15, 0, 10] + }) + bodyData.push({ + layout:{ + fillColor:function(rowIndex,node,columnIndex){ + if(rowIndex === (table?.tableRows?.length)) { + return "#F47738" + } + return (rowIndex % 2 === 0) ? "#F47738" : null; + }, + fillOpacity:function(rowIndex,node,columnIndex) { + if (rowIndex === (table?.tableRows?.length)) { + return 1; + } + return (rowIndex % 2 === 0) ? 0.15 : 1; + } + }, + table:{ + headerRows:1, + widths: ["*", "*", "*", "*"], + body:[ + table?.headers?.map(header =>{ + return { + text:t(header), + style:"header", + fontSize:11, + bold:true, + border: [false, false, false, false] + } + }), + ...table?.tableRows?.map(row => { + return [ + { + text:t(row?.[0]), + style:"header", + fontSize:11, + border: [false, false, false, false] + }, + { + text: t(row?.[1]), + style: "header", + fontSize: 11, + border: [false, false, false, false] + }, + { + text: t(row?.[2]), + style: "header", + fontSize: 11, + border: [false, false, false, false] + }, + { + text: t(row?.[3]), + style: "header", + fontSize: 11, + border: [false, false, false, false] + } + ] + }) + ] + } + }) + return bodyData +} + +const createHeaderBillAmend = (headerDetails, logo, tenantId,t) => { + + let headerData = []; + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + margin: [-40, -40, -40, 40], + table: { + widths: ['5%', 'auto', '*'], + body: [ + [ + { + image: logo || getBase64Image(tenantId) || defaultLogo, + // width: 50, + margin: [10, 10], + fit: [50, 50], + //width: 50, + //margin: [10, 10] + }, + { + text: headerDetails?.header, //"Amritsar Municipal Corporation", + margin: [40, 10, 2, 4], + style: "header", + // italics: true, + fontSize: 18, + bold: true + }, + { + text: headerDetails?.typeOfApplication, //"New Sewerage Connection", + bold: true, + fontSize: 16, + alignment: "right", + margin: [-40, 10, 2, 0], + color: "#F47738" + } + ], + [ + { text: "" }, + { + text: headerDetails?.subHeader, //"Municipal Corporation Amritsar, Town Hall, Amritsar, Punjab.", + margin: [40, -45, -2, -5], + style: "header", + // italics: true, + fontSize: 10, + bold: true + }, + + { + text: headerDetails?.date, //"28/03/2022", + bold: true, + fontSize: 16, + margin: [0, -45, 10, 0], + alignment: "right", + color: "#F47738" + } + ], + [ + { text: "" }, + + { + text: headerDetails?.description, //"0183-2545155 | www.amritsarcorp.com | cmcasr@gmail.com", + margin: [40, -40, 2, 10], + style: "header", + // italics: true, + fontSize: 10, + bold: true + }, + { + text: "", + } + ] + ] + } + }); + headerDetails?.values?.forEach((header, index) => { + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + margin: [-40, -40, -40, 20], + table: { + widths: ['30%', '*'], + body: [ + [ + { + text: header?.title, + margin: index == 0 ? [40, 0, 2, 10] : [40, 10, 2, 10], + style: "header", + fontSize: 10, + bold: true + }, + { + text: header?.value, + bold: true, + fontSize: 10, + alignment: "left", + margin: index == 0 ? [0, 0, 2, 10] : [0, 10, 2, 10], + } + ] + ] + } + }) + }) + //push demand revision details old way + + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + margin: [-40, -25, -1000000, 20], + table: { + widths: ['30%', '*'], + body: [ + [ + { + text: headerDetails?.DemandRevision?.title, + margin: [40, 0, 2, 20], + style: "header", + fontSize: 13, + bold: true + } + ] + ] + } + }) + + headerDetails?.DemandRevision?.values?.forEach((header, index) => { + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + margin: [-40, -40, -40, 20], + table: { + widths: ['30%', '*'], + body: [ + [ + { + text: header?.title, + margin: index == 0 ? [40, 0, 2, 10] : [40, 10, 2, 10], + style: "header", + fontSize: 10, + bold: true + }, + { + text: header?.value, + bold: false, + fontSize: 10, + alignment: "left", + margin: index == 0 ? [0, 0, 2, 10] : [0, 10, 2, 10], + } + ] + ] + } + }) + }) + + //attachment details + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + margin: [-40, -25, -1000000, 20], + table: { + widths: ['30%', '*'], + body: [ + [ + { + text: headerDetails?.Attachments?.title, + margin: [40, 0, 2, 110], + style: "header", + fontSize: 13, + bold: true + } + ] + ] + } + }) + + headerData.push({ + layout: "noBorders", + ul: headerDetails?.Attachments?.values, + margin:[0,-130,0,40] + }) + + return headerData; +} + +const createBodyContent = (details) => { + let detailsHeaders = [] + details.map((table,index) =>{ + if (table?.isAttachments && table.values) { + detailsHeaders.push({ + style: 'tableExample', + layout: "noBorders", + margin: [0, 13, 0, 5], + table: { + body: [ + [ + { + text: table?.title, + color: "#F47738", + style: "header", + fontSize: 14, + bold: true + } + ] + ] + } + }) + detailsHeaders.push({ + layout:'noBorders', + ul: table?.values + }) + return + } + detailsHeaders.push({ + layout:'noBorders', + table:{ + headerRows:1, + widths:["*","*","*"], + body:[ + table?.title?.map(t=>{ + return { + text:t, + color: "#F47738", + style: "header", + fontSize: 14, + bold: true, + margin:[0,15,0,0] + } + }), + ...table?.values?.map((value,index) => { + return [ + { + text:value?.val1, + style: "header", + fontSize: 10, + bold: true + }, + { + text: value?.val2, + fontSize: 10 + }, + { + text: value?.val3, + fontSize: 10 + } + ] + }) + ] + } + }) + }) + + return detailsHeaders +} + +function createContentDetails(details) { + let detailsHeaders = []; + details.forEach((detail, index) => { + if (detail?.title) { + detailsHeaders.push({ + style: 'tableExample', + layout: "noBorders", + margin:[0,13,0,5], + table: { + body: [ + [ + { + text: detail?.title, + color: "#F47738", + style: "header", + fontSize: 14, + bold: true + } + ] + ] + } + }) + } + if (detail?.isAttachments && detail.values) { + detailsHeaders.push({ + ul: detail?.values + }) + } else { + detail?.values?.forEach(indData => { + detailsHeaders.push({ + style: 'tableExample', + layout: "noBorders", + table: { + widths: ['40%', '*'], + body: [ + [ + { + text: indData?.title, + style: "header", + fontSize: 10, + bold: true + }, + + { + text: indData?.value, + fontSize: 10 + } + ] + ] + } + }) + }) + } + }); + return detailsHeaders; +} + +function createHeader(headerDetails,logo,tenantId) { + let headerData = []; + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + "margin": [-40, -40, -40, 40], + table: { + widths: ['5%', 'auto', '*'], + body: [ + [ + // { + // margin: [40, 10, 2, 2], + // "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABBtJREFUWAntV11oVEcUnjN3mzXm111toQ8lWOtLTbIG0YgpMdQ05CEv0iTU1hhR7EMRWYuKSkteVExJBRGkpaUk0ChRSYtpKam4sbE0ia7RSNaS0uIfWtT4E8Xs5u7O8Vy7c3f27t2fh4W+ZF7OmfN9c86Ze2bOvZex/3mAGv/RIU9xJCL2IWIdAS7C/Nyhtbm8l39XeVKfOrLcHZoOHmCA7zJkC6VdSmAQRoYBAHbCXZBzED726xKT0kwgGnyUgpdI0JBEEMD4B+4dV3pU+9Mvyl4NMTZKAV5X7cl0APC5P127BqBNqBwuJ5Gw2G8NbmDIGEcQR+9/u6pAcg0ZYtiRaXCDT75rHnT0bjF0dZgJkLP3VEDVEakcj58ti7MBJOWrPFUHJurUuaGbCVCd5llBdQ4Yw7GnUaM9Fal4JjptJCGGmQA964upnPBXHCYOTSciDMGcp1qnYpzBBXVu6LEEGHxOByViJURJX7m2+W+qmKax3cn4Kk/qdJgnnXOdHXIupZnA/B1jw5TP+wzgngSpLEhX6ahLy/dKm5Su7WODBK4l/I60JZPkJ0DcuvxPLvxr5ZjXUAL45crchxD00A12OR3apTyv/67E7CQerndOztwto9uymPI1N2RwOcMwgBYorigah5qBsN36WVtCCZI9kqqu8Td0DG2mhlJKdb8JGvQOrV86YMevPDZagjpuQoFLqPY3gDtOjawvH7TjZpRAZeelesHwON3jQtUJtej2kdalu1RbZZe/QSB0U6L5ph0AObB9wy0Vn5m2qJI2geWd19yI09eo8SywLjbmdMgaRjZ4+gx9RffV13BGD1BXNV5kCYMzrW641dOvAnGnVgVMHYLUPu2DGxxk4iPJFeFwfbLgL7lcfCi5UqZNgK7WIkm2k4AxHARLyaUSJuBpE6AtBuwCmzaAGM5Tc6neMW7UQdoEcnOdv9Cpv24GjFNAAPCvpalwTuFP1J5vy7kqqRtGOGjfqDZDT5vAQNPbzzTgzQmOAWZotXe4xXNeOj3T9OYTjUMzHU1Le4YQImwdaimndh8/0t4CSV/T83fR1PRUI9W8lALc4jla3x/ryv6UuCqrvh+bp+t6IwL81weQn6abMqFyZnX5BDIugVyQifT52hxD7HyVAFFKb8nreVg46K354bHd2qwn0H6u9i0dI9S2scIMSN8YHHDjnmrfz6YtqmQ1gZ7xxpyJ+5MX6ROYDqplADzPAc2zs/rXv1Qk7TVUyen0iclHDbbBjYWIc3UR3mb1kdUEQGC5NYA6p1dzAp7VBKjulgakhjf+sqwNKoNOGO8i9Uxz8H6KEkzKAvzRimX1Cex+58w/9O2/nT4S4v7/jKDUyo/vrfZ1WxPI6i2Qzvf/VrtKRMJbKewSeiI3aJcn96w++53EVfkCw79XQZYr/EsAAAAASUVORK5CYII=" + // }, + { + image: logo || getBase64Image(tenantId) || defaultLogo, + // width: 50, + margin: [10, 10], + fit: [50,50], + //width: 50, + //margin: [10, 10] + }, + { + text: headerDetails?.[0]?.header, //"Amritsar Municipal Corporation", + margin: [40, 10, 2, 4], + style: "header", + // italics: true, + fontSize: 18, + bold: true + }, + { + text: headerDetails?.[0]?.typeOfApplication, //"New Sewerage Connection", + bold: true, + fontSize: 16, + alignment: "right", + margin: [-40, 10, 2, 0], + color: "#F47738" + } + ], + [ + { text: "" }, + { + text: headerDetails?.[0]?.subHeader, //"Municipal Corporation Amritsar, Town Hall, Amritsar, Punjab.", + margin: [40, -45, -2, -5], + style: "header", + // italics: true, + fontSize: 10, + bold: true + }, + + { + text: headerDetails?.[0]?.date, //"28/03/2022", + bold: true, + fontSize: 16, + margin: [0, -50, 10, 0], + alignment: "right", + color: "#F47738" + } + ], + [ + { text: "" }, + + { + text: headerDetails?.[0]?.description, //"0183-2545155 | www.amritsarcorp.com | cmcasr@gmail.com", + margin: [40, -40, 2, 10], + style: "header", + // italics: true, + fontSize: 10, + bold: true + }, + { + text: "", + } + ] + ] + } + }); + headerDetails?.[0]?.values?.forEach((header, index) => { + headerData.push({ + style: 'tableExample', + layout: "noBorders", + fillColor: "#f7e0d4", + "margin": [-40, -40, -40, 20], + table: { + widths: ['30%', '*'], + body: [ + [ + { + text: header?.title, + margin: index == 0 ? [40, 0, 2, 10] : [40, 10, 2, 10], + style: "header", + fontSize: 10, + bold: true + }, + { + text: header?.value, + bold: true, + fontSize: 10, + alignment: "left", + margin: index == 0 ? [0, 0, 2, 10] : [0, 10, 2, 10], + } + ] + ] + } + }) + }) + + return headerData; +} + + +function createContent(details, phoneNumber, breakPageLimit = null) { + const data = []; + + details.forEach((detail, index) => { + if (detail?.values?.length > 0) { + let column1 = []; + let column2 = []; + + if ( breakPageLimit ? (index + 1) % breakPageLimit === 0 : (index + 1) % 7 === 0) { + data.push({ + text: "", + margin: [-25, 0, 0, 200], + }); + } + + data.push({ + text: `${detail.title}`, + font: "Hind", + fontSize: 18, + bold: true, + margin: [-25, 20, 0, 20], + }); + + const newArray = []; + let count = 0; + let arrayNumber = 0; + + detail.values.forEach((value, index) => { + if (count <= 3) { + if (!newArray[arrayNumber]) { + newArray[arrayNumber] = []; + } + if (value) { + newArray[arrayNumber].push(value); + } + count++; + } + if (count === 4) { + count = 0; + arrayNumber++; + } + }); + + newArray.forEach((value) => { + if (value?.length === 2) { + createContentForDetailsWithLengthOfTwo(value, data, column1, column2, detail.values.length > 3 ? 10 : 0); + } else if (value?.length === 1 || value?.length === 3) { + createContentForDetailsWithLengthOfOneAndThree(value, data, column1, column2, detail.values.length > 3 ? 10 : 0); + } else { + value.forEach((value, index) => { + let margin = [-25, 0, 0, 5]; + if (index === 1) margin = [15, 0, 0, 5]; + if (index === 2) margin = [26, 0, 0, 5]; + if (index === 3) margin = [30, 0, 0, 5]; + column1.push({ + text: value.title, + font: "Hind", + fontSize: 11, + bold: true, + margin, + }); + if (index === 1) margin = [15, 0, 0, 10]; + if (index === 2) margin = [26, 0, 0, 10]; + if (index === 3) margin = [30, 0, 0, 10]; + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + margin, + color: "#1a1a1a", + width: "25%", + }); + }); + data.push({ columns: column1 }); + data.push({ columns: column2 }); + column1 = []; + column2 = []; + } + }); + } + }); + + return data; +} + +function createContentForDetailsWithLengthOfTwo(values, data, column1, column2, num = 0) { + values.forEach((value, index) => { + if (index === 0) { + column1.push({ + text: value.title, + font: "Hind", + fontSize: 12, + bold: true, + margin: [-25, num - 10, -25, 0], + }); + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + margin: [-25, 5, 0, 0], + color: "#1a1a1a", + width: "25%", + }); + } else { + column1.push({ + text: value.title, + font: "Hind", + fontSize: 12, + bold: true, + margin: [-115, num - 10, -115, 0], + }); + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + margin: [15, 5, 0, 0], + color: "#1a1a1a", + width: "25%", + }); + } + }); + data.push({ columns: column1 }); + data.push({ columns: column2 }); +} + +function createContentForDetailsWithLengthOfOneAndThree(values, data, column1, column2, num = 0) { + values.forEach((value, index) => { + if (index === 0) { + column1.push({ + text: value.title, + font: "Hind", + fontSize: 12, + bold: true, + margin: values.length > 1 ? [-25, -5, 0, 0] : [-25, 0, 0, 0], + }); + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + color: "#1a1a1a", + margin: values.length > 1 ? [-25, 5, 0, 0] : [-25, 5, 0, 0], + width: "25%", + }); + } else if (index === 2) { + column1.push({ + text: value.title, + font: "Hind", + fontSize: 12, + bold: true, + margin: [-60, -5, 0, 0], + }); + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + margin: [26, 5, 0, 0], + color: "#1a1a1a", + width: "25%", + }); + } else { + column1.push({ + text: value.title, + font: "Hind", + fontSize: 12, + bold: true, + margin: [-28, -5, 0, 0], + }); + column2.push({ + text: value.value, + font: "Hind", + fontSize: 9, + margin: [15, 5, 0, 0], + color: "#1a1a1a", + width: "25%", + }); + } + }); + data.push({ columns: column1 }); + data.push({ columns: column2 }); +} + +// EXAMPLE +// , + +const downloadPdf = (blob, fileName) => { + if (window.mSewaApp && window.mSewaApp.isMsewaApp() && window.mSewaApp.downloadBase64File) { + var reader = new FileReader(); + reader.readAsDataURL(blob); + reader.onloadend = function () { + var base64data = reader.result; + window.mSewaApp.downloadBase64File(base64data, fileName); + }; + } else { + const link = document.createElement("a"); + // create a blobURI pointing to our Blob + link.href = URL.createObjectURL(blob); + link.download = fileName; + // some browser needs the anchor to be in the doc + document.body.append(link); + link.click(); + link.remove(); + // in case the Blob uses a lot of memory + setTimeout(() => URL.revokeObjectURL(link.href), 7000); + } +}; + +/* Download Receipts */ + +export const downloadReceipt = async ( + consumerCode, + businessService, + pdfKey = "consolidatedreceipt", + tenantId = Digit.ULBService.getCurrentTenantId(), + receiptNumber = null +) => { + const response = await Digit.ReceiptsService.receipt_download(businessService, consumerCode, tenantId, pdfKey, receiptNumber); + const responseStatus = parseInt(response.status, 10); + if (responseStatus === 201 || responseStatus === 200) { + let filename = receiptNumber ? `receiptNumber-${receiptNumber}.pdf` : `consumer-${consumerCode}.pdf`; + downloadPdf(new Blob([response.data], { type: "application/pdf" }), filename); + } +}; +/* Download Bills */ + +export const downloadBill = async ( + consumerCode, + businessService, + pdfKey = "consolidatedbill", + tenantId = Digit.ULBService.getCurrentTenantId(), +) => { + const response = await Digit.ReceiptsService.bill_download(businessService, consumerCode, tenantId, pdfKey); + const responseStatus = parseInt(response.status, 10); + if (responseStatus === 201 || responseStatus === 200) { + let filename = consumerCode ? `consumerCode-${consumerCode}.pdf` : `consumer-${consumerCode}.pdf`; + downloadPdf(new Blob([response.data], { type: "application/pdf" }), filename); + } +}; + +export const getFileUrl = (linkText = "") => { + const linkList = (linkText && typeof linkText == "string" && linkText.split(",")) || []; + let fileURL = ""; + linkList && + linkList.map((link) => { + if (!link.includes("large") && !link.includes("medium") && !link.includes("small")) { + fileURL = link; + } + }); + return fileURL; +}; + +/* Use this util function to download the file from any s3 links */ +export const downloadPDFFromLink = async (link, openIn = "_blank") => { + var response = await fetch(link, { + responseType: "arraybuffer", + headers: { + "Content-Type": "application/json", + Accept: "application/pdf", + }, + method: "GET", + mode: "cors", + }).then((res) => res.blob()); + if (window.mSewaApp && window.mSewaApp.isMsewaApp() && window.mSewaApp.downloadBase64File) { + var reader = new FileReader(); + reader.readAsDataURL(response); + reader.onloadend = function () { + var base64data = reader.result; + window.mSewaApp.downloadBase64File(base64data, decodeURIComponent(link.split("?")[0].split("/").pop().slice(13))); + }; + } else { + var a = document.createElement("a"); + document.body.appendChild(a); + a.style = "display: none"; + let url = window.URL.createObjectURL(response); + a.href = url; + a.download = decodeURIComponent(link.split("?")[0].split("/").pop().slice(13)); + a.click(); + window.URL.revokeObjectURL(url); + } +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfig.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfig.js new file mode 100644 index 00000000000..5d3aa0742a9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfig.js @@ -0,0 +1,128 @@ + +import _ from "lodash"; + +/* +PRE-PROCESS MDMS CONFIG +----------------------- +@Author - Hariom Sinha + +Usually FormComposer configs needs some dependendent params to drive the rendering and functionality. In MDMS config, we cannot inject those params. +So, this component is developed to help convert any MDMS config to a FormComposer enabled config by injecting multiple params. +As of now, two params are introduced - + a. translate + b. updateDependent + c. convertStringToRegEx + Based on the newer requirement, this utility can be enhanced to support extra types of params. + +How to use this Pre-Process Utility - +1. Fetch any config from MDMS. +2. In each input object of the config, set preProcess object with required Params. + ex - + { + isMandatory: false, + key: "noSubProject_locality", + type: "radioordropdown", + label: "WORKS_LOCALITY", + disable: false, + preProcess : { + translate : ["populators.error"], + updateDependent : ["populators.options"] + }, + populators: { + name: "noSubProject_locality", + optionsKey: "i18nKey", + error: "WORKS_REQUIRED_ERR", + required: false, + optionsCustomStyle : { + top : "2.5rem" + }, + options: [] + }, + }, +3. Both 'translate' and 'updateDependent' supports multiple JSON paths. This means that we can inject multiple params at a time in the same input object. +4. Any component who wants to transform MDMS config to FormComposer config using this Pre-Process Utility should pass the dependencies based on their requirement. + Example, if one needs to update the dropdown value based on other dropdown field change, then the component can pass that Param as state. + The Component should make calls to this config only when the dependent state changes, to avoid performance issues. + + const config = useMemo( + () => Digit.Utils.preProcessMDMSConfig(t, createProjectConfig, { + updateDependent : [ + { + key : 'withSubProject_project_subScheme', + value : [withSubProjectSubSchemeOptions] + } + ] + }), + [withSubProjectSubSchemeOptions]); +5. Translation and convertStringToRegEx will be handled by the Pre-Preprocess on its own. No params are required for this. +*/ + + +const translate = (config, index, inputIndex, t) => { + + let input = config?.form[index].body[inputIndex]; + //iterate all translate keys and handle translation + for(let toTranslate = 0; toTranslate { + let input = config?.form[index].body[inputIndex]; + //iterate all update options keys and add options as params + for(let toUpdate = 0; toUpdatedependent?.key === inputKey)?.[0]?.value?.[toUpdate])); + } + + return config; +} + +const convertStringToRegEx = (config, index, inputIndex) => { + + let input = config?.form[index].body[inputIndex]; + //iterate all translate keys and handle translation + for(let toValidate = 0; toValidate { + //Do not loop preProcess object, to avoid unnecessary 'translate' and 'updateDependent' calls + //To add any new transform object, simply add a new if statement + if(preProcesses?.translate) { + config = translate(config, index, inputIndex, t); + } + if(preProcesses?.updateDependent) { + config = updateDependent(config, index, inputIndex, inputKey, dependencyConfig); + } + if(preProcesses?.convertStringToRegEx) { + config = convertStringToRegEx(config, index, inputIndex, inputKey); + } + return config; +} + +const preProcessMDMSConfig = (t, config, dependencyConfig) => { + config?.form?.map((section, index)=>{ + section?.body?.map((input, inputIndex)=>{ + let preProcesses = input?.preProcess; + if(preProcesses){ + config = transform(preProcesses, config, index, inputIndex, input?.key, t, dependencyConfig); + } + }) + }) + return config; +} + +export default preProcessMDMSConfig; + diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfigInboxSearch.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfigInboxSearch.js new file mode 100644 index 00000000000..05743c9347a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/preProcessMDMSConfigInboxSearch.js @@ -0,0 +1,110 @@ + +import _ from "lodash"; + +/* +PRE-PROCESS MDMS CONFIG +----------------------- +@Author - Hariom Sinha + +Usually FormComposer configs needs some dependendent params to drive the rendering and functionality. In MDMS config, we cannot inject those params. +So, this component is developed to help convert any MDMS config to a FormComposer enabled config by injecting multiple params. +As of now, two params are introduced - + a. translate + b. updateDependent + c. convertStringToRegEx + Based on the newer requirement, this utility can be enhanced to support extra types of params. + +How to use this Pre-Process Utility - +1. Fetch any config from MDMS. +2. In each input object of the config, set preProcess object with required Params. + ex - + { + isMandatory: false, + key: "noSubProject_locality", + type: "radioordropdown", + label: "WORKS_LOCALITY", + disable: false, + preProcess : { + translate : ["populators.error"], + updateDependent : ["populators.options"] + }, + populators: { + name: "noSubProject_locality", + optionsKey: "i18nKey", + error: "WORKS_REQUIRED_ERR", + required: false, + optionsCustomStyle : { + top : "2.5rem" + }, + options: [] + }, + }, +3. Both 'translate' and 'updateDependent' supports multiple JSON paths. This means that we can inject multiple params at a time in the same input object. +4. Any component who wants to transform MDMS config to FormComposer config using this Pre-Process Utility should pass the dependencies based on their requirement. + Example, if one needs to update the dropdown value based on other dropdown field change, then the component can pass that Param as state. + The Component should make calls to this config only when the dependent state changes, to avoid performance issues. + + const config = useMemo( + () => Digit.Utils.preProcessMDMSConfig(t, createProjectConfig, { + updateDependent : [ + { + key : 'withSubProject_project_subScheme', + value : [withSubProjectSubSchemeOptions] + } + ] + }), + [withSubProjectSubSchemeOptions]); +5. Translation and convertStringToRegEx will be handled by the Pre-Preprocess on its own. No params are required for this. +*/ + +const convertStringToRegEx = (target) => { + //iterate all translate keys and handle translation + for(let toValidate = 0; toValidate { + //iterate all translate keys and handle translation + for(let toUpdate = 0; toUpdatedependent?.key === inputKey)?.[0]?.value)); + + _.set(target, keyToUpdate, dependentObject); + } + return target; +} + +const transform = (preProcesses, target, inputIndex, inputKey, t, dependencyConfig) => { + //Do not loop preProcess object, to avoid unnecessary 'translate' and 'updateDependent' calls + //To add any new transform object, simply add a new if statement + if(preProcesses?.convertStringToRegEx) { + target = convertStringToRegEx(target); + } + if(preProcesses?.updateDependent) { + target = updateDependent(target, dependencyConfig, inputKey); + } + return target; +} + +const preProcessMDMSConfigInboxSearch = (t, config, jsonpath, dependencyConfig) => { + let targetConfig = _.get(config, jsonpath); + let updatedConfig = []; + //Iterate the entire jsonpath array and push the updated objects in the new res array. + //Set the updated res in place of the targetConfig + targetConfig?.map((target, inputIndex) => { + let preProcesses = target?.preProcess; + updatedConfig.push(transform(preProcesses, target, inputIndex, target?.key, t, dependencyConfig)); + }) + _.set(config, jsonpath, updatedConfig); + return config; +} + +export default preProcessMDMSConfigInboxSearch; + diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/privacy.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/privacy.js new file mode 100644 index 00000000000..ae2d62c50a8 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/privacy.js @@ -0,0 +1,107 @@ +/** + * Contains all utils used for Privacy + * + * @author jagankumar-egov + * + * Feature :: Privacy + */ + +/** + * Custom util to get the privacy object of current screen + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.getPrivacyObject() + * + * @returns {object} Returns the privacy object + */ +export const getPrivacyObject = () => { + const privacyObj = getAllPrivacyObject(); + return privacyObj?.[window.location.pathname] || {}; +}; + +/** + * Custom util to get the complete privacy object. + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.getAllPrivacyObject() + * + * @returns {object} Returns the key value pair of privacy object in every screens + */ +export const getAllPrivacyObject = () => { + return Digit.SessionStorage.get("PRIVACY_OBJECT") || {}; +}; + +/** + * Custom util to update the privacy object. + * + * @author jagankumar-egov + * + * @example + * Digit.Utils.setPrivacyObject({}) + * + */ +export const setPrivacyObject = (updatedPrivacyValue = {}) => { + return Digit.SessionStorage.set("PRIVACY_OBJECT", { ...updatedPrivacyValue }); +}; + +/** + * Main Util to update the privacy + * + * @author jagankumar-egov + * + * Feature :: Privacy + * + * @example + * Digit.Utils.updatePrivacy(uuid, fieldName) + * + * @returns {object} Returns the updated privacy object + */ +export const updatePrivacy = (uuid, fieldName) => { + const privacyObj = Digit.Utils.getAllPrivacyObject(); + const plainRequestFields = + privacyObj?.[window.location.pathname]?.recordId === uuid ? privacyObj?.[window.location.pathname]?.plainRequestFields || [] : []; + const newObj = { + ...privacyObj, + [window.location.pathname]: { recordId: uuid, plainRequestFields: Array.isArray(fieldName) ? [...fieldName, ...plainRequestFields] : [fieldName, ...plainRequestFields] }, + }; + Digit.Utils.setPrivacyObject({ ...newObj }); + return newObj; +}; + +/** + * Core Component Logic for showing the unmask button and for which fields will be controlled by + * mdms -> DataSecurity -> SecurityPolicy.json + * + * @author jagankumar-egov + * + * Feature :: Privacy + * + * @example + * Digit.Utils.checkPrivacy(mdmsObj, privacyDetail) + * + * @returns {boolean} Returns the show or hide in boolean type + */ + +export const checkPrivacy = (mdmsObj, privacyDetail) => { + if (mdmsObj?.attributes?.some((ele) => (ele?.name === privacyDetail?.fieldName || privacyDetail?.fieldName?.includes(ele?.name) )&& ele?.defaultVisibility === "MASKED")) { + return true; + } + const userInfo = Digit.UserService.getUser(); + const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); + if ( + mdmsObj?.roleBasedDecryptionPolicy?.some( + (ele) => + ele?.roles?.some((e) => userRoles?.includes(e)) && + ele?.attributeAccessList?.some( + (ele) => (ele?.attribute === privacyDetail?.fieldName || privacyDetail?.fieldName?.includes(ele?.attribute)) && ele?.firstLevelVisibility === "MASKED" && ele?.secondLevelVisibility === "PLAIN" + ) + ) + ) { + return true; + } + return false; +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/pt/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/pt/index.js new file mode 100644 index 00000000000..ec8ff0468f6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/libraries/src/utils/pt/index.js @@ -0,0 +1,65 @@ +export const getPropertyTypeLocale = (value) => { + return `PROPERTYTAX_BILLING_SLAB_${value?.split(".")[0]}`; +}; + +export const getPropertySubtypeLocale = (value) => `PROPERTYTAX_BILLING_SLAB_${value}`; + +export const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { + if (searcher === "") return str; + while (str.includes(searcher)) { + str = str.replace(searcher, replaceWith); + } + return str; +}; + +/* method to check not null if not returns false*/ +export const checkForNotNull = (value = "") => { + return value && value != null && value != undefined && value != "" ? true : false; +}; + +export const convertDotValues = (value = "") => { + return ( + (checkForNotNull(value) && ((value.replaceAll && value.replaceAll(".", "_")) || (value.replace && stringReplaceAll(value, ".", "_")))) || "NA" + ); +}; + +export const convertToLocale = (value = "", key = "") => { + let convertedValue = convertDotValues(value); + if (convertedValue === "NA") { + return "PT_NA"; + } + return `${key}_${convertedValue}`; +}; +export const getMohallaLocale = (value = "", tenantId = "") => { + let convertedValue = convertDotValues(tenantId); + if (convertedValue === "NA" || !checkForNotNull(value)) { + return "PT_NA"; + } + convertedValue = convertedValue.toUpperCase(); + return convertToLocale(value, `${convertedValue}_REVENUE`); +}; + +export const getCityLocale = (value = "") => { + let convertedValue = convertDotValues(value); + if (convertedValue === "NA" || !checkForNotNull(value)) { + return "PT_NA"; + } + convertedValue = convertedValue.toUpperCase(); + return convertToLocale(convertedValue, `TENANT_TENANTS`); +}; + +export const convertDateToEpoch = (dateString, dayStartOrEnd = "dayend") => { + //example input format : "2018-10-02" + try { + const parts = dateString.match(/(\d{4})-(\d{1,2})-(\d{1,2})/); + const DateObj = new Date(Date.UTC(parts[1], parts[2] - 1, parts[3])); + DateObj.setMinutes(DateObj.getMinutes() + DateObj.getTimezoneOffset()); + if (dayStartOrEnd === "dayend") { + DateObj.setHours(DateObj.getHours() + 24); + DateObj.setSeconds(DateObj.getSeconds() - 1); + } + return DateObj.getTime(); + } catch (e) { + return dateString; + } +}; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/README.md b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/README.md new file mode 100644 index 00000000000..dcf4b64180f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/README.md @@ -0,0 +1,77 @@ + + +# digit-ui-module-common + +## Install + +```bash +npm install --save @egovernments/digit-ui-module-common +``` + +## Limitation + +```bash +This Package is more specific to DIGIT-UI's can be used across mission's for Payments +``` + +## Usage + +After adding the dependency make sure you have this dependency in + +```bash +frontend/micro-ui/web/package.json +``` + +```json +"@egovernments/digit-ui-module-common":"^1.5.0", +``` + +then navigate to App.js + +```bash + frontend/micro-ui/web/src/App.js +``` + + +```jsx +/** add this import **/ + +import { paymentConfigs, PaymentLinks, PaymentModule } from "@egovernments/digit-ui-module-common"; + +/** inside enabledModules add this new module key **/ + +const enabledModules = ["Payment"]; + +/** inside init Function call this function **/ + +const initDigitUI = () => { + window?.Digit.ComponentRegistryService.setupRegistry({ + PaymentModule, + ...paymentConfigs, + PaymentLinks, + }); +}; +``` + +# Changelog + +```bash +1.8.0-beta workbench base version beta release +1.7.0 urban 2.9 +1.6.0 urban 2.8 +1.5.31 updated the readme content +1.5.30 Fixes mannual receipt date range validation, Cheque and card number validation for FSM +1.5.29 version upgraded for fixes in payment modules +1.5.28 base version +``` + +# Contributors + +[jagankumar-egov] [Tulika-eGov] [vamshikrishnakole-wtt-egov] [nabeelmd-eGov] [anil-egov] + +## Published from DIGIT Core +Digit Dev Repo (https://github.com/egovernments/Digit-Core/tree/digit-ui-core) + +## License + +MIT © [jagankumar-egov](https://github.com/jagankumar-egov) \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/package.json b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/package.json new file mode 100644 index 00000000000..d6c652f598e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/package.json @@ -0,0 +1,34 @@ +{ + "name": "@egovernments/digit-ui-module-common", + "version": "1.8.0-beta", + "license": "MIT", + "main": "dist/index.js", + "module": "dist/index.modern.js", + "source": "src/Module.js", + "files": [ + "dist" + ], + "scripts": { + "start": "microbundle-crl watch --no-compress --format modern,cjs", + "build": "microbundle-crl --compress --no-sourcemap --format cjs", + "prepublish": "yarn build" + }, + "dependencies": { + "@egovernments/digit-ui-react-components": "1.5.23", + "react": "17.0.2", + "react-dom": "17.0.2", + "react-hook-form": "6.15.8", + "react-i18next": "11.16.2", + "react-query": "3.6.1", + "react-router-dom": "5.3.0" + }, + "author": "JaganKumar ", + "keywords": [ + "digit", + "egov", + "dpg", + "digit-ui", + "common", + "payment" + ] +} \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/Module.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/Module.js new file mode 100644 index 00000000000..8e922b1cfed --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/Module.js @@ -0,0 +1 @@ +export * from "./payments"; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/hoc/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/hoc/index.js new file mode 100644 index 00000000000..695e38ccf3b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/hoc/index.js @@ -0,0 +1,3 @@ +import { SubformComposer } from "./subform-composer"; + +export { SubformComposer }; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/hoc/subform-composer.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/hoc/subform-composer.js new file mode 100644 index 00000000000..98dd3df4551 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/hoc/subform-composer.js @@ -0,0 +1,72 @@ +import { Card, CardHeader } from "@egovernments/digit-ui-react-components"; +import React, { useCallback, useEffect, useMemo, useState } from "react"; +import { useForm, Controller } from "react-hook-form"; +import { subFormRegistry } from "@egovernments/digit-ui-libraries"; + +export const SubformComposer = ({ _key, ...props }) => { + const config = subFormRegistry._registry[_key]; + const { setValue, setError, control, watch, getValues } = useForm({ shouldFocusError: true }); + const [state, setState] = useState(config?.state); + + const _setState = useCallback((obj) => { + setState((oldState) => ({ ...oldState, ...obj })); + }, []); + + const clearState = useCallback(() => { + setState(config.state); + }, []); + + const formData = watch(); + + useEffect(() => { + (async () => { + props.getSubFormValue(await callMiddlewares(formData)); + })(); + }, [formData]); + + const callMiddlewares = useCallback(async (data) => { + let applyBreak = false; + let itr = -1; + let _break = () => (applyBreak = true); + let _next = async (data) => { + if (!applyBreak && ++itr < config?.middlewares.length) { + let key = Object.keys(config?.middlewares[itr])[0]; + let nextMiddleware = config?.middlewares[itr][key]; + let isAsync = nextMiddleware.constructor.name === "AsyncFunction"; + if (isAsync) return await nextMiddleware(data, _break, _next); + else return nextMiddleware(data, _break, _next); + } else return data; + }; + let ret = await _next(data); + return ret; + }, []); + + const allFields = useMemo(() => (config && [...config?.fields, ...config?.addedFields]) || [], [config]); + + return ( + + + + {_key} + {allFields.map(({ label, component, customProps, defaultValue, name }, index) => { + let _customProps = typeof customProps === "function" ? customProps(state, _setState) : customProps; + let _defaultValue = typeof defaultValue === "function" ? defaultValue(state, _setState) : defaultValue; + return ( +
+ {label &&
{label}
} +
+ component({ ...props, setState: _setState, setValue, setError, state, getValues }, _customProps)} + /> +
+
+ ); + })} +
+ +
+ ); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/hoc/testForm-config.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/hoc/testForm-config.js new file mode 100644 index 00000000000..42c48e5e887 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/hoc/testForm-config.js @@ -0,0 +1,148 @@ +import React from "react"; +import { Dropdown, SearchIconSvg } from "@egovernments/digit-ui-react-components"; + +const middleWare_1 = async (data, _break, _next) => { + data.a = "a"; + return await _next(data); +}; + +const middleWare_2 = async (data, _break, _next) => { + data.b = "b"; + // _break(); + return await _next(data); +}; + +const middleWare_3 = async (data, _break, _next) => { + data.c = "c"; + if (data.b === "b") { + try { + const res = await window.fetch(`https://ifsc.razorpay.com/hdfc0000090`); + if (res.ok) { + const { BANK, BRANCH } = await res.json(); + data.BANKFROMMiddleWare = BANK; + } else alert("Wrong IFSC Code"); + } catch (er) { + alert("Something Went Wrong !"); + } + } + return await _next(data); +}; + +const asyncData = { + a: ["1", "2", "3"], + b: ["4", "5", "6"], + c: ["7", "8", "9"], + j: ["10", "11", "12"], + k: ["22", "45"], + l: ["456"], +}; + +export const testForm = { + addedFields: [], + middlewares: [{ middleWare_1 }, { middleWare_2 }, { middleWare_3 }], + + state: { firstDDoptions: ["a", "b", "c"], secondDDoptions: asyncData.a, thirdDDoptions: ["d", "e", "f"] }, + + fields: [ + { + label: "first", + name: "pehla", + defaultValue: "b", + customProps: (state) => ({ isMendatory: true, option: state.firstDDoptions }), + component: (props, customProps) => ( + { + props.setState({ secondDDoptions: asyncData[d] }); + props.setValue("doosra", ""); + props.onChange(d); + }} + selected={props.value} + {...customProps} + /> + ), + validations: {}, + }, + { + label: "second", + name: "doosra", + customProps: (state) => ({ isMendatory: true, option: state.secondDDoptions }), + defaultValue: (state) => state.secondDDoptions[1], + component: (props, customProps) => ( + { + props.onChange(d); + }} + selected={props.value} + {...customProps} + /> + ), + }, + { + label: "third", + name: "teesra", + customProps: (state) => ({ isMendatory: true, option: state.thirdDDoptions }), + defaultValue: "d", + component: (props, customProps) => ( + { + props.onChange(d); + }} + selected={props.value} + {...customProps} + /> + ), + }, + { + label: "IFSC", + name: "ifsc", + customProps: { + isMendatory: true, + setBankDetailsFromIFSC: async (props) => { + try { + const res = await window.fetch(`https://ifsc.razorpay.com/${props.getValues("ifsc")}`); + if (res.ok) { + const { BANK, BRANCH } = await res.json(); + props.setValue("bank", BANK); + props.setValue("branch", BRANCH); + } else alert("Wrong IFSC Code"); + } catch (er) { + alert("Something Went Wrong !"); + } + }, + }, + defaultValue: "", + component: (props, customProps) => ( +
+ { + props.setState({ ifsc: e.target.value }); + props.onChange(e.target.value); + }} + /> + +
+ ), + }, + { + label: "Bank", + name: "bank", + defaultValue: "d", + component: (props, customProps) => , + }, + { + label: "Branch", + name: "branch", + defaultValue: "d", + component: (props, customProps) => , + }, + ], +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/index.js new file mode 100644 index 00000000000..94de35555cc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/index.js @@ -0,0 +1,64 @@ +import { Loader } from "@egovernments/digit-ui-react-components"; +import React, { useEffect } from "react"; +import { useParams, useHistory, useRouteMatch, useLocation } from "react-router-dom"; +import Routes from "./routes"; +// import { myBillMap } from "./myBillsKeysMap"; + +export const MyBills = ({ stateCode }) => { + const { businessService } = useParams(); + const { tenantId: _tenantId, isDisoconnectFlow } = Digit.Hooks.useQueryParams(); + + const { isLoading: storeLoading, data: store } = Digit.Services.useStore({ + stateCode, + moduleCode: businessService, + language: Digit.StoreData.getCurrentLanguage(), + }); + + const history = useHistory(); + const { url } = useRouteMatch(); + const location = useLocation(); + + const { tenantId } = Digit.UserService.getUser()?.info || location?.state || { tenantId: _tenantId } || {}; + + if (!tenantId && !location?.state?.fromSearchResults) { + history.replace(`/${window?.contextPath}/citizen/login`, { from: url }); + } + + const { isLoading, data } = Digit.Hooks.useFetchCitizenBillsForBuissnessService( + { businessService }, + { refetchOnMount: true, enabled: !location?.state?.fromSearchResults } + ); + const { isLoading: mdmsLoading, data: mdmsBillingData } = Digit.Hooks.useGetPaymentRulesForBusinessServices(tenantId); + + const billsList = data?.Bill || []; + + const getPaymentRestrictionDetails = () => { + const payRestrictiondetails = mdmsBillingData?.MdmsRes?.BillingService?.BusinessService; + let updatedBussinessService = ((businessService === "WS" || businessService === "SW") && isDisoconnectFlow === "true") ? "DISCONNECT" : businessService; + if (payRestrictiondetails?.length) return payRestrictiondetails.filter((e) => e.code == updatedBussinessService)?.[0]||{ + isAdvanceAllowed: false, + isVoucherCreationEnabled: true, + minAmountPayable: 100, + partPaymentAllowed: false, + }; + else + return { + // isAdvanceAllowed: false, + // isVoucherCreationEnabled: true, + // minAmountPayable: 100, + // partPaymentAllowed: true, + }; + }; + + const getProps = () => ({ billsList, paymentRules: getPaymentRestrictionDetails(), businessService }); + + if (mdmsLoading) { + return ; + } + + return ( + + + + ); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/arrear-summary.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/arrear-summary.js new file mode 100644 index 00000000000..9df15ba9231 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/arrear-summary.js @@ -0,0 +1,105 @@ +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; +import ArrearTable from "./arrear-table"; + +const styles = { + buttonStyle: { display: "flex", justifyContent: "flex-end", color: "#f47738" }, + headerStyle: { + marginTop: "10px", + fontSize: "16px", + fontWeight: "700", + lineHeight: "24px", + color: " rgba(11, 12, 12, var(--text-opacity))", + }, +}; + +const ArrearSummary = ({ bill = {} }) => { + const { t } = useTranslation(); + const formatTaxHeaders = (billDetail = {}) => { + let formattedFees = {}; + const { billAccountDetails = [] } = billDetail; + billAccountDetails.map((taxHead) => { + formattedFees[taxHead.taxHeadCode] = { value: taxHead.amount, order: taxHead.order }; + }); + formattedFees["CS_BILL_NO"] = { value: billDetail?.billNumber || "NA", order: -2 }; + formattedFees["CS_BILL_DUEDATE"] = { + value: (billDetail?.expiryDate && new Date(billDetail?.expiryDate).toLocaleDateString()) || "NA", + order: -1, + }; + formattedFees["TL_COMMON_TOTAL_AMT"] = { value: billDetail.amount, order: 10 }; + return formattedFees; + }; + + const getFinancialYears = (from, to) => { + const fromDate = new Date(from); + const toDate = new Date(to); + if (toDate.getYear() - fromDate.getYear() != 0) { + return `FY${fromDate.getYear() + 1900}-${toDate.getYear() - 100}`; + } + return `${fromDate.toLocaleDateString()}-${toDate.toLocaleDateString()}`; + }; + + let fees = {}; + let sortedBillDetails = bill?.billDetails?.sort((a, b) => b.fromPeriod - a.fromPeriod) || []; + sortedBillDetails = [...sortedBillDetails]; + const arrears = sortedBillDetails?.reduce((total, current, index) => (index === 0 ? total : total + current.amount), 0) || 0; + let arrearsAmount = `₹ ${arrears?.toFixed?.(0) || Number(0).toFixed(0)}`; + + sortedBillDetails.shift(); + sortedBillDetails.map((bill) => { + let fee = formatTaxHeaders(bill); + fees[getFinancialYears(bill.fromPeriod, bill.toPeriod)] = fee; + }); + + let head = {}; + fees + ? Object.keys(fees).map((key, ind) => { + let value = []; + Object.keys(fees[key]).map((key1) => { + head[key1] = (fees[key] && fees[key][key1] && fees[key][key1].order) || 0; + }); + }) + : "NA"; + let keys = []; + + keys = Object.keys(head); + keys.sort((x, y) => head[x] - head[y]); + + const [showArrear, setShowArrear] = useState(false); + + if (arrears == 0 || arrears < 0) { + return ; + } + return ( + +
{t("CS_ARREARS_DETAILS")}
+ {showArrear && } + {!showArrear && ( +
+ +
+ )} + {showArrear && ( +
+ +
+ )} +
+ ); +}; + +export default ArrearSummary; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/arrear-table.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/arrear-table.js new file mode 100644 index 00000000000..22fabff393a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/arrear-table.js @@ -0,0 +1,103 @@ +import React from "react"; +import { useTranslation } from "react-i18next"; + +const styles = { + root: { + width: "100%", + marginTop: "2px", + overflowX: "auto", + boxShadow: "none", + }, + table: { + minWidth: 700, + backgroundColor: "rgba(250, 250, 250, var(--bg-opacity))", + }, + cell: { + maxWidth: "7em", + minWidth: "1em", + border: "1px solid #e8e7e6", + padding: "4px 5px", + fontSize: "0.8em", + textAlign: "left", + lineHeight: "1.5em", + }, + cellHeader: { + overflow: "hidden", + textOverflow: "ellipsis", + }, + cellLeft: { + // position: 'sticky', + // backgroundColor:'rgba(250, 250, 250, var(--bg-opacity))', + // left: 0 + }, + cellRight: { + // position: 'sticky', + // backgroundColor:'rgba(250, 250, 250, var(--bg-opacity))', + // right: 0 + }, +}; + +const ArrearTable = ({ className = "table", headers = [], values = [], arrears = 0 }) => { + const { t } = useTranslation(); + return ( + +
+
+ + + + {headers.map((header, ind) => { + let styleRight = headers.length == ind + 1 ? styles.cellRight : {}; + return ( + + ); + })} + + + + {Object.values(values).map((row, ind) => ( + + + {headers.map((header, i) => { + let styleRight = headers.length == i + 1 ? styles.cellRight : {}; + return ( + + ); + })} + + ))} + + + {headers.map((header, ind) => { + if (ind == headers.length - 1) { + return ( + + ); + } else if (ind == headers.length - 2) { + return ( + + ); + } else { + return ; + } + })} + + +
{t("CS_BILL_PERIOD")} + {t(header)} +
+ {Object.keys(values)[ind]} + + {i > 1 && "₹"} + {(row[header] && row[header]["value"]) || "0"} +
+ {arrears} + + {t("COMMON_ARREARS_TOTAL")} +
+
+ + ); +}; + +export default ArrearTable; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/bill-details.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/bill-details.js new file mode 100644 index 00000000000..dcf0f047fce --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/bill-details.js @@ -0,0 +1,270 @@ +import { Card, CardSubHeader, Header, KeyNote, Loader, RadioButtons, SubmitBar, TextInput } from "@egovernments/digit-ui-react-components"; +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { useHistory, useLocation, useParams } from "react-router-dom"; +import ArrearSummary from "./arrear-summary"; +import BillSumary from "./bill-summary"; +import { stringReplaceAll } from "./utils"; + +const BillDetails = ({ paymentRules, businessService }) => { + const { t } = useTranslation(); + const history = useHistory(); + const { state, pathname, search } = useLocation(); + const userInfo = Digit.UserService.getUser(); + let { consumerCode } = useParams(); + const { workflow: wrkflow, tenantId: _tenantId, authorization, ConsumerName } = Digit.Hooks.useQueryParams(); + const [bill, setBill] = useState(state?.bill); + const tenantId = state?.tenantId || _tenantId || Digit.UserService.getUser().info?.tenantId; + const propertyId = state?.propertyId; + if (wrkflow === "WNS" && consumerCode.includes("?")) consumerCode = consumerCode.substring(0, consumerCode.indexOf("?")); + const { data, isLoading } = state?.bill + ? { isLoading: false } + : Digit.Hooks.useFetchPayment({ + tenantId, + businessService, + consumerCode: wrkflow === "WNS" ? stringReplaceAll(consumerCode, "+", "/") : consumerCode, + }); + + let Useruuid = data?.Bill?.[0]?.userId || ""; + let requestCriteria = [ + "/user/_search", + {}, + { data: { uuid: [Useruuid] } }, + { recordId: Useruuid, plainRequestFields: ["mobileNumber"] }, + { + enabled: Useruuid ? true : false, + cacheTime: 100, + }, + ]; + + const { isLoading: isUserLoading, data: userData, revalidate } = Digit.Hooks.useCustomAPIHook(...requestCriteria); + + const { isLoading: isFSMLoading, isError, error, data: application, error: errorApplication } = Digit.Hooks.fsm.useApplicationDetail( + t, + tenantId, + consumerCode, + { enabled: pathname.includes("FSM") ? true : false }, + "CITIZEN" + ); + let { minAmountPayable, isAdvanceAllowed } = paymentRules; + minAmountPayable = wrkflow === "WNS" ? 100 : minAmountPayable; + const billDetails = bill?.billDetails?.sort((a, b) => b.fromPeriod - a.fromPeriod)?.[0] || []; + const Arrears = + bill?.billDetails + ?.sort((a, b) => b.fromPeriod - a.fromPeriod) + ?.reduce((total, current, index) => (index === 0 ? total : total + current.amount), 0) || 0; + + const { key, label } = Digit.Hooks.useApplicationsForBusinessServiceSearch({ businessService }, { enabled: false }); + + const getBillingPeriod = () => { + const { fromPeriod, toPeriod } = billDetails; + if (fromPeriod && toPeriod) { + let from, to; + if (wrkflow === "mcollect" || wrkflow === "WNS") { + from = + new Date(fromPeriod).getDate().toString() + + " " + + Digit.Utils.date.monthNames[new Date(fromPeriod).getMonth()]?.toString() + + " " + + new Date(fromPeriod).getFullYear().toString(); + to = + new Date(toPeriod).getDate() + + " " + + Digit.Utils.date.monthNames[new Date(toPeriod).getMonth()] + + " " + + new Date(toPeriod).getFullYear(); + return from + " - " + to; + } + from = new Date(billDetails.fromPeriod).getFullYear().toString(); + to = new Date(billDetails.toPeriod).getFullYear().toString(); + if (from === to) { + if(window.location.href.includes("BPA")) + { + if(new Date(data?.Bill?.[0]?.billDate).getMonth()+1 < 4) + { + let newfrom = (parseInt(from)-1).toString(); + return "FY " + newfrom + "-" + to; + } + else + { + let newTo = (parseInt(to)+1).toString(); + return "FY " + from + "-" + newTo; + } + } + else + return "FY " + from; + } + return "FY " + from + "-" + to; + } else return "N/A"; + }; + + const getBillBreakDown = () => billDetails?.billAccountDetails || []; + + const getTotal = () => bill?.totalAmount || 0; + const getAdvanceAmount = () => application?.pdfData?.advanceAmount; + + const [paymentType, setPaymentType] = useState(t("CS_PAYMENT_FULL_AMOUNT")); + const [amount, setAmount] = useState(getTotal()); + const [paymentAllowed, setPaymentAllowed] = useState(true); + const [formError, setError] = useState(""); + + if (authorization === "true" && !userInfo?.access_token) { + localStorage.clear(); + sessionStorage.clear(); + window.location.href = `/${window?.contextPath}/citizen/login?from=${encodeURIComponent(pathname + search)}`; + } + useEffect(() => { + window.scroll({ top: 0, behavior: "smooth" }); + }, []); + + useEffect(() => { + if (paymentType == t("CS_PAYMENT_FULL_AMOUNT")) setAmount(getTotal()); + }, [paymentType, bill]); + + useEffect(() => { + let changeAdvanceAllowed = isAdvanceAllowed; + if (isAdvanceAllowed && wrkflow === "WNS") changeAdvanceAllowed = false; + const allowPayment = minAmountPayable && amount >= minAmountPayable && !changeAdvanceAllowed && amount <= getTotal() && !formError; + if (paymentType != t("CS_PAYMENT_FULL_AMOUNT")) setPaymentAllowed(allowPayment); + else setPaymentAllowed(true); + }, [paymentType, amount]); + + useEffect(() => { + if (!isFSMLoading && application?.pdfData?.applicationStatus === "PENDING_APPL_FEE_PAYMENT") { + setPaymentAllowed(true); + setPaymentType(t("CS_PAYMENT_ADV_COLLECTION")); + } + }); + + useEffect(() => { + if (!bill && data) { + let requiredBill = data.Bill.filter((e) => e.consumerCode == (wrkflow === "WNS" ? stringReplaceAll(consumerCode, "+", "/") : consumerCode))[0]; + setBill(requiredBill); + } + }, [isLoading]); + + const onSubmit = () => { + let paymentAmount = + paymentType === t("CS_PAYMENT_FULL_AMOUNT") + ? getTotal() + : amount || businessService === "FSM.TRIP_CHARGES" + ? application?.pdfData?.advanceAmount + : amount; + if (window.location.href.includes("mcollect")) { + history.push(`/${window?.contextPath}/citizen/payment/collect/${businessService}/${consumerCode}?workflow=mcollect`, { + paymentAmount, + tenantId: billDetails.tenantId, + }); + } else if (wrkflow === "WNS") { + history.push(`/${window?.contextPath}/citizen/payment/billDetails/${businessService}/${consumerCode}/${paymentAmount}?workflow=WNS&ConsumerName=${ConsumerName}`, { + paymentAmount, + tenantId: billDetails.tenantId, + name: bill.payerName, + mobileNumber: bill.mobileNumber && bill.mobileNumber?.includes("*") ? userData?.user?.[0]?.mobileNumber : bill.mobileNumber, + }); + } else if (businessService === "PT") { + history.push(`/${window?.contextPath}/citizen/payment/billDetails/${businessService}/${consumerCode}/${paymentAmount}`, { + paymentAmount, + tenantId: billDetails.tenantId, + name: bill.payerName, + mobileNumber: bill.mobileNumber && bill.mobileNumber?.includes("*") ? userData?.user?.[0]?.mobileNumber : bill.mobileNumber, }); + } else { + history.push(`/${window?.contextPath}/citizen/payment/collect/${businessService}/${consumerCode}`, { paymentAmount, tenantId: billDetails.tenantId, propertyId: propertyId }); + } + }; + + const onChangeAmount = (value) => { + setError(""); + if (isNaN(value) || value.includes(".")) { + setError("AMOUNT_INVALID"); + } else if (!isAdvanceAllowed && value > getTotal()) { + setError("CS_ADVANCED_PAYMENT_NOT_ALLOWED"); + } else if (value < minAmountPayable) { + setError("CS_CANT_PAY_BELOW_MIN_AMOUNT"); + } + setAmount(value); + }; + + if (isLoading || isFSMLoading) return ; + + return ( + +
{t("CS_PAYMENT_BILL_DETAILS")}
+ +
+ + {businessService !== "PT.MUTATION" && businessService !== "FSM.TRIP_CHARGES" && ( + + )} + {businessService?.includes("PT") || + (wrkflow === "WNS" && billDetails?.currentBillNo && )} + {businessService?.includes("PT") || + (wrkflow === "WNS" && billDetails?.currentExpiryDate && ( + + ))} + {businessService === "FSM.TRIP_CHARGES" ? ( +
+ + + {application?.pdfData?.applicationStatus !== "PENDING_APPL_FEE_PAYMENT" ? ( + + ) : null} +
+ ) : ( + + )} + +
+ +
+
+ {t("CS_COMMON_PAYMENT_AMOUNT")} + {businessService === "FSM.TRIP_CHARGES" ? null : ( + + )} + +
+ + ₹ + + {paymentType !== t("CS_PAYMENT_FULL_AMOUNT") ? ( + businessService === "FSM.TRIP_CHARGES" ? ( + {}} value={getAdvanceAmount()} disable={true} /> + ) : ( + onChangeAmount(e.target.value)} value={amount} disable={getTotal() === 0} /> + ) + ) : ( + {}} disable={true} /> + )} + {formError === "CS_CANT_PAY_BELOW_MIN_AMOUNT" ? ( + + {t(formError)}: {"₹" + minAmountPayable} + + ) : ( + {t(formError)} + )} +
+ +
+
+
+ ); +}; + +export default BillDetails; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/bill-summary.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/bill-summary.js new file mode 100644 index 00000000000..5cf0ea864e1 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/bill-summary.js @@ -0,0 +1,47 @@ +import React, { useEffect } from "react"; +import { useTranslation } from "react-i18next"; + +const BillSumary = ({ billAccountDetails, total, businessService, arrears }) => { + const { t } = useTranslation(); + const { workflow: ModuleWorkflow } = Digit.Hooks.useQueryParams(); + + useEffect(() => { + ModuleWorkflow === "mcollect" && billAccountDetails && billAccountDetails.map((ob) => { + if(ob.taxHeadCode.includes("CGST")) + ob.order = 3; + else if(ob.taxHeadCode.includes("SGST")) + ob.order = 4; + }) + },[billAccountDetails]) + return ( + +
+ {billAccountDetails + .sort((a, b) => a.order - b.order) + .map((amountDetails, index) => { + return ( +
+
{t(amountDetails.taxHeadCode)}
+
₹ {Math.abs(amountDetails?.amount?.toFixed(2))}
+
+ ); + })} + + { +
+
{t("COMMON_ARREARS")}
+
₹ {Math.abs(arrears?.toFixed?.(2) || Number(0).toFixed(2))}
+
+ } + +
+
+
{t("CS_PAYMENT_TOTAL_AMOUNT")}
+
₹ {Number(total).toFixed(2)}
+
+
+
+ ); +}; + +export default BillSumary; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/utils.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/utils.js new file mode 100644 index 00000000000..7a580f0139e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/utils.js @@ -0,0 +1,7 @@ +export const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => { + if (searcher == "") return str; + while (str.includes(searcher)) { + str = str.replace(searcher, replaceWith); + } + return str; + }; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/yearwise-bills.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/yearwise-bills.js new file mode 100644 index 00000000000..ea8aa25a58b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/bill-details/yearwise-bills.js @@ -0,0 +1,73 @@ +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; + +const YearWiseBilltable = ({ bill, ...props }) => { + const { t } = useTranslation(); + const [showDetails, setShowDetails] = useState(true); + const yearWiseBills = bill?.billDetails?.sort((a, b) => b.fromPeriod - a.fromPeriod); + + const getFinancialYear = (_bill) => { + const { fromPeriod, toPeriod } = _bill; + let from = new Date(fromPeriod).getFullYear().toString(); + let to = new Date(toPeriod).getFullYear().toString(); + return from + "-" + to.slice(-2); + }; + + const thStyle = { whiteSpace: "break-spaces", paddingBottom: "13px" }; + + return ( + + {showDetails ? ( +
+
+
+ + { + + + + {yearWiseBills?.[0]?.billAccountDetails + ?.sort((a, b) => a.order - b.order) + ?.map((head, index) => ( + + ))} + + + + } + + {yearWiseBills?.map((bill, ind) => { + const sorted_tax_heads = bill?.billAccountDetails?.sort((a, b) => a.order - b.order); + return ( + + + {sorted_tax_heads.map((e, i) => ( + + ))} + + + ); + })} + +
+ {t("ES_FINANCIAL_YEAR")} + + {t(head.taxHeadCode)} + + {t("ES_TOTAL_TAX").split(" ")[0] + "\n" + t("ES_TOTAL_TAX").split(" ")[1]} +
{getFinancialYear(bill)}{e.amount}{bill.amount}
+
+
+
setShowDetails(false)} className="filter-button"> + {t("ES_COMMON_HIDE_DETAILS")} +
+
+ ) : ( +
setShowDetails(true)} className="filter-button"> + {t("ES_COMMON_VIEW_DETAILS")} +
+ )} +
+ ); +}; +export default YearWiseBilltable; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/index.js new file mode 100644 index 00000000000..812d541bcae --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/index.js @@ -0,0 +1,21 @@ +import React from "react"; +import { Route, Switch, useRouteMatch } from "react-router-dom"; +import { BillList } from "./my-bills/my-bills"; +import BillDetails from "./bill-details/bill-details"; +import { BackButton } from "@egovernments/digit-ui-react-components"; + +const BillRoutes = ({ billsList, paymentRules, businessService }) => { + const { url: currentPath, ...match } = useRouteMatch(); + + return ( + + + + } /> + } /> + + + ); +}; + +export default BillRoutes; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/my-bills/my-bill.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/my-bills/my-bill.js new file mode 100644 index 00000000000..617d8a0590a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/my-bills/my-bill.js @@ -0,0 +1,35 @@ +import React from "react"; +import { useTranslation } from "react-i18next"; +import { Card, KeyNote, SubmitBar } from "@egovernments/digit-ui-react-components"; +import { Link, useHistory } from "react-router-dom"; + +// import { getKeyNotesConfig } from "./keynotesConfig"; + +const MyBill = ({ bill, currentPath, businessService, getKeyNotesConfig }) => { + const { t } = useTranslation(); + const history = useHistory(); + + const onSubmit = () => { + history.push(`${currentPath}/${bill.consumerCode}`, { tenantId:bill?.tenantId }); + }; + + return ( + + {typeof getKeyNotesConfig === "function" && ( + + {getKeyNotesConfig(businessService, t)["my-bill"].map((obj, index) => { + const value = obj.keyPath.reduce((acc, key) => { + if (typeof key === "function") acc = key(acc); + else acc = acc[key]; + return acc; + }, bill); + return ; + })} + + + )} + + ); +}; + +export default MyBill; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/my-bills/my-bills.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/my-bills/my-bills.js new file mode 100644 index 00000000000..2191941f8e5 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/bills/routes/my-bills/my-bills.js @@ -0,0 +1,94 @@ +import React, { useState, useEffect, useMemo } from "react"; +import { ArrowLeft, Header, Loader } from "@egovernments/digit-ui-react-components"; +import { useTranslation } from "react-i18next"; +import { Link, useHistory } from "react-router-dom"; + +import MyBill from "./my-bill"; + +export const BillList = ({ billsList, currentPath, businessService }) => { + const { t } = useTranslation(); + const history = useHistory(); + + const consumerCodes = billsList.map((bill) => bill.consumerCode); + // const { mobileNumber } = Digit.UserService.getUser()?.info; + + const searchResult = Digit.Hooks.useApplicationsForBusinessServiceSearch({ filters: { consumerCodes: consumerCodes.join() }, businessService }); + + /* + call the relevant business search and find what key is being used as consumerCode in bills it is as follows :- + + FSM -> applicationNo + PT -> propertyId + + */ + + const keyForConsumerCode = searchResult.key; + + const [applicationList, setApplicationList] = useState([]); + const [getKeyNotesConfig, setConfig] = useState(() => Digit.ComponentRegistryService?.getComponent("getBillDetailsConfigWithBusinessService")); + const billableApplicationsObj = useMemo(() => ({}), []); + const billsListObj = useMemo(() => ({}), []); + + useEffect(() => { + if (searchResult.data) searchResult.refetch(); + }, []); + + useEffect(() => { + if (searchResult.data) { + const billableApps = searchResult.data.filter((property) => consumerCodes.includes(property[keyForConsumerCode])); + const billableIDs = billableApps.map((e) => e[keyForConsumerCode]); + + billableApps.forEach((app) => { + billableApplicationsObj[app[keyForConsumerCode]] = app; + }); + + + billsList.forEach((bill) => { + billsListObj[bill.consumerCode] = bill; + }); + + const newBillsList = billableIDs.map((e) => ({ ...billsListObj[e], ...billableApplicationsObj[e] })); + setApplicationList(newBillsList); + } + }, [searchResult.data, getKeyNotesConfig]); + + if (searchResult.isLoading) { + return ; + } + + return ( + +
+ {/*
*/} +
{t("CS_TITLE_MY_BILLS") + ` (${applicationList.length})`}
+ {applicationList?.length > 0 && + getKeyNotesConfig && + applicationList.map((bill, index) => ( +
+ +
+ ))} + {!applicationList?.length > 0 &&

{t("CS_BILLS_TEXT_NO_BILLS_FOUND")}

} + {/*
*/} + {businessService === "PT" && ( +

+ {t("PT_TEXT_NOT_ABLE_TO_FIND_THE_PROPERTY")} + + {t("PT_COMMON_CLICK_HERE")} + +

+ )} +
+
+ ); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/index.js new file mode 100644 index 00000000000..8bbbef59a99 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/index.js @@ -0,0 +1,39 @@ +import React from "react"; +import { Switch, Route, useRouteMatch } from "react-router-dom"; +import { PrivateRoute } from "@egovernments/digit-ui-react-components"; +import PayersDetails from "./payers-details"; + +import { MyBills } from "./bills"; +import { SelectPaymentType } from "./payment-type/index"; +import { SuccessfulPayment, FailedPayment } from "./response"; + +const CitizenPayment = ({ stateCode, cityCode, moduleCode }) => { + const { path: currentPath } = useRouteMatch(); + const commonProps = { stateCode, cityCode, moduleCode }; + + return ( + +
+ + + + + + + + + + + + + + + + + +
+
+ ); +}; + +export default CitizenPayment; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/keynotesConfig.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/keynotesConfig.js new file mode 100644 index 00000000000..0e9378815fb --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/keynotesConfig.js @@ -0,0 +1,104 @@ +import React from "react"; + +export const getKeyNotesConfig = (businessService, t) => { + const businessId = businessService?.toLowerCase().split(".")[0]; + + switch (businessId) { + case "pt": + return { + "my-bill": [ + { + keyValue: "CS_COMMON_AMOUNT_DUE", + keyPath: [ + (d) => { + const overdueBy = new Date().getTime() - new Date(d.billDetails[0]?.toPeriod).getTime(); + const days = Math.floor(overdueBy / (86400 * 1000)); + return ( + + {"₹" + d["totalAmount"]} + {days >= 0 ? ( + {` ( ${t( + "CS_PAYMENT_OVERDUE" + )} ${days} ${t(days === 1 ? "CS_COMMON_DAY" : "CS_COMMON_DAYS")})`} + ) : null} + + ); + }, + ], + fallback: "N/A", + noteStyle: { fontWeight: "bold", fontSize: "24px", paddingTop: "5px" }, + }, + { + keyValue: "PT_PROPERTY_ID", + keyPath: ["propertyId"], + fallback: "", + }, + { + keyValue: "CS_OWNER_NAME", + keyPath: ["owners", 0, "name"], + fallback: "ES_TITLE_FSM", + }, + { + keyValue: "PT_PROPERTY_ADDRESS", + keyPath: ["address", "locality", "name"], + fallback: "CS_APPLICATION_TYPE_DESLUDGING", + }, + { + keyValue: "CS_PAYMENT_BILLING_PERIOD", + keyPath: [ + "billDetails", + (d) => { + const { fromPeriod, toPeriod } = d[0]; + if (fromPeriod && toPeriod) { + let from = new Date(fromPeriod).getFullYear().toString(); + let to = new Date(toPeriod).getFullYear().toString(); + return "FY " + from + "-" + to; + } else return "N/A"; + }, + ], + fallback: "N/A", + }, + { + keyValue: "PT_DUE_DATE", + keyPath: [ + "billDetails", + (d) => { + if (!d[0]?.toPeriod) return "N/A"; + const date = new Date(d[0]?.toPeriod); + const month = Digit.Utils.date.monthNames[date.getMonth()]; + return `${date.getDate()} ${month} ${date.getFullYear()}`; + }, + ], + fallback: "N/A", + }, + ], + response: [], + }; + + /** + + */ + + case "fsm": + return { + "my-bill": [ + { + keyValue: "CS_COMMON_AMOUNT_DUE", + keyPath: ["totalAmount", (d) => d.toFixed(2), (d) => "₹" + d], + fallback: "N/A", + noteStyle: { fontWeight: "bold", fontSize: "24px", paddingTop: "5px" }, + }, + ], + response: [], + }; + } +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/payers-details/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/payers-details/index.js new file mode 100644 index 00000000000..f2dbfdc9936 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/payers-details/index.js @@ -0,0 +1,241 @@ +import React, { useState, useEffect } from "react"; +import { + Header, + Card, + RadioButtons, + SubmitBar, + BackButton, + Loader, + TextInput, + MobileNumber, + CheckBox, + CitizenConsentForm +} from "@egovernments/digit-ui-react-components"; +import { useTranslation } from "react-i18next"; +import { useForm } from "react-hook-form"; +import { useParams, useHistory, useLocation } from "react-router-dom"; +import { stringReplaceAll } from "../bills/routes/bill-details/utils"; + +const SelectPaymentType = (props) => { + const optionFirst = { + code: "PAY_BY_OWNER", + i18nKey: "PT_PAY_BY_OWNER", + name: "I am making the payment as the owner/ consumer of the service", + }; + + const optionSecound = { + code: "PAY_BEHALF_OWNER", + i18nKey: "PT_PAY_BEHALF_OWNER", + name: "I am making the payment on behalf of the owner/ consumer of the service", + }; + + const userInfo = Digit.UserService.getUser()?.info; + const payersActiveName = userInfo?.name; + const payersActiveMobileNumber = userInfo?.mobileNumber; + + const { t } = useTranslation(); + const history = useHistory(); + const { state, ...location } = useLocation(); + const { consumerCode, businessService, paymentAmt } = useParams(); + const { workflow: wrkflow, tenantId: _tenantId, ConsumerName } = Digit.Hooks.useQueryParams(); + const [bill, setBill] = useState(state?.bill); + const tenantId = state?.tenantId || _tenantId || Digit.UserService.getUser().info?.tenantId; + const isLoggedIn = Digit.UserService.getUser() + + + const { data, isLoading } = state?.bill ? { isLoading: false } : Digit.Hooks.useFetchPayment({ tenantId, businessService, consumerCode }); + + let Useruuid = data?.Bill?.[0]?.userId || ""; + let requestCriteria = [ + "/user/_search", + {}, + {data : {uuid:[Useruuid]}}, + { recordId: Useruuid, plainRequestFields: ["mobileNumber"] }, + { + enabled: Useruuid ? true : false, + cacheTime: 100, + } + ] + const { isLoading : isUserLoading, data: userData, revalidate } = Digit.Hooks.useCustomAPIHook(...requestCriteria); + + const billDetails = bill?.billDetails?.sort((a, b) => b.fromPeriod - a.fromPeriod)?.[0] || []; + const Arrears = + bill?.billDetails + ?.sort((a, b) => b.fromPeriod - a.fromPeriod) + ?.reduce((total, current, index) => (index === 0 ? total : total + current.amount), 0) || 0; + + const [paymentType, setPaymentType] = useState(optionFirst); + const [payersName, setPayersName] = useState(""); + const [payersMobileNumber, setPayersMobileNumber] = useState(""); + const { control, handleSubmit } = useForm(); + const [canSubmit, setCanSubmit] = useState(false); + const [mobileNumberError, setmobileNumberError] = useState(null); + const [isCheckBox, setIsCheckBox] = useState(false); + const [isCCFEnabled, setisCCFEnabled] = useState(false); + const [mdmsConfig, setMdmsConfig] = useState(""); + + const { isLoading: citizenConcentFormLoading, data:ccfData } = Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(), "common-masters", [{ name: "CitizenConsentForm" }]); + + function setTermsAndPolicyDetails(e) { + setIsCheckBox(e.target.checked) + } + + const checkDisbaled = () => { + if (isCCFEnabled?.isCitizenConsentFormEnabled && !isLoggedIn?.access_token) { + const isData = paymentType?.code !== optionSecound?.code ? false : userInfo ? false : !canSubmit; + let isEnabled = false + if (!isData && isCheckBox) isEnabled = false; + else isEnabled = true; + return isEnabled; + } else { + return paymentType?.code !== optionSecound?.code ? false : userInfo ? false : !canSubmit + } + } + + useEffect(()=> { + if (ccfData?.["common-masters"]?.CitizenConsentForm?.[0]?.isCitizenConsentFormEnabled) { + setisCCFEnabled(ccfData?.["common-masters"]?.CitizenConsentForm?.[0]) + } + }, [ccfData]); + + const onLinkClick = (e) => { + setMdmsConfig(e.target.id) +} + + const checkLabels = () => { + return + {isCCFEnabled?.checkBoxLabels?.map((data, index) => { + return + {/* {index == 0 && "CCF"} */} + {data?.linkPrefix && {t(`${data?.linkPrefix}_`)}} + {data?.link && { onLinkClick(e) }} style={{ color: "#F47738", cursor: "pointer" }}>{t(`${data?.link}_`)}} + {data?.linkPostfix && {t(`${data?.linkPostfix}_`)}} + {(index == isCCFEnabled?.checkBoxLabels?.length - 1) && t("LABEL")} + + })} + + } + + + useEffect(() => { + if (!bill && data) { + let requiredBill = data?.Bill?.filter((e) => e.consumerCode == consumerCode)[0]; + setBill(requiredBill); + } + }, [isLoading]); + + const onChangePayersMobileNumber = (e) => { + setmobileNumberError(null); + let validation = "^\\d{10}$"; + if (!e.match(validation)) { + setmobileNumberError("CORE_COMMON_PHONENO_INVALIDMSG"); + setCanSubmit(false); + } + setPayersMobileNumber(e); + + e.length == 10 && payersName != "" ? setCanSubmit(true) : setCanSubmit(false); + }; + + const onChangePayersName = (value) => { + setPayersName(value); + value.length !== 0 && mobileNumberError != "CORE_COMMON_PHONENO_INVALIDMSG" && payersName != "" && payersMobileNumber != "" ? setCanSubmit(true) : setCanSubmit(false); + }; + + const onSubmit = () => { + if(wrkflow === "WNS") + { + history.push(`/${window?.contextPath}/citizen/payment/collect/${businessService}/${consumerCode}?workflow=WNS&consumerCode=${stringReplaceAll(consumerCode, "+", "/")}`, { + paymentAmount: paymentAmt, + tenantId: billDetails.tenantId, + name: paymentType?.code !== optionSecound?.code && ConsumerName !== "undefined" ? ConsumerName : userInfo ? payersActiveName : payersName, + mobileNumber: paymentType?.code !== optionSecound?.code ? (bill?.mobileNumber?.includes("*") ? userData?.user?.[0]?.mobileNumber : bill?.mobileNumber ) : userInfo ? payersActiveMobileNumber : payersMobileNumber, + }); + } + else{ + history.push(`/${window?.contextPath}/citizen/payment/collect/${businessService}/${consumerCode}`, { + paymentAmount: paymentAmt, + tenantId: billDetails.tenantId, + name: paymentType?.code !== optionSecound?.code ? bill?.payerName : userInfo ? payersActiveName : payersName, + mobileNumber: paymentType?.code !== optionSecound?.code ? (bill?.mobileNumber?.includes("*") ? userData?.user?.[0]?.mobileNumber : bill?.mobileNumber ) : userInfo ? payersActiveMobileNumber : payersMobileNumber, + }); + } + }; + + if (isLoading || isUserLoading || citizenConcentFormLoading) { + return ; + } + + return ( + + {t("CS_COMMON_BACK")} +
+ {/*
{t("PAYMENT_CS_HEADER")}
*/} +
{t("PT_PAYERS_DETAILS_HEADER")}
+ + {t(mobileNumberError)} + +
+ {paymentType?.code !== optionFirst?.code && !userInfo ? ( +
+ + {t("PT_PAYERS_MOBILE_NO")} + + + + {t("PT_PAYERS_NAME")} + onChangePayersName(e.target.value)} + value={payersName} + /> + +
+ ) : null} +
+ + {isCCFEnabled?.isCitizenConsentFormEnabled && !isLoggedIn?.access_token &&
+ + + +
} + + +
+
+
+ ); +}; + +export default SelectPaymentType; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/payment-type/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/payment-type/index.js new file mode 100644 index 00000000000..0bac57d4a66 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/payment-type/index.js @@ -0,0 +1,144 @@ +import React, { useEffect, useState } from "react"; +import { + Header, + Card, + RadioButtons, + SubmitBar, + BackButton, + CardLabel, + CardLabelDesc, + CardSectionHeader, + InfoBanner, + Loader, + Toast, + CardText, +} from "@egovernments/digit-ui-react-components"; +import { useTranslation } from "react-i18next"; +import { useForm, Controller } from "react-hook-form"; +import { useParams, useHistory, useLocation, Redirect } from "react-router-dom"; +import { stringReplaceAll } from "../bills/routes/bill-details/utils"; + +export const SelectPaymentType = (props) => { + const { state = {} } = useLocation(); + const userInfo = Digit.UserService.getUser(); + const [showToast, setShowToast] = useState(null); + const { tenantId: __tenantId, authorization, workflow: wrkflow , consumerCode : connectionNo } = Digit.Hooks.useQueryParams(); + const paymentAmount = state?.paymentAmount; + const { t } = useTranslation(); + const history = useHistory(); + const { pathname, search } = useLocation(); + // const menu = ["AXIS"]; + let { consumerCode, businessService } = useParams(); + const tenantId = state?.tenantId || __tenantId || Digit.ULBService.getCurrentTenantId(); + const propertyId = state?.propertyId; + const stateTenant = Digit.ULBService.getStateId(); + const { control, handleSubmit } = useForm(); + const { data: menu, isLoading } = Digit.Hooks.useCommonMDMS(stateTenant, "DIGIT-UI", "PaymentGateway"); + const { data: paymentdetails, isLoading: paymentLoading } = Digit.Hooks.useFetchPayment( + { tenantId: tenantId, consumerCode: wrkflow === "WNS" ? connectionNo : consumerCode, businessService }, + {} + ); + if (window.location.href.includes("ISWSCON") || wrkflow === "WNS") consumerCode = decodeURIComponent(consumerCode); + if( wrkflow === "WNS") consumerCode = stringReplaceAll(consumerCode,"+","/") + useEffect(() => { + if (paymentdetails?.Bill && paymentdetails.Bill.length == 0) { + setShowToast({ key: true, label: "CS_BILL_NOT_FOUND" }); + } + }, [paymentdetails]); + useEffect(() => { + localStorage.setItem("BillPaymentEnabled", "true"); + }, []); + const { name, mobileNumber } = state; + + const billDetails = paymentdetails?.Bill ? paymentdetails?.Bill[0] : {}; + + const onSubmit = async (d) => { + const filterData = { + Transaction: { + tenantId: billDetails?.tenantId, + txnAmount: paymentAmount || billDetails.totalAmount, + module: businessService, + billId: billDetails.id, + consumerCode: consumerCode, + productInfo: "Common Payment", + gateway: d.paymentType, + taxAndPayments: [ + { + billId: billDetails.id, + amountPaid: paymentAmount || billDetails.totalAmount, + }, + ], + user: { + name: (name || userInfo?.info?.name || billDetails?.payerName).trim(), + mobileNumber: mobileNumber || userInfo?.info?.mobileNumber || billDetails?.mobileNumber, + tenantId: billDetails?.tenantId, + }, + // success + callbackUrl: window.location.href.includes("mcollect") || wrkflow === "WNS" + ? `${window.location.protocol}//${window.location.host}/${window?.contextPath}/citizen/payment/success/${businessService}/${wrkflow === "WNS"? encodeURIComponent(consumerCode):consumerCode}/${tenantId}?workflow=${wrkflow === "WNS"? wrkflow : "mcollect"}` + : `${window.location.protocol}//${window.location.host}/${window?.contextPath}/citizen/payment/success/${businessService}/${wrkflow === "WNS"? encodeURIComponent(consumerCode):consumerCode}/${tenantId}?propertyId=${propertyId}`, + additionalDetails: { + isWhatsapp: false, + }, + }, + }; + + try { + const data = await Digit.PaymentService.createCitizenReciept(billDetails?.tenantId, filterData); + const redirectUrl = data?.Transaction?.redirectUrl; + window.location = redirectUrl; + } catch (error) { + let messageToShow = "CS_PAYMENT_UNKNOWN_ERROR_ON_SERVER"; + if (error.response?.data?.Errors?.[0]) { + const { code, message } = error.response?.data?.Errors?.[0]; + messageToShow = code; + } + setShowToast({ key: true, label: t(messageToShow) }); + } + }; + + if (authorization === "true" && !userInfo.access_token) { + localStorage.clear(); + sessionStorage.clear(); + window.location.href = `/${window?.contextPath}/citizen/login?from=${encodeURIComponent(pathname + search)}`; + } + + if (isLoading || paymentLoading) { + return ; + } + + return ( + + {t("CS_COMMON_BACK")} +
+
{t("PAYMENT_CS_HEADER")}
+ +
+ {t("PAYMENT_CS_TOTAL_AMOUNT_DUE")} + ₹ { paymentAmount !== undefined ? Number(paymentAmount).toFixed(2) : Number(billDetails?.totalAmount).toFixed(2)} +
+ {t("PAYMENT_CS_SELECT_METHOD")} + {menu?.length && ( + } + /> + )} + {!showToast && } +
+
+ + {showToast && ( + { + setShowToast(null); + }} + /> + )} +
+ ); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/response/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/response/index.js new file mode 100644 index 00000000000..9cc35b94fa6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/citizen/response/index.js @@ -0,0 +1,426 @@ +import { Banner, Card, CardText, Loader, Row, StatusTable, SubmitBar, DownloadPrefixIcon } from "@egovernments/digit-ui-react-components"; +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { useQueryClient } from "react-query"; +import { Link, useParams } from "react-router-dom"; + +export const SuccessfulPayment = (props)=>{ + if(localStorage.getItem("BillPaymentEnabled")!=="true"){ + window.history.forward(); + return null; + } + return +} + + + const WrapPaymentComponent = (props) => { + const { t } = useTranslation(); + const queryClient = useQueryClient(); + const { eg_pg_txnid: egId, workflow: workflw, propertyId } = Digit.Hooks.useQueryParams(); + const [printing, setPrinting] = useState(false); + const [allowFetchBill, setallowFetchBill] = useState(false); + const { businessService: business_service, consumerCode, tenantId } = useParams(); + const { data: bpaData = {}, isLoading: isBpaSearchLoading, isSuccess: isBpaSuccess, error: bpaerror } = Digit?.Hooks?.obps?.useOBPSSearch( + "", {}, tenantId, { applicationNo: consumerCode }, {}, {enabled:(window.location.href.includes("bpa") || window.location.href.includes("BPA"))} + )||{}; + + const { isLoading, data, isError } = Digit.Hooks.usePaymentUpdate({ egId }, business_service, { + retry: false, + staleTime: Infinity, + refetchOnWindowFocus: false, + }); + + const { label } = Digit.Hooks.useApplicationsForBusinessServiceSearch({ businessService: business_service }, { enabled: false }); + + // const { data: demand } = Digit.Hooks.useDemandSearch( + // { consumerCode, businessService: business_service }, + // { enabled: !isLoading, retry: false, staleTime: Infinity, refetchOnWindowFocus: false } + // ); + + // const { data: billData, isLoading: isBillDataLoading } = Digit.Hooks.useFetchPayment( + // { tenantId, consumerCode, businessService: business_service }, + // { enabled: allowFetchBill, retry: false, staleTime: Infinity, refetchOnWindowFocus: false } + // ); + + const { data: reciept_data, isLoading: recieptDataLoading } = Digit.Hooks.useRecieptSearch( + { + tenantId, + businessService: business_service, + receiptNumbers: data?.payments?.Payments?.[0]?.paymentDetails[0].receiptNumber, + }, + { + retry: false, + staleTime: Infinity, + refetchOnWindowFocus: false, + select: (dat) => { + return dat.Payments[0]; + }, + enabled: allowFetchBill, + } + ); + + const { data: generatePdfKey } = Digit.Hooks.useCommonMDMS(tenantId, "common-masters", "ReceiptKey", { + select: (data) => + data["common-masters"]?.uiCommonPay?.filter(({ code }) => business_service?.includes(code))[0]?.receiptKey || "consolidatedreceipt", + retry: false, + staleTime: Infinity, + refetchOnWindowFocus: false, + }); + + const payments = data?.payments; + + useEffect(() => { + return () => { + localStorage.setItem("BillPaymentEnabled","false") + queryClient.clear(); + }; + }, []); + + useEffect(() => { + if (data && data.txnStatus && data.txnStatus !== "FAILURE") { + setallowFetchBill(true); + } + }, [data]); + + if (isLoading || recieptDataLoading) { + return ; + } + + const applicationNo = data?.applicationNo; + + const isMobile = window.Digit.Utils.browser.isMobile(); + + + if (isError || !payments || !payments.Payments || payments.Payments.length === 0 || data.txnStatus === "FAILURE") { + return ( + + + {t("CS_PAYMENT_FAILURE_MESSAGE")} + {!(business_service?.includes("PT")) ? ( + + + + ) : ( + + + + +
+ {t("CORE_COMMON_GO_TO_HOME")} +
+
+ )} +
+ ); + } + + const paymentData = data?.payments?.Payments[0]; + const amount = reciept_data?.paymentDetails?.[0]?.totalAmountPaid; + const transactionDate = paymentData?.transactionDate; + const printCertificate = async () => { + //const tenantId = Digit.ULBService.getCurrentTenantId(); + const state = tenantId; + const applicationDetails = await Digit.TLService.search({ applicationNumber: consumerCode, tenantId }); + const generatePdfKeyForTL = "tlcertificate"; + + if (applicationDetails) { + let response = await Digit.PaymentService.generatePdf(state, { Licenses: applicationDetails?.Licenses }, generatePdfKeyForTL); + const fileStore = await Digit.PaymentService.printReciept(state, { fileStoreIds: response.filestoreIds[0] }); + window.open(fileStore[response.filestoreIds[0]], "_blank"); + } + }; + + const printReciept = async () => { + if (printing) return; + setPrinting(true); + const tenantId = paymentData?.tenantId; + const state = Digit.ULBService.getStateId(); + let response = { filestoreIds: [payments.Payments[0]?.fileStoreId] }; + if (!paymentData?.fileStoreId) { + response = await Digit.PaymentService.generatePdf(state, { Payments: [payments.Payments[0]] }, generatePdfKey); + } + const fileStore = await Digit.PaymentService.printReciept(state, { fileStoreIds: response.filestoreIds[0] }); + if (fileStore && fileStore[response.filestoreIds[0]]) { + window.open(fileStore[response.filestoreIds[0]], "_blank"); + } + setPrinting(false); + }; + + const convertDateToEpoch = (dateString, dayStartOrEnd = "dayend") => { + //example input format : "2018-10-02" + try { + const parts = dateString.match(/(\d{4})-(\d{1,2})-(\d{1,2})/); + const DateObj = new Date(Date.UTC(parts[1], parts[2] - 1, parts[3])); + DateObj.setMinutes(DateObj.getMinutes() + DateObj.getTimezoneOffset()); + if (dayStartOrEnd === "dayend") { + DateObj.setHours(DateObj.getHours() + 24); + DateObj.setSeconds(DateObj.getSeconds() - 1); + } + return DateObj.getTime(); + } catch (e) { + return dateString; + } + }; + + const printPdf = (blob) => { + const fileURL = URL.createObjectURL(blob); + var myWindow = window.open(fileURL); + if (myWindow != undefined) { + myWindow.addEventListener("load", (event) => { + myWindow.focus(); + myWindow.print(); + }); + } + }; + + const downloadPdf = (blob, fileName) => { + if (window.mSewaApp && window.mSewaApp.isMsewaApp() && window.mSewaApp.downloadBase64File) { + var reader = new FileReader(); + reader.readAsDataURL(blob); + reader.onloadend = function () { + var base64data = reader.result; + mSewaApp.downloadBase64File(base64data, fileName); + }; + } else { + const link = document.createElement("a"); + // create a blobURI pointing to our Blob + link.href = URL.createObjectURL(blob); + link.download = fileName; + // some browser needs the anchor to be in the doc + document.body.append(link); + link.click(); + link.remove(); + // in case the Blob uses a lot of memory + setTimeout(() => URL.revokeObjectURL(link.href), 7000); + } + }; + + const getPermitOccupancyOrderSearch = async(order, mode="download") => { + let queryObj = { applicationNo: bpaData?.[0]?.applicationNo }; + let bpaResponse = await Digit.OBPSService.BPASearch(bpaData?.[0]?.tenantId, queryObj); + const edcrResponse = await Digit.OBPSService.scrutinyDetails(bpaData?.[0]?.tenantId, { edcrNumber: bpaData?.[0]?.edcrNumber }); + let bpaDataDetails = bpaResponse?.BPA?.[0], edcrData = edcrResponse?.edcrDetail?.[0]; + let currentDate = new Date(); + bpaDataDetails.additionalDetails.runDate = convertDateToEpoch( + currentDate.getFullYear() + "-" + (currentDate.getMonth() + 1) + "-" + currentDate.getDate() + ); + let reqData = { ...bpaDataDetails, edcrDetail: [{ ...edcrData }] }; + let response = await Digit.PaymentService.generatePdf(bpaDataDetails?.tenantId, { Bpa: [reqData] }, order); + const fileStore = await Digit.PaymentService.printReciept(bpaDataDetails?.tenantId, { fileStoreIds: response.filestoreIds[0] }); + window.open(fileStore[response?.filestoreIds[0]], "_blank"); + + reqData["applicationType"] = bpaDataDetails?.additionalDetails?.applicationType; + let edcrresponse = await Digit.OBPSService.edcr_report_download({ BPA: { ...reqData } }); + const responseStatus = parseInt(edcrresponse.status, 10); + if (responseStatus === 201 || responseStatus === 200) { + mode == "print" + ? printPdf(new Blob([edcrresponse.data], { type: "application/pdf" })) + : downloadPdf(new Blob([edcrresponse.data], { type: "application/pdf" }), `edcrReport.pdf`); + } + }; + + const getBillingPeriod = (billDetails) => { + const { taxPeriodFrom, taxPeriodTo, fromPeriod, toPeriod } = billDetails || {}; + if (taxPeriodFrom && taxPeriodTo) { + let from = new Date(taxPeriodFrom).getFullYear().toString(); + let to = new Date(taxPeriodTo).getFullYear().toString(); + return "FY " + from + "-" + to; + } else if (fromPeriod && toPeriod) { + if (workflw === "mcollect") { + let from = + new Date(fromPeriod).getDate().toString() + + " " + + Digit.Utils.date.monthNames[new Date(fromPeriod).getMonth() ].toString() + + " " + + new Date(fromPeriod).getFullYear().toString(); + let to = + new Date(toPeriod).getDate() + + " " + + Digit.Utils.date.monthNames[new Date(toPeriod).getMonth()] + + " " + + new Date(toPeriod).getFullYear(); + return from + " - " + to; + } + else if(workflw === "WNS") + { + let from = + new Date(fromPeriod).getDate().toString() + + "/" + + (new Date(fromPeriod).getMonth() + 1).toString() + + "/" + + new Date(fromPeriod).getFullYear().toString(); + let to = + new Date(toPeriod).getDate() + + "/" + + (new Date(toPeriod).getMonth() + 1) + + "/" + + new Date(toPeriod).getFullYear(); + return from + " - " + to; + } + let from = new Date(fromPeriod).getFullYear().toString(); + let to = new Date(toPeriod).getFullYear().toString(); + return "FY " + from + "-" + to; + } else return "N/A"; + }; + + let bannerText; + if (workflw) { + bannerText = `CITIZEN_SUCCESS_UC_PAYMENT_MESSAGE`; + } else { + if (paymentData?.paymentDetails?.[0]?.businessService && paymentData?.paymentDetails?.[0]?.businessService?.includes("BPA")) { + let nameOfAchitect = sessionStorage.getItem("BPA_ARCHITECT_NAME"); + let parsedArchitectName = nameOfAchitect ? JSON.parse(nameOfAchitect) : "ARCHITECT"; + bannerText = `CITIZEN_SUCCESS_${paymentData?.paymentDetails[0]?.businessService.replace(/\./g, "_")}_${parsedArchitectName}_PAYMENT_MESSAGE`; + } else if (business_service?.includes("WS") || business_service?.includes("SW")) { + bannerText = t(`CITIZEN_SUCCESS_${paymentData?.paymentDetails[0].businessService.replace(/\./g, "_")}_WS_PAYMENT_MESSAGE`); + } else { + bannerText = paymentData?.paymentDetails[0]?.businessService ? `CITIZEN_SUCCESS_${paymentData?.paymentDetails[0]?.businessService.replace(/\./g, "_")}_PAYMENT_MESSAGE` : t("CITIZEN_SUCCESS_UC_PAYMENT_MESSAGE"); + } + } + + // https://dev.digit.org/collection-services/payments/FSM.TRIP_CHARGES/_search?tenantId=pb.amritsar&consumerCodes=107-FSM-2021-02-18-063433 + + // if (billDataLoading) return ; + + const rowContainerStyle = { + padding: "4px 0px", + justifyContent: "space-between", + }; + + const ommitRupeeSymbol = ["PT"].includes(business_service); + + if ((window.location.href.includes("bpa") || window.location.href.includes("BPA")) && isBpaSearchLoading) return + + return ( + + + + + } + message={t("CS_COMMON_PAYMENT_COMPLETE")} + info={t("CS_COMMON_RECIEPT_NO")} + applicationNumber={paymentData?.paymentDetails[0].receiptNumber} + successful={true} + /> + {t(`${bannerText}_DETAIL`)} + + + {/** TODO : move this key and value into the hook based on business Service */} + {(business_service === "PT" || workflw) && ( + + )} + + {(business_service === "PT" || workflw) && ( + + )} + + + + {(business_service !== "PT" || workflw) && ( + + )} + +
+ {business_service == "TL" ? ( +
+ + + + + {t("TL_RECEIPT")} +
+ ) : null} + {business_service == "TL" ? ( +
+ + + + + {t("TL_CERTIFICATE")} +
+ ) : null} + {bpaData?.[0]?.businessService === "BPA_OC" && (bpaData?.[0]?.status==="APPROVED" || bpaData?.[0]?.status==="PENDING_SANC_FEE_PAYMENT") ? ( +
getPermitOccupancyOrderSearch("occupancy-certificate")}> + + {t("BPA_OC_CERTIFICATE")} +
+ ) : null} + {bpaData?.[0]?.businessService === "BPA_LOW" ? ( +
getPermitOccupancyOrderSearch("buildingpermit-low")}> + + {t("BPA_PERMIT_ORDER")} +
+ ) : null} + {bpaData?.[0]?.businessService === "BPA" && (bpaData?.[0]?.businessService !== "BPA_LOW") && (bpaData?.[0]?.businessService !== "BPA_OC") && (bpaData?.[0]?.status==="PENDING_SANC_FEE_PAYMENT" || bpaData?.[0]?.status==="APPROVED")? ( +
getPermitOccupancyOrderSearch("buildingpermit")}> + + {t("BPA_PERMIT_ORDER")} +
+ ) : null} +
+ {business_service?.includes("PT") &&
+ +
} + {business_service?.includes("PT") ? ( +
+ {t("CS_DOWNLOAD_RECEIPT")} +
+ ) : null} + {!(business_service == "TL") || !(business_service?.includes("PT")) && } + {!(business_service == "TL") || !(business_service?.includes("PT")) && ( +
+ {t("CORE_COMMON_GO_TO_HOME")} +
+ )} + {business_service == "TL" && ( + + + + )} +
+ ); +}; + +export const FailedPayment = (props) => { + const { addParams, clearParams } = props; + const { t } = useTranslation(); + const { consumerCode } = useParams(); + + const getMessage = () => "Failure !"; + return ( + + + {t("ES_COMMON_TRACK_COMPLAINT_TEXT")} + + ); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/employee/IFrameInterface/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/employee/IFrameInterface/index.js new file mode 100644 index 00000000000..28bc48cb6c3 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/modules/common/src/payments/employee/IFrameInterface/index.js @@ -0,0 +1,51 @@ +import { Header, Loader } from "@egovernments/digit-ui-react-components"; +import React, { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { useParams } from "react-router-dom"; + + +const IFrameInterface = (props) => { + const { stateCode } = props; + const { moduleName, pageName } = useParams(); + + const { t } = useTranslation(); + const [url, setUrl] = useState(""); + const [title, setTitle] = useState(""); + + const { data, isLoading } = Digit.Hooks.dss.useMDMS(stateCode, "common-masters", ["uiCommonConstants"], { + select: (data) => { + let formattedResponse = data?.["common-masters"]?.["uiCommonConstants"]?.[0] || {}; + return formattedResponse; + }, + enabled: true, + }); + + useEffect(() => { + const pageObject = data?.[moduleName]?.["iframe-routes"]?.[pageName] || {}; + const isOrign = pageObject?.["isOrigin"] || false; + const domain = isOrign ? (process.env.NODE_ENV === "development" ? "https://qa.digit.org" : document.location.origin) : pageObject?.["domain"]; + const contextPath = pageObject?.["routePath"] || ""; + const title = pageObject?.["title"] || ""; + let url = `${domain}${contextPath}`; + setUrl(url); + setTitle(title); + }, [data, moduleName, pageName]); + + if (isLoading) { + return ; + } + + if (!url) { + return
No Iframe To Load
; + } + return ( + +
{t(title)}
+
+ +
: +
+ {t("COMMON_URL_NOT_FOUND")} +
} + + : null} +
+ ); +}; + +export default CitizenConsentForm; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CitizenHomeCard.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CitizenHomeCard.js new file mode 100644 index 00000000000..1f131101dbe --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CitizenHomeCard.js @@ -0,0 +1,26 @@ +import React from "react"; +import { Link } from "react-router-dom"; + +const CitizenHomeCard = ({ header, links = [], state, Icon, Info, isInfo = false, styles }) => { + return ( +
+
+

{header}

+ +
+ +
+ {links.map((e, i) => ( +
+ + {e.i18nKey} + +
+ ))} +
+
{isInfo ? : null}
+
+ ); +}; + +export default CitizenHomeCard; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CitizenInfoLabel.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CitizenInfoLabel.js new file mode 100644 index 00000000000..652146cf887 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CitizenInfoLabel.js @@ -0,0 +1,22 @@ +import React from "react"; +import { InfoBannerIcon } from "./svgindex"; + +const CitizenInfoLabel = (props) => { + //if type is "component", then props will come from props?.props. + //if the component has props passed directly, then props will be used. + props = props?.props ? props?.props : props; + const showInfo = props?.showInfo ? props?.showInfo : true; + + return ( +
+ {showInfo &&
+ +

{props?.info}

+
+ } +

{props?.text}

+
+ ); +}; + +export default CitizenInfoLabel; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CollapseAndExpandGroups.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CollapseAndExpandGroups.js new file mode 100644 index 00000000000..473440b077f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CollapseAndExpandGroups.js @@ -0,0 +1,46 @@ +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { SVG } from "./SVG"; +import PropTypes from "prop-types"; + +const CollapseAndExpandGroups = ({ children, groupElements = false, groupHeader = "", headerLabel = "", headerValue = "", customClass = "" ,showHelper=false,collapseState=false}) => { + const { t } = useTranslation(); + const [collapse, setCollapse] = useState(collapseState); + return ( +
+ {groupHeader &&
{t(groupHeader)}
} + {groupElements && ( +
+ {headerLabel} + {headerValue} +
setCollapse((prev) => !prev)} className="digit-icon-toggle "> + {!collapse && ( + + {showHelper&&
{t("COMMON_CORE_COLLAPSE")}
} + +
+ )} + {collapse && ( + + {showHelper&&
{t("COMMON_CORE_EXPAND")}
} + +
+ )} +
+
+ )} +
{children}
+
+ ); +}; + +CollapseAndExpandGroups.propTypes = { + children: PropTypes.node, + style: PropTypes.object, + customClass: PropTypes.string, + groupElements: PropTypes.bool, + groupHeader: PropTypes.string, + headerLabel: PropTypes.string, + headerValue: PropTypes.string, +}; +export default CollapseAndExpandGroups; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ConnectingCheckPoints.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ConnectingCheckPoints.js new file mode 100644 index 00000000000..b2e4fa88ad2 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ConnectingCheckPoints.js @@ -0,0 +1,59 @@ +import React from "react"; +import PropTypes from "prop-types"; + +export const CheckPoint = (props) => { + return ( +
+

+
+ {props.label} + {props.info ?

{props.info}

: null} + {props.customChild ? props.customChild : null} +
+
+ ); +}; + +export const ConnectingCheckPoints = (props) => { + if (props.children && props.children.length >= 1) { + return ( + + {props.children.map((child, index) => { + return props.children.length === ++index ? ( +
{child}
+ ) : ( +
+ {child} +
+
+ ); + })} +
+ ); + } else { + return null; + } +}; + +CheckPoint.propTypes = { + /** + * Is checkpoint completed or not? + */ + isCompleted: PropTypes.bool, + /** + * key value + */ + key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + /** + * checkpoint content + */ + label: PropTypes.string, + info: PropTypes.string, +}; + +CheckPoint.defaultProps = { + isCompleted: false, + key: 0, + label: "", + info: "", +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ConnectingCheckPoints.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ConnectingCheckPoints.stories.js new file mode 100644 index 00000000000..72a8513e99c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ConnectingCheckPoints.stories.js @@ -0,0 +1,19 @@ +import React from "react"; + +import { CheckPoint } from "./ConnectingCheckPoints"; + +export default { + title: "Atom/CheckPoint", + component: CheckPoint, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + isCompleted: true, + key: 234234, + label: "First checkpoint", + info: "This is the first checkpoint", +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CustomButton.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CustomButton.js new file mode 100644 index 00000000000..a1ba8a10b8f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/CustomButton.js @@ -0,0 +1,13 @@ +import React from "react"; + +const CustomButton = ({ text, onClick, selected }) => { + return ( + + + + ); +}; + +export default CustomButton; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DatePicker.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DatePicker.js new file mode 100644 index 00000000000..6436ffed23b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DatePicker.js @@ -0,0 +1,72 @@ +import React, { useState, useRef } from "react"; +import { CalendarIcon } from "../atoms/svgindex"; +import PropTypes from "prop-types"; + +const DatePicker = (props) => { + // const [date, setDate] = useState(() => props.initialDate || null); + const dateInp = useRef(); + + function defaultFormatFunc(date) { + if (date) { + const operationDate = typeof date === "string" ? new Date(date) : date; + const years = operationDate?.getFullYear(); + const month = operationDate?.getMonth() + 1; + const _date = operationDate?.getDate(); + return _date && month && years ? `${_date}/${month}/${years}` : ""; + } + return ""; + } + + const getDatePrint = () => props?.formattingFn?.(props?.date) || defaultFormatFunc(props?.date); + const selectDate = (e) => { + const date = e.target.value; + // setDate(date); + props?.onChange?.(date); + }; + let addStyle = {}; + if (Digit.UserService.getType() === "citizen") { + addStyle = { maxWidth: "540px" }; + } + return ( +
+ + {/* + */} + + +
+ ); +}; + +DatePicker.propTypes = { + disabled: PropTypes.bool, + date: PropTypes.any, + min: PropTypes.any, + max: PropTypes.any, + defaultValue: PropTypes.any, + onChange: PropTypes.func, +}; + +export default DatePicker; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DateWrap.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DateWrap.js new file mode 100644 index 00000000000..9f0fbed244f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DateWrap.js @@ -0,0 +1,25 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { Calender } from "./svgindex"; + +const DateWrap = (props) => { + return ( +
+ +

{props.date}

+
+ ); +}; + +DateWrap.propTypes = { + /** + * date + */ + date: PropTypes.any, +}; + +DateWrap.defaultProps = { + date: 0, +}; + +export default DateWrap; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DateWrap.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DateWrap.stories.js new file mode 100644 index 00000000000..230abdd47d5 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DateWrap.stories.js @@ -0,0 +1,19 @@ +import React from "react"; + +import DateWrap from "./DateWrap"; + +export default { + title: "Atom/DateWrap", + component: DateWrap, + argTypes: { + date: { control: "date" }, + }, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + date: 1607498172995, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DescriptionText.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DescriptionText.js new file mode 100644 index 00000000000..bd4fa92d8c6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DescriptionText.js @@ -0,0 +1,23 @@ +import React from "react"; +import PropTypes from "prop-types"; + +const DescriptionText = (props) => { + return ( +
+

{props.text}

+
+ ); +}; + +DescriptionText.propTypes = { + /** + * DescriptionText contents + */ + date: PropTypes.string, +}; + +DescriptionText.defaultProps = { + text: "", +}; + +export default DescriptionText; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DescriptionText.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DescriptionText.stories.js new file mode 100644 index 00000000000..7c996644594 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DescriptionText.stories.js @@ -0,0 +1,16 @@ +import React from "react"; + +import DescriptionText from "./DescriptionText"; + +export default { + title: "Atom/DescriptionText", + component: DescriptionText, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + text: "This is the description", +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DisplayPhotos.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DisplayPhotos.js new file mode 100644 index 00000000000..c08c85899d3 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DisplayPhotos.js @@ -0,0 +1,43 @@ +import React from "react"; +import PropTypes from "prop-types"; +import {PDFSvg} from "./svgindex" + +const ImageOrPDFIcon = ({source, index, last=false, onClick}) => { + return Digit.Utils.getFileTypeFromFileStoreURL(source) === "pdf" ? + + : + issue thumbnail onClick(source, index)}> +} + +const DisplayPhotos = (props) => { + return ( +
+ {props.srcs.map((source, index) => { + return + })} +
+ ); +}; + +DisplayPhotos.propTypes = { + /** + * images + */ + srcs: PropTypes.array, + /** + * optional click handler + */ + onClick: PropTypes.func, +}; + +DisplayPhotos.defaultProps = { + srcs: [], +}; + +export default DisplayPhotos; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DisplayPhotos.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DisplayPhotos.stories.js new file mode 100644 index 00000000000..9946593f32d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/DisplayPhotos.stories.js @@ -0,0 +1,20 @@ +import React from "react"; + +import DisplayPhotos from "./DisplayPhotos"; + +export default { + title: "Atom/DisplayPhotos", + component: DisplayPhotos, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + srcs: [ + "https://randomwordgenerator.com/img/picture-generator/5ee6d1454b53b10ff3d8992cc12c30771037dbf85254794e722679d49445_640.jpg", + "https://randomwordgenerator.com/img/picture-generator/55e3d1404351ab14f1dc8460962e33791c3ad6e04e507440762a7cd49348cc_640.jpg", + "https://randomwordgenerator.com/img/picture-generator/57e0d1444250a414f1dc8460962e33791c3ad6e04e50744077297bd59445c2_640.jpg", + ], +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.js new file mode 100644 index 00000000000..9958174f10d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.js @@ -0,0 +1,295 @@ +import PropTypes from "prop-types"; +import React, { useEffect, useRef, useState } from "react"; +import { ArrowDown,SearchIcon } from "./svgindex"; + +const TextField = (props) => { + const [value, setValue] = useState(props.selectedVal ? props.selectedVal : ""); + + useEffect(() => { + if (!props.keepNull) + if( props.selectedVal) + setValue(props.selectedVal) + else + { setValue(""); props.setFilter("") } + else setValue(""); + }, [props.selectedVal, props.forceSet]); + + function inputChange(e) { + if (props.freeze) return; + + setValue(e.target.value); + props.setFilter(e.target.value); + } + + function broadcastToOpen() { + if (!props.disable) { + props.dropdownDisplay(true); + } + } + + function broadcastToClose() { + props.dropdownDisplay(false); + } + + /* Custom function to scroll and select in the dropdowns while using key up and down */ + const keyChange = (e) => { + if (e.key == "ArrowDown") { + props.setOptionIndex((state) => (state + 1 == props.addProps.length ? 0 : state + 1)); + if (props.addProps.currentIndex + 1 == props.addProps.length) { + e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollTo?.(0, 0); + } else { + props?.addProps?.currentIndex > 2 && e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollBy?.(0, 45); + } + e.preventDefault(); + } else if (e.key == "ArrowUp") { + props.setOptionIndex((state) => (state !== 0 ? state - 1 : props.addProps.length - 1)); + if (props.addProps.currentIndex == 0) { + e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollTo?.(100000, 100000); + } else { + props?.addProps?.currentIndex > 2 && e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollBy?.(0, -45); + } + e.preventDefault(); + } else if (e.key == "Enter") { + props.addProps.selectOption(props.addProps.currentIndex); + e.preventDefault(); + } + }; + + return ( + { + broadcastToClose(); + props?.onBlur?.(e); + if (props.selectedVal !== props.filterVal) { + setTimeout(() => { + props.setforceSet((val) => val + 1); + }, 1000); + } + }} + onKeyDown={keyChange} + readOnly={props.disable} + autoFocus={props.autoFocus} + placeholder={props.placeholder} + autoComplete={"off"} + style={props.style} + /> + ); +}; + +const translateDummy = (text) => { + return text; +}; + +const Dropdown = (props) => { + const user_type = Digit.SessionStorage.get("userType"); + const [dropdownStatus, setDropdownStatus] = useState(false); + const [selectedOption, setSelectedOption] = useState(props.selected ? props.selected : null); + const [filterVal, setFilterVal] = useState(""); + const [forceSet, setforceSet] = useState(0); + const [optionIndex, setOptionIndex] = useState(-1); + const optionRef = useRef(null); + const hasCustomSelector = props.customSelector ? true : false; + const t = props.t || translateDummy; + + useEffect(() => { + setSelectedOption(props.selected); + }, [props.selected]); + + function dropdownSwitch() { + if (!props.disable) { + var current = dropdownStatus; + if (!current) { + document.addEventListener("mousedown", handleClick, false); + } + setDropdownStatus(!current); + props?.onBlur?.(); + } + } + + function handleClick(e) { + if (!optionRef.current || !optionRef.current.contains(e.target)) { + document.removeEventListener("mousedown", handleClick, false); + setDropdownStatus(false); + } + } + + function dropdownOn(val) { + const waitForOptions = () => setTimeout(() => setDropdownStatus(val), 500); + const timerId = waitForOptions(); + return () => { + clearTimeout(timerId); + }; + } + + function onSelect(val) { + if (val !== selectedOption || props.allowMultiselect) { + props.select(val); + setSelectedOption(val); + setDropdownStatus(false); + } else { + setSelectedOption(val); + setforceSet(forceSet + 1); + } + } + + function setFilter(val) { + setFilterVal(val); + } + + let filteredOption = + (props.option && props.option?.filter((option) => t(option[props.optionKey])?.toUpperCase()?.indexOf(filterVal?.toUpperCase()) > -1)) || []; + function selectOption(ind) { + onSelect(filteredOption[ind]); + } + + if(props.isBPAREG && selectedOption) + { + let isSelectedSameAsOptions = props.option?.filter((ob) => ob?.code === selectedOption?.code)?.length > 0; + if(!isSelectedSameAsOptions) setSelectedOption(null) + } + + return ( +
+ {hasCustomSelector && ( +
+ {props.customSelector} + {props.showArrow && } +
+ )} + {!hasCustomSelector && ( +
+ + {props.showSearchIcon ?null:} + {props.showSearchIcon ?:null} +
+ )} + {dropdownStatus ? ( + props.optionKey ? ( +
+ {filteredOption && + filteredOption.map((option, index) => { + return ( +
onSelect(option)} + > + {option.icon && {option.icon} } + {props.isPropertyAssess?
{props.t ? props.t(option[props.optionKey]) : option[props.optionKey]}
: + {props.t ? props.t(option[props.optionKey]) : option[props.optionKey]}} +
+ ); + })} + {filteredOption && filteredOption.length === 0 && ( +
{ + + }}> + { {props.t ? props.t("CMN_NOOPTION") : "CMN_NOOPTION"}} +
+ )} +
+ ) : ( +
+ {props.option + ?.filter((option) => option?.toUpperCase().indexOf(filterVal?.toUpperCase()) > -1) + .map((option, index) => { + return ( +

onSelect(option)} + > + {option} +

+ ); + })} +
+ ) + ) : null} +
+ ); +}; + +Dropdown.propTypes = { + customSelector: PropTypes.any, + showArrow: PropTypes.bool, + selected: PropTypes.any, + style: PropTypes.object, + option: PropTypes.array, + optionKey: PropTypes.any, + select: PropTypes.any, + t: PropTypes.func, +}; + +Dropdown.defaultProps = { + customSelector: null, + showArrow: true, +}; + +export default Dropdown; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.stories.js new file mode 100644 index 00000000000..0898c7e44e2 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Dropdown.stories.js @@ -0,0 +1,18 @@ +import React from "react"; + +import Dropdown from "./Dropdown"; + +export default { + title: "Atom/Dropdown", + component: Dropdown, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + selected: "first", + option: ["first", "second", "third"], + optionKey: 0, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EllipsisMenu.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EllipsisMenu.js new file mode 100644 index 00000000000..a26a49de1da --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EllipsisMenu.js @@ -0,0 +1,33 @@ +import React, { useRef, useState } from "react"; +import { Ellipsis } from "./svgindex"; + +const Menu = ({ menu, displayKey, onSelect }) => ( +
+ {menu.map((item, index) => ( +
onSelect(item)} key={index}> + {item.icon} + {item[displayKey]} +
+ ))} +
+); + +const EllipsisMenu = ({ menuItems, displayKey, onSelect }) => { + const menuRef = useRef(); + const [active, setActive] = useState(false); + Digit.Hooks.useClickOutside(menuRef, () => setActive(false), active); + + function onItemSelect(item) { + setActive(false); + onSelect(item); + } + + return ( +
+ setActive(true)} /> + {active ? : null} +
+ ); +}; + +export default EllipsisMenu; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeAppContainer.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeAppContainer.js new file mode 100644 index 00000000000..3aaed46b4fc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeAppContainer.js @@ -0,0 +1,7 @@ +import React from "react"; + +const EmployeeAppContainer = (props) => { + return
{props.children}
; +}; + +export default EmployeeAppContainer; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeModuleCard.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeModuleCard.js new file mode 100644 index 00000000000..05bb8f8beea --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EmployeeModuleCard.js @@ -0,0 +1,85 @@ +import React, { Fragment } from "react"; +import { ArrowRightInbox } from "./svgindex"; +import { useHistory, useLocation, Link } from "react-router-dom"; + + +const EmployeeModuleCard = ({ Icon, moduleName, kpis = [], links = [], isCitizen = false, className, styles, longModuleName=false }) => { + const history = useHistory(); + + return ( +
+
+
+ {moduleName} + {Icon} +
+
+ {kpis.length !== 0 && ( +
+ {kpis.map(({ count, label, link }, index) => ( +
+
+ {count || "-"} +
+
+ + {link ? history.push(`${link}`,{count})}>{label} : null} +
+
+ ))} +
+ )} +
+ {links.map(({ count, label, link }, index) => ( + + {link ? {label} : null} + {count ? ( + <> + history.push(`${link}`)}>{count || "-"} + + + + + ) : null} + + ))} +
+
+
+
+ ); +}; + +const ModuleCardFullWidth = ({ moduleName, links = [], isCitizen = false, className, styles, headerStyle, subHeader, subHeaderLink }) => { + return ( +
+
+ +
+
+ {links.map(({ count, label, link }, index) => ( + + {link ? (link?.includes(`${window?.contextPath}/`)?{label}:{label}) : null} + + ))} +
+
+
+
+ ); +}; + +export { EmployeeModuleCard, ModuleCardFullWidth }; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ErrorMessage.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ErrorMessage.js new file mode 100644 index 00000000000..c82e041c9fb --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ErrorMessage.js @@ -0,0 +1,25 @@ +import React, { useEffect, useState } from "react"; + +const ErrorMessage = ({ name, formState, formData, config, setError, clearErrors }) => { + useEffect(() => { + const { pattern, errMsg } = config.inputs.find((i) => i.name === name); + const regex = new RegExp(pattern); + if (!regex.test(formData?.[name]) && pattern) { + setError(name, { type: "pattern", message: errMsg }); + } else { + clearErrors(name); + } + }, [formData?.[name]]); + + return ( + + {Object.keys(formState?.dirtyFields)?.includes(name) || formState?.isSubmitted ? ( +

{formState?.errors?.[name].messsage}

+ ) : ( + + )} + + ); +}; + +export default ErrorMessage; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EventCalendarView.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EventCalendarView.js new file mode 100644 index 00000000000..e4f51b632ad --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/EventCalendarView.js @@ -0,0 +1,14 @@ +import React from "react" + +const EventCalendarView = ({onGroundEventMonth, onGroundEventDate}) => { + return
+
+

{onGroundEventMonth}

+
+
+

{onGroundEventDate}

+
+
+} + +export default EventCalendarView \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/GreyOutText.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/GreyOutText.js new file mode 100644 index 00000000000..a099557d896 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/GreyOutText.js @@ -0,0 +1,5 @@ +import React from "react"; + +const GreyOutText = (props) =>
{props.children}
; + +export default GreyOutText; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Hamburger.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Hamburger.js new file mode 100644 index 00000000000..17bf671d683 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Hamburger.js @@ -0,0 +1,10 @@ +import React from "react"; +import { HamburgerIcon } from "./svgindex"; + +const Hamburger = ({ handleClick, color }) => ( + + + +); + +export default Hamburger; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Header.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Header.js new file mode 100644 index 00000000000..9ea57f5a8ad --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Header.js @@ -0,0 +1,11 @@ +import React from "react"; + +const Header = (props) => { + return ( +
+ {props.children} +
+ ); +}; + +export default Header; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HeaderBar.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HeaderBar.js new file mode 100644 index 00000000000..328964c3fdc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HeaderBar.js @@ -0,0 +1,26 @@ +import React from "react"; +import PropTypes from "prop-types"; + +const HeaderBar = (props) => { + return ( +
+ {props.start ?
{props.start}
: null} + {props.main ?
{props.main}
: null} + {props.end ?
{props.end}
: null} +
+ ); +}; + +HeaderBar.propTypes = { + start: PropTypes.any, + main: PropTypes.any, + end: PropTypes.any, +}; + +HeaderBar.defaultProps = { + start: "", + main: "", + end: "", +}; + +export default HeaderBar; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HeaderBar.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HeaderBar.stories.js new file mode 100644 index 00000000000..f9e9cd87430 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HeaderBar.stories.js @@ -0,0 +1,18 @@ +import React from "react"; + +import HeaderBar from "./HeaderBar"; + +export default { + title: "Atom/HeaderBar", + component: HeaderBar, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + start: "First", + main: "Second", + end: "Third", +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HomeLink.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HomeLink.js new file mode 100644 index 00000000000..74bfcee80a0 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HomeLink.js @@ -0,0 +1,21 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { Link } from "react-router-dom"; + +const HomeLink = ({ to, children }) => ( +
+ {children} +
+); + +HomeLink.propTypes = { + to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), + children: PropTypes.string, +}; + +HomeLink.defaultProps = { + to: "#", + children: "Link", +}; + +export default HomeLink; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HomeLink.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HomeLink.stories.js new file mode 100644 index 00000000000..96812f9407d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HomeLink.stories.js @@ -0,0 +1,22 @@ +import React from "react"; +import { BrowserRouter as Router } from "react-router-dom"; + +import HomeLink from "./HomeLink"; + +export default { + title: "Atom/HomeLink", + component: HomeLink, +}; + +const Template = (args) => ( + + + +); + +export const Default = Template.bind({}); + +Default.args = { + to: "https://google.com", + children: "Google", +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HorizontalNav.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HorizontalNav.js new file mode 100644 index 00000000000..ef6a5c26a8d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/HorizontalNav.js @@ -0,0 +1,42 @@ +import React, {useState} from 'react' +import { useTranslation } from 'react-i18next' + + + + +const HorizontalNav = ({ configNavItems, activeLink, setActiveLink, showNav = false, children, customStyle = {}, customClassName = "", inFormComposer = true, navClassName = "", navStyles = {} }) => { + const { t } = useTranslation() + + const setActive = (item) => { + setActiveLink(item.name) + } + + const MenuItem = ({ item }) => { + let itemComponent = item.code; + + const Item = () => ( + +
{t(itemComponent)}
+
+ ); + + return ( + + ); + }; + return ( +
+ {showNav &&
+ {configNavItems?.map((item, index) => ( +
setActive(item)}> + +
+ ))} +
+ } + {children} +
+ ) +} + +export default HorizontalNav \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageUploadHandler.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageUploadHandler.js new file mode 100644 index 00000000000..906d3af5343 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageUploadHandler.js @@ -0,0 +1,112 @@ +import React, { useCallback, useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; +import Toast from "./Toast"; +import UploadImages from "./UploadImages"; + +export const ImageUploadHandler = (props) => { + // const __initImageIds = Digit.SessionStorage.get("PGR_CREATE_IMAGES"); + // const __initThumbnails = Digit.SessionStorage.get("PGR_CREATE_THUMBNAILS"); + const [image, setImage] = useState(null); + const [uploadedImagesThumbs, setUploadedImagesThumbs] = useState(null); + const [uploadedImagesIds, setUploadedImagesIds] = useState(props.uploadedImages); + + const [rerender, setRerender] = useState(1); + const [imageFile, setImageFile] = useState(null); + const [isDeleting, setIsDeleting] = useState(false); + const [error, setError] = useState(""); + + useEffect(() => { + if (image) { + uploadImage(); + } + }, [image]); + + useEffect(() => { + if (!isDeleting) { + (async () => { + if (uploadedImagesIds !== null) { + await submit(); + setRerender(rerender + 1); + props.onPhotoChange(uploadedImagesIds); + } + })(); + } else { + setIsDeleting(false); + } + }, [uploadedImagesIds]); + + useEffect(() => { + if (imageFile && imageFile.size > 2097152) { + setError("File is too large"); + } else { + setImage(imageFile); + } + }, [imageFile]); + + const addUploadedImageIds = useCallback( + (imageIdData) => { + if (uploadedImagesIds === null) { + var arr = []; + } else { + arr = uploadedImagesIds; + } + return [...arr, imageIdData.data.files[0].fileStoreId]; + }, + [uploadedImagesIds] + ); + + function getImage(e) { + setError(null); + setImageFile(e.target.files[0]); + } + + const uploadImage = useCallback(async () => { + const response = await Digit.UploadServices.Filestorage("property-upload", image, props.tenantId); + setUploadedImagesIds(addUploadedImageIds(response)); + }, [addUploadedImageIds, image]); + + function addImageThumbnails(thumbnailsData) { + var keys = Object.keys(thumbnailsData.data); + var index = keys.findIndex((key) => key === "fileStoreIds"); + if (index > -1) { + keys.splice(index, 1); + } + var thumbnails = []; + // if (uploadedImagesThumbs !== null) { + // thumbnails = uploadedImagesThumbs.length > 0 ? uploadedImagesThumbs.filter((thumb) => thumb.key !== keys[0]) : []; + // } + + const newThumbnails = keys.map((key) => { + return { image: thumbnailsData.data[key].split(",")[2], key }; + }); + + setUploadedImagesThumbs([...thumbnails, ...newThumbnails]); + } + + const submit = useCallback(async () => { + if (uploadedImagesIds !== null && uploadedImagesIds.length > 0) { + const res = await Digit.UploadServices.Filefetch(uploadedImagesIds, props.tenantId); + addImageThumbnails(res); + } + }, [uploadedImagesIds]); + + function deleteImage(img) { + setIsDeleting(true); + var deleteImageKey = uploadedImagesThumbs.filter((o, index) => o.image === img); + + var uploadedthumbs = uploadedImagesThumbs; + var newThumbsList = uploadedthumbs.filter((thumbs) => thumbs != deleteImageKey[0]); + + var newUploadedImagesIds = uploadedImagesIds.filter((key) => key !== deleteImageKey[0].key); + setUploadedImagesThumbs(newThumbsList); + setUploadedImagesIds(newUploadedImagesIds); + Digit.SessionStorage.set("PGR_CREATE_IMAGES", newUploadedImagesIds); + } + + return ( + + {error && setError(null)} />} + o.image) : []} /> + + ); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageViewer.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageViewer.js new file mode 100644 index 00000000000..adbf068ea9a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageViewer.js @@ -0,0 +1,24 @@ +import React from "react"; +import PropTypes from "prop-types"; + +const ImageViewer = (props) => { + return ( +
+ + + + + +
+ ); +}; + +ImageViewer.propTypes = { + imageSrc: PropTypes.string, +}; + +ImageViewer.defaultProps = { + imageSrc: "", +}; + +export default ImageViewer; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageViewer.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageViewer.stories.js new file mode 100644 index 00000000000..7cd6864bce1 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/ImageViewer.stories.js @@ -0,0 +1,21 @@ +import React from "react"; +import { BrowserRouter as Router } from "react-router-dom"; + +import ImageViewer from "./ImageViewer"; + +export default { + title: "Atom/ImageViewer", + component: ImageViewer, +}; + +const Template = (args) => ( + + + +); + +export const Default = Template.bind({}); + +Default.args = { + imageSrc: "https://randomwordgenerator.com/img/picture-generator/5ee6d1454b53b10ff3d8992cc12c30771037dbf85254794e722679d49445_640.jpg", +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InboxLinks.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InboxLinks.js new file mode 100644 index 00000000000..0307e267452 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InboxLinks.js @@ -0,0 +1,33 @@ +import React from "react" +import Card from "../atoms/Card" +import { useTranslation } from "react-i18next"; +import { Link } from "react-router-dom"; + +const InboxLinks = ({logoIcon, headerText, links, customClass}) => { + + const { t } = useTranslation(); + + const GetLogo = () =>
+ + {logoIcon} + {" "} + {t(headerText)} +
+ + return +
+ {GetLogo()} +
+ {links.map(({ link, text, hyperlink = false, accessTo = [] }, index) => { + return ( + + {hyperlink ? {t(text)} : {t(text)}} + + ); + })} +
+
+
+} + +export default InboxLinks \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InboxSearchLinks.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InboxSearchLinks.js new file mode 100644 index 00000000000..9d340be0190 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InboxSearchLinks.js @@ -0,0 +1,43 @@ +import React, { useState, useEffect } from "react" +import { useTranslation } from "react-i18next"; +import { Link } from "react-router-dom"; +import { PropertyHouse, BioMetricIcon,WorksMgmtIcon} from "./svgindex"; + +const getIconComponent = (iconName="")=>{ + return require("@egovernments/digit-ui-react-components")?.[iconName]; +} + +const InboxSearchLinks = ({headerText, links, businessService, customClass="", logoIcon}) => { + + const { t } = useTranslation(); + const { roles: userRoles } = Digit.UserService.getUser().info; + const [linksToShow, setLinksToShow] = useState([]); + const IconComponent=getIconComponent(logoIcon?.component); + useEffect(() => { + let linksToShow = links.filter(({ roles }) => roles.some((role) => userRoles.map(({ code }) => code).includes(role)) || !roles?.length); + setLinksToShow(linksToShow); + }, []); + const renderHeader = () =>
+ + {logoIcon?.component && IconComponent && } + + {t(headerText)} +
+ return ( +
+ ) + +} + +export default InboxSearchLinks; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InfoBanner.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InfoBanner.js new file mode 100644 index 00000000000..a56e96e8f0e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InfoBanner.js @@ -0,0 +1,16 @@ +import React from "react"; +import { ErrorSvg, InfoBannerIcon } from "./svgindex"; + +const InfoBanner = ({ label, text }) => { + return ( +
+
+ +

{label}

+
+

{text}

+
+ ); +}; + +export default InfoBanner; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InputTextAmount.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InputTextAmount.js new file mode 100644 index 00000000000..48d6bc940dd --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/InputTextAmount.js @@ -0,0 +1,408 @@ +import TextInput from "./TextInput"; + +import React, { forwardRef, useImperativeHandle, useMemo, useRef, useEffect, useState } from "react"; +import { + cleanValue, + fixedDecimalValue, + formatValue, + getLocaleConfig, + getIntlConfig, + getSuffix, + isNumber, + padTrimValue, + repositionCursor, +} from "./amtUtils"; + +/* Amount component by default round offs and formats for amount */ + +const InputTextAmount = ({ value, prefix = "₹ ",intlConfig = getIntlConfig(prefix), onChange, inputRef,...otherProps }) => { + return ; +}; + +export default InputTextAmount; + +export const CurrencyInput = forwardRef( + ( + { + allowDecimals = true, + allowNegativeValue = true, + id, + name, + className, + customInput, + decimalsLimit, + defaultValue, + disabled = false, + maxLength: userMaxLength, + value: userValue, + onValueChange, + fixedDecimalLength, + placeholder, + decimalScale, + prefix, + suffix, + intlConfig, + step, + min, + max, + disableGroupSeparators = false, + disableAbbreviations = false, + decimalSeparator: _decimalSeparator, + groupSeparator: _groupSeparator, + onChange, + onFocus, + onBlur, + onKeyDown, + onKeyUp, + transformRawValue, + otherProps, + inputRef:inputRefFrom, + ...props + }, + ref + ) => { + if (_decimalSeparator && isNumber(_decimalSeparator)) { + throw new Error("decimalSeparator cannot be a number"); + } + + if (_groupSeparator && isNumber(_groupSeparator)) { + throw new Error("groupSeparator cannot be a number"); + } + + const localeConfig = useMemo(() => getLocaleConfig(intlConfig), [intlConfig]); + const decimalSeparator = _decimalSeparator || localeConfig.decimalSeparator || ""; + const groupSeparator = _groupSeparator || localeConfig.groupSeparator || ""; + + if (decimalSeparator && groupSeparator && decimalSeparator === groupSeparator && disableGroupSeparators === false) { + throw new Error("decimalSeparator cannot be the same as groupSeparator"); + } + + const formatValueOptions = { + decimalSeparator, + groupSeparator, + disableGroupSeparators, + intlConfig, + prefix: prefix || localeConfig.prefix, + suffix: suffix, + }; + + const cleanValueOptions = { + decimalSeparator, + groupSeparator, + allowDecimals, + decimalsLimit: decimalsLimit || fixedDecimalLength || 2, + allowNegativeValue, + disableAbbreviations, + prefix: prefix || localeConfig.prefix, + transformRawValue, + }; + + const formattedStateValue = + defaultValue !== undefined && defaultValue !== null + ? formatValue({ ...formatValueOptions, decimalScale, value: String(defaultValue) }) + : userValue !== undefined && userValue !== null + ? formatValue({ ...formatValueOptions, decimalScale, value: String(userValue) }) + : ""; + + const [stateValue, setStateValue] = useState(formattedStateValue); + const [dirty, setDirty] = useState(false); + const [cursor, setCursor] = useState(0); + const [changeCount, setChangeCount] = useState(0); + const [lastKeyStroke, setLastKeyStroke] = useState(null); + const inputRef = useRef(inputRefFrom); + useImperativeHandle(ref, () => inputRef.current); + + /** + * Process change in value + */ + const processChange = (value, selectionStart) => { + setDirty(true); + + const { modifiedValue, cursorPosition } = repositionCursor({ + selectionStart, + value, + lastKeyStroke, + stateValue, + groupSeparator, + }); + + const stringValue = cleanValue({ value: modifiedValue, ...cleanValueOptions }); + + if (userMaxLength && stringValue.replace(/-/g, "").length > userMaxLength) { + return; + } + + if (stringValue === "" || stringValue === "-" || stringValue === decimalSeparator) { + onValueChange && onValueChange(undefined, name, { float: null, formatted: "", value: "" }); + setStateValue(stringValue); + return; + } + + const stringValueWithoutSeparator = decimalSeparator ? stringValue.replace(decimalSeparator, ".") : stringValue; + + const numberValue = parseFloat(stringValueWithoutSeparator); + + const formattedValue = formatValue({ + value: stringValue, + ...formatValueOptions, + }); + + if (cursorPosition !== undefined && cursorPosition !== null) { + // Prevent cursor jumping + let newCursor = cursorPosition + (formattedValue.length - value.length); + newCursor = newCursor <= 0 ? (prefix ? prefix.length : 0) : newCursor; + + setCursor(newCursor); + setChangeCount(changeCount + 1); + } + + setStateValue(formattedValue); + + if (onValueChange) { + const values = { + float: numberValue, + formatted: formattedValue, + value: stringValue, + }; + onValueChange(stringValue, name, values); + } + }; + + /** + * Handle change event + */ + const handleOnChange = (event) => { + const { + target: { value, selectionStart }, + } = event; + + processChange(value, selectionStart); + + onChange && onChange(event); + }; + + /** + * Handle focus event + */ + const handleOnFocus = (event) => { + onFocus && onFocus(event); + return stateValue ? stateValue.length : 0; + }; + + /** + * Handle blur event + * + * Format value by padding/trimming decimals if required by + */ + const handleOnBlur = (event) => { + const { + target: { value }, + } = event; + + const valueOnly = cleanValue({ value, ...cleanValueOptions }); + + if (valueOnly === "-" || !valueOnly) { + setStateValue(""); + onBlur && onBlur(event); + return; + } + + const fixedDecimals = fixedDecimalValue(valueOnly, decimalSeparator, fixedDecimalLength); + + const newValue = padTrimValue(fixedDecimals, decimalSeparator, decimalScale !== undefined ? decimalScale : fixedDecimalLength); + + const numberValue = parseFloat(newValue.replace(decimalSeparator, ".")); + + const formattedValue = formatValue({ + ...formatValueOptions, + value: newValue, + }); + + if (onValueChange) { + onValueChange(newValue, name, { + float: numberValue, + formatted: formattedValue, + value: newValue, + }); + } + + setStateValue(formattedValue); + + onBlur && onBlur(event); + }; + + /** + * Handle key down event + * + * Increase or decrease value by step + */ + const handleOnKeyDown = (event) => { + const { key } = event; + + setLastKeyStroke(key); + + if (step && (key === "ArrowUp" || key === "ArrowDown")) { + event.preventDefault(); + setCursor(stateValue.length); + + const currentValue = + parseFloat( + userValue !== undefined && userValue !== null + ? String(userValue).replace(decimalSeparator, ".") + : cleanValue({ value: stateValue, ...cleanValueOptions }) + ) || 0; + const newValue = key === "ArrowUp" ? currentValue + step : currentValue - step; + + if (min !== undefined && newValue < min) { + return; + } + + if (max !== undefined && newValue > max) { + return; + } + + const fixedLength = String(step).includes(".") ? Number(String(step).split(".")[1].length) : undefined; + + processChange(String(fixedLength ? newValue.toFixed(fixedLength) : newValue).replace(".", decimalSeparator)); + } + + onKeyDown && onKeyDown(event); + }; + + /** + * Handle key up event + * + * Move cursor if there is a suffix to prevent user typing past suffix + */ + const handleOnKeyUp = (event) => { + const { + key, + currentTarget: { selectionStart }, + } = event; + if (key !== "ArrowUp" && key !== "ArrowDown" && stateValue !== "-") { + const suffix = getSuffix(stateValue, { groupSeparator, decimalSeparator }); + + if (suffix && selectionStart && selectionStart > stateValue.length - suffix.length) { + /* istanbul ignore else */ + if (inputRef.current) { + const newCursor = stateValue.length - suffix.length; + inputRef.current.setSelectionRange(newCursor, newCursor); + } + } + } + + onKeyUp && onKeyUp(event); + }; + + useEffect(() => { + // prevent cursor jumping if editing value + if (dirty && stateValue !== "-" && inputRef.current && document.activeElement === inputRef.current) { + inputRef.current.setSelectionRange(cursor, cursor); + } + }, [stateValue, cursor, inputRef, dirty, changeCount]); + + /** + * If user has only entered "-" or decimal separator, + * keep the char to allow them to enter next value + */ + const getRenderValue = () => { + if (userValue !== undefined && userValue !== null && stateValue !== "-" && (!decimalSeparator || stateValue !== decimalSeparator)) { + return formatValue({ + ...formatValueOptions, + decimalScale: dirty ? undefined : decimalScale, + value: String(userValue), + }); + } + + return stateValue; + }; + + const inputProps = { + type: "text", + inputMode: "decimal", + id, + name, + className, + onChange: handleOnChange, + onBlur: handleOnBlur, + onFocus: handleOnFocus, + onKeyDown: handleOnKeyDown, + onKeyUp: handleOnKeyUp, + placeholder, + disabled, + value: getRenderValue(), + ref: inputRef, + ...props, + }; + + if (customInput) { + const CustomInput = customInput; + return ; + } + + return ; + } +); + +CurrencyInput.displayName = "CurrencyInput"; + +export const InputAmountWrapper = ({ref,...props}) => { + const limit = 1000; + const prefix = props?.prefix; + + const [errorMessage, setErrorMessage] = useState(""); + const [className, setClassName] = useState(""); + const [value, setValue] = useState(props?.defaultValue); + const [values, setValues] = useState(); + const [rawValue, setRawValue] = useState(" "); + + useEffect(() => { + props.onValueChange(value); + }, [value]); + + /** + * Handle validation + */ + const handleOnValueChange = (value, _, values) => { + setValues(values); + setRawValue(value === undefined ? "undefined" : value || " "); + + if (!value) { + setClassName(""); + setValue(""); + return; + } + + if (Number.isNaN(Number(value))) { + // setErrorMessage('Please enter a valid number'); + // setClassName('is-invalid'); + return; + } + + if (Number(value) > limit) { + // setErrorMessage(`Max: ${prefix}${limit}`); + // setClassName('is-invalid'); + setValue(value); + return; + } + + // setClassName('is-valid'); + setValue(value); + }; + + return ( + + ); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/KeyNote.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/KeyNote.js new file mode 100644 index 00000000000..f8f9d1c0076 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/KeyNote.js @@ -0,0 +1,38 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { UnMaskComponent } from ".."; +const KeyNote = ({ keyValue, note, caption, noteStyle, children, privacy }) => { + return ( +
+

{keyValue}

+
+

{note}

+ { privacy && ( + + {/* + Feature :: Privacy + privacy object set to the Mask Component + */} + + + )} +
+

{caption}

+ {children} +
+ ); +}; + +KeyNote.propTypes = { + keyValue: PropTypes.string, + note: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + noteStyle: PropTypes.any, +}; + +KeyNote.defaultProps = { + keyValue: "", + note: "", + noteStyle: {}, +}; + +export default KeyNote; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/KeyNote.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/KeyNote.stories.js new file mode 100644 index 00000000000..666f23cd024 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/KeyNote.stories.js @@ -0,0 +1,17 @@ +import React from "react"; + +import KeyNote from "./KeyNote"; + +export default { + title: "Atom/KeyNote", + component: KeyNote, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + keyValue: "note1", + note: "My first note", +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Label.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Label.js new file mode 100644 index 00000000000..88f27bef117 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Label.js @@ -0,0 +1,7 @@ +import React from "react"; + +const Label = (props) => { + return

{props.children}

; +}; + +export default Label; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LabelFieldPair.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LabelFieldPair.js new file mode 100644 index 00000000000..7548b9c38b9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LabelFieldPair.js @@ -0,0 +1,11 @@ +import React from "react"; + +const LabelFieldPair = (props) => { + return ( +
+ {props.children} +
+ ); +}; + +export default LabelFieldPair; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkButton.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkButton.js new file mode 100644 index 00000000000..427fa0bc808 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkButton.js @@ -0,0 +1,25 @@ +import React from "react"; +import PropTypes from "prop-types"; + +const LinkButton = (props) => { + return ( + + {props.label} + + ); +}; + +LinkButton.propTypes = { + /** + * LinkButton contents + */ + label: PropTypes.any, + /** + * Optional click handler + */ + onClick: PropTypes.func, +}; + +LinkButton.defaultProps = {}; + +export default LinkButton; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkButton.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkButton.stories.js new file mode 100644 index 00000000000..b07c5b09df9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkButton.stories.js @@ -0,0 +1,16 @@ +import React from "react"; + +import LinkButton from "./LinkButton"; + +export default { + title: "Atom/LinkButton", + component: LinkButton, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + label: "Link", +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkLabel.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkLabel.js new file mode 100644 index 00000000000..f008e2c7ea1 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LinkLabel.js @@ -0,0 +1,11 @@ +import React from "react"; + +const LinkLabel = (props) => { + return ( + + ); +}; + +export default LinkLabel; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Loader.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Loader.js new file mode 100644 index 00000000000..062bf7ecc3e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Loader.js @@ -0,0 +1,23 @@ +import React from "react"; +import PropTypes from "prop-types"; + +export const Loader = ({ page = false }) => ( +
+
+
+
+
+
+
+); + +Loader.propTypes = { + /** + * Is this is page or a module? + */ + page: PropTypes.bool, +}; + +Loader.defaultProps = { + page: false, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Loader.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Loader.stories.js new file mode 100644 index 00000000000..b5200ae1b3b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Loader.stories.js @@ -0,0 +1,20 @@ +import React from "react"; + +import { Loader } from "./Loader"; + +export default { + title: "Atom/Loader", + component: Loader, +}; + +const Template = (args) => ; + +export const Module = Template.bind({}); +Module.args = { + page: false, +}; + +export const Page = Template.bind({}); +Page.args = { + page: true, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LocationSearch.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LocationSearch.js new file mode 100644 index 00000000000..86f321eb310 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/LocationSearch.js @@ -0,0 +1,394 @@ +import React, { useEffect } from "react"; +import { SearchIconSvg } from "./svgindex"; +import { Loader } from "@googlemaps/js-api-loader"; + +let defaultBounds = {}; + +const updateDefaultBounds = (center) => { + if (!center.lat || !center.lng) { + return; + } + defaultBounds = { + north: center.lat + 0.1, + south: center.lat - 0.1, + east: center.lng + 0.1, + west: center.lng - 0.1, + }; +}; +const GetPinCode = (places) => { + let postalCode = null; + places?.address_components?.forEach((place) => { + let hasPostalCode = place.types.includes("postal_code"); + postalCode = hasPostalCode ? place.long_name : null; + }); + return postalCode; +}; + +const getName = (places) => { + let name = ""; + places?.address_components?.forEach((place) => { + let hasName = place.types.includes("sublocality_level_2") || place.types.includes("sublocality_level_1"); + if (hasName) { + name = hasName ? place.long_name : null; + } + }); + return name; +}; + +const loadGoogleMaps = (callback) => { + const key = globalConfigs?.getConfig("GMAPS_API_KEY"); + const loader = new Loader({ + apiKey: key, + version: "weekly", + libraries: ["places"], + }); + + loader + .load() + .then(() => { + if (callback) callback(); + }) + .catch((e) => { + // do something + }); +}; + +const mapStyles = [ + { + elementType: "geometry", + stylers: [ + { + color: "#f5f5f5", + }, + ], + }, + { + elementType: "labels.icon", + stylers: [ + { + visibility: "off", + }, + ], + }, + { + elementType: "labels.text.fill", + stylers: [ + { + color: "#616161", + }, + ], + }, + { + elementType: "labels.text.stroke", + stylers: [ + { + color: "#f5f5f5", + }, + ], + }, + { + featureType: "administrative.land_parcel", + elementType: "labels.text.fill", + stylers: [ + { + color: "#bdbdbd", + }, + ], + }, + { + featureType: "poi", + elementType: "geometry", + stylers: [ + { + color: "#eeeeee", + }, + ], + }, + { + featureType: "poi", + elementType: "labels.text.fill", + stylers: [ + { + color: "#757575", + }, + ], + }, + { + featureType: "poi.park", + elementType: "geometry", + stylers: [ + { + color: "#e5e5e5", + }, + ], + }, + { + featureType: "poi.park", + elementType: "labels.text.fill", + stylers: [ + { + color: "#9e9e9e", + }, + ], + }, + { + featureType: "road", + elementType: "geometry", + stylers: [ + { + color: "#ffffff", + }, + ], + }, + { + featureType: "road.arterial", + elementType: "labels.text.fill", + stylers: [ + { + color: "#757575", + }, + ], + }, + { + featureType: "road.highway", + elementType: "geometry", + stylers: [ + { + color: "#dadada", + }, + ], + }, + { + featureType: "road.highway", + elementType: "labels.text.fill", + stylers: [ + { + color: "#616161", + }, + ], + }, + { + featureType: "road.local", + elementType: "labels.text.fill", + stylers: [ + { + color: "#9e9e9e", + }, + ], + }, + { + featureType: "transit.line", + elementType: "geometry", + stylers: [ + { + color: "#e5e5e5", + }, + ], + }, + { + featureType: "transit.station", + elementType: "geometry", + stylers: [ + { + color: "#eeeeee", + }, + ], + }, + { + featureType: "water", + elementType: "geometry", + stylers: [ + { + color: "#c9c9c9", + }, + ], + }, + { + featureType: "water", + elementType: "labels.text.fill", + stylers: [ + { + color: "#9e9e9e", + }, + ], + }, +]; + +const setLocationText = (location, onChange, isPlaceRequired=false) => { + const geocoder = new google.maps.Geocoder(); + geocoder.geocode( + { + location, + }, + function (results, status) { + if (status === "OK") { + if (results[0]) { + let pincode = GetPinCode(results[0]); + const infoWindowContent = document.getElementById("pac-input"); + infoWindowContent.value = getName(results[0]); + if (onChange) { + if(isPlaceRequired) + onChange(pincode, { longitude: location.lng, latitude: location.lat }, infoWindowContent.value); + else + onChange(pincode, { longitude: location.lng, latitude: location.lat }); + } + } + } + } + ); +}; + +const onMarkerDragged = (marker, onChange, isPlaceRequired = false) => { + if (!marker) return; + const { latLng } = marker; + const currLat = latLng.lat(); + const currLang = latLng.lng(); + const location = { + lat: currLat, + lng: currLang, + }; + if(isPlaceRequired) + setLocationText(location, onChange, true); + else + setLocationText(location, onChange); +}; + +const initAutocomplete = (onChange, position, isPlaceRequired=false) => { + const map = new window.google.maps.Map(document.getElementById("map"), { + center: position, + zoom: 15, + mapTypeId: "roadmap", + styles: mapStyles, + }); // Create the search box and link it to the UI element. + + const input = document.getElementById("pac-input"); + updateDefaultBounds(position); + const options = { + bounds: defaultBounds, + componentRestrictions: { country: "in" }, + fields: ["address_components", "geometry", "icon", "name"], + origin: position, + strictBounds: false, + types: ["address"], + }; + const searchBox = new window.google.maps.places.Autocomplete(input, options); + // map.controls[google.maps.ControlPosition.TOP_LEFT].push(input); // Bias the SearchBox results towards current map's viewport. + + map.addListener("bounds_changed", () => { + searchBox.setBounds(map.getBounds()); + }); + + let markers = [ + new window.google.maps.Marker({ + map, + title: "a", + position: position, + draggable: true, + clickable: true, + }), + ]; + + if(isPlaceRequired) + setLocationText(position, onChange,true); + else + setLocationText(position, onChange); + + // Listen for the event fired when the user selects a prediction and retrieve + // more details for that place. + markers[0].addListener("dragend", (marker) => onMarkerDragged(marker, onChange, isPlaceRequired)); + searchBox.addListener("place_changed", () => { + const place = searchBox.getPlace(); + + if (!place) { + return; + } // Clear out the old markers. + let pincode = GetPinCode(place); + if (pincode) { + const { geometry } = place; + const geoLocation = { + latitude: geometry.location.lat(), + longitude: geometry.location.lng(), + }; + if(isPlaceRequired) + onChange(pincode, geoLocation, place.name); + else + onChange(pincode, geoLocation); + } + markers.forEach((marker) => { + marker.setMap(null); + }); + markers = []; // For each place, get the icon, name and location. + + const bounds = new window.google.maps.LatLngBounds(); + if (!place.geometry) { + return; + } + + markers.push( + new window.google.maps.Marker({ + map, + title: place.name, + position: place.geometry.location, + draggable: true, + clickable: true, + }) + ); + markers[0].addListener("dragend", (marker) => onMarkerDragged(marker, onChange, isPlaceRequired)); + if (place.geometry.viewport) { + // Only geocodes have viewport. + bounds.union(place.geometry.viewport); + } else { + bounds.extend(place.geometry.location); + } + + map.fitBounds(bounds); + }); +}; + +const LocationSearch = (props) => { + useEffect(() => { + async function mapScriptCall() { + const getLatLng = (position) => { + initAutocomplete(props.onChange, { lat: position.coords.latitude, lng: position.coords.longitude }, props.isPlaceRequired); + }; + const getLatLngError = (error) => { + let defaultLatLong = {}; + if (props?.isPTDefault) { + defaultLatLong = props?.PTdefaultcoord?.defaultConfig || { lat: 31.6160638, lng: 74.8978579 }; + } else { + defaultLatLong = { + lat: 31.6160638, + lng: 74.8978579, + }; + } + initAutocomplete(props.onChange, defaultLatLong, props.isPlaceRequired); + }; + + const initMaps = () => { + if (props.position?.latitude && props.position?.longitude) { + getLatLng({ coords: props.position }); + } else if (navigator?.geolocation) { + navigator.geolocation.getCurrentPosition(getLatLng, getLatLngError); + } else { + getLatLngError(); + } + }; + + loadGoogleMaps(initMaps); + } + mapScriptCall(); + }, []); + + return ( +
+
+ {/* */} + + +
+
+
+ ); +}; + +export default LocationSearch; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Menu.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Menu.js new file mode 100644 index 00000000000..34722b99ce3 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Menu.js @@ -0,0 +1,30 @@ +import React from "react"; +import PropTypes from "prop-types"; + +const Menu = (props) => { + const keyPrefix = props.localeKeyPrefix || "CS_ACTION"; + + return ( +
+ {props.options.map((option, index) => { + return ( +
props.onSelect(option)}> +

{props.t ? props.t(Digit.Utils.locale.getTransformedLocale(option.forcedName || `${keyPrefix}_${props.optionKey ? option[props.optionKey] : option}`)) : option}

+
+ ); + })} +
+ ); +}; + +Menu.propTypes = { + options: PropTypes.array, + onSelect: PropTypes.func, +}; + +Menu.defaultProps = { + options: [], + onSelect: () => {}, +}; + +export default Menu; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Menu.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Menu.stories.js new file mode 100644 index 00000000000..36f6d1f78c3 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Menu.stories.js @@ -0,0 +1,15 @@ +import React from "react"; + +import Menu from "./Menu"; + +export default { + title: "Atom/Menu", + component: Menu, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); +Default.args = { + options: ["first", "second", "third"], +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/MobileNumber.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/MobileNumber.js new file mode 100644 index 00000000000..9686908db5f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/MobileNumber.js @@ -0,0 +1,67 @@ +import React from "react"; +import PropTypes from "prop-types"; + +const MobileNumber = (props) => { + const user_type = Digit.SessionStorage.get("userType"); + + const onChange = (e) => { + let val = e.target.value; + if (isNaN(val) || [" ", "e", "E"].some((e) => val.includes(e)) || val.length > (props.maxLength || 10)) { + val = val.slice(0, -1); + } + props?.onChange?.(val); + }; + + return ( + +
+ {!props.hideSpan ? ( + + +91 + + ) : null} +
+ +
+
+
+ ); +}; + +MobileNumber.propTypes = { + userType: PropTypes.string, + isMandatory: PropTypes.bool, + name: PropTypes.string, + placeholder: PropTypes.string, + onChange: PropTypes.func, + ref: PropTypes.func, + value: PropTypes.any, +}; + +MobileNumber.defaultProps = { + isMandatory: false, +}; + +export default MobileNumber; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/WorkflowPopup.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/WorkflowPopup.js new file mode 100644 index 00000000000..dc73540c26a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/WorkflowPopup.js @@ -0,0 +1,112 @@ +import React,{ useState,useEffect } from 'react' +import { Loader } from "../Loader" +import configEstimateModal from './config/configEstimateModal' +import Modal from '../../hoc/Modal' +import { FormComposer } from '../../hoc/FormComposer' + + +const Heading = (props) => { + return

{props.label}

; +}; + +const Close = () => ( + + + + +); + +const CloseBtn = (props) => { + return ( +
+ +
+ ); +}; + + +const WorkflowPopup = ({ applicationDetails,...props}) => { + const { + action, + tenantId, + t, + closeModal, + submitAction, + businessService, + moduleCode + } = props + + const enableAssignee = Digit?.Customizations?.["commonUiConfig"]?.enableHrmsSearch(businessService,action) + // const [approvers,setApprovers] = useState([]) + const [config,setConfig] = useState(null) + const [modalSubmit,setModalSubmit] = useState(true) + //hrms user search + let { isLoading: isLoadingHrmsSearch, isError, error, data: assigneeOptions } = Digit.Hooks.hrms.useHRMSSearch({ roles: action?.assigneeRoles?.toString(), isActive: true }, tenantId, null, null, { enabled: action?.assigneeRoles?.length > 0 && enableAssignee }); + + assigneeOptions = assigneeOptions?.Employees + assigneeOptions?.map(emp => emp.nameOfEmp = emp?.user?.name || t("ES_COMMON_NA")) + + useEffect(() => { + if(businessService==="muster-roll-approval" && action.action==="APPROVE"){ + setModalSubmit(false) + } + }, [businessService]) + + + useEffect(() => { + if(assigneeOptions?.length >=0){ + setConfig( + configEstimateModal(t,action,assigneeOptions,businessService, moduleCode) + ) + } + else { + setConfig( + configEstimateModal(t, action, undefined, businessService, moduleCode) + ) + } + + }, [assigneeOptions]) + + const _submit = (data) => { + //here call an UICustomizaton fn to update the payload for update call(businessService based) + const updatePayload = Digit?.Customizations?.["commonUiConfig"]?.updatePayload(applicationDetails, data, action, businessService) + //calling submitAction + submitAction(updatePayload, action) + + } + + const modalCallBack = (setValue, formData, formState, reset, setError, clearErrors, trigger, getValues) => { + Digit?.Customizations?.["commonUiConfig"]?.enableModalSubmit(businessService,action,setModalSubmit,formData) + } + + if(isLoadingHrmsSearch) return + + return action && config?.form ? ( + } + headerBarEnd={} + actionCancelLabel={t(config.label.cancel)} + actionCancelOnSubmit={closeModal} + actionSaveLabel={t(config.label.submit)} + actionSaveOnSubmit={() => { }} + formId="modal-action" + isDisabled = {!modalSubmit} + > + + + + ) : ( + + ); +} + +export default WorkflowPopup \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/config/configEstimateModal.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/config/configEstimateModal.js new file mode 100644 index 00000000000..bda9ca66040 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/config/configEstimateModal.js @@ -0,0 +1,400 @@ +import Dropdown from '../../Dropdown'; +import { Loader } from '../../Loader'; +import React, { useState } from 'react' + +const configEstimateModal = ( + t, + action, + approvers, + businessService, + moduleCode +) => { + + const {action:actionString} = action + const bsEstimate = Digit?.Customizations?.["commonUiConfig"]?.getBusinessService("estimate"); + const bsContract = Digit?.Customizations?.["commonUiConfig"]?.getBusinessService("contract"); + const bsMuster = Digit?.Customizations?.["commonUiConfig"]?.getBusinessService("muster roll"); + const bsPurchaseBill = Digit?.Customizations?.["commonUiConfig"]?.getBusinessService("works.purchase"); + + const configMap = { + [bsEstimate]: { + "default":{ + comments:{ + isMandatory:false, + show:true, + }, + assignee:{ + isMandatory:false, + show:true + }, + upload:{ + isMandatory:false, + show:true, + allowedFileTypes:/(.*?)(pdf|vnd.openxmlformats-officedocument.wordprocessingml.document|msword|vnd.ms-excel|vnd.openxmlformats-officedocument.spreadsheetml.sheet|csv|jpeg)$/i + } + }, + "REJECT": { + comments: { + isMandatory: true, + show: true, + }, + assignee: { + isMandatory: false, + show: false + }, + upload: { + isMandatory: false, + show: true + } + }, + "SENDBACK": { + comments: { + isMandatory: false, + show: true, + }, + assignee: { + isMandatory: false, + show: false + }, + upload: { + isMandatory: false, + show: true + } + }, + "SENDBACKTOORIGINATOR": { + comments: { + isMandatory: false, + show: true, + }, + assignee: { + isMandatory: false, + show: false + }, + upload: { + isMandatory: false, + show: true + } + }, + "APPROVE": { + comments: { + isMandatory: false, + show: true, + }, + assignee: { + isMandatory: false, + show: false + }, + upload: { + isMandatory: false, + show: true + } + } + }, + [bsContract]: { + "default":{ + comments:{ + isMandatory:false, + show:true, + }, + assignee:{ + isMandatory:false, + show:true + }, + upload:{ + isMandatory:false, + show:true, + allowedFileTypes:/(.*?)(pdf|vnd.openxmlformats-officedocument.wordprocessingml.document|msword|vnd.ms-excel|vnd.openxmlformats-officedocument.spreadsheetml.sheet|csv|jpeg)$/i + } + }, + "REJECT": { + comments: { + isMandatory: true, + show: true, + }, + assignee: { + isMandatory: false, + show: false + }, + upload: { + isMandatory: false, + show: true + } + }, + "SEND_BACK": { + comments: { + isMandatory: false, + show: true, + }, + assignee: { + isMandatory: false, + show: false + }, + upload: { + isMandatory: false, + show: true + } + }, + "VERIFY_AND_FORWARD": { + comments:{ + isMandatory:false, + show:true, + }, + assignee:{ + isMandatory:false, + show:true + }, + upload:{ + isMandatory:false, + show:true + } + }, + "SEND_BACK_TO_ORIGINATOR": { + comments: { + isMandatory: false, + show: true, + }, + assignee: { + isMandatory: false, + show: false + }, + upload: { + isMandatory: false, + show: true + } + }, + "APPROVE": { + comments: { + isMandatory: false, + show: true, + }, + assignee: { + isMandatory: false, + show: false + }, + upload: { + isMandatory: false, + show: true + } + }, + }, + [bsMuster]:{ + "default":{ + comments:{ + isMandatory:false, + show:true, + }, + assignee:{ + isMandatory:false, + show:true + }, + upload:{ + isMandatory:false, + show:true, + allowedFileTypes:/(.*?)(pdf|vnd.openxmlformats-officedocument.wordprocessingml.document|msword|vnd.ms-excel|vnd.openxmlformats-officedocument.spreadsheetml.sheet|csv|jpeg)$/i + } + }, + "APPROVE": { + comments: { + isMandatory: false, + show: true, + }, + assignee: { + isMandatory: false, + show: false + }, + upload: { + isMandatory: false, + show: true + }, + acceptTerms: { + isMandatory:true, + show:true + } + }, + "REJECT": { + comments: { + isMandatory: true, + show: true, + }, + upload: { + isMandatory: false, + show: true + }, + }, + "SENDBACK":{ + comments: { + isMandatory: false, + show: true, + }, + assignee: { + isMandatory: false, + show: false + }, + upload: { + isMandatory: false, + show: true + }, + acceptTerms: { + isMandatory:false, + show:false + } + }, + "SENDBACKTOCBO":{ + comments: { + isMandatory: false, + show: true, + }, + assignee: { + isMandatory: false, + show: false + }, + upload: { + isMandatory: false, + show: true + }, + acceptTerms: { + isMandatory:false, + show:false + } + } + }, + [bsPurchaseBill]:{ + "default":{ + comments:{ + isMandatory:false, + show:true, + }, + assignee:{ + isMandatory:false, + show:false + }, + upload:{ + isMandatory:false, + show:true + } + }, + "VERIFY_AND_FORWARD":{ + comments:{ + isMandatory:false, + show:true, + }, + assignee:{ + isMandatory:false, + show:true + }, + upload:{ + isMandatory:false, + show:true + } + }, + "REJECT":{ + comments:{ + isMandatory:true, + show:true, + }, + assignee:{ + isMandatory:false, + show:false + }, + upload:{ + isMandatory:false, + show:true + } + } + } + } +//field can have (comments,assignee,upload) + const fetchIsMandatory = (field) => { + + if(configMap?.[businessService]?.[actionString]){ + return configMap?.[businessService]?.[actionString]?.[field]?.isMandatory ? configMap?.[businessService]?.[actionString]?.[field]?.isMandatory : false + }else{ + return configMap?.[businessService]?.default?.[field]?.isMandatory ? configMap?.[businessService]?.default?.[field]?.isMandatory: false + } + } + const fetchIsShow = (field) => { + + if (configMap?.[businessService]?.[actionString]) { + return configMap?.[businessService]?.[actionString]?.[field]?.show ? configMap?.[businessService]?.[actionString]?.[field]?.show : false + } else { + return configMap?.[businessService]?.default?.[field]?.show ? configMap?.[businessService]?.default?.[field]?.show:false + } + + } + + return { + label: { + heading: Digit.Utils.locale.getTransformedLocale(`WF_MODAL_HEADER_${businessService}_${action.action}`), + submit: Digit.Utils.locale.getTransformedLocale(`WF_MODAL_SUBMIT_${businessService}_${action.action}`), + cancel: "WF_MODAL_CANCEL", + }, + form: [ + { + body: [ + { + label: " ", + type: "checkbox", + disable: false, + isMandatory:false, + populators: { + name: "acceptTerms", + title: "MUSTOR_APPROVAL_CHECKBOX", + isMandatory: false, + labelStyles: {marginLeft:"40px"}, + customLabelMarkup: true, + hideInForm: !fetchIsShow("acceptTerms") + } + }, + { + label: t("WF_MODAL_APPROVER"), + type: "dropdown", + isMandatory: fetchIsMandatory("assignee"), + disable: false, + key:"assignees", + populators: { + name: "assignee", + optionsKey: "nameOfEmp", + options: approvers, + hideInForm: !fetchIsShow("assignee"), + "optionsCustomStyle": { + "top": "2.3rem" + } + }, + }, + { + label: t("WF_MODAL_COMMENTS"), + type: "textarea", + isMandatory: fetchIsMandatory("comments"), + populators: { + name: "comments", + hideInForm:!fetchIsShow("comments"), + validation:{ + maxLength:{ + value:1024, + message:t("WORKS_COMMENT_LENGTH_EXCEEDED_1024") + } + } + }, + }, + { + type: "multiupload", + label: t("WORKFLOW_MODAL_UPLOAD_FILES"), + populators: { + name: "documents", + allowedMaxSizeInMB: 5, + maxFilesAllowed: 1, + allowedFileTypes:configMap?.[businessService]?.default?.upload?.allowedFileTypes, + hintText:t("WORKS_DOC_UPLOAD_HINT"), + showHintBelow:true, + customClass: "upload-margin-bottom", + errorMessage: t("WORKS_FILE_UPLOAD_CUSTOM_ERROR_MSG"), + hideInForm:!fetchIsShow("upload") + } + } + ] + } + ] + } +} + +export default configEstimateModal \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/index.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/index.js new file mode 100644 index 00000000000..f3c3cca1608 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Modals/index.js @@ -0,0 +1,13 @@ +import React, { useState, useEffect } from "react"; + + +import WorkflowPopup from "./WorkflowPopup"; + +const ActionModal = (props) => { + //here we can render different modals based on respective modules + return ; + + +}; + +export default ActionModal; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/MultiLink.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/MultiLink.js new file mode 100644 index 00000000000..d62b4bd8269 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/MultiLink.js @@ -0,0 +1,45 @@ +import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react"; +import LinkButton from "./LinkButton"; +import { PrimaryDownlaodIcon } from "./svgindex"; +import { useTranslation } from "react-i18next"; + +const MultiLink = forwardRef(({ className, onHeadClick, displayOptions = false, options, label, icon, showOptions, setShowOptions = () => {}, downloadBtnClassName, downloadOptionsClassName, optionsClassName, style, optionsStyle, reportStyles }, ref) => { + const { t } = useTranslation(); + const menuRef = useRef(); + const [showMenu, setshowMenu] = useState(false); + const handleOnClick = () => { + if(!(setShowOptions.toString().replace(/\s+/g,``) === "function(){}" ||setShowOptions.toString().replace(/\s+/g,``) === "()=>{}")) + { + setShowOptions(false); + setshowMenu(false); + } + } + Digit.Hooks.useClickOutside(menuRef, handleOnClick, showMenu); + + useMemo(() => { + setshowMenu(displayOptions); + },[displayOptions]) + + const MenuWrapper = React.forwardRef((props, ref) => { + return
+ {options.map((option, index) => ( +
option.onClick()} key={index} className={`multilink-option`}> + {option?.icon} + {option.label} +
+ ))} +
+ }) + + return ( +
+
+ {icon ? icon : } + +
+ {showMenu ? : null} +
+ ); +}); + +export default MultiLink; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/MultiSelectDropdown.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/MultiSelectDropdown.js new file mode 100644 index 00000000000..9ed5e1c52b1 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/MultiSelectDropdown.js @@ -0,0 +1,142 @@ +import React, { useEffect, useReducer, useRef, useState } from "react"; +import { ArrowDown, CheckSvg } from "./svgindex"; +import { useTranslation } from "react-i18next"; +import RemoveableTag from "./RemoveableTag"; +const MultiSelectDropdown = ({ options, optionsKey, selected = [], onSelect, defaultLabel = "", defaultUnit = "",BlockNumber=1,isOBPSMultiple=false,props={},isPropsNeeded=false,ServerStyle={}, config}) => { + const [active, setActive] = useState(false); + const [searchQuery, setSearchQuery] = useState(); + const [optionIndex, setOptionIndex] = useState(-1); + const dropdownRef = useRef(); + const { t } = useTranslation(); + + function reducer(state, action){ + switch(action.type){ + case "ADD_TO_SELECTED_EVENT_QUEUE": + return [...state, {[optionsKey]: action.payload?.[1]?.[optionsKey], propsData: action.payload} ] + case "REMOVE_FROM_SELECTED_EVENT_QUEUE": + const newState = state.filter( + (e) => e?.[optionsKey] !== action.payload?.[1]?.[optionsKey] + ); + onSelect(newState.map((e) => e.propsData), props); // Update the form state here + return newState; + case "REPLACE_COMPLETE_STATE": + return action.payload + default: + return state + } + } + + useEffect(() => { + dispatch({type: "REPLACE_COMPLETE_STATE", payload: fnToSelectOptionThroughProvidedSelection(selected) }) + },[selected?.length]) + + function fnToSelectOptionThroughProvidedSelection(selected){ + return selected?.map( e => ({[optionsKey]: e?.[optionsKey], propsData: [null, e]})) + } + + const [alreadyQueuedSelectedState, dispatch] = useReducer(reducer, selected, fnToSelectOptionThroughProvidedSelection) + + useEffect(()=> { + if(!active){ + onSelect(alreadyQueuedSelectedState?.map( e => e.propsData), props) + } + },[active]) + + + function handleOutsideClickAndSubmitSimultaneously(){ + setActive(false) + } + + Digit.Hooks.useClickOutside(dropdownRef, handleOutsideClickAndSubmitSimultaneously , active, {capture: true} ); + const filtOptns = + searchQuery?.length > 0 ? options.filter((option) => t(option[optionsKey]&&typeof option[optionsKey]=="string" && option[optionsKey].toUpperCase()).toLowerCase().indexOf(searchQuery.toLowerCase()) >= 0) : options; + + function onSearch(e) { + setSearchQuery(e.target.value); + } + + function onSelectToAddToQueue(...props){ + const isChecked = arguments[0].target.checked + isChecked ? dispatch({type: "ADD_TO_SELECTED_EVENT_QUEUE", payload: arguments }) : dispatch({type: "REMOVE_FROM_SELECTED_EVENT_QUEUE", payload: arguments }) + } + +/* Custom function to scroll and select in the dropdowns while using key up and down */ + const keyChange = (e) => { + if (e.key == "ArrowDown") { + setOptionIndex(state =>state+1== filtOptns.length?0:state+1); + if(optionIndex+1== filtOptns.length){ + e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollTo?.(0,0) + }else{ + optionIndex>2&& e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollBy?.(0,45) + } + e.preventDefault(); + } else if (e.key == "ArrowUp") { + setOptionIndex(state => state!==0? state - 1: filtOptns.length-1); + if(optionIndex===0){ + e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollTo?.(100000,100000) + }else{ + optionIndex>2&&e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollBy?.(0,-45) + } + e.preventDefault(); + }else if(e.key=="Enter"){ + onSelectToAddToQueue(e,filtOptns[optionIndex]); + } + } + + const MenuItem = ({ option, index }) => ( +
+ selectedOption[optionsKey] === option[optionsKey]) ? true : false} + onChange={(e) => isPropsNeeded?onSelectToAddToQueue(e, option,props):isOBPSMultiple?onSelectToAddToQueue(e, option,BlockNumber):onSelectToAddToQueue(e, option)} + style={{minWidth: "24px", width: "100%"}} + /> +
+ +
+

{t(option[optionsKey]&&typeof option[optionsKey]=="string" && option[optionsKey])}

+
+ ); + + const Menu = () => { + const filteredOptions = + searchQuery?.length > 0 ? options.filter((option) => t(option[optionsKey]&&typeof option[optionsKey]=="string" && option[optionsKey].toUpperCase()).toLowerCase().indexOf(searchQuery.toLowerCase()) >= 0) : options; + return filteredOptions?.map((option, index) => ); + }; + + return ( +
+
+
+ setActive(true)} value={searchQuery} onChange={onSearch} /> +
+

{alreadyQueuedSelectedState.length > 0 ? `${alreadyQueuedSelectedState.length} ${defaultUnit}` : defaultLabel}

+ +
+
+ {active ? ( +
+ +
+ ) : null} + +
+ {config?.isDropdownWithChip ?
+ {alreadyQueuedSelectedState.length > 0 && + alreadyQueuedSelectedState.map((value, index) => { + return onSelectToAddToQueue(e, value,props) + : (e) => onSelectToAddToQueue(e, value) + } />; + })} +
: null} +
+ ); +}; + +export default MultiSelectDropdown; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/NavBar.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/NavBar.js new file mode 100644 index 00000000000..27b7643d928 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/NavBar.js @@ -0,0 +1,194 @@ +import React, { useRef, useState } from "react"; +import { Link, useLocation } from "react-router-dom"; +import { useTranslation } from "react-i18next"; +import SubMenu from "./SubMenu"; +import { + HomeIcon, + BPAHomeIcon, + PersonIcon, + DocumentIconSolid, + DropIcon, + CollectionsBookmarIcons, + FinanceChartIcon, + ComplaintIcon, + SearchIcon, + CollectionIcon, + PropertyHouse, + CaseIcon, + PTIcon, + PGRIcon, + MCollectIcon, + OBPSIcon, + WSICon, + FSMIcon, + Phone, + LogoutIcon, + EditPencilIcon, + LanguageIcon, +} from "./svgindex"; +import { BirthIcon, DeathIcon, FirenocIcon } from ".."; + +const IconsObject = { + CommonPTIcon: , + OBPSIcon: , + propertyIcon: , + TLIcon: , + PGRIcon: , + FSMIcon: , + WSIcon: , + BirthIcon: , + DeathIcon: , + FirenocIcon: , + MCollectIcon: , + BillsIcon: , + home: , + announcement: , + business: , + store: , + assignment: , + receipt: , + "business-center": , + description: , + "water-tap": , + "collections-bookmark": , + "insert-chart": , + edcr: , + collections: , + "open-complaints": , + HomeIcon: , + EditPencilIcon: , + LogoutIcon: , + Phone: , + LanguageIcon: , +}; +const NavBar = ({ open, toggleSidebar, profileItem, menuItems, onClose, Footer, isEmployee, search, setSearch }) => { + const node = useRef(); + const location = useLocation(); + const { pathname } = location; + const { t } = useTranslation(); + Digit.Hooks.useClickOutside(node, open ? onClose : null, open); + + const MenuItem = ({ item }) => { + let itemComponent; + if (item.type === "component") { + itemComponent = item.action; + } else { + itemComponent = item.text; + } + const leftIconArray = item.icon || item.icon?.type?.name; + const leftIcon = leftIconArray ? IconsObject[leftIconArray] : IconsObject.BillsIcon; + const Item = () => ( + + {leftIcon} +
{itemComponent}
+
+ ); + + if (item.type === "external-link") { + return ( + + + + ); + } + if (item.type === "link") { + if (item.link.indexOf(`/${window?.contextPath}`) === -1 && isEmployee) { + const getOrigin = window.location.origin; + return ( + + + + ); + } + return ( + + + + ); + } + + if (item.type === "dynamic") { + if (isEmployee) { + return ; + } + } + return ; + }; + + const renderSearch = () => { + return ( +
+
+
+
+ + setSearch(e.target.value)} + /> +
+
+
+
+ ); + }; + return ( + +
+
+
+ {profileItem} +
+ {isEmployee ? renderSearch() : null} + {menuItems?.map((item, index) => ( +
+ +
+ ))} +
+
{Footer}
+
+
+
+
+
+ ); +}; + +export default NavBar; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/NoResultsFound.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/NoResultsFound.js new file mode 100644 index 00000000000..fdceb7aef91 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/NoResultsFound.js @@ -0,0 +1,15 @@ +import React from "react"; +import { NoResultsFoundIcon } from "./svgindex"; +import { useTranslation } from "react-i18next"; + +const NoResultsFound = () => { + const {t} = useTranslation(); + return ( +
+ + {t("COMMON_NO_RESULTS_FOUND")} +
+ ) +} + +export default NoResultsFound; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/OTPInput.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/OTPInput.js new file mode 100644 index 00000000000..5d4555e7dfd --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/OTPInput.js @@ -0,0 +1,98 @@ +import React, { useEffect, useRef, useState } from "react"; +import PropTypes from "prop-types"; + +const BACKSPACE = 8; + +const SingleInput = ({ isFocus, onChange, onFocus, value, ...rest }) => { + const inputRef = useRef(); + useEffect(() => { + if (isFocus) { + inputRef.current.focus(); + } + }, [isFocus]); + + return ( + + ); +}; + +const OTPInput = (props) => { + const [activeInput, setActiveInput] = useState(0); + + const isInputValueValid = (value) => { + return typeof value === "string" && value.trim().length === 1; + }; + + const changeCodeAtFocus = (value) => { + const { onChange } = props; + const otp = getOtpValue(); + otp[activeInput] = value[0]; + const otpValue = otp.join(""); + onChange(otpValue); + }; + + const focusNextInput = () => { + setActiveInput((activeInput) => Math.min(activeInput + 1, props.length - 1)); + }; + + const focusPrevInput = () => { + setActiveInput((activeInput) => Math.max(activeInput - 1, 0)); + }; + + const getOtpValue = () => (props.value ? props.value.toString().split("") : []); + + const handleKeyDown = (event) => { + if (event.keyCode === BACKSPACE || event.key === "Backspace") { + event.preventDefault(); + changeCodeAtFocus(""); + focusPrevInput(); + } + }; + + function inputChange(event) { + const { value } = event.target; + changeCodeAtFocus(value); + if (isInputValueValid(value)) { + focusNextInput(); + } + } + + const OTPStack = []; + const otp = getOtpValue(); + for (let i = 0; i < props.length; i++) { + OTPStack.push( + { + setActiveInput(i); + e.target.select(); + }} + value={otp[i]} + /> + ); + } + + return
{OTPStack}
; +}; + +OTPInput.propTypes = { + length: PropTypes.number, +}; + +OTPInput.defaultProps = { + length: 0, +}; + +export default OTPInput; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/OTPInput.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/OTPInput.stories.js new file mode 100644 index 00000000000..3844f362f09 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/OTPInput.stories.js @@ -0,0 +1,16 @@ +import React from "react"; + +import OTPInput from "./OTPInput"; + +export default { + title: "Atom/OTPInput", + component: OTPInput, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + length: 4, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/OpenLinkContainer.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/OpenLinkContainer.js new file mode 100644 index 00000000000..b7aed26cf55 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/OpenLinkContainer.js @@ -0,0 +1,29 @@ +import React, { useState } from "react"; +import PropTypes from "prop-types"; +import { NotificationBell } from "./svgindex"; + +const OpenLinkContainer = ({ img,}) => { + return ( +
+
+ +
+
+ ); +}; + +OpenLinkContainer.propTypes = { + img: PropTypes.string, +}; + +OpenLinkContainer.defaultProps = { + img: undefined, +}; + +export default OpenLinkContainer; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Paragraph.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Paragraph.js new file mode 100644 index 00000000000..cb1d2dd8526 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Paragraph.js @@ -0,0 +1,11 @@ +import React from "react"; + +const Paragraph = (props) => { + const {value, customClassName, customStyle, inputRef} = props; + + return ( +

{value}

+ ) +} + +export default Paragraph; \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/PopUp.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/PopUp.js new file mode 100644 index 00000000000..1180dc8a126 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/PopUp.js @@ -0,0 +1,7 @@ +import React from "react"; + +const PopUp = ({className, ...props}) => { + return
{props.children}
; +}; + +export default PopUp; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/PopupHeadingLabel.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/PopupHeadingLabel.js new file mode 100644 index 00000000000..df950fa20d7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/PopupHeadingLabel.js @@ -0,0 +1,20 @@ +import React from "react" + +const PopupHeadingLabel = ({IconSVG, headingLabel, onResetSortForm}) => { + return
+
+ +

{headingLabel}:

+
+ + + + + +
+} + +export default PopupHeadingLabel \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/PrivateRoute.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/PrivateRoute.js new file mode 100644 index 00000000000..a671b35ebd7 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/PrivateRoute.js @@ -0,0 +1,29 @@ +import React from "react"; +import { Route, Redirect } from "react-router-dom"; + +export const PrivateRoute = ({ component: Component, roles, ...rest }) => { + return ( + { + const user = Digit.UserService.getUser(); + const userType = Digit.UserService.getType(); + function getLoginRedirectionLink (){ + if(userType === "employee"){ + return `/${window?.contextPath}/employee/user/language-selection` + } + else{ + return `/${window?.contextPath}/citizen/login` + } + } + if (!user || !user.access_token) { + // not logged in so redirect to login page with the return url + return ; + } + + // logged in so return component + return ; + }} + /> + ); +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RadioButtons.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RadioButtons.js new file mode 100644 index 00000000000..5b501fb4afc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RadioButtons.js @@ -0,0 +1,91 @@ +import React, { useEffect, useState } from "react"; +import PropTypes from "prop-types"; +import isEqual from "lodash/isEqual"; +import { useTranslation } from "react-i18next"; + +const RadioButtons = (props) => { + const { t } = useTranslation(); + var selected = props.selectedOption; + function selectOption(value) { + //selected = value; + props.onSelect(value); + } + + return ( +
+ {props?.options?.map((option, ind) => { + if (props?.optionsKey && !props?.isDependent) { + return ( +
+ + selectOption(option)} + disabled={props?.disabled} + name={props.name} + ref={props.inputRef} + /> + + + +
+ ); + } else if (props?.optionsKey && props?.isDependent) { + return ( +
+ + selectOption(option)} + disabled={props?.disabled} + name={props.name} + ref={props.inputRef} + /> + + + +
+ ); + } else { + return ( +
+ + selectOption(option)} + disabled={props?.disabled} + name={props.name} + ref={props.inputRef} + /> + + + +
+ ); + } + })} +
+ ); +}; + +RadioButtons.propTypes = { + selectedOption: PropTypes.any, + onSelect: PropTypes.func, + options: PropTypes.any, + optionsKey: PropTypes.string, + innerStyles: PropTypes.any, + style: PropTypes.any, +}; + +RadioButtons.defaultProps = {}; + +export default RadioButtons; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RadioButtons.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RadioButtons.stories.js new file mode 100644 index 00000000000..07122bb0e95 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RadioButtons.stories.js @@ -0,0 +1,19 @@ +import React from "react"; + +import RadioButtons from "./RadioButtons"; + +export default { + title: "Atom/RadioButtons", + component: RadioButtons, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + selectedOption: "first", + onSelect: undefined, + options: ["first", "second"], + optionsKey: "", +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.js new file mode 100644 index 00000000000..309e3d6e9a5 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.js @@ -0,0 +1,45 @@ +import React, { useRef } from "react"; +import { StarFilled } from "./svgindex"; +import { StarEmpty } from "./svgindex"; +import PropTypes from "prop-types"; + +const Rating = (props) => { + var stars = []; + const star = useRef(null); + + for (var i = 1; i <= props.maxRating; i++) { + if (i - props.currentRating <= 0) { + const index = i; + // stars.push(star filledprops.onFeedback(e,ref)}/>) + stars.push( props.onFeedback(e, star, index)} />); + } else if (i - props.currentRating > 0 && i - props.currentRating < 1) { + const index = i; + stars.push( props.onFeedback(e, star, index)} percentage={Math.round(((props.currentRating - parseInt(props.currentRating)) * 100))} />) + } else { + const index = i; + // stars.push(star emptyprops.onFeedback(e,ref)}/>) + stars.push( props.onFeedback(e, star, index)} />); + } + } + + return ( +
+ {props.text ? props.text : ""} {stars} +
+ ); +}; + +Rating.propTypes = { + maxRating: PropTypes.number, + currentRating: PropTypes.number, + onFeedback: PropTypes.func, +}; + +Rating.defaultProps = { + maxRating: 5, + id: '0', + currentRating: 0, + onFeedback: () => {}, +}; + +export default Rating; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.stories.js new file mode 100644 index 00000000000..2aadb7da6b9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Rating.stories.js @@ -0,0 +1,18 @@ +import React from "react"; + +import Rating from "./Rating"; + +export default { + title: "Atom/Rating", + component: Rating, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + maxRating: 5, + currentRating: 0, + onFeedback: () => {}, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Reason.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Reason.js new file mode 100644 index 00000000000..085011dcaca --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Reason.js @@ -0,0 +1,29 @@ +import React,{Fragment} from "react"; +import { useTranslation } from "react-i18next"; +// TODO @Nipun localise +const Reason = ({ headComment, otherComment, additionalComment }) => { + const { t } = useTranslation() + const getMarkup = () => { + if(additionalComment) { + return
+

{t("COMMON_CERTIFY_ONE")}

+
+

+ {t("ES_COMMON_NOTE")}{t("COMMON_CERTIFY_TWO")} +

+
+ + } + else { + return
+

{headComment}

+

{otherComment}

+
+ } + } + return ( + getMarkup() + ); +} + +export default Reason; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RemoveableTag.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RemoveableTag.js new file mode 100644 index 00000000000..1f7fe96fe04 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RemoveableTag.js @@ -0,0 +1,13 @@ +import React from "react"; +import { Close } from "./svgindex"; + +const RemoveableTag = ({ text, onClick, extraStyles,disabled = false }) => ( +
+ {text} + + + +
+); + +export default RemoveableTag; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RoundedLabel.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RoundedLabel.js new file mode 100644 index 00000000000..aa2fa5e0a8a --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/RoundedLabel.js @@ -0,0 +1,5 @@ +import React from "react"; + +const RoundedLabel = ({ count }) => (count ?
{count}
: ); + +export default RoundedLabel; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js new file mode 100644 index 00000000000..b24afb197ae --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js @@ -0,0 +1,1561 @@ +import { + Rotation3D, + SixFtApart, + Rotate360, + Accessibility, + AccessibilityNew, + Accessible, + AccessibleForward, + AccountBalance, + AccountBalanceWallet, + AccountBox, + AccountCircle, + AddAlert, + AddBusiness, + AddChart, + AddExpense, + AddExpenseTwo, + AddIcCall, + AddLocation, + AddLocationAlt, + AddModerator, + AddRoad, + AddShoppingCart, + AddTask, + AddToDrive, + AdminPanelSettings, + Agriculture, + Alarm, + AlarmAdd, + AlarmOff, + AlarmOn, + AllInbox, + AllOut, + AlternateEmail, + AltRoute, + Analytics, + Anchor, + Android, + Announcement, + Api, + AppBlocking, + AppRegistration, + Approval, + Apps, + AppSettingsAlt, + Architecture, + ArrowBack, + ArrowBackIos, + ArrowCircleDown, + ArrowCircleUp, + ArrowDownward, + ArrowDropDown, + ArrowDropDownCircle, + ArrowDropUp, + ArrowForward, + ArrowForwardIos, + ArrowForwardIosAlt, + ArrowLeft, + ArrowRight, + ArrowRightAlt, + ArrowUpward, + Article, + AspectRatio, + Assessment, + Assignment, + AssignmentInd, + AssignmentLate, + AssignmentReturn, + AssignmentReturned, + AssignmentTurnedIn, + AssistantDirection, + AssistantNavigation, + Atm, + AttachEmail, + Attachment, + Attractions, + AutoDelete, + AutoRenew, + Backup, + BackupTable, + Badge, + BakeryDining, + BatchPrediction, + BeenHere, + BikeScooter, + Book, + Bookmark, + BookmarkBorder, + Bookmarks, + BookOnline, + BreakfastDining, + BrunchDining, + BugReport, + Build, + BuildCircle, + BusAlert, + Business, + Cached, + Cake, + CalendarToday, + CalendarViewDay, + Call, + CallEnd, + CallMade, + CallMerge, + CallMissed, + CallMissedOutgoing, + CallReceived, + CallSplit, + CameraEnhance, + Campaign, + Cancel, + CancelPresentation, + CancelScheduleSend, + CardGiftcard, + CardMembership, + CardTravel, + CarRental, + CarRepair, + Category, + Celebration, + CellWifi, + ChangeHistory, + Chat, + ChatBubble, + ChatBubbleOutline, + Check, + CheckCircle, + CheckCircleOutline, + ChevronLeft, + ChevronRight, + ChromeReaderMode, + CircleNotifications, + Class, + CleanHands, + CleaningServices, + ClearAll, + Clock, + Close, + CloseFullscreen, + Cloud, + CloudCircle, + CloudDone, + CloudDownload, + CloudOff, + CloudQueue, + CloudUpload, + Code, + Comment, + CommentBank, + Commute, + CompareArrows, + CompassCalibration, + Compress, + ConnectWithoutContact, + Construction, + Contactless, + ContactMail, + ContactPage, + ContactPhone, + Contacts, + ContactSupport, + Copyright, + Coronavirus, + CreateNewFolder, + CreditCard, + Cut, + Dangerous, + Dashboard, + DashboardCustomize, + DateRange, + Deck, + Delete, + DeleteForever, + DeleteOutline, + DeliveryDining, + DepartureBoard, + Description, + DesignServices, + DesktopAccessDisabled, + DialerSip, + Dialpad, + DinnerDining, + Directions, + DirectionsBike, + DirectionsBoat, + DirectionsBus, + DirectionsCar, + DirectionsRailway, + DirectionsRun, + DirectionsSubway, + DirectionsTransit, + DirectionsWalk, + DisabledByDefault, + Dns, + Domain, + DomainDisabled, + DomainVerification, + Done, + DoneAll, + DoneOutline, + DonutLarge, + DonutSmall, + DoubleArrow, + DragIndicator, + DriveFileMove, + DriveFileMoveOutline, + DriveFileRenameOutline, + DriveFolderUpload, + DryCleaning, + DSOTruck, + Duo, + DynamicForm, + East, + Eco, + Edit, + EditAttributes, + EditLocation, + EditOff, + EditRoad, + Eject, + Elderly, + ElectricalServices, + ElectricBike, + ElectricCar, + ElectricMoped, + ElectricRickshaw, + ElectricScooter, + Email, + EmojiEmotions, + EmojiEvents, + EmojiFlags, + EmojiFoodBeverage, + EmojiNature, + EmojiObjects, + EmojiPeople, + EmojiSymbols, + EmojiTransportation, + Engineering, + Error, + ErrorOutline, + EuroSymbol, + Event, + EventSeat, + EvStation, + ExitToApp, + Expand, + ExpandLess, + ExpandMore, + Explore, + ExploreOff, + Extension, + Face, + Facebook, + FactCheck, + Fastfood, + Favorite, + FavoriteBorder, + Feedback, + Festival, + File, + FileDownload, + FileDownloadDone, + FilePresent, + FileUpload, + FilterAlt, + FilterListAlt, + FindInPage, + FindReplace, + Fingerprint, + Fireplace, + FirstPageAlt, + FirstPage, + FitScreen, + Flaky, + Flight, + FlightLand, + FlightTakeoff, + FlipToBack, + FlipToFront, + Folder, + FolderOpen, + FolderShared, + FollowTheSigns, + Forum, + ForwardToInbox, + Fullscreen, + FullscreenExit, + Gavel, + GetApp, + Gif, + Grade, + Grading, + GridView, + Group, + GroupAdd, + Groups, + GroupWork, + GTranslate, + Hail, + Handyman, + Hardware, + Help, + HelpCenter, + HelpOutline, + HighlightAlt, + HighlightOff, + History, + HistoryEdu, + HistoryToggleOff, + Home, + HomeFilled, + HomeRepairService, + HomeWork, + HorizontalSplit, + Hotel, + HourglassBottom, + HourglassDisabled, + HourglassEmpty, + HourglassFull, + HourglassTop, + Http, + Https, + Hvac, + Icecream, + IconSwerage, + IconSwerageAlt, + ImportantDevices, + ImportContacts, + ImportExport, + Info, + InfoOutline, + Input, + IntegrationInstructions, + InvertColors, + InvertColorsOff, + IosShare, + KingBed, + Label, + LabelImportant, + LabelImportantOutline, + LabelOff, + LabelOutline, + TranslateLanguage, + Language, + LastPageAlt, + LastPage, + Launch, + Layers, + LayersClear, + Leaderboard, + LegendToggle, + Lightbulb, + LightbulbOutline, + LineStyle, + LineWeight, + Liquor, + List, + ListAlt, + LiveHelp, + LocalActivity, + LocalAirport, + LocalAtm, + LocalBar, + LocalCafe, + LocalCarWash, + LocalConvenienceStore, + LocalDining, + LocalDrink, + LocalFireDepartment, + LocalFlorist, + LocalGasStation, + LocalGroceryStore, + LocalHospital, + LocalHotel, + LocalLaundryService, + LocalLibrary, + LocalMall, + LocalMovies, + LocalOffer, + LocalParking, + LocalPharmacy, + LocalPhone, + LocalPizza, + LocalPlay, + LocalPolice, + LocalPostOffice, + LocalPrintshop, + LocalSee, + LocalShipping, + LocalTaxi, + LocationCity, + LocationOff, + LocationOn, + LocationPin, + Lock, + LockClock, + LockOpen, + LockOutline, + Login, + Logout, + Loyalty, + Luggage, + LunchDining, + MailOutline, + Map, + MapsUgc, + MarkAsUnread, + MarkChatRead, + MarkChatUnread, + MarkEmailRead, + MarkEmailUnread, + MarkunreadMailbox, + Masks, + Maximize, + Mediation, + MedicalServices, + Menu, + MenuBook, + MenuOpen, + Message, + MilitaryTech, + Minimize, + MiscellaneousServices, + MobileScreenShare, + ModelTraining, + Money, + Mood, + MoodBad, + Moped, + MoreHoriz, + MoreTime, + MoreVert, + MultipleStop, + Museum, + MyLocation, + Nat, + Navigation, + NearMe, + NearMeDisabled, + NextPlan, + Nightlife, + NightlightRound, + NightsStay, + NoLuggage, + NoMeals, + NoResultsFoundIcon, + NoMealsOuline, + North, + NorthEast, + NorthWest, + NoSim, + NotAccessible, + NoteAdd, + NotificationImportant, + Notifications, + NotificationsActive, + NotificationsNone, + NotificationsOff, + NotificationsPaused, + NotListedLocation, + NoTransfer, + NotStarted, + TorchNoun, + OfflineBolt, + OfflinePin, + OfflineShare, + OnlinePrediction, + Opacity, + OpenInBrowser, + OpenInFull, + OpenInNew, + OpenWith, + Outbond, + Outbox, + OutdoorGrill, + OutgoingMail, + Outlet, + Pages, + Pageview, + PanTool, + Park, + PartyMode, + PausePresentation, + Payment, + Payments, + PedalBike, + Pending, + PendingActions, + People, + PeopleAlt, + PeopleOutline, + PermCameraMic, + PermContactCalendar, + PermDataSetting, + PermDeviceInformation, + PermIdentity, + PermMedia, + PermPhoneMsg, + PermScanWifi, + Person, + PersonAdd, + PersonAddAlt, + PersonAddSecondary, + PersonAddDisabled, + PersonOutline, + PersonPin, + PersonPinCircle, + PersonRemove, + PersonRemoveAlt, + PersonSearch, + PestControl, + PestControlRodent, + Pets, + Phone, + PhoneDisabled, + PhoneEnabled, + PhonelinkErase, + PhonelinkLock, + PhonelinkRing, + PhonelinkSetup, + PictureInPicture, + PictureInPictureAlt, + PinDrop, + PivotTableChart, + Place, + Plagiarism, + PlayForWork, + Plumbing, + PlusOne, + Poll, + Polymer, + Population, + PortableWifiOff, + PowerSettingsNew, + PregnantWoman, + PresentToAll, + Preview, + Print, + PrintDisabled, + PrivacyTip, + Psychology, + Public, + PublicOff, + PublishedWithChanges, + QrCode, + QrCodeScanner, + QueryBuilder, + QuestionAnswer, + Quickreply, + RailwayAlert, + RamenDining, + RateReview, + ReadMore, + Receipt, + Recommend, + RecordVoiceOver, + Redeem, + ReduceCapacity, + Refresh, + RemoveDone, + RemoveModerator, + RemoveShoppingCart, + Reorder, + ReportProblem, + RequestPage, + RequestQuote, + Restaurant, + RestaurantMenu, + Restore, + RestoreFromTrash, + RestorePage, + RingVolume, + Room, + RoundedCorner, + Rowing, + RssFeed, + Rtt, + Rule, + RuleFolder, + RunCircle, + Sanitizer, + Satellite, + SavedSearch, + Schedule, + ScheduleSend, + School, + Science, + ScreenShare, + Search, + SearchOff, + Segment, + SelfImprovement, + SendAndArchive, + SentimentDissatisfied, + SentimentNeutral, + SentimentSatisfied, + SentimentSatisfiedAlt, + SentimentVeryDissatisfied, + SentimentVerySatisfied, + SetMeal, + Settings, + SettingsApplications, + SettingsBackupRestore, + SettingsBluetooth, + SettingsBrightness, + SettingsCell, + SettingsEthernet, + SettingsInputAntenna, + SettingsInputComponent, + SettingsInputComposite, + SettingsInputHdmi, + SettingsInputVideo, + SettingsOverscan, + SettingsPhone, + SettingsPower, + SettingsRemote, + SettingsVoice, + Share, + Shop, + ShoppingBag, + ShoppingBasket, + ShoppingCart, + ShopAlt, + Sick, + SingleBed, + SmartButton, + SnippetFolder, + Source, + South, + SouthEast, + SouthWest, + SpeakerNotes, + SpeakerNotesOff, + SpeakerPhone, + SpellCheck, + Sports, + SportsBaseball, + SportsBasketball, + SportsCricket, + SportsEsports, + SportsFootball, + SportsGolf, + SportsHandball, + SportsHockey, + SportsKabaddi, + SportsMma, + SportsMotorsports, + SportsRugby, + SportsSoccer, + SportsTennis, + SportsVolleyball, + StarRate, + Stars, + StayCurrentLandscape, + StayCurrentPortrait, + StayPrimaryLandscape, + StayPrimaryPortrait, + StickyNotesSecondary, + ScreenShareStop, + Store, + StoreMallDirectory, + StreetView, + SubdirectoryArrowLeft, + SubdirectoryArrowRight, + Subject, + SubtitlesOff, + Subway, + SupervisedUserCircle, + SupervisorAccount, + Support, + SwapCalls, + SwapHorizontal, + SwapHorizontalCircle, + SwapVertical, + SwapVerticalCircle, + Swipe, + SwitchAccount, + SwitchLeft, + SwitchRight, + SyncAlt, + SystemUpdateAlt, + Tab, + TableView, + TabUnselected, + TakeOutDining, + TaxiAlert, + Terrain, + TextRotateUp, + TextRotateVertical, + TextRotationAngleDown, + TextRotationAngleUp, + TextRotationDown, + TextRotationNone, + SMSText, + TextSnippet, + TheaterComedy, + Theaters, + ThumbDown, + ThumbDownAlt, + ThumbDownOffAlt, + ThumbsUpDown, + ThumbUp, + ThumbUpAlt, + ThumbUpOffAlt, + Timeline, + Toc, + Today, + Toll, + Topic, + Torch, + TouchApp, + Tour, + TrackChanges, + Traffic, + Train, + Tram, + TransferWithinStation, + TransitEnterExit, + Translate, + TrendingDown, + TrendingFlat, + TrendingUp, + TripOrigin, + TurnedIn, + TurnedInNot, + TwoWheeler, + UnfoldLess, + UnfoldMore, + Unpublished, + Unsubscribe, + Update, + UpdateExpense, + UpdateExpenseSecondary, + Upgrade, + UploadFile, + Verified, + VerifiedUser, + VerticalSplit, + ViewAgenda, + ViewArray, + ViewCarousel, + ViewColumn, + ViewDay, + ViewHeadline, + ViewInAr, + ViewList, + ViewModule, + ViewQuilt, + ViewSidebar, + ViewStream, + ViewWeek, + Visibility, + VisibilityOff, + Voicemail, + VoiceOverOff, + VolunteerActivism, + VpnKey, + Warning, + WatchLater, + WaterfallChart, + West, + Whatsapp, + Whatshot, + WifiCalling, + WifiProtectedSetup, + WineBar, + Work, + WorkOff, + WorkOutline, + WorkspacesFilled, + WorkspacesOutline, + WrongLocation, + Wysiwyg, + YoutubeSearchedFor, + ZoomIn, + ZoomOut, + ZoomOutMap, + } from "@egovernments/digit-ui-svg-components"; + + + + export const SVG={ + Rotation3D, + SixFtApart, + Rotate360, + Accessibility, + AccessibilityNew, + Accessible, + AccessibleForward, + AccountBalance, + AccountBalanceWallet, + AccountBox, + AccountCircle, + AddAlert, + AddBusiness, + AddChart, + AddExpense, + AddExpenseTwo, + AddIcCall, + AddLocation, + AddLocationAlt, + AddModerator, + AddRoad, + AddShoppingCart, + AddTask, + AddToDrive, + AdminPanelSettings, + Agriculture, + Alarm, + AlarmAdd, + AlarmOff, + AlarmOn, + AllInbox, + AllOut, + AlternateEmail, + AltRoute, + Analytics, + Anchor, + Android, + Announcement, + Api, + AppBlocking, + AppRegistration, + Approval, + Apps, + AppSettingsAlt, + Architecture, + ArrowBack, + ArrowBackIos, + ArrowCircleDown, + ArrowCircleUp, + ArrowDownward, + ArrowDropDown, + ArrowDropDownCircle, + ArrowDropUp, + ArrowForward, + ArrowForwardIos, + ArrowForwardIosAlt, + ArrowLeft, + ArrowRight, + ArrowRightAlt, + ArrowUpward, + Article, + AspectRatio, + Assessment, + Assignment, + AssignmentInd, + AssignmentLate, + AssignmentReturn, + AssignmentReturned, + AssignmentTurnedIn, + AssistantDirection, + AssistantNavigation, + Atm, + AttachEmail, + Attachment, + Attractions, + AutoDelete, + AutoRenew, + Backup, + BackupTable, + Badge, + BakeryDining, + BatchPrediction, + BeenHere, + BikeScooter, + Book, + Bookmark, + BookmarkBorder, + Bookmarks, + BookOnline, + BreakfastDining, + BrunchDining, + BugReport, + Build, + BuildCircle, + BusAlert, + Business, + Cached, + Cake, + CalendarToday, + CalendarViewDay, + Call, + CallEnd, + CallMade, + CallMerge, + CallMissed, + CallMissedOutgoing, + CallReceived, + CallSplit, + CameraEnhance, + Campaign, + Cancel, + CancelPresentation, + CancelScheduleSend, + CardGiftcard, + CardMembership, + CardTravel, + CarRental, + CarRepair, + Category, + Celebration, + CellWifi, + ChangeHistory, + Chat, + ChatBubble, + ChatBubbleOutline, + Check, + CheckCircle, + CheckCircleOutline, + ChevronLeft, + ChevronRight, + ChromeReaderMode, + CircleNotifications, + Class, + CleanHands, + CleaningServices, + ClearAll, + Clock, + Close, + CloseFullscreen, + Cloud, + CloudCircle, + CloudDone, + CloudDownload, + CloudOff, + CloudQueue, + CloudUpload, + Code, + Comment, + CommentBank, + Commute, + CompareArrows, + CompassCalibration, + Compress, + ConnectWithoutContact, + Construction, + Contactless, + ContactMail, + ContactPage, + ContactPhone, + Contacts, + ContactSupport, + Copyright, + Coronavirus, + CreateNewFolder, + CreditCard, + Cut, + Dangerous, + Dashboard, + DashboardCustomize, + DateRange, + Deck, + Delete, + DeleteForever, + DeleteOutline, + DeliveryDining, + DepartureBoard, + Description, + DesignServices, + DesktopAccessDisabled, + DialerSip, + Dialpad, + DinnerDining, + Directions, + DirectionsBike, + DirectionsBoat, + DirectionsBus, + DirectionsCar, + DirectionsRailway, + DirectionsRun, + DirectionsSubway, + DirectionsTransit, + DirectionsWalk, + DisabledByDefault, + Dns, + Domain, + DomainDisabled, + DomainVerification, + Done, + DoneAll, + DoneOutline, + DonutLarge, + DonutSmall, + DoubleArrow, + DragIndicator, + DriveFileMove, + DriveFileMoveOutline, + DriveFileRenameOutline, + DriveFolderUpload, + DryCleaning, + DSOTruck, + Duo, + DynamicForm, + East, + Eco, + Edit, + EditAttributes, + EditLocation, + EditOff, + EditRoad, + Eject, + Elderly, + ElectricalServices, + ElectricBike, + ElectricCar, + ElectricMoped, + ElectricRickshaw, + ElectricScooter, + Email, + EmojiEmotions, + EmojiEvents, + EmojiFlags, + EmojiFoodBeverage, + EmojiNature, + EmojiObjects, + EmojiPeople, + EmojiSymbols, + EmojiTransportation, + Engineering, + Error, + ErrorOutline, + EuroSymbol, + Event, + EventSeat, + EvStation, + ExitToApp, + Expand, + ExpandLess, + ExpandMore, + Explore, + ExploreOff, + Extension, + Face, + Facebook, + FactCheck, + Fastfood, + Favorite, + FavoriteBorder, + Feedback, + Festival, + File, + FileDownload, + FileDownloadDone, + FilePresent, + FileUpload, + FilterAlt, + FilterListAlt, + FindInPage, + FindReplace, + Fingerprint, + Fireplace, + FirstPageAlt, + FirstPage, + FitScreen, + Flaky, + Flight, + FlightLand, + FlightTakeoff, + FlipToBack, + FlipToFront, + Folder, + FolderOpen, + FolderShared, + FollowTheSigns, + Forum, + ForwardToInbox, + Fullscreen, + FullscreenExit, + Gavel, + GetApp, + Gif, + Grade, + Grading, + GridView, + Group, + GroupAdd, + Groups, + GroupWork, + GTranslate, + Hail, + Handyman, + Hardware, + Help, + HelpCenter, + HelpOutline, + HighlightAlt, + HighlightOff, + History, + HistoryEdu, + HistoryToggleOff, + Home, + HomeFilled, + HomeRepairService, + HomeWork, + HorizontalSplit, + Hotel, + HourglassBottom, + HourglassDisabled, + HourglassEmpty, + HourglassFull, + HourglassTop, + Http, + Https, + Hvac, + Icecream, + IconSwerage, + IconSwerageAlt, + ImportantDevices, + ImportContacts, + ImportExport, + Info, + InfoOutline, + Input, + IntegrationInstructions, + InvertColors, + InvertColorsOff, + IosShare, + KingBed, + Label, + LabelImportant, + LabelImportantOutline, + LabelOff, + LabelOutline, + TranslateLanguage, + Language, + LastPageAlt, + LastPage, + Launch, + Layers, + LayersClear, + Leaderboard, + LegendToggle, + Lightbulb, + LightbulbOutline, + LineStyle, + LineWeight, + Liquor, + List, + ListAlt, + LiveHelp, + LocalActivity, + LocalAirport, + LocalAtm, + LocalBar, + LocalCafe, + LocalCarWash, + LocalConvenienceStore, + LocalDining, + LocalDrink, + LocalFireDepartment, + LocalFlorist, + LocalGasStation, + LocalGroceryStore, + LocalHospital, + LocalHotel, + LocalLaundryService, + LocalLibrary, + LocalMall, + LocalMovies, + LocalOffer, + LocalParking, + LocalPharmacy, + LocalPhone, + LocalPizza, + LocalPlay, + LocalPolice, + LocalPostOffice, + LocalPrintshop, + LocalSee, + LocalShipping, + LocalTaxi, + LocationCity, + LocationOff, + LocationOn, + LocationPin, + Lock, + LockClock, + LockOpen, + LockOutline, + Login, + Logout, + Loyalty, + Luggage, + LunchDining, + MailOutline, + Map, + MapsUgc, + MarkAsUnread, + MarkChatRead, + MarkChatUnread, + MarkEmailRead, + MarkEmailUnread, + MarkunreadMailbox, + Masks, + Maximize, + Mediation, + MedicalServices, + Menu, + MenuBook, + MenuOpen, + Message, + MilitaryTech, + Minimize, + MiscellaneousServices, + MobileScreenShare, + ModelTraining, + Money, + Mood, + MoodBad, + Moped, + MoreHoriz, + MoreTime, + MoreVert, + MultipleStop, + Museum, + MyLocation, + Nat, + Navigation, + NearMe, + NearMeDisabled, + NextPlan, + Nightlife, + NightlightRound, + NightsStay, + NoLuggage, + NoMeals, + NoMealsOuline, + NoResultsFoundIcon, + North, + NorthEast, + NorthWest, + NoSim, + NotAccessible, + NoteAdd, + NotificationImportant, + Notifications, + NotificationsActive, + NotificationsNone, + NotificationsOff, + NotificationsPaused, + NotListedLocation, + NoTransfer, + NotStarted, + TorchNoun, + OfflineBolt, + OfflinePin, + OfflineShare, + OnlinePrediction, + Opacity, + OpenInBrowser, + OpenInFull, + OpenInNew, + OpenWith, + Outbond, + Outbox, + OutdoorGrill, + OutgoingMail, + Outlet, + Pages, + Pageview, + PanTool, + Park, + PartyMode, + PausePresentation, + Payment, + Payments, + PedalBike, + Pending, + PendingActions, + People, + PeopleAlt, + PeopleOutline, + PermCameraMic, + PermContactCalendar, + PermDataSetting, + PermDeviceInformation, + PermIdentity, + PermMedia, + PermPhoneMsg, + PermScanWifi, + Person, + PersonAdd, + PersonAddAlt, + PersonAddSecondary, + PersonAddDisabled, + PersonOutline, + PersonPin, + PersonPinCircle, + PersonRemove, + PersonRemoveAlt, + PersonSearch, + PestControl, + PestControlRodent, + Pets, + Phone, + PhoneDisabled, + PhoneEnabled, + PhonelinkErase, + PhonelinkLock, + PhonelinkRing, + PhonelinkSetup, + PictureInPicture, + PictureInPictureAlt, + PinDrop, + PivotTableChart, + Place, + Plagiarism, + PlayForWork, + Plumbing, + PlusOne, + Poll, + Polymer, + Population, + PortableWifiOff, + PowerSettingsNew, + PregnantWoman, + PresentToAll, + Preview, + Print, + PrintDisabled, + PrivacyTip, + Psychology, + Public, + PublicOff, + PublishedWithChanges, + QrCode, + QrCodeScanner, + QueryBuilder, + QuestionAnswer, + Quickreply, + RailwayAlert, + RamenDining, + RateReview, + ReadMore, + Receipt, + Recommend, + RecordVoiceOver, + Redeem, + ReduceCapacity, + Refresh, + RemoveDone, + RemoveModerator, + RemoveShoppingCart, + Reorder, + ReportProblem, + RequestPage, + RequestQuote, + Restaurant, + RestaurantMenu, + Restore, + RestoreFromTrash, + RestorePage, + RingVolume, + Room, + RoundedCorner, + Rowing, + RssFeed, + Rtt, + Rule, + RuleFolder, + RunCircle, + Sanitizer, + Satellite, + SavedSearch, + Schedule, + ScheduleSend, + School, + Science, + ScreenShare, + Search, + SearchOff, + Segment, + SelfImprovement, + SendAndArchive, + SentimentDissatisfied, + SentimentNeutral, + SentimentSatisfied, + SentimentSatisfiedAlt, + SentimentVeryDissatisfied, + SentimentVerySatisfied, + SetMeal, + Settings, + SettingsApplications, + SettingsBackupRestore, + SettingsBluetooth, + SettingsBrightness, + SettingsCell, + SettingsEthernet, + SettingsInputAntenna, + SettingsInputComponent, + SettingsInputComposite, + SettingsInputHdmi, + SettingsInputVideo, + SettingsOverscan, + SettingsPhone, + SettingsPower, + SettingsRemote, + SettingsVoice, + Share, + Shop, + ShoppingBag, + ShoppingBasket, + ShoppingCart, + ShopAlt, + Sick, + SingleBed, + SmartButton, + SnippetFolder, + Source, + South, + SouthEast, + SouthWest, + SpeakerNotes, + SpeakerNotesOff, + SpeakerPhone, + SpellCheck, + Sports, + SportsBaseball, + SportsBasketball, + SportsCricket, + SportsEsports, + SportsFootball, + SportsGolf, + SportsHandball, + SportsHockey, + SportsKabaddi, + SportsMma, + SportsMotorsports, + SportsRugby, + SportsSoccer, + SportsTennis, + SportsVolleyball, + StarRate, + Stars, + StayCurrentLandscape, + StayCurrentPortrait, + StayPrimaryLandscape, + StayPrimaryPortrait, + StickyNotesSecondary, + ScreenShareStop, + Store, + StoreMallDirectory, + StreetView, + SubdirectoryArrowLeft, + SubdirectoryArrowRight, + Subject, + SubtitlesOff, + Subway, + SupervisedUserCircle, + SupervisorAccount, + Support, + SwapCalls, + SwapHorizontal, + SwapHorizontalCircle, + SwapVertical, + SwapVerticalCircle, + Swipe, + SwitchAccount, + SwitchLeft, + SwitchRight, + SyncAlt, + SystemUpdateAlt, + Tab, + TableView, + TabUnselected, + TakeOutDining, + TaxiAlert, + Terrain, + TextRotateUp, + TextRotateVertical, + TextRotationAngleDown, + TextRotationAngleUp, + TextRotationDown, + TextRotationNone, + SMSText, + TextSnippet, + TheaterComedy, + Theaters, + ThumbDown, + ThumbDownAlt, + ThumbDownOffAlt, + ThumbsUpDown, + ThumbUp, + ThumbUpAlt, + ThumbUpOffAlt, + Timeline, + Toc, + Today, + Toll, + Topic, + Torch, + TouchApp, + Tour, + TrackChanges, + Traffic, + Train, + Tram, + TransferWithinStation, + TransitEnterExit, + Translate, + TrendingDown, + TrendingFlat, + TrendingUp, + TripOrigin, + TurnedIn, + TurnedInNot, + TwoWheeler, + UnfoldLess, + UnfoldMore, + Unpublished, + Unsubscribe, + Update, + UpdateExpense, + UpdateExpenseSecondary, + Upgrade, + UploadFile, + Verified, + VerifiedUser, + VerticalSplit, + ViewAgenda, + ViewArray, + ViewCarousel, + ViewColumn, + ViewDay, + ViewHeadline, + ViewInAr, + ViewList, + ViewModule, + ViewQuilt, + ViewSidebar, + ViewStream, + ViewWeek, + Visibility, + VisibilityOff, + Voicemail, + VoiceOverOff, + VolunteerActivism, + VpnKey, + Warning, + WatchLater, + WaterfallChart, + West, + Whatsapp, + Whatshot, + WifiCalling, + WifiProtectedSetup, + WineBar, + Work, + WorkOff, + WorkOutline, + WorkspacesFilled, + WorkspacesOutline, + WrongLocation, + Wysiwyg, + YoutubeSearchedFor, + ZoomIn, + ZoomOut, + ZoomOutMap, + } \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SearchComponent.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SearchComponent.js new file mode 100644 index 00000000000..1b10c02ab7b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SearchComponent.js @@ -0,0 +1,160 @@ +import React, { useContext, useEffect, useState } from "react"; +import { useForm } from "react-hook-form"; +import { useTranslation } from "react-i18next"; +import { InboxContext } from "../hoc/InboxSearchComposerContext"; +import RenderFormFields from "../molecules/RenderFormFields"; +import Header from "../atoms/Header"; +import LinkLabel from '../atoms/LinkLabel'; +import SubmitBar from "../atoms/SubmitBar"; +import Toast from "../atoms/Toast"; +import { FilterIcon, RefreshIcon } from "./svgindex"; + +const SearchComponent = ({ uiConfig, header = "", screenType = "search", fullConfig, data}) => { + const { t } = useTranslation(); + const { state, dispatch } = useContext(InboxContext) + const [showToast,setShowToast] = useState(null) + let updatedFields = []; + const {apiDetails} = fullConfig + + if (fullConfig?.postProcessResult){ + //conditions can be added while calling postprocess function to pass different params + Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.postProcess(data, uiConfig) + } + + const { + register, + handleSubmit, + setValue, + getValues, + reset, + watch, + trigger, + control, + formState, + errors, + setError, + clearErrors, + unregister, + } = useForm({ + defaultValues: uiConfig?.defaultValues, + }); + const formData = watch(); + const checkKeyDown = (e) => { + const keyCode = e.keyCode ? e.keyCode : e.key ? e.key : e.which; + if (keyCode === 13) { + // e.preventDefault(); + } + }; + + useEffect(() => { + updatedFields = Object.values(formState?.dirtyFields) + }, [formState]) + + const onSubmit = (data) => { + + //here -> added a custom validator function, if required add in UICustomizations + const isAnyError = Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.customValidationCheck ? Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.customValidationCheck(data) : false + if(isAnyError) { + setShowToast(isAnyError) + setTimeout(closeToast,3000) + return + } + + if(updatedFields.length >= uiConfig?.minReqFields) { + // here based on screenType call respective dispatch fn + dispatch({ + type: uiConfig?.type === "filter" ? "filterForm" : "searchForm", + state: { + ...data + } + }) + } else { + setShowToast({ warning: true, label: t("ES_COMMON_MIN_SEARCH_CRITERIA_MSG") }) + setTimeout(closeToast, 3000); + } + } + + const clearSearch = () => { + reset(uiConfig?.defaultValues) + dispatch({ + type: "clearSearchForm", + state: { ...uiConfig?.defaultValues } + //need to pass form with empty strings + }) + dispatch({ + type:"clearTableForm" + }) + } + + const closeToast = () => { + setShowToast(null); + } + + const handleFilterRefresh = () => { + reset(uiConfig?.defaultValues) + dispatch({ + type: "clearFilterForm", + state: { ...uiConfig?.defaultValues } + //need to pass form with empty strings + }) + } + + const renderHeader = () => { + switch(uiConfig?.type) { + case "filter" : { + return ( +
+
+
{t(header)}
+
+
+ ) + } + default : { + return
{t(header)}
+ } + } + } + + return ( + +
+ {header && renderHeader()} +
checkKeyDown(e)}> +
+ {uiConfig?.showFormInstruction &&

{t(uiConfig?.showFormInstruction)}

} +
+ +
+ { uiConfig?.secondaryLabel && {t(uiConfig?.secondaryLabel)} } + { uiConfig?.primaryLabel && } +
+
+
+
+ { showToast && + } +
+
+ ) +} + +export default SearchComponent \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SearchableDropdown.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SearchableDropdown.js new file mode 100644 index 00000000000..935a1647ab0 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SearchableDropdown.js @@ -0,0 +1,312 @@ +import PropTypes from "prop-types"; +import React, { useEffect, useRef, useState } from "react"; +import { ArrowDown, SearchIcon } from "./svgindex"; + +const TextField = (props) => { + const {value,setValue} = props + + useEffect(() => { + if (!props.keepNull) + if (props.selectedVal) + setValue(props.selectedVal) + else { setValue(""); props.setFilter("") } + else setValue(""); + }, [props.selectedVal, props.forceSet]); + + function inputChange(e) { + if (props.freeze) return; + + setValue(e.target.value); + props.setFilter(e.target.value); + } + + function broadcastToOpen() { + if (!props.disable) { + props.dropdownDisplay(true); + } + } + + function broadcastToClose() { + props.dropdownDisplay(false); + } + + /* Custom function to scroll and select in the dropdowns while using key up and down */ + const keyChange = (e) => { + if (e.key == "ArrowDown") { + props.setOptionIndex((state) => (state + 1 == props.addProps.length ? 0 : state + 1)); + if (props.addProps.currentIndex + 1 == props.addProps.length) { + e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollTo?.(0, 0); + } else { + props?.addProps?.currentIndex > 2 && e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollBy?.(0, 45); + } + e.preventDefault(); + } else if (e.key == "ArrowUp") { + props.setOptionIndex((state) => (state !== 0 ? state - 1 : props.addProps.length - 1)); + if (props.addProps.currentIndex == 0) { + e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollTo?.(100000, 100000); + } else { + props?.addProps?.currentIndex > 2 && e?.target?.parentElement?.parentElement?.children?.namedItem("jk-dropdown-unique")?.scrollBy?.(0, -45); + } + e.preventDefault(); + } else if (e.key == "Enter") { + props.addProps.selectOption(props.addProps.currentIndex); + } + }; + + return ( + { + broadcastToClose(); + props?.onBlur?.(e); + if (props.selectedVal !== props.filterVal) { + setTimeout(() => { + props.setforceSet((val) => val + 1); + }, 1000); + } + }} + onKeyDown={keyChange} + readOnly={props.disable} + autoFocus={props.autoFocus} + placeholder={props.placeholder} + autoComplete={"off"} + style={props.style} + /> + ); +}; + +const translateDummy = (text) => { + return text; +}; + +const Dropdown = (props) => { + + const {tableRow,setTableRow} = props; + + const user_type = Digit.SessionStorage.get("userType"); + const [dropdownStatus, setDropdownStatus] = useState(false); + const [selectedOption, setSelectedOption] = useState(props.selected ? props.selected : null); + const [filterVal, setFilterVal] = useState(""); + const [forceSet, setforceSet] = useState(0); + const [optionIndex, setOptionIndex] = useState(-1); + const optionRef = useRef(null); + const hasCustomSelector = props.customSelector ? true : false; + const t = props.t || translateDummy; + + useEffect(() => { + setSelectedOption(props.selected); + }, [props.selected]); + + function dropdownSwitch() { + if (!props.disable) { + var current = dropdownStatus; + if (!current) { + document.addEventListener("mousedown", handleClick, false); + } + setDropdownStatus(!current); + props?.onBlur?.(); + } + } + + function handleClick(e) { + if (!optionRef.current || !optionRef.current.contains(e.target)) { + document.removeEventListener("mousedown", handleClick, false); + setDropdownStatus(false); + } + } + + function dropdownOn(val) { + const waitForOptions = () => setTimeout(() => setDropdownStatus(val), 500); + const timerId = waitForOptions(); + return () => { + clearTimeout(timerId); + }; + } + + function onSelect(val) { + + if (val !== selectedOption || props.allowMultiselect) { + props.select(val); + setSelectedOption(val); + setDropdownStatus(false); + + //here update the tableState + setTableRow((prevState) => { + //just for static screen purposes + const newObj = { + "name": "Name New", + "aadhar": val, + "acno": "1212-1212-1212", + "ifsc": "1313-1313-1331" + } + return [...prevState,newObj] + }) + } else { + setSelectedOption(val); + setforceSet(forceSet + 1); + + + } + } + + function setFilter(val) { + setFilterVal(val); + } + + let filteredOption = + (props.option && props.option?.filter((option) => t(option[props.optionKey])?.toUpperCase()?.indexOf(filterVal?.toUpperCase()) > -1)) || []; + function selectOption(ind) { + onSelect(filteredOption[ind]); + } + + if (props.isBPAREG && selectedOption) { + let isSelectedSameAsOptions = props.option?.filter((ob) => ob?.code === selectedOption?.code)?.length > 0; + if (!isSelectedSameAsOptions) setSelectedOption(null) + } + + return ( +
+ {hasCustomSelector && ( +
+ {props.customSelector} + {props.showArrow && } +
+ )} + {!hasCustomSelector && ( +
+ + {props.showSearchIcon ? null : } + {props.showSearchIcon ? : null} +
+ )} + {dropdownStatus ? ( + props.optionKey ? ( +
+ {filteredOption && + filteredOption.map((option, index) => { + return ( +
onSelect(option)} + > + {option.icon && {option.icon} } + {props.isPropertyAssess ?
{props.t ? props.t(option[props.optionKey]) : option[props.optionKey]}
: + {props.t ? props.t(option[props.optionKey]) : option[props.optionKey]}} +
+ ); + })} + {filteredOption && filteredOption.length === 0 && ( +
{ + + }}> + { {props.t ? props.t("CMN_NOOPTION") : "CMN_NOOPTION"}} +
+ )} +
+ ) : ( +
+ {props.option + ?.filter((option) => option?.toUpperCase().indexOf(filterVal?.toUpperCase()) > -1) + .map((option, index) => { + return ( +

onSelect(option)} + > + {option} +

+ ); + })} +
+ ) + ) : null} +
+ ); +}; + +Dropdown.propTypes = { + customSelector: PropTypes.any, + showArrow: PropTypes.bool, + selected: PropTypes.any, + style: PropTypes.object, + option: PropTypes.array, + optionKey: PropTypes.any, + select: PropTypes.any, + t: PropTypes.func, +}; + +Dropdown.defaultProps = { + customSelector: null, + showArrow: true, +}; + +export default Dropdown; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SectionalDropdown.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SectionalDropdown.js new file mode 100644 index 00000000000..726f8304dc9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SectionalDropdown.js @@ -0,0 +1,90 @@ +import React, { useEffect, useState } from "react"; +import { ArrowDown } from "./svgindex"; + +const TextField = (props) => { + const [value, setValue] = useState(props.selectedVal ? props.selectedVal : ""); + + useEffect(() => { + props.selectedVal ? setValue(props.selectedVal) : null; + }, [props.selectedVal]); + + function inputChange(e) { + setValue(e.target.value); + props.setFilter(e.target.value); + } + + return ; +}; + +const SectionalDropdown = (props) => { + const [dropdownStatus, setDropdownStatus] = useState(false); + const [selectedOption, setSelectedOption] = useState(props.selected ? props.selected : null); + const [filterVal, setFilterVal] = useState(""); + + useEffect(() => { + setSelectedOption(props.selected); + }, [props.selected]); + + function dropdownSwitch() { + var current = dropdownStatus; + setDropdownStatus(!current); + } + + function dropdownOn() { + setDropdownStatus(true); + } + + function onSelect(selectedOption) { + props.select(selectedOption); + setSelectedOption(selectedOption); + setDropdownStatus(false); + } + + function setFilter(val) { + setFilterVal(val); + } + + return ( +
+
+ + +
+ {dropdownStatus ? ( +
+ {props.menuData + .filter((subMenu) => subMenu.options.filter((option) => option[props.displayKey].toUpperCase().includes(filterVal.toUpperCase()))) + .map((subMenu, index) => { + return ( + +

{subMenu.heading}

+ {subMenu.options.map((option, index) => { + return ( +

onSelect(option)}> + {props.t ? props.t(option[props.displayKey]) : option[props.displayKey]} +

+ ); + })} +
+ ); + })} +
+ ) : null} +
+ ); +}; + +export default SectionalDropdown; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/StandaloneSearchBar.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/StandaloneSearchBar.js new file mode 100644 index 00000000000..b4700aa1858 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/StandaloneSearchBar.js @@ -0,0 +1,10 @@ +import React from "react" +import { SearchIconSvg } from "./svgindex" +const StandaloneSearchBar = ({placeholder}) => { + return
+ + +
+} + +export default StandaloneSearchBar \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/StatusTable.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/StatusTable.js new file mode 100644 index 00000000000..e83a23936e6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/StatusTable.js @@ -0,0 +1,108 @@ +import React from "react"; +import { UnMaskComponent } from ".."; + +export const LastRow = (props) => { + return ( +
+

{props.label}

+

{props.text}

+
+ ); +}; + +export const Row = (props) => { + let value = props.text; + let valueStyle = props.textStyle || {}; + let labelStyle = props.labelStyle || {}; + if (Array.isArray(props.text)) { + value = props.text.map((val, index) => { + if (val?.className) { + return ( +

+ {val?.value} + {/* + Feature :: Privacy + privacy object set to the Mask Component + */} + {props?.privacy && ( + + + + )} +

+ ); + } + return ( +

+ {val} + {props?.privacy && ( + + {/* + Feature :: Privacy + privacy object set to the Mask Component + */} + + + )} +

+ ); + }); + } + // display: inline-flex; + // width: fit-content; + // margin-left: 10px; + // } + + return ( +
+

{props.label}{props?.isMandotary && '*'}

+
+ { + props?.isValueLink ? (

{value}

) :

{value}

+ } + {props?.privacy && ( + + + + )} + {props.caption &&
{props.caption}
} +
+ {props.actionButton ? ( +
+ {props.actionButton} +
+ ) : null} +
+ ); +}; + +export const MediaRow = (props) => { + return ( +
+

{props.label}

+ {props.children} +
+ ); +}; + +export const StatusTable = (props) => { + const employee = Digit.SessionStorage.get("user_type") === "employee" ? true : false; + if (props.dataObject) { + return ( +
+ {Object.keys(props.dataObject).map((name, index) => { + if (++index === Object.keys(props.dataObject).length) { + return ; + } + return ; + })} +
+ ); + } else { + return ( +
+ {props.children} +
+ ); + } +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubMenu.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubMenu.js new file mode 100644 index 00000000000..d74ff7573fc --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubMenu.js @@ -0,0 +1,105 @@ +import React, { useState } from "react"; +import { Link, useLocation } from "react-router-dom"; +import { + PTIcon, + OBPSIcon, + PropertyHouse, + CaseIcon, + PGRIcon, + FSMIcon, + WSICon, + MCollectIcon, + CollectionIcon, + HomeIcon, + ComplaintIcon, + PersonIcon, + DocumentIconSolid, + DropIcon, + CollectionsBookmarIcons, + FinanceChartIcon, +} from "./svgindex"; + +const IconsObject = { + CommonPTIcon: , + OBPSIcon: , + propertyIcon: , + TLIcon: , + PGRIcon: , + FSMIcon: , + WSIcon: , + MCollectIcon: , + BillsIcon: , + home: , + announcement: , + business: , + store: , + assignment: , + receipt: , + "business-center": , + description: , + "water-tap": , + "collections-bookmark": , + "insert-chart": , + edcr: , + collections: , +}; +const SubMenu = ({ item, t, isEmployee }) => { + const [subnav, setSubnav] = useState(false); + const location = useLocation(); + const { pathname } = location; + const showSubnav = () => setSubnav(!subnav); + + const leftIconCitizenArray = item.icon; + const leftIconCitizen = IconsObject[leftIconCitizenArray] || IconsObject.BillsIcon; + + const leftIconEmployeeItems = item?.icon?.split?.(":")?.[1] || ""; + + const leftIconEmployee = IconsObject[leftIconEmployeeItems] || IconsObject.collections; + + return ( + +
+
+
+ {isEmployee ? leftIconEmployee : leftIconCitizen} + {isEmployee ? item.moduleName : t(Digit.Utils.locale.getTransformedLocale(`ACTION_TEST_${item.moduleName}`))} +
+
{item.links && subnav}
+
+
+ + {subnav && + item.links + .sort((a, b) => a.orderNumber - b.orderNumber) + .map((item, index) => { + if (item.navigationURL.indexOf(`/${window?.contextPath}`) === -1) { + const getOrigin = window.location.origin; + return ( + +
+ {item.label || item.displayName} +
+
+ ); + } + return ( + +
+ {item.label || item.displayName} +
+ + ); + })} +
+ ); +}; + +export default SubMenu; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubmitBar.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubmitBar.js new file mode 100644 index 00000000000..bef3395df49 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubmitBar.js @@ -0,0 +1,41 @@ +import React, { forwardRef } from "react"; +import PropTypes from "prop-types"; + +const SubmitBar = forwardRef((props, ref) => { + return ( + + ); +}); + +SubmitBar.propTypes = { + /** + * Is it a normal button or submit button? + */ + submit: PropTypes.any, + /** + * style for the button + */ + style: PropTypes.object, + /** + * SubmitButton contents + */ + label: PropTypes.string, + /** + * Optional click handler + */ + onSubmit: PropTypes.func, +}; + +SubmitBar.defaultProps = {}; + +export default SubmitBar; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubmitBar.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubmitBar.stories.js new file mode 100644 index 00000000000..ef9f73c0a43 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/SubmitBar.stories.js @@ -0,0 +1,28 @@ +import React from "react"; + +import SubmitBar from "./SubmitBar"; + +export default { + title: "Atom/SubmitBar", + component: SubmitBar, +}; + +const Template = (args) => ; + +export const SubmitButton = Template.bind({}); + +SubmitButton.args = { + submit: true, + style: {}, + label: "Submit", + onSubmit: undefined, +}; + +export const NormalButton = Template.bind({}); + +NormalButton.args = { + submit: false, + style: {}, + label: "Click me", + onSubmit: undefined, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TLCaption.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TLCaption.js new file mode 100644 index 00000000000..e13fe31dff5 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TLCaption.js @@ -0,0 +1,40 @@ +import React from "react"; +import { useTranslation } from "react-i18next"; +import Reason from "./Reason"; +import TelePhone from "./TelePhone" +import DisplayPhotos from "./DisplayPhotos"; +import UnMaskComponent from "./UnMaskComponent"; + + + +const TLCaption = ({ data, OpenImage, privacy = {} }) => { + + const { t } = useTranslation(); + return ( +
+ {data.date &&

{data.date}

} +

{data.name}

+ {data.mobileNumber && + +

    

+ +
} + {data.source &&

{t("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_" + data.source.toUpperCase())}

} + {data.comment && } + {data.additionalComment && } + {data?.wfComment.length>0 ?
{data?.wfComment?.map(e => +
+

{t("WF_COMMON_COMMENTS")}

+

{e}

+
+ )}
: null} + + {data?.thumbnailsToShow?.thumbs?.length > 0 ?
+

{t("CS_COMMON_ATTACHMENTS")}

+ { OpenImage(src, index, data?.thumbnailsToShow) }} /> +
: null} +
+ ); +}; + +export default TLCaption; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Table.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Table.js new file mode 100644 index 00000000000..bc335c1482c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/Table.js @@ -0,0 +1,274 @@ +import React, { useEffect, useState, useRef, forwardRef } from "react"; +import { useGlobalFilter, usePagination, useRowSelect, useSortBy, useTable } from "react-table"; +import { ArrowBack, ArrowForward, ArrowToFirst, ArrowToLast, SortDown, SortUp, DoubleTickIcon } from "./svgindex"; +import CheckBox from "./CheckBox"; +import ActionBar from "./ActionBar"; +import SubmitBar from "./SubmitBar"; +import Toast from "./Toast"; + +const noop = () => {}; + +const IndeterminateCheckbox = forwardRef( + ({ indeterminate, ...rest }, ref) => { + const defaultRef = useRef() + const resolvedRef = ref || defaultRef + + useEffect(() => { + resolvedRef.current.indeterminate = indeterminate + }, [resolvedRef, indeterminate]) + + return ( + + + + ) + } +) +const getNoColumnBorder=(noColumnBorder)=>noColumnBorder?({ + cellspacing:"0" ,cellpadding:"0" +}):null; +const Table = ({ + className = "table", + t, + data, + columns, + getCellProps, + currentPage = 0, + pageSizeLimit = 10, + disableSort = true, + autoSort = false, + initSortId = "", + onSearch = false, + manualPagination = true, + totalRecords, + onNextPage, + onPrevPage, + globalSearch, + onSort = noop, + onPageSizeChange, + onLastPage, + onFirstPage, + isPaginationRequired = true, + sortParams = [], + showAutoSerialNo = false, + customTableWrapperClassName = "", + styles = {}, + tableTopComponent, + tableRef, + isReportTable = false, + showCheckBox = false, + actionLabel = 'CS_COMMON_DOWNLOAD', + tableSelectionHandler = () => {}, + onClickRow= ()=>{}, + rowClassName = "", + noColumnBorder=false +}) => { + const { + getTableProps, + getTableBodyProps, + headerGroups, + rows, + prepareRow, + page, + canPreviousPage, + canNextPage, + pageOptions, + pageCount, + gotoPage, + nextPage, + previousPage, + setPageSize, + setGlobalFilter, + state: { pageIndex, pageSize, sortBy, globalFilter, selectedRowIds }, + } = useTable( + { + columns, + data, + initialState: { pageIndex: currentPage, pageSize: pageSizeLimit, sortBy: autoSort ? [{ id: initSortId, desc: false }] : sortParams }, + pageCount: totalRecords > 0 ? Math.ceil(totalRecords / pageSizeLimit) : -1, + manualPagination: manualPagination, + disableMultiSort: false, + disableSortBy: disableSort, + manualSortBy: autoSort ? false : true, + autoResetPage: false, + autoResetSortBy: false, + disableSortRemove: true, + disableGlobalFilter: onSearch === false ? true : false, + globalFilter: globalSearch || "text", + useControlledState: (state) => { + return React.useMemo(() => ({ + ...state, + pageIndex: manualPagination ? currentPage : state.pageIndex, + })); + }, + }, + useGlobalFilter, + useSortBy, + usePagination, + useRowSelect, + hooks => { + if(showCheckBox) { + hooks.visibleColumns.push(columns => [ + { + id: 'selection', + Header: ({ getToggleAllPageRowsSelectedProps }) => ( +
+ +
+ ), + Cell: ({ row }) => ( +
+ +
+ ), + }, + ...columns, + ]) + } + } + ); + let isTotalColSpanRendered = false; + const [toast, setToast] = useState({show : false, label : "", error : false}); + + useEffect(() => { + onSort(sortBy); + }, [onSort, sortBy]); + + + useEffect(() => setGlobalFilter(onSearch), [onSearch, setGlobalFilter,data]); + + const handleSelection = async () => { + const selectedRows = rows?.filter(ele => Object.keys(selectedRowIds)?.includes(ele?.id)) + const response = await tableSelectionHandler(selectedRows,t) + setToast({show: true, label: t(response?.label), error: !response?.isSuccess}) + } + + const handleToastClose = () => { + setToast({show : false, label : "", error : false}) + } + + useEffect(()=>{ + if(toast?.show) { + setTimeout(()=>{ + handleToastClose(); + },3000); + } + },[toast?.show]) + + //note -> adding data prop in dependency array to trigger filter whenever state of the table changes + //use case -> without this if we enter string to search and then click on it's attendence checkbox or skill selector for that matter then the global filtering resets and whole table is shown + return ( + + + {tableTopComponent ? tableTopComponent : null} + + + {headerGroups.map((headerGroup) => ( + + {showAutoSerialNo && ( + + )} + {headerGroup.headers.map((column) => ( + + ))} + + ))} + + + {page.map((row, i) => { + // rows.slice(0, 10).map((row, i) => { + prepareRow(row); + return ( + onClickRow(row)} className={rowClassName}> + {showAutoSerialNo && } + {row.cells.map((cell) => { + return ( + + ); + })} + + ); + })} + +
+ {showAutoSerialNo && typeof showAutoSerialNo == "string" ? t(showAutoSerialNo) : t("TB_SNO")} + + {column.render("Header")} + {column.isSorted ? column.isSortedDesc ? : : ""} +
{i + 1} + {cell.attachment_link ? ( + + {cell.render("Cell")} + + ) : ( + {cell.render("Cell")} + )} +
+
+ {isPaginationRequired && ( +
+ {`${t("CS_COMMON_ROWS_PER_PAGE")} :`} + + + + {pageIndex * pageSize + 1} + {"-"} + {manualPagination + ? (currentPage + 1) * pageSizeLimit > totalRecords + ? totalRecords + : (currentPage + 1) * pageSizeLimit + : pageIndex * pageSize + page?.length}{" "} + {/* {(pageIndex + 1) * pageSizeLimit > rows.length ? rows.length : (pageIndex + 1) * pageSizeLimit}{" "} */} + {totalRecords ? `of ${manualPagination ? totalRecords : rows.length}` : ""} + {" "} + + {/* to go to first and last page we need to do a manual pagination , it can be updated later*/} + {!manualPagination && pageIndex != 0 && gotoPage(0)} className={"cp"} />} + {canPreviousPage && manualPagination && onFirstPage && manualPagination && onFirstPage()} className={"cp"} />} + {canPreviousPage && (manualPagination ? onPrevPage() : previousPage())} className={"cp"} />} + {canNextPage && (manualPagination ? onNextPage() : nextPage())} className={"cp"} />} + {!manualPagination && pageIndex != pageCount - 1 && gotoPage(pageCount - 1)} className={"cp"} />} + {rows.length == pageSizeLimit && canNextPage && manualPagination && onLastPage && ( + manualPagination && onLastPage()} className={"cp"} /> + )} + {/* to go to first and last page we need to do a manual pagination , it can be updated later*/} +
+ )} + { Object.keys(selectedRowIds)?.length > 0 && ( + + + +

{`${Object.keys(selectedRowIds)?.length} ${t("COMMON_SELECTED")}`}

+
+ +
)} + {toast?.show && } +
+ ); +}; + +export default Table; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TelePhone.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TelePhone.js new file mode 100644 index 00000000000..3b7e1860b6b --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TelePhone.js @@ -0,0 +1,27 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { Phone } from "./svgindex"; + +const TelePhone = ({ mobile, text }) => ( + + {text} +
+ +
+
+); + +TelePhone.propTypes = { + mobile: PropTypes.any, + text: PropTypes.string, +}; + +TelePhone.defaultProps = { + mobile: "", + text: "", +}; + +export default TelePhone; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TelePhone.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TelePhone.stories.js new file mode 100644 index 00000000000..69764f33bac --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TelePhone.stories.js @@ -0,0 +1,16 @@ +import React from "react"; + +import TelePhone from "./TelePhone"; + +export default { + title: "Atom/TelePhone", + component: TelePhone, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); +Default.args = { + mobile: "9292929929", + text: "Joe Doe", +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextArea.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextArea.js new file mode 100644 index 00000000000..957dbb0c40f --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextArea.js @@ -0,0 +1,45 @@ +import React from "react"; +import PropTypes from "prop-types"; + +const TextArea = (props) => { + const user_type = Digit.SessionStorage.get("userType"); + + return ( + + + {

{props.hintText}

} +
+ ); +}; + +TextArea.propTypes = { + userType: PropTypes.string, + name: PropTypes.string.isRequired, + ref: PropTypes.func, + value: PropTypes.string, + onChange: PropTypes.func, + id: PropTypes.string, +}; + +TextArea.defaultProps = { + ref: undefined, + onChange: undefined, +}; + +export default TextArea; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextArea.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextArea.stories.js new file mode 100644 index 00000000000..afe730836cd --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/atoms/TextArea.stories.js @@ -0,0 +1,18 @@ +import React from "react"; + +import TextArea from "./TextArea"; + +export default { + title: "Atom/TextArea", + component: TextArea, +}; + +const Template = (args) => + + ); + }); + + return ( +
+ + {!childrenAtTheBottom && children} + {inputs} + {forcedError && !showErrorBelowChildren && {t(forcedError)}} + {childrenAtTheBottom && children} + {forcedError && showErrorBelowChildren && {t(forcedError)}} + +
+ ); +}; + +FormStep.propTypes = { + config: PropTypes.shape({}), + onSelect: PropTypes.func, + onSkip: PropTypes.func, + onAdd: PropTypes.func, + t: PropTypes.func, +}; + +FormStep.defaultProps = { + config: {}, + onSelect: undefined, + onSkip: undefined, + onAdd: undefined, + t: (value) => value, +}; + +export default FormStep; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/FormStep.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/FormStep.stories.js new file mode 100644 index 00000000000..33618f20523 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/FormStep.stories.js @@ -0,0 +1,18 @@ +import React from "react"; + +import FormStep from "./FormStep"; + +export default { + title: "Molecule/FormStep", + component: FormStep, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + config: { + inputs: [{ type: "text", name: "firstName", label: "First Name", error: "This field is required", validation: null }], + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/InputCard.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/InputCard.js new file mode 100644 index 00000000000..46002483135 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/InputCard.js @@ -0,0 +1,60 @@ +import React from "react"; +import PropTypes from "prop-types"; + +import Card from "../atoms/Card"; +import CardHeader from "../atoms/CardHeader"; +import CardText from "../atoms/CardText"; +import SubmitBar from "../atoms/SubmitBar"; +import LinkButton from "../atoms/LinkButton"; +import CardCaption from "../atoms/CardCaption"; +import TextInput from "../atoms/TextInput"; + +const InputCard = ({ + t, + children, + texts = {}, + submit = false, + inputs = [], + inputRef, + onNext, + onSkip, + isDisable, + onAdd, + isMultipleAllow = false, + cardStyle = {}, +}) => { + const isMobile = window.Digit.Utils.browser.isMobile(); + // TODO: inputs handle + return ( + + {texts.headerCaption && {t(texts.headerCaption)}} + {texts?.header && {t(texts.header)}} + {texts?.cardText && {t(texts.cardText)}} + {children} + {texts.submitBarLabel ? : null} + {texts.skipLabel ? {t(texts.skipLabel)} : null} + {texts.skipText ? : null} + {isMultipleAllow && texts.addMultipleText ? : null} + + ); +}; + +InputCard.propTypes = { + text: PropTypes.object, + submit: PropTypes.bool, + onNext: PropTypes.func, + onSkip: PropTypes.func, + onAdd: PropTypes.func, + t: PropTypes.func, +}; + +InputCard.defaultProps = { + texts: {}, + submit: false, + onNext: undefined, + onSkip: undefined, + onAdd: undefined, + t: (value) => value, +}; + +export default InputCard; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/InputCard.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/InputCard.stories.js new file mode 100644 index 00000000000..0b94f76fda2 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/InputCard.stories.js @@ -0,0 +1,22 @@ +import React from "react"; + +import InputCard from "./InputCard"; + +export default { + title: "Molecule/InputCard", + component: InputCard, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + texts: { + headerCaption: "Header Caption", + header: "Header", + cardText: "Card Text", + nextText: "Next", + skipText: "Skip", + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/Localities.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/Localities.js new file mode 100644 index 00000000000..68eb85aa176 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/Localities.js @@ -0,0 +1,29 @@ +import React from "react"; +import { Loader } from "../atoms/Loader"; +import Dropdown from "../atoms/Dropdown"; +import { useTranslation } from "react-i18next"; + +const Localities = ({ selectLocality, tenantId, boundaryType, keepNull, selected, optionCardStyles, style, disable, disableLoader, sortFn }) => { + const { t } = useTranslation(); + + const { data: tenantlocalties, isLoading } = Digit.Hooks.useBoundaryLocalities(tenantId, boundaryType, { enabled: !disable }, t); + if (isLoading && !disableLoader) { + return ; + } + + return ( + + ); + //

ABCD

+}; + +export default Localities; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationDropdownWrapper.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationDropdownWrapper.js new file mode 100644 index 00000000000..585702856d9 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationDropdownWrapper.js @@ -0,0 +1,97 @@ +import React,{Fragment,useState,useEffect} from 'react' +import MultiSelectDropdown from '../atoms/MultiSelectDropdown' +import Dropdown from '../atoms/Dropdown' +import { Loader } from '../atoms/Loader' +import { useTranslation } from 'react-i18next' +const LocationDropdownWrapper = ({populators,formData,props,inputRef,errors,setValue}) => { + //based on type (ward/locality) we will render dropdowns respectively + //here we will render two types of dropdown based on allowMultiSelect boolean + // for singleSelect render + + const [options,setOptions] = useState([]) + + const tenantId = Digit.ULBService.getCurrentTenantId() + const headerLocale = Digit.Utils.locale.getTransformedLocale(tenantId); + const { t } = useTranslation() + const { isLoading, data: wardsAndLocalities } = Digit.Hooks.useLocation( + tenantId, 'Ward', + { + select: (data) => { + + const wards = [] + const localities = {} + data?.TenantBoundary[0]?.boundary.forEach((item) => { + localities[item?.code] = item?.children.map(item => ({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label: item?.label })) + wards.push({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` }) + }); + + return { + wards, localities + } + } + }); + + + useEffect(() => { + if(wardsAndLocalities) { + if(populators.type==="ward"){ + setOptions(wardsAndLocalities?.wards) + } + else{ + //here you need to set the localities based on the selected ward + let locs = [] + const selectedWardsCodes = formData?.ward?.map(row=>row.code) + selectedWardsCodes?.forEach(code=>{ + locs=[...locs,...wardsAndLocalities?.localities?.[code]] + }) + setOptions(locs) + } + } + }, [wardsAndLocalities,formData?.ward]) + + + if(isLoading) return + + return ( + <> + {populators.allowMultiSelect &&
+ { + if(populators.type === "ward"){ + setValue('locality',[]) + } + props.onChange(e?.map(row => { return row?.[1] ? row[1] : null }).filter(e => e)) + }} + selected={props?.value} + defaultLabel={t(populators?.defaultText)} + defaultUnit={t(populators?.selectedText)} + config={populators} + /> +
} + {!populators.allowMultiSelect && + { + props.onChange([e], populators.name); + }} + selected={props.value?.[0] || populators.defaultValue} + defaultValue={props.value?.[0] || populators.defaultValue} + t={t} + errorStyle={errors?.[populators.name]} + optionCardStyles={populators?.optionsCustomStyle} + /> + } + + ) +} + +export default LocationDropdownWrapper \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationSearchCard.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationSearchCard.js new file mode 100644 index 00000000000..a894348905d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationSearchCard.js @@ -0,0 +1,107 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { useTranslation } from "react-i18next"; + +import Card from "../atoms/Card"; +import CardHeader from "../atoms/CardHeader"; +import CardText from "../atoms/CardText"; +import CardLabelError from "../atoms/CardLabelError"; +import LocationSearch from "../atoms/LocationSearch"; +import SubmitBar from "../atoms/SubmitBar"; +import LinkButton from "../atoms/LinkButton"; + +const LocationSearchCard = ({ + header, + cardText, + nextText, + t, + skipAndContinueText, + forcedError, + skip, + onSave, + onChange, + position, + disabled, + cardBodyStyle = {}, + isPTDefault, + PTdefaultcoord, + isPlaceRequired, + handleRemove, + Webview=false, + isPopUp=false, +}) => { + let isDisabled = false || disabled; + const onLocationChange = (val, location) => { + isDisabled = val ? false : true; + onChange(val, location); + }; + + const onLocationChangewithPlace = (val, location, place) => { + isDisabled = val ? false : true; + onChange(val, location, place); + }; + + return ( + + {header} +
+ {isPopUp && + + + + + +
+ } + style={{width: "100px", display:"inline"}} + onClick={(e) => handleRemove()} + />} + + {/* Click and hold to drop the pin to complaint location. If you are not + able to pin the location you can skip the continue for next step. */} + {cardText} + + + + {forcedError && {t(forcedError)}} +
+ + {skip ? : null} + + ); +}; + +LocationSearchCard.propTypes = { + header: PropTypes.string, + cardText: PropTypes.string, + nextText: PropTypes.string, + skipAndContinueText: PropTypes.string, + skip: PropTypes.func, + onSave: PropTypes.func, + onChange: PropTypes.func, + position: PropTypes.any, + isPTDefault: PropTypes.any, + PTdefaultcoord: PropTypes.any, + isPlaceRequired: PropTypes.any, +}; + +LocationSearchCard.defaultProps = { + header: "", + cardText: "", + nextText: "", + skipAndContinueText: "", + skip: () => {}, + onSave: null, + onChange: () => {}, + position: undefined, + isPTDefault: false, + PTdefaultcoord: {}, + isPlaceRequired: false, + handleRemove: () => {}, + Webview:false, + isPopUp:false, +}; + +export default LocationSearchCard; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationSearchCard.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationSearchCard.stories.js new file mode 100644 index 00000000000..96517792e00 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/LocationSearchCard.stories.js @@ -0,0 +1,20 @@ +import React from "react"; + +import LocationSearchCard from "./LocationSearchCard"; + +export default { + title: "Molecule/LocationSearchCard", + component: LocationSearchCard, +}; + +const Template = (args) => ; + +export const Default = Template.bind({}); + +Default.args = { + header: "Header", + cardText: "Card Text", + nextText: "Next Text", + skipAndContinueText: "Skip", + skip: true, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/MultiUploadWrapper.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/MultiUploadWrapper.js new file mode 100644 index 00000000000..6cca7471a71 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/MultiUploadWrapper.js @@ -0,0 +1,145 @@ +import React, { useEffect, useReducer, useState } from "react" +import UploadFile from "../atoms/UploadFile" + +const displayError = ({ t, error, name }, customErrorMsg) => ( + +
{customErrorMsg ? t(customErrorMsg) : t(error)}
+
{customErrorMsg ? '' : `${t('ES_COMMON_DOC_FILENAME')} : ${name} ...`}
+
+) + +const fileValidationStatus = (file, regex, maxSize, t) => { + + const status = { valid: true, name: file?.name?.substring(0, 15), error: '' }; + if (!file) return; + + if (!regex.test(file.type) && (file.size / 1024 / 1024) > maxSize) { + status.valid = false; status.error = t(`NOT_SUPPORTED_FILE_TYPE_AND_FILE_SIZE_EXCEEDED_5MB`); + } + + if (!regex.test(file.type)) { + status.valid = false; status.error = t(`NOT_SUPPORTED_FILE_TYPE`); + } + + if ((file.size / 1024 / 1024) > maxSize) { + status.valid = false; status.error = t(`FILE_SIZE_EXCEEDED_5MB`); + } + + return status; +} +const checkIfAllValidFiles = (files, regex, maxSize, t, maxFilesAllowed, state) => { + if (!files.length || !regex || !maxSize) return [{}, false]; + + // added another condition files.length > 0 , for when user uploads files more than maxFilesAllowed in one go the + const uploadedFiles = state.length + 1 + if ( maxFilesAllowed && (uploadedFiles > maxFilesAllowed || files.length > maxFilesAllowed)) return [[{ valid: false, name: files[0]?.name?.substring(0, 15), error: t(`FILE_LIMIT_EXCEEDED`)}],true] + + // Adding a check for fileSize > maxSize + // const maxSizeInBytes = maxSize * 1000000 + // if(files?.some(file => file.size > maxSizeInBytes)){ + // return [[{ valid: false, name: "", error: t(`FILE_SIZE_EXCEEDED_5MB`) }], true] + // } + + const messages = []; + let isInValidGroup = false; + for (let file of files) { + const fileStatus = fileValidationStatus(file, regex, maxSize, t); + if (!fileStatus.valid) { + isInValidGroup = true; + } + messages.push(fileStatus); + } + + return [messages, isInValidGroup]; +} + +// can use react hook form to set validations @neeraj-egov +const MultiUploadWrapper = ({ t, module = "PGR", tenantId = Digit.ULBService.getStateId(), getFormState, requestSpecifcFileRemoval, extraStyleName = "", setuploadedstate = [], showHintBelow, hintText, allowedFileTypesRegex = /(.*?)(jpg|jpeg|webp|aif|png|image|pdf|msword|openxmlformats-officedocument)$/i, allowedMaxSizeInMB = 10, acceptFiles = "image/*, .jpg, .jpeg, .webp, .aif, .png, .image, .pdf, .msword, .openxmlformats-officedocument, .dxf", maxFilesAllowed, customClass="", customErrorMsg,containerStyles }) => { + const FILES_UPLOADED = "FILES_UPLOADED" + const TARGET_FILE_REMOVAL = "TARGET_FILE_REMOVAL" + + const [fileErrors, setFileErrors] = useState([]); + const [enableButton, setEnableButton] = useState(true) + + const uploadMultipleFiles = (state, payload) => { + const { files, fileStoreIds } = payload; + const filesData = Array.from(files) + const newUploads = filesData?.map((file, index) => [file.name, { file, fileStoreId: fileStoreIds[index] }]) + return [...state, ...newUploads] + } + + const removeFile = (state, payload) => { + const __indexOfItemToDelete = state.findIndex(e => e[1].fileStoreId.fileStoreId === payload.fileStoreId.fileStoreId) + const mutatedState = state.filter((e, index) => index !== __indexOfItemToDelete) + setFileErrors([]) + return [...mutatedState] + } + + const uploadReducer = (state, action) => { + switch (action.type) { + case FILES_UPLOADED: + return uploadMultipleFiles(state, action.payload) + case TARGET_FILE_REMOVAL: + return removeFile(state, action.payload) + default: + break; + } + } + + const [state, dispatch] = useReducer(uploadReducer, [...setuploadedstate]) + + const onUploadMultipleFiles = async (e) => { + setEnableButton(false) + setFileErrors([]) + const files = Array.from(e.target.files); + + if (!files.length) return; + const [validationMsg, error] = checkIfAllValidFiles(files, allowedFileTypesRegex, allowedMaxSizeInMB, t, maxFilesAllowed, state); + + if (!error) { + try { + const { data: { files: fileStoreIds } = {} } = await Digit.UploadServices.MultipleFilesStorage(module, e.target.files, tenantId) + setEnableButton(true) + return dispatch({ type: FILES_UPLOADED, payload: { files: e.target.files, fileStoreIds } }) + } catch (err) { + setEnableButton(true) + } + } else { + setFileErrors(validationMsg) + setEnableButton(true) + } + } + + useEffect(() => getFormState(state), [state]) + + useEffect(() => { + requestSpecifcFileRemoval ? dispatch({ type: TARGET_FILE_REMOVAL, payload: requestSpecifcFileRemoval }) : null + }, [requestSpecifcFileRemoval]) + + return ( +
+ onUploadMultipleFiles(e)} + removeTargetedFile={(fileDetailsData) => dispatch({ type: TARGET_FILE_REMOVAL, payload: fileDetailsData })} + uploadedFiles={state} + multiple={true} + showHintBelow={showHintBelow} + hintText={hintText} + extraStyleName={extraStyleName} + onDelete={() => { + setFileErrors([]) + }} + accept={acceptFiles} + message={t(`WORKS_NO_FILE_SELECTED`)} + customClass={customClass} + enableButton={enableButton} + /> + + {fileErrors.length ? fileErrors.map(({ valid, name, type, size, error }) => ( + valid ? null : displayError({ t, error, name }, customErrorMsg) + )) : null} + +
) +} + +export default MultiUploadWrapper \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/OnGroundEventCard.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/OnGroundEventCard.js new file mode 100644 index 00000000000..317c79faac6 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/OnGroundEventCard.js @@ -0,0 +1,28 @@ +import React from "react" +import EventCalendarView from "../atoms/EventCalendarView" +import { MapMarker, Clock } from "../atoms/svgindex" + +const OnGroundEventCard = ({onClick = () => null, name, id, eventDetails, onGroundEventMonth="MAR", onGroundEventDate="12 - 16", onGroundEventName="To the moon", onGroundEventLocation="Moon", onGroundEventTimeRange="10:00 am - 1:00 pm", eventCategory, showEventCatergory }) => { + + const onEventCardClick = () => onClick(id) + + return
+ +
+

{name}

+ {!showEventCatergory ?
+ +

{eventDetails?.address}

+
: null} + {!showEventCatergory ?
+ +

{onGroundEventTimeRange}

+
: null} + {showEventCatergory ?
+

{eventCategory}

+
: null} +
+
+} + +export default OnGroundEventCard \ No newline at end of file diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/PageBasedInput.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/PageBasedInput.js new file mode 100644 index 00000000000..0615e05fa7d --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/PageBasedInput.js @@ -0,0 +1,19 @@ +import React from "react"; +import Card from "../atoms/Card"; +import SubmitBar from "../atoms/SubmitBar"; + +const PageBasedInput = ({ children, texts, onSubmit }) => { + return ( +
+ + {children} + + +
+ +
+
+ ); +}; + +export default PageBasedInput; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/PitDimension.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/PitDimension.js new file mode 100644 index 00000000000..733d555764c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/PitDimension.js @@ -0,0 +1,52 @@ +import React from "react"; +import TextInput from "../atoms/TextInput"; +import CardText from "../atoms/CardText"; + +const DimentionInput = ({ name, value, onChange, disable }) => ( + +); + +const PitDimension = ({ sanitationType, t, size = {}, handleChange, disable = false }) => { + return sanitationType?.dimension === "dd" ? ( +
+
+ + + {t("CS_FILE_PROPERTY_DIAMETER")} + +
+ x +
+ + + {t("CS_FILE_PROPERTY_HEIGHT")} + +
+
+ ) : ( +
+
+ + + {t("CS_FILE_PROPERTY_LENGTH")} + +
+ x +
+ + + {t("CS_FILE_PROPERTY_WIDTH")} + +
+ x +
+ + + {t("CS_FILE_PROPERTY_HEIGHT")} + +
+
+ ); +}; + +export default PitDimension; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RadioOrSelect.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RadioOrSelect.js new file mode 100644 index 00000000000..75e201cc812 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RadioOrSelect.js @@ -0,0 +1,55 @@ +import React from "react"; +import RadioButtons from "../atoms/RadioButtons"; +import Dropdown from "../atoms/Dropdown"; + +const RadioOrSelect = ({ + options, + onSelect, + optionKey, + selectedOption, + isMandatory, + t, + labelKey, + dropdownStyle = {}, + isDependent = false, + disabled = false, + optionCardStyles, + isPTFlow=false, + isDropDown = false, + innerStyles = {}, + inputStyle = {} +}) => { + return ( + + {options?.length < 5 && !isDropDown ? ( + + ) : ( + + )} + + ); +}; + +export default RadioOrSelect; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.js new file mode 100644 index 00000000000..104a6339a52 --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.js @@ -0,0 +1,108 @@ +import React, { useState } from "react"; +import { useForm } from "react-hook-form"; +import PropTypes from "prop-types"; + +import TextArea from "../atoms/TextArea"; +import CardLabel from "../atoms/CardLabel"; +import Rating from "../atoms/Rating"; +import CheckBox from "../atoms/CheckBox"; +import Card from "../atoms/Card"; +import CardHeader from "../atoms/CardHeader"; +import SubmitBar from "../atoms/SubmitBar"; +import RadioButtons from "../atoms/RadioButtons"; +import Dropdown from "../atoms/Dropdown"; + +const RatingCard = ({ config, onSelect, t }) => { + const { register, watch, handleSubmit } = useForm(); + const [comments, setComments] = useState(""); + const [rating, setRating] = useState(0); + + const onSubmit = (data) => { + data.rating = rating; + onSelect(data); + }; + + const feedback = (e, ref, index) => { + setRating(index); + }; + + const segments = config.inputs?.map((input, index) => { + if (input.type === "rate") { + return ( + + {t(input.label)} + {input?.error} + feedback(e, ref, i)} /> + + ); + } + + if (input.type === "checkbox") { + return ( + + {t(input.label)} + {input.checkLabels && + input.checkLabels.map((label, index) => )} + + ); + } + + if (input.type === "radio") { + return ( + + {t(input.label)} + + + ); + } + + if (input.type === "textarea") { + return ( + + {t(input.label)} + + + ); + } + + if (input.type === "dropDown") { + return ( + + {t(input.label)} + + + ); + } + }); + return ( +
+ + {t(config.texts.header)} + {segments} + + +
+ ); +}; + +RatingCard.propTypes = { + config: PropTypes.object, + onSubmit: PropTypes.func, + t: PropTypes.func, +}; + +RatingCard.defaultProps = { + config: {}, + onSubmit: undefined, + t: (value) => value, +}; + +export default RatingCard; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.stories.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.stories.js new file mode 100644 index 00000000000..ee8a52c619e --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RatingCard.stories.js @@ -0,0 +1,37 @@ +import React from "react"; + +import RatingCard from "./RatingCard"; + +export default { + title: "Molecule/RatingCard", + component: RatingCard, +}; + +const Template = (args) => ; + +export const InputTypeRate = Template.bind({}); + +InputTypeRate.args = { + config: { + inputs: [{ type: "rate", label: "Label" }], + texts: { header: "Header", submitBarLabel: "Submit" }, + }, +}; + +export const InputTypeCheckbox = Template.bind({}); + +InputTypeCheckbox.args = { + config: { + inputs: [{ type: "checkbox", label: "Label", checkLabels: ["Check Label"] }], + texts: { header: "Header", submitBarLabel: "Submit" }, + }, +}; + +export const InputTypeTextArea = Template.bind({}); + +InputTypeTextArea.args = { + config: { + inputs: [{ type: "textarea", label: "Label", name: "name" }], + texts: { header: "Header", submitBarLabel: "Submit" }, + }, +}; diff --git a/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RenderFormFields.js b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RenderFormFields.js new file mode 100644 index 00000000000..7449cb69a8c --- /dev/null +++ b/frontend/workbench-ui/web/micro-ui-internals/packages/react-components/src/molecules/RenderFormFields.js @@ -0,0 +1,349 @@ +import React from 'react'; +import { useTranslation } from "react-i18next"; +import { Controller } from "react-hook-form"; +import CardLabelError from "../atoms/CardLabelError"; +import LabelFieldPair from '../atoms/LabelFieldPair'; +import CardLabel from "../atoms/CardLabel"; +import TextInput from "../atoms/TextInput"; +import TextArea from "../atoms/TextArea"; +import CustomDropdown from './CustomDropdown'; +import MobileNumber from '../atoms/MobileNumber'; +import DateRangeNew from './DateRangeNew'; +import MultiUploadWrapper from "./MultiUploadWrapper"; +import MultiSelectDropdown from '../atoms/MultiSelectDropdown'; +import LocationDropdownWrapper from './LocationDropdownWrapper'; +import WorkflowStatusFilter from './WorkflowStatusFilter'; +import ApiDropdown from './ApiDropdown'; +const RenderFormFields = ({data,...props}) => { + + const { t } = useTranslation(); + const { fields, control, formData, errors, register, setValue, getValues, setError, clearErrors, apiDetails} = props + + const fieldSelector = (type, populators, isMandatory, disable = false, component, config) => { + const Component = typeof component === "string" ? Digit.ComponentRegistryService.getComponent(component) : component; + let customValidations = config?.additionalValidation ? Digit?.Customizations?.[apiDetails?.masterName]?.[apiDetails?.moduleName]?.additionalValidations(config?.additionalValidation?.type, formData, config?.additionalValidation?.keys) : null + const customRules = customValidations ? { validate: customValidations} : {} + switch (type) { + case "date": + case "text": + case "number": + case "password": + case "time": + return ( + ( + + )} + name={populators.name} + rules={{required: isMandatory, ...populators.validation, ...customRules }} + control={control} + /> + ); + + case "textarea": + return ( + ( +