Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mattermost/mattermost-plugin-todo…
Browse files Browse the repository at this point in the history
… into fix_issue_218
  • Loading branch information
ayusht2810 committed Apr 24, 2024
2 parents d77c7f6 + b8dff94 commit 20fb024
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 27 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
name: cd
on:
workflow_run:
workflows: ["ci"]
branches-ignore: ["*"]
types:
- completed
push:
tags:
- "v*"

permissions:
contents: read

jobs:
plugin-cd:
uses: mattermost/actions-workflows/.github/workflows/plugin-cd.yml@main
uses: mattermost/actions-workflows/.github/workflows/community-plugin-cd.yml@d9defa3e455bdbf889573e112ad8d05b91d66b4c
secrets: inherit
12 changes: 3 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
name: ci
on:
schedule:
- cron: "0 0 * * *"
pull_request:
push:
branches:
- master
tags:
- "v*"
pull_request:

permissions:
contents: read
- main

jobs:
plugin-ci:
uses: mattermost/actions-workflows/.github/workflows/plugin-ci.yml@main
uses: mattermost/actions-workflows/.github/workflows/community-plugin-ci.yml@139a051e8651e6246e3764fe342297b73120e590
secrets: inherit
3 changes: 1 addition & 2 deletions e2e/playwright/tests/test.list.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {test} from '@playwright/test';
import core from './todo_plugin.spec';

import '../support/init_test';

test.describe(core.connected);
core.connected();
6 changes: 2 additions & 4 deletions e2e/playwright/tests/todo_plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ import {fillMessage, getTodoBotDMPageURL} from 'support/utils';
export default {
connected: () => {
test.describe('available commands', () => {
test('with just the main command', async ({pages, page, pw}) => {
test('with just the main command', async ({page, pw}) => {

const {adminClient, adminUser} = await pw.getAdminClient();
if (adminUser === null) {
throw new Error('can not get adminUser');
}
const dmURL = await getTodoBotDMPageURL(adminClient, '', adminUser.id);
await page.goto(dmURL, {waitUntil: 'load'});

const c = new pages.ChannelsPage(page);
const slash = new SlashCommandSuggestions(page.locator('#suggestionList'));

// # Run incomplete command to trigger help
Expand All @@ -39,4 +38,3 @@ export default {
});
},
};

6 changes: 4 additions & 2 deletions server/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,10 @@ func (l *listManager) ChangeAssignment(issueID string, userID string, sendTo str
return issue.Message, ir.ForeignUserID, nil
}

if err := l.store.RemoveReference(userID, issueID, list); err != nil {
return "", "", err
if userID != sendTo {
if err := l.store.RemoveReference(userID, issueID, list); err != nil {
return "", "", err
}
}

receiverIssue := newIssue(issue.Message, issue.Description, issue.PostID)
Expand Down
11 changes: 10 additions & 1 deletion webapp/src/components/user_selector/autocomplete_selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import React, {CSSProperties} from 'react';

import {components} from 'react-select';
import AsyncSelect from 'react-select/async';
import {OptionsType, ValueType, Theme as ComponentTheme} from 'react-select/src/types';
import {Props as ComponentProps, StylesConfig} from 'react-select/src/styles';
Expand Down Expand Up @@ -51,7 +52,7 @@ const useTheme = (mattermostTheme: Theme): [StylesConfig, ThemeConfig] => {
return [styles, compTheme];
};

const renderOption = (option: UserProfile, {context} : {context: FormatOptionLabelContext}) => {
const renderOption = (option: UserProfile, {context}: {context: FormatOptionLabelContext}) => {
const {username} = option;
const name = `@${username}`;
const description = getDescription(option);
Expand Down Expand Up @@ -116,6 +117,13 @@ export default function AutocompleteSelector(props: Props) {
);
}

//@ts-ignore
const Input = (inputProps) => (
<components.Input
{...inputProps}
maxLength={22}
/>);

return (
<div
data-testid='autoCompleteSelector'
Expand All @@ -124,6 +132,7 @@ export default function AutocompleteSelector(props: Props) {
{labelContent}
<div className={inputClassName}>
<AsyncSelect
components={{Input}}
autoFocus={Boolean(props.autoFocus)}
cacheOptions={true}
loadOptions={loadOptions}
Expand Down

0 comments on commit 20fb024

Please sign in to comment.