mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[Feedback] Use common email regexp and filter out incorrect emails on submit stage
GitOrigin-RevId: d03a0022fce2f926f0c7894f917e7c8101e3a9c5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
81ffdbb0c0
commit
49f6b018ee
@@ -36,7 +36,6 @@ const val TEXT_AREA_ROW_SIZE = 5
|
||||
internal const val TEXT_FIELD_EMAIL_COLUMN_SIZE = 25
|
||||
internal const val COMBOBOX_COLUMN_SIZE = 25
|
||||
|
||||
internal val EMAIL_REGEX = Regex("^[a-zA-Z0-9\\\\._%+!$&*=^|~#{}-]+@([a-zA-Z0-9\\\\-]+\\.)+([a-zA-Z]{2,22})$")
|
||||
internal fun Row.feedbackAgreement(project: Project?, @NlsContexts.DetailedDescription agreementText: String, systemInfo: () -> Unit) {
|
||||
comment(agreementText, maxLineLength = MAX_LINE_LENGTH_WORD_WRAP) {
|
||||
when (it.description) {
|
||||
|
||||
@@ -3,9 +3,9 @@ package com.intellij.platform.feedback.dialog.uiBlocks
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.NlsContexts
|
||||
import com.intellij.platform.feedback.dialog.EMAIL_REGEX
|
||||
import com.intellij.platform.feedback.dialog.TEXT_FIELD_EMAIL_COLUMN_SIZE
|
||||
import com.intellij.platform.feedback.dialog.feedbackAgreement
|
||||
import com.intellij.platform.feedback.impl.EMAIL_REGEX
|
||||
import com.intellij.platform.feedback.impl.bundle.CommonFeedbackBundle
|
||||
import com.intellij.ui.LicensingFacade
|
||||
import com.intellij.ui.components.JBCheckBox
|
||||
|
||||
@@ -40,7 +40,7 @@ const val DEFAULT_FEEDBACK_CONSENT_ID = "rsch.statistics.feedback.common"
|
||||
private const val REQUEST_ID_KEY = "Request-Id"
|
||||
|
||||
private const val EMAIL_PLACEHOLDER = "<EMAIL>"
|
||||
internal val EMAIL_REGEX = Regex("\\S+@\\S+\\.\\S+")
|
||||
internal val EMAIL_REGEX = Regex("^[a-zA-Z0-9\\\\._%+!$&*=^|~#{}-]+@([a-zA-Z0-9\\\\-]+\\.)+([a-zA-Z]{2,22})$")
|
||||
internal val SPACE_SYMBOL_REGEX = Regex("\\s")
|
||||
|
||||
private val LOG = Logger.getInstance(FeedbackRequestDataHolder::class.java)
|
||||
@@ -89,7 +89,7 @@ data class FeedbackRequestDataWithDetailedAnswer(val email: String,
|
||||
return buildJsonObject {
|
||||
put(FEEDBACK_FROM_ID_KEY, FEEDBACK_FORM_ID_WITH_DETAILED_ANSWER)
|
||||
put(FEEDBACK_AUTO_SOLVE_TICKET_KEY, autoSolveTicket)
|
||||
put(FEEDBACK_EMAIL_KEY, email)
|
||||
put(FEEDBACK_EMAIL_KEY, if (email.matches(EMAIL_REGEX)) email else "")
|
||||
put(FEEDBACK_SUBJECT_KEY, title)
|
||||
put(FEEDBACK_COMMENT_KEY, description)
|
||||
put(FEEDBACK_INTELLIJ_PRODUCT_KEY, getProductTag())
|
||||
|
||||
Reference in New Issue
Block a user