Skip to content

Commit 14a4533

Browse files
Change order of ContextProperties param in MicrosoftUserFeedback.Codeunit.al (#6254)
<!-- Thank you for submitting a Pull Request. If you're new to contributing to BCApps please read our pull request guideline below * https://github.com/microsoft/BCApps/Contributing.md --> #### Summary <!-- Provide a general summary of your changes --> The `RequestDislikeFeedback` method had ContextFiles and ContextProperties in a different order than the other methods, which could lead to bugs. While on paper, this is a breaking change, it is an internal only API, and has very little usage. So, I believe that we can except it in this case, after speaking with quentin Also, made the methods scope on prem to indicate non-public use #### Work Item(s) <!-- Add the issue number here after the #. The issue needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> Fixes [AB#615526](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/615526) --------- Co-authored-by: Eddy Lynch <eddylynch@microsoft.com>
1 parent 8f30c2f commit 14a4533

1 file changed

Lines changed: 59 additions & 2 deletions

File tree

src/System Application/App/Microsoft User Feedback/src/MicrosoftUserFeedback.Codeunit.al

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ codeunit 1590 "Microsoft User Feedback"
1818
/// Requests general feedback for a feature, optionally specifying if it is a Copilot feature and its area.
1919
/// </summary>
2020
/// <param name="FeatureName">The name of the feature for which feedback is requested.</param>
21+
#pragma warning disable AS0022
22+
[Scope('OnPrem')]
2123
procedure RequestFeedback(FeatureName: Text)
2224
var
2325
CallerModuleInfo: ModuleInfo;
@@ -27,13 +29,16 @@ codeunit 1590 "Microsoft User Feedback"
2729
NavApp.GetCallerModuleInfo(CallerModuleInfo);
2830
this.FeedbackImpl.RequestFeedback(FeatureName, '', '', EmptyContextFiles, EmptyContextProperties, CallerModuleInfo);
2931
end;
32+
#pragma warning restore AS0022
3033

3134
/// <summary>
3235
/// Requests general feedback for a feature, optionally specifying if it is a Copilot feature and its area.
3336
/// </summary>
3437
/// <param name="FeatureName">The name of the feature for which feedback is requested.</param>
3538
/// <param name="FeatureArea">The area or sub-area of the feature. ID on OCV.</param>
3639
/// <param name="FeatureAreaDisplayName">The display name of the feature area.</param>
40+
#pragma warning disable AS0022
41+
[Scope('OnPrem')]
3742
procedure RequestFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text)
3843
var
3944
CallerModuleInfo: ModuleInfo;
@@ -43,6 +48,7 @@ codeunit 1590 "Microsoft User Feedback"
4348
NavApp.GetCallerModuleInfo(CallerModuleInfo);
4449
this.FeedbackImpl.RequestFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, EmptyContextFiles, EmptyContextProperties, CallerModuleInfo);
4550
end;
51+
#pragma warning restore AS0022
4652

4753
/// <summary>
4854
/// Requests general feedback for a feature, optionally specifying if it is a Copilot feature and its area.
@@ -52,18 +58,23 @@ codeunit 1590 "Microsoft User Feedback"
5258
/// <param name="FeatureAreaDisplayName">The display name of the feature area.</param>
5359
/// <param name="ContextFiles">Map of filename to base64 file to attach to the feedback. Must contain the filename in the extension.</param>
5460
/// <param name="ContextProperties">Additional data to pass properties to the feedback mechanism.</param>
61+
#pragma warning disable AS0022
62+
[Scope('OnPrem')]
5563
procedure RequestFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text; ContextFiles: Dictionary of [Text, Text]; ContextProperties: Dictionary of [Text, Text])
5664
var
5765
CallerModuleInfo: ModuleInfo;
5866
begin
5967
NavApp.GetCallerModuleInfo(CallerModuleInfo);
6068
this.FeedbackImpl.RequestFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, ContextFiles, ContextProperties, CallerModuleInfo);
6169
end;
70+
#pragma warning restore AS0022
6271

6372
/// <summary>
6473
/// Requests a 'like' (positive) feedback for a feature, optionally specifying if it is a Copilot feature and its area.
6574
/// </summary>
6675
/// <param name="FeatureName">The name of the feature for which like feedback is requested.</param>
76+
#pragma warning disable AS0022
77+
[Scope('OnPrem')]
6778
procedure RequestLikeFeedback(FeatureName: Text)
6879
var
6980
CallerModuleInfo: ModuleInfo;
@@ -73,13 +84,16 @@ codeunit 1590 "Microsoft User Feedback"
7384
NavApp.GetCallerModuleInfo(CallerModuleInfo);
7485
this.FeedbackImpl.RequestLikeFeedback(FeatureName, '', '', EmptyContextFiles, EmptyContextProperties, CallerModuleInfo);
7586
end;
87+
#pragma warning restore AS0022
7688

7789
/// <summary>
7890
/// Requests a 'like' (positive) feedback for a feature, optionally specifying if it is a Copilot feature and its area.
7991
/// </summary>
8092
/// <param name="FeatureName">The name of the feature for which like feedback is requested.</param>
8193
/// <param name="FeatureArea">The area or sub-area of the feature. ID on OCV.</param>
8294
/// <param name="FeatureAreaDisplayName">The display name of the feature area.</param>
95+
#pragma warning disable AS0022
96+
[Scope('OnPrem')]
8397
procedure RequestLikeFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text)
8498
var
8599
CallerModuleInfo: ModuleInfo;
@@ -89,6 +103,7 @@ codeunit 1590 "Microsoft User Feedback"
89103
NavApp.GetCallerModuleInfo(CallerModuleInfo);
90104
this.FeedbackImpl.RequestLikeFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, EmptyContextFiles, EmptyContextProperties, CallerModuleInfo);
91105
end;
106+
#pragma warning restore AS0022
92107

93108
/// <summary>
94109
/// Requests a 'like' (positive) feedback for a feature, optionally specifying if it is a Copilot feature and its area.
@@ -97,18 +112,23 @@ codeunit 1590 "Microsoft User Feedback"
97112
/// <param name="FeatureArea">The area or sub-area of the feature.</param>
98113
/// <param name="ContextFiles">Map of filename to base64 file to attach to the feedback. Must contain the filename in the extension.</param>
99114
/// <param name="ContextProperties">Additional data to pass properties to the feedback mechanism.</param>
115+
#pragma warning disable AS0022
116+
[Scope('OnPrem')]
100117
procedure RequestLikeFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text; ContextFiles: Dictionary of [Text, Text]; ContextProperties: Dictionary of [Text, Text])
101118
var
102119
CallerModuleInfo: ModuleInfo;
103120
begin
104121
NavApp.GetCallerModuleInfo(CallerModuleInfo);
105122
this.FeedbackImpl.RequestLikeFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, ContextFiles, ContextProperties, CallerModuleInfo);
106123
end;
124+
#pragma warning restore AS0022
107125

108126
/// <summary>
109127
/// Requests a 'dislike' (negative) feedback for a feature, optionally specifying if it is a Copilot feature and its area.
110128
/// </summary>
111129
/// <param name="FeatureName">The name of the feature for which dislike feedback is requested.</param>
130+
#pragma warning disable AS0022
131+
[Scope('OnPrem')]
112132
procedure RequestDislikeFeedback(FeatureName: Text)
113133
var
114134
CallerModuleInfo: ModuleInfo;
@@ -118,13 +138,16 @@ codeunit 1590 "Microsoft User Feedback"
118138
NavApp.GetCallerModuleInfo(CallerModuleInfo);
119139
this.FeedbackImpl.RequestDislikeFeedback(FeatureName, '', '', EmptyContextFiles, EmptyContextProperties, CallerModuleInfo);
120140
end;
141+
#pragma warning restore AS0022
121142

122143
/// <summary>
123144
/// Requests a 'dislike' (negative) feedback for a feature, optionally specifying if it is a Copilot feature and its area.
124145
/// </summary>
125146
/// <param name="FeatureName">The name of the feature for which dislike feedback is requested.</param>
126147
/// <param name="FeatureArea">The area or sub-area of the feature. ID of the sub-area on OCV.</param>
127148
/// <param name="FeatureAreaDisplayName">The display name of the feature area.</param>
149+
#pragma warning disable AS0022
150+
[Scope('OnPrem')]
128151
procedure RequestDislikeFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text)
129152
var
130153
CallerModuleInfo: ModuleInfo;
@@ -134,139 +157,173 @@ codeunit 1590 "Microsoft User Feedback"
134157
NavApp.GetCallerModuleInfo(CallerModuleInfo);
135158
this.FeedbackImpl.RequestDislikeFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, EmptyContextFiles, EmptyContextProperties, CallerModuleInfo);
136159
end;
160+
#pragma warning restore AS0022
137161

138162
/// <summary>
139163
/// Requests a 'dislike' (negative) feedback for a feature, optionally specifying if it is a Copilot feature and its area.
140164
/// </summary>
141165
/// <param name="FeatureName">The name of the feature for which dislike feedback is requested.</param>
142166
/// <param name="FeatureArea">The area or sub-area of the feature. ID of the sub-area on OCV.</param>
143167
/// <param name="FeatureAreaDisplayName">The display name of the feature area.</param>
144-
/// <param name="ContextProperties">Additional data to pass properties to the feedback mechanism.</param>
145168
/// <param name="ContextFiles">Map of filename to base64 file to attach to the feedback. Must contain the filename in the extension.</param>
146-
procedure RequestDislikeFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text; ContextProperties: Dictionary of [Text, Text]; ContextFiles: Dictionary of [Text, Text])
169+
/// <param name="ContextProperties">Additional data to pass properties to the feedback mechanism.</param>
170+
#pragma warning disable AS0022
171+
[Scope('OnPrem')]
172+
procedure RequestDislikeFeedback(FeatureName: Text; FeatureArea: Text; FeatureAreaDisplayName: Text; ContextFiles: Dictionary of [Text, Text]; ContextProperties: Dictionary of [Text, Text])
147173
var
148174
CallerModuleInfo: ModuleInfo;
149175
begin
150176
NavApp.GetCallerModuleInfo(CallerModuleInfo);
151177
this.FeedbackImpl.RequestDislikeFeedback(FeatureName, FeatureArea, FeatureAreaDisplayName, ContextFiles, ContextProperties, CallerModuleInfo);
152178
end;
179+
#pragma warning restore AS0022
153180

154181
/// <summary>
155182
/// Sets whether the General/Like/Dislike feedback being collected is for an AI feature.
156183
/// </summary>
157184
/// <param name="IsAIFeedback">True if the feedback is for an AI feature; otherwise, false.</param>
158185
/// <returns>The current instance of the "Microsoft User Feedback Impl" codeunit.</returns>
186+
#pragma warning disable AS0022
187+
[Scope('OnPrem')]
159188
procedure SetIsAIFeedback(IsAIFeedback: Boolean): Codeunit "Microsoft User Feedback"
160189
begin
161190
this.FeedbackImpl := this.FeedbackImpl.SetIsAIFeedback(IsAIFeedback);
162191
exit(this);
163192
end;
193+
#pragma warning restore AS0022
164194

165195
/// <summary>
166196
/// Sets a custom question to be included in the feedback prompt.
167197
/// </summary>
168198
/// <param name="Question">The text of the custom question.</param>
169199
/// <param name="QuestionDisplay">The display text of the custom question.</param>
170200
/// <returns>The current instance of the "Microsoft User Feedback Impl" codeunit.</returns>
201+
#pragma warning disable AS0022
202+
[Scope('OnPrem')]
171203
procedure WithCustomQuestion(Question: Text; QuestionDisplay: Text): Codeunit "Microsoft User Feedback"
172204
begin
173205
this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestion(Question, QuestionDisplay);
174206
exit(this);
175207
end;
208+
#pragma warning restore AS0022
176209

177210
/// <summary>
178211
/// Sets the type of the custom question to be included in the feedback prompt.
179212
/// </summary>
180213
/// <param name="QuestionType">The type of the custom question.</param>
181214
/// <returns>The current instance of the "Microsoft User Feedback Impl" codeunit.</returns>
215+
#pragma warning disable AS0022
216+
[Scope('OnPrem')]
182217
procedure WithCustomQuestionType(QuestionType: Enum FeedbackQuestionType): Codeunit "Microsoft User Feedback"
183218
begin
184219
this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestionType(QuestionType);
185220
exit(this);
186221
end;
222+
#pragma warning restore AS0022
187223

188224
/// <summary>
189225
/// Sets the required behavior for the custom question to be included in the feedback prompt.
190226
/// </summary>
191227
/// <param name="RequiredBehavior">The behaviour.</param>
192228
/// <param name="Enabled">If true, enables the specified required behavior; if false, disables it.</param>
193229
/// <returns>The current instance of the "Microsoft User Feedback Impl" codeunit.</returns>
230+
#pragma warning disable AS0022
231+
[Scope('OnPrem')]
194232
procedure WithCustomQuestionRequiredBehavior(RequiredBehavior: Enum FeedbackRequiredBehavior; Enabled: Boolean): Codeunit "Microsoft User Feedback"
195233
begin
196234
this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestionRequiredBehavior(RequiredBehavior, Enabled);
197235
exit(this);
198236
end;
237+
#pragma warning restore AS0022
199238

200239
/// <summary>
201240
/// Sets the required behavior for the custom question to be included in the feedback prompt.
202241
/// </summary>
203242
/// <param name="RequiredBehavior">A dictionary defining the required behavior for the custom question.</param>
204243
/// <returns>The current instance of the "Microsoft User Feedback Impl" codeunit.</returns>
244+
#pragma warning disable AS0022
245+
[Scope('OnPrem')]
205246
procedure WithCustomQuestionRequiredBehavior(RequiredBehavior: Dictionary of [Enum FeedbackRequiredBehavior, Text]): Codeunit "Microsoft User Feedback"
206247
begin
207248
this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestionRequiredBehavior(RequiredBehavior);
208249
exit(this);
209250
end;
251+
#pragma warning restore AS0022
210252

211253
/// <summary>
212254
/// Adds an answer option for the custom question to be included in the feedback prompt.
213255
/// </summary>
214256
/// <param name="AnswerOption">The answer option.</param>
215257
/// <param name="AnswerDisplayText">The display text for the answer option.</param>
216258
/// <returns>The current instance of the "Microsoft User Feedback Impl" codeunit.</returns>
259+
#pragma warning disable AS0022
260+
[Scope('OnPrem')]
217261
procedure WithCustomQuestionAnswerOption(AnswerOption: Text; AnswerDisplayText: Text): Codeunit "Microsoft User Feedback"
218262
begin
219263
this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestionAnswerOption(AnswerOption, AnswerDisplayText);
220264
exit(this);
221265
end;
266+
#pragma warning restore AS0022
222267

223268
/// <summary>
224269
/// Sets the answer options for the custom question to be included in the feedback prompt.
225270
/// </summary>
226271
/// <param name="AnswerOptions">A dictionary defining the answer options for the custom question.</param>
227272
/// <returns>The current instance of the "Microsoft User Feedback Impl" codeunit.</returns>
273+
#pragma warning disable AS0022
274+
[Scope('OnPrem')]
228275
procedure WithCustomQuestionAnswerOptions(AnswerOptions: Dictionary of [Text, Text]): Codeunit "Microsoft User Feedback"
229276
begin
230277
this.FeedbackImpl := this.FeedbackImpl.WithCustomQuestionAnswerOptions(AnswerOptions);
231278
exit(this);
232279
end;
280+
#pragma warning restore AS0022
233281

234282
/// <summary>
235283
/// Clears any previously set custom question.
236284
/// </summary>
237285
/// <returns>The current instance of the "Microsoft User Feedback" codeunit.</returns>
286+
#pragma warning disable AS0022
287+
[Scope('OnPrem')]
238288
procedure ClearCustomQuestion(): Codeunit "Microsoft User Feedback"
239289
begin
240290
this.FeedbackImpl := this.FeedbackImpl.ClearCustomQuestion();
241291
exit(this);
242292
end;
293+
#pragma warning restore AS0022
243294

244295
/// <summary>
245296
/// Starts or stops a survey timer activity. This is used to start a timer to count up user usage
246297
/// times, which can then trigger a survey prompt after a certain threshold is reached.
247298
/// </summary>
248299
/// <param name="ActivityName">The name of the activity for which the timer is started or stopped.</param>
249300
/// <param name="Start">If true, starts the timer; if false, stops the timer.</param>
301+
#pragma warning disable AS0022
302+
[Scope('OnPrem')]
250303
procedure SurveyTimerActivity(ActivityName: Text; Start: Boolean)
251304
var
252305
CallerModuleInfo: ModuleInfo;
253306
begin
254307
NavApp.GetCallerModuleInfo(CallerModuleInfo);
255308
this.FeedbackImpl.SurveyTimerActivity(ActivityName, Start, CallerModuleInfo);
256309
end;
310+
#pragma warning restore AS0022
257311

258312
/// <summary>
259313
/// Sends a one-time trigger event based on a specific activity name.
260314
/// The event could be, for example, a user clicking a button
261315
/// </summary>
262316
/// <param name="ActivityName">The name of the activity that triggers the survey.</param>
317+
#pragma warning disable AS0022
318+
[Scope('OnPrem')]
263319
procedure SurveyTriggerActivity(ActivityName: Text)
264320
var
265321
CallerModuleInfo: ModuleInfo;
266322
begin
267323
NavApp.GetCallerModuleInfo(CallerModuleInfo);
268324
this.FeedbackImpl.SurveyTriggerActivity(ActivityName, CallerModuleInfo);
269325
end;
326+
#pragma warning restore AS0022
270327

271328
var
272329
FeedbackImpl: Codeunit "Microsoft User Feedback Impl";

0 commit comments

Comments
 (0)