Skip to content

Commit

Permalink
[core] Fix typo on Netlify script (#45278)
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Evtush <154841002+maximevtush@users.noreply.github.com>
Signed-off-by: Aarón García Hervás <aaron@mui.com>
Co-authored-by: Aarón García Hervás <aaron@mui.com>
  • Loading branch information
maximevtush and aarongarciah authored Feb 11, 2025
1 parent a442c35 commit 77ac115
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions netlify/functions/feedback-management.mts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ app.action<BlockAction<ButtonAction>>('delete_action', async ({ ack, body, clien

const channelId = channel?.id;

const { comment, currentLocationURL = '', commmentSectionURL = '' } = JSON.parse(value);
const { comment, currentLocationURL = '', commentSectionURL = '' } = JSON.parse(value);

const googleAuth = new JWT({
email: 'service-account-804@docs-feedbacks.iam.gserviceaccount.com',
Expand All @@ -121,7 +121,7 @@ app.action<BlockAction<ButtonAction>>('delete_action', async ({ ack, body, clien
range: 'Deleted messages!A:D',
valueInputOption: 'USER_ENTERED',
resource: {
values: [[username, comment, currentLocationURL, commmentSectionURL]],
values: [[username, comment, currentLocationURL, commentSectionURL]],
},
});

Expand Down Expand Up @@ -150,7 +150,7 @@ app.action('save_message', async ({ ack, body, client, logger }) => {
} = body as BlockAction<ButtonAction>;

const channelId = channel?.id;
const { comment, currentLocationURL = '', commmentSectionURL = '' } = JSON.parse(value);
const { comment, currentLocationURL = '', commentSectionURL = '' } = JSON.parse(value);

const googleAuth = new JWT({
email: 'service-account-804@docs-feedbacks.iam.gserviceaccount.com',
Expand All @@ -165,7 +165,7 @@ app.action('save_message', async ({ ack, body, client, logger }) => {
range: 'Sheet1!A:D',
valueInputOption: 'USER_ENTERED',
updates: {
values: [[username, comment, currentLocationURL, commmentSectionURL]],
values: [[username, comment, currentLocationURL, commentSectionURL]],
},
});

Expand Down Expand Up @@ -198,24 +198,22 @@ export const handler: Handler = async (event, context, callback) => {
rating,
comment,
currentLocationURL,
commmentSectionURL: inCommmentSectionURL,
commmentSectionTitle,
commentSectionURL: inCommentSectionURL,
commentSectionTitle,
githubRepo,
productId,
} = data;

// The design feedback alert was removed in /~https://github.com/mui/material-ui/pull/39691
// This dead code is here to simplify the creation of special feedback channel
const isDesignFeedback = inCommmentSectionURL.includes('#new-docs-api-feedback');
const commmentSectionURL = isDesignFeedback ? '' : inCommmentSectionURL;
const isDesignFeedback = inCommentSectionURL.includes('#new-docs-api-feedback');
const commentSectionURL = isDesignFeedback ? '' : inCommentSectionURL;

const simpleSlackMessage = [
`New comment ${rating === 1 ? '👍' : ''}${rating === 0 ? '👎' : ''}`,
`>${comment.split('\n').join('\n>')}`,
`sent from ${currentLocationURL}${
commmentSectionTitle
? ` (from section <${commmentSectionURL}|${commmentSectionTitle})>`
: ''
commentSectionTitle ? ` (from section <${commentSectionURL}|${commentSectionTitle})>` : ''
}`,
].join('\n\n');

Expand All @@ -224,7 +222,7 @@ export const handler: Handler = async (event, context, callback) => {
body: `Feedback received:
${comment}
from ${commmentSectionURL}
from ${commentSectionURL}
`,
});

Expand Down Expand Up @@ -260,7 +258,7 @@ from ${commmentSectionURL}
value: JSON.stringify({
comment,
currentLocationURL,
commmentSectionURL,
commentSectionURL,
}),
action_id: 'save_message',
},
Expand All @@ -273,7 +271,7 @@ from ${commmentSectionURL}
value: JSON.stringify({
comment,
currentLocationURL,
commmentSectionURL,
commentSectionURL,
}),
style: 'danger',
action_id: 'delete_action',
Expand Down

0 comments on commit 77ac115

Please sign in to comment.