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

[pull] master from mattermost:master #90

Merged
merged 4 commits into from
Jan 22, 2025
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
8 changes: 4 additions & 4 deletions server/channels/app/app_iface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion server/channels/app/integration_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ func (a *App) DoPostActionWithCookie(c request.CTX, postID, actionId, userID, se
return "", model.NewAppError("DoPostActionWithCookie", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
}

// Log request, regardless of whether destination is internal or external
c.Logger().Info("DoPostActionWithCookie POST request, through DoActionRequest",
mlog.String("url", upstreamURL),
mlog.String("user_id", upstreamRequest.UserId),
mlog.String("post_id", upstreamRequest.PostId),
mlog.String("channel_id", upstreamRequest.ChannelId),
mlog.String("team_id", upstreamRequest.TeamId),
)

ctx, cancel := context.WithTimeout(context.Background(), time.Duration(*a.Config().ServiceSettings.OutgoingIntegrationRequestsTimeout)*time.Second)
defer cancel()
resp, appErr := a.DoActionRequest(c.WithContext(ctx), upstreamURL, requestJSON)
Expand Down Expand Up @@ -297,7 +306,7 @@ func (a *App) DoPostActionWithCookie(c request.CTX, postID, actionId, userID, se
return clientTriggerId, nil
}

// Perform an HTTP POST request to an integration's action endpoint.
// DoActionRequest performs an HTTP POST request to an integration's action endpoint.
// Caller must consume and close returned http.Response as necessary.
// For internal requests, requests are routed directly to a plugin ServerHTTP hook
func (a *App) DoActionRequest(c request.CTX, rawURL string, body []byte) (*http.Response, *model.AppError) {
Expand Down Expand Up @@ -489,6 +498,14 @@ func (a *App) SubmitInteractiveDialog(c request.CTX, request model.SubmitDialogR
return nil, model.NewAppError("SubmitInteractiveDialog", "app.submit_interactive_dialog.json_error", nil, "", http.StatusBadRequest).Wrap(err)
}

// Log request, regardless of whether destination is internal or external
c.Logger().Info("SubmitInteractiveDialog POST request, through DoActionRequest",
mlog.String("url", url),
mlog.String("user_id", request.UserId),
mlog.String("channel_id", request.ChannelId),
mlog.String("team_id", request.TeamId),
)

ctx, cancel := context.WithTimeout(context.Background(), time.Duration(*a.Config().ServiceSettings.OutgoingIntegrationRequestsTimeout)*time.Second)
defer cancel()
resp, appErr := a.DoActionRequest(c.WithContext(ctx), url, b)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ export default function ChannelNotificationsModal(props: Props) {
</main>
<footer className='channel-notifications-settings-modal__footer'>
{serverError &&
<span className='channel-notifications-settings-modal__server-error'>
<span
role='alert'
className='channel-notifications-settings-modal__server-error'
>
{serverError}
</span>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See LICENSE.txt for license information.

import React, {useRef, useCallback, useEffect, useState} from 'react';
import {FormattedMessage} from 'react-intl';
import {FormattedMessage, useIntl} from 'react-intl';
import {useDispatch, useSelector} from 'react-redux';
import styled, {css} from 'styled-components';

Expand Down Expand Up @@ -126,6 +126,7 @@ const Button = styled.button<{open: boolean}>(({open}) => {
});

const OnBoardingTaskList = (): JSX.Element | null => {
const {formatMessage} = useIntl();
const hasPreferences = useSelector((state: GlobalState) => Object.keys(getMyPreferencesSelector(state)).length !== 0);

useEffect(() => {
Expand Down Expand Up @@ -255,6 +256,7 @@ const OnBoardingTaskList = (): JSX.Element | null => {
ref={trigger}
open={open}
data-cy='onboarding-task-list-action-button'
aria-label={formatMessage({id: 'onboardingTask.checklist.start_onboarding_process', defaultMessage: 'Start the onboarding process.'})}
>
{open ? <CloseIcon size={20}/> : <PlaylistCheckIcon size={20}/>}
{itemsLeft !== 0 && (<span>{itemsLeft}</span>)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export default function TeamButton({
const teamButton = (
<Link
id={`${url.slice(1)}TeamButton`}
aria-label={ariaLabel}
aria-label={isNotCreateTeamButton ? ariaLabel : displayName}
to={url}
onClick={handleSwitch}
>
Expand Down
9 changes: 8 additions & 1 deletion webapp/channels/src/components/team_sidebar/team_sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ export class TeamSidebar extends React.PureComponent<Props, State> {

render() {
const {intl} = this.props;

const root: Element | null = document.querySelector('#root');
if (this.props.myTeams.length <= 1) {
root!.classList.remove('multi-teams');
Expand Down Expand Up @@ -267,6 +266,10 @@ export class TeamSidebar extends React.PureComponent<Props, State> {
}
content={plusIcon}
switchTeam={this.props.actions.switchTeam}
displayName={intl.formatMessage({
id: 'team_sidebar.join',
defaultMessage: 'Other teams you can join',
})}
/>,
);
} else {
Expand All @@ -286,6 +289,10 @@ export class TeamSidebar extends React.PureComponent<Props, State> {
}
content={plusIcon}
switchTeam={this.props.actions.switchTeam}
displayName={intl.formatMessage({
id: 'navbar_dropdown.create',
defaultMessage: 'Create a Team',
})}
/>
</SystemPermissionGate>,
);
Expand Down
1 change: 1 addition & 0 deletions webapp/channels/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4570,6 +4570,7 @@
"onboardingTask.checklist.main_subtitle": "Let's get up and running.",
"onboardingTask.checklist.no_thanks": "No, thanks",
"onboardingTask.checklist.start_enterprise_now": "Start your free Enterprise trial now!",
"onboardingTask.checklist.start_onboarding_process": "Start the onboarding process.",
"onboardingTask.checklist.task_complete_your_profile": "Complete your profile.",
"onboardingTask.checklist.task_download_mm_apps": "Download the Desktop and Mobile Apps.",
"onboardingTask.checklist.task_invite_team_members": "Invite team members to the workspace.",
Expand Down
Loading