Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: App requests notify admin function generating wrong link #28111

Merged
merged 4 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const AppStatus = ({ app, showStatus = true, isAppDetailsPage, installed, ...pro
notifyAdmins({
appId: app.id,
appName: app.name,
appVersion: app.marketplaceVersion,
message: postMessage.message,
});
};
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/client/views/marketplace/AppMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function AppMenu({ app, isAppDetailsPage, ...props }) {
notifyAdmins({
appId: app.id,
appName: app.name,
appVersion: app.marketplaceVersion,
message: postMessage.message,
});
};
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/ee/server/apps/communication/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,12 +805,12 @@ export class AppsRestApi {
{ authRequired: true },
{
async post() {
const { appId, appName, message } = this.bodyParams;
const { appId, appName, appVersion, message } = this.bodyParams;
const workspaceUrl = settings.get('Site_Url');

const regex = new RegExp('\\/$', 'gm');
const safeWorkspaceUrl = workspaceUrl.replace(regex, '');
const learnMore = `${safeWorkspaceUrl}/marketplace/explore/info/${appId}`;
const learnMore = `${safeWorkspaceUrl}/marketplace/explore/info/${appId}/${appVersion}/requests`;

try {
const msgs = ({ adminUser }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/rest-typings/src/apps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export type AppsEndpoints = {
};

'/apps/notify-admins': {
POST: (params: { appId: string; appName: string; message: string }) => void;
POST: (params: { appId: string; appName: string; appVersion: string; message: string }) => void;
};

'/apps': {
Expand Down