diff --git a/.stylelintrc.js b/.stylelintrc.js index 2ae843a75..44adc446f 100644 --- a/.stylelintrc.js +++ b/.stylelintrc.js @@ -10,6 +10,7 @@ module.exports = { } ], 'at-rule-no-unknown': [true, { ignoreAtRules: ['mixin', 'define-mixin'] - }] + }], + 'no-descending-specificity': null } }; diff --git a/schema.graphql b/schema.graphql index 0f198316c..9bfdc34ab 100644 --- a/schema.graphql +++ b/schema.graphql @@ -185,6 +185,12 @@ input CreateProjectNotificationsRuleInput { """Words to exclude from notification""" excluding: [String!]! = [] + """Treshold to be reached to send notification""" + threshold: Int = 100 + + """Treshold period in milliseconds""" + thresholdPeriod: Int = 3600000 + """Notification channels to recieve events""" channels: NotificationsChannelsInput! } diff --git a/src/analytics/amplitude.ts b/src/analytics/amplitude.ts index 98bcf6c44..ef729b4cf 100644 --- a/src/analytics/amplitude.ts +++ b/src/analytics/amplitude.ts @@ -43,6 +43,10 @@ export const Analytics = { * @param userId - user identifier */ setUserId: (userId: string): void => { + if (!isRegistered) { + return; + } + return setUserId(userId); }, }; diff --git a/src/api/fragments.ts b/src/api/fragments.ts index 622bb471d..467876b5a 100644 --- a/src/api/fragments.ts +++ b/src/api/fragments.ts @@ -80,6 +80,15 @@ export const PROJECT_NOTIFICATIONS_RULE_FRAGMENT = ` isEnabled } } + threshold + thresholdPeriod + } +`; + +export const PROJECT_NOTIFICATIONS_RULE_POINTER_FRAGMENT = ` + fragment ProjectNotificationRulePointer on ProjectNotificationRulePointer { + id + projectId } `; diff --git a/src/api/projects/index.js b/src/api/projects/index.js index a9ebbad57..4e01ef12d 100644 --- a/src/api/projects/index.js +++ b/src/api/projects/index.js @@ -5,6 +5,7 @@ import { MUTATION_UPDATE_LAST_VISIT, MUTATION_CREATE_PROJECT_NOTIFY_RULE, MUTATION_UPDATE_PROJECT_NOTIFY_RULE, + MUTATION_REMOVE_PROJECT_NOTIFY_RULE, MUTATION_REMOVE_PROJECT, MUTATION_TOGGLE_ENABLED_STATE_OF_A_PROJECT_NOTIFY_RULE, QUERY_CHART_DATA, MUTATION_GENERATE_NEW_INTEGRATION_TOKEN @@ -114,6 +115,18 @@ export async function updateProjectNotificationsRule(payload) { })).updateProjectNotificationsRule; } +/** + * Send request for removing specific project notifications rule + * + * @param {ProjectNotificationRulePointer} payload - update rule payload + * @returns {Promise} + */ +export async function removeProjectNotificationsRule(payload) { + return (await api.callOld(MUTATION_REMOVE_PROJECT_NOTIFY_RULE, { + input: payload, + })).removeProjectNotificationsRule; +} + /** * Send request for updating specific project notifications rule * diff --git a/src/api/projects/queries.js b/src/api/projects/queries.js index 463cfdc5c..becc65d40 100644 --- a/src/api/projects/queries.js +++ b/src/api/projects/queries.js @@ -109,6 +109,19 @@ export const MUTATION_UPDATE_PROJECT_NOTIFY_RULE = ` ${PROJECT_NOTIFICATIONS_RULE_FRAGMENT} `; +// language=GraphQL +export const MUTATION_REMOVE_PROJECT_NOTIFY_RULE = ` + mutation ( $input: ProjectNotificationRulePointer! ) { + deleteProjectNotificationsRule( + input: $input + ) { + ...ProjectNotificationsRule + } + } + + ${PROJECT_NOTIFICATIONS_RULE_FRAGMENT} +`; + // language=GraphQL export const MUTATION_REMOVE_PROJECT = ` mutation removeProject($projectId: ID!) { diff --git a/src/components/catalog/Item.vue b/src/components/catalog/Item.vue index a6edd95e6..482190e4e 100644 --- a/src/components/catalog/Item.vue +++ b/src/components/catalog/Item.vue @@ -75,8 +75,8 @@ export default { } &__header { - height: 100px; flex-shrink: 0; + height: 100px; background-position: center center; background-size: cover; border-radius: 4px; diff --git a/src/components/catalog/catchers/AddCatcher.vue b/src/components/catalog/catchers/AddCatcher.vue index eebd12784..128be6111 100644 --- a/src/components/catalog/catchers/AddCatcher.vue +++ b/src/components/catalog/catchers/AddCatcher.vue @@ -308,12 +308,12 @@ export default { } &__catalog-more { - background-color: var(--color-bg-main); + width: 100%; margin: 7.5px 7.5px 50px; - text-align: center; padding: 18px 20px; + text-align: center; + background-color: var(--color-bg-main); border-radius: 4px; - width: 100%; cursor: pointer; transition: all 0.2s ease; diff --git a/src/components/event/details/DetailsBase.vue b/src/components/event/details/DetailsBase.vue index 6aa4834f1..794631808 100644 --- a/src/components/event/details/DetailsBase.vue +++ b/src/components/event/details/DetailsBase.vue @@ -43,15 +43,15 @@ export default { diff --git a/src/components/modals/PaymentDetailsDialog.vue b/src/components/modals/PaymentDetailsDialog.vue index 3eb281482..0010c60c5 100644 --- a/src/components/modals/PaymentDetailsDialog.vue +++ b/src/components/modals/PaymentDetailsDialog.vue @@ -101,7 +101,6 @@ v-if="isRecurrent" class="payment-details__adoption-autoProlongation" > - {{ eventCount | abbreviateNumber }} -
- +
+ {{ affectedUsersCount | abbreviateNumber }}
@@ -52,20 +58,20 @@ export default { diff --git a/src/components/project/settings/NotificationsRule.vue b/src/components/project/settings/NotificationsRule.vue index 46da956a5..577e7852b 100644 --- a/src/components/project/settings/NotificationsRule.vue +++ b/src/components/project/settings/NotificationsRule.vue @@ -135,7 +135,7 @@ export default Vue.extend({ return this.$t('projects.settings.notifications.receiveNewLabel') as string; } - return this.$t('projects.settings.notifications.receiveAllLabel') as string; + return this.$t('projects.settings.notifications.receiveSeenMoreLabel') as string; }, /** @@ -152,8 +152,8 @@ export default Vue.extend({ }, { title: this.$t('projects.settings.notifications.removeRule') as string, - onClick() { - console.log('Remove rule clicked'); + onClick: () => { + this.$emit('removeClicked', this.rule.id); }, }, ]; diff --git a/src/components/utils/FeedbackButton.vue b/src/components/utils/FeedbackButton.vue index 751265f7c..18a885171 100644 --- a/src/components/utils/FeedbackButton.vue +++ b/src/components/utils/FeedbackButton.vue @@ -28,26 +28,25 @@ export default Vue.extend({ right: 30px; bottom: 30px; z-index: 9995; - background-color: var(--color-indicator-medium); - padding: 8px 10px; - box-shadow: 0px 9px 16px rgba(16, 106, 189, 0.3); - border-radius: 8px; - cursor: pointer; - display: flex; flex-direction: row; align-items: center; + padding: 8px 10px; + background-color: var(--color-indicator-medium); + border-radius: 8px; + box-shadow: 0px 9px 16px rgba(16, 106, 189, 0.3); + cursor: pointer; svg { - height: 16px; width: 18px; + height: 16px; } } &-description { + margin: 0px 6px; font-weight: 500; font-size: 14px; line-height: 12px; - margin: 0px 6px; } } diff --git a/src/components/utils/TariffPlan.vue b/src/components/utils/TariffPlan.vue index 0de6be309..06edc3471 100644 --- a/src/components/utils/TariffPlan.vue +++ b/src/components/utils/TariffPlan.vue @@ -96,15 +96,15 @@ export default {