Skip to content

Commit 78bdbac

Browse files
authored
Ocv tweaks (microsoft#10434)
* put configs in a function to make sure stuff like locale loads before they're registered * change the give feedback option to just have feedback * change it for skillmap as well
1 parent 1699990 commit 78bdbac

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

react-common/components/controls/Feedback/Feedback.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path="../../../../localtypings/ocv.d.ts" />
22
import { useEffect } from "react"
33
import { initFeedbackEventListener, removeFeedbackEventListener } from "./FeedbackEventListener";
4-
import { baseConfig, ratingFeedbackConfig } from "./configs";
4+
import { getBaseConfig, getRatingFeedbackConfig } from "./configs";
55
import { Modal } from "../Modal";
66

77
// both components require onClose because the feedback modal should close when the user clicks the "finish" button
@@ -36,7 +36,7 @@ export const FeedbackModal = (props: IFeedbackModalProps) => {
3636
export const Feedback = (props: IFeedbackProps) => {
3737
const { kind, onClose } = props;
3838

39-
const feedbackConfig = kind === "rating" ? ratingFeedbackConfig : baseConfig ;
39+
const feedbackConfig = kind === "rating" ? getRatingFeedbackConfig() : getBaseConfig();
4040
const frameId = kind === "rating" ? "activity-feedback-frame" : "menu-feedback-frame";
4141

4242
const onDismiss = () => {

react-common/components/controls/Feedback/configs.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/// <reference path="../../../../localtypings/ocv.d.ts" />
22

33

4-
export const baseConfig: ocv.IFeedbackConfig = {
4+
export const getBaseConfig = (): ocv.IFeedbackConfig => {
5+
return {
56
feedbackUiType: "NoSurface",
67
hostPlatform: "IFrame",
78
isDisplayed: true,
@@ -13,6 +14,7 @@ export const baseConfig: ocv.IFeedbackConfig = {
1314
isFeedbackForumEnabled: false,
1415
isMyFeedbackEnabled: false,
1516
isThankYouPageDisabled: false,
17+
}
1618
}
1719

1820
export const createRatingQuestions = () => {
@@ -47,8 +49,9 @@ export const createRatingQuestions = () => {
4749
}
4850

4951

50-
export const ratingFeedbackConfig: ocv.IFeedbackConfig = {
51-
...baseConfig,
52+
export const getRatingFeedbackConfig = (): ocv.IFeedbackConfig => {
53+
return {
54+
...getBaseConfig(),
5255
initialFeedbackType: "Unclassified",
5356
scenarioConfig: {
5457
isScenarioEnabled: true,
@@ -61,4 +64,5 @@ export const ratingFeedbackConfig: ocv.IFeedbackConfig = {
6164
]
6265
}
6366
}
67+
}
6468
}

skillmap/src/components/HeaderBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ export class HeaderBarImpl extends React.Component<HeaderBarProps> {
8181
if (pxt.U.ocvEnabled()) {
8282
items.push({
8383
id: "feedback",
84-
title: lf("Give Feedback"),
85-
label: lf("Give Feedback"),
84+
title: lf("Feedback"),
85+
label: lf("Feedback"),
8686
onClick: this.onFeedbackClicked
8787
});
8888
}

webapp/src/container.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ export class SettingsMenu extends data.Component<SettingsMenuProps, SettingsMenu
364364
{
365365
// we always need a way to clear local storage, regardless if signed in or not
366366
}
367-
{showFeedbackOption ? <sui.Item role="menuitem" icon="comment" text={lf("Give Feedback")} onClick={this.showFeedbackDialog} /> : undefined}
367+
{showFeedbackOption ? <sui.Item role="menuitem" icon="comment" text={lf("Feedback")} onClick={this.showFeedbackDialog} /> : undefined}
368368
</sui.DropdownMenu>;
369369
}
370370
}

webapp/src/projects.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export class ProjectSettingsMenu extends data.Component<ProjectSettingsMenuProps
324324
{reportAbuse ? <sui.Item role="menuitem" icon="warning circle" text={lf("Report Abuse...")} onClick={this.showReportAbuse} /> : undefined}
325325
<sui.Item role="menuitem" icon='sign out' text={lf("Reset")} onClick={this.showResetDialog} />
326326
<sui.Item role="menuitem" text={lf("About...")} onClick={this.showAboutDialog} />
327-
{showFeedbackOption ? <sui.Item role="menuitem" icon="comment" text={lf("Give Feedback")} onClick={this.showFeedbackDialog} /> : undefined}
327+
{showFeedbackOption ? <sui.Item role="menuitem" icon="comment" text={lf("Feedback")} onClick={this.showFeedbackDialog} /> : undefined}
328328
</sui.DropdownMenu>;
329329
}
330330
}

0 commit comments

Comments
 (0)