@fluid-topics/ft-reader-feedback 1.0.54 → 1.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,7 @@ import { html, nothing } from "lit";
8
8
  import { property, query, state } from "lit/decorators.js";
9
9
  import { parseDate, redux, } from "@fluid-topics/ft-wc-utils";
10
10
  import { styles } from "./ft-reader-feedback.css";
11
+ import { userHasRole } from "@fluid-topics/public-api";
11
12
  import { FtTypography } from "@fluid-topics/ft-typography";
12
13
  import { FtIcon } from "@fluid-topics/ft-icon";
13
14
  import { FtTooltip } from "@fluid-topics/ft-tooltip";
@@ -20,6 +21,7 @@ import { withI18n } from "@fluid-topics/ft-i18n";
20
21
  import { defaultDesignerMessages, designer } from "./utils/InDesignerFeedbackComponentMessages";
21
22
  import { FtTextField } from "@fluid-topics/ft-text-field";
22
23
  import { FtReaderComponent } from "@fluid-topics/ft-reader-context/build/registration";
24
+ import { FtReaderFeatures } from "@fluid-topics/ft-reader-context/build/store/utils/FtReaderService";
23
25
  class FtReaderFeedback extends withI18n(FtReaderComponent) {
24
26
  constructor() {
25
27
  super();
@@ -38,13 +40,15 @@ class FtReaderFeedback extends withI18n(FtReaderComponent) {
38
40
  this.addI18nContext(designer, defaultDesignerMessages);
39
41
  }
40
42
  get canAccessFeedback() {
41
- return this.user && this.user.roles.includes("FEEDBACK_USER");
43
+ var _a;
44
+ return this.user && userHasRole(this.user.roles, "FEEDBACK_USER") && ((_a = this.service) === null || _a === void 0 ? void 0 : _a.isFeatureAccessible(FtReaderFeatures.FEEDBACK));
42
45
  }
43
46
  get canAccessRating() {
44
- return this.userHasRatingRole && this.configuredRatingType !== "NO_RATING";
47
+ var _a;
48
+ return this.userHasRatingRole && this.configuredRatingType !== "NO_RATING" && ((_a = this.service) === null || _a === void 0 ? void 0 : _a.isFeatureAccessible(FtReaderFeatures.RATING));
45
49
  }
46
50
  get userHasRatingRole() {
47
- return this.user && this.user.roles.includes("RATING_USER");
51
+ return this.user && userHasRole(this.user.roles, "RATING_USER");
48
52
  }
49
53
  get configuredRatingType() {
50
54
  var _a, _b;
@@ -209,7 +213,7 @@ class FtReaderFeedback extends withI18n(FtReaderComponent) {
209
213
  ${this.i18n(this.i18nProperties.feedbackSectionTitle)}
210
214
  </ft-typography>
211
215
  ${((_a = this.user) === null || _a === void 0 ? void 0 : _a.userId) == null && ((_b = this.configuration) === null || _b === void 0 ? void 0 : _b.mailsSentByFluidTopicsForUnauthenticatedUsers) ? html `
212
- <ft-text-field
216
+ <ft-text-field outlined
213
217
  class="ft-reader-feedback--from-input"
214
218
  label=${feedback.messages.feedbackfromEmail()}
215
219
  @live-change=${(e) => this.from = e.detail.trim()}