Merge branch 'misskey-dev:develop' into disable-reconnect-alert
This commit is contained in:
commit
0f90087e9f
|
@ -43,6 +43,41 @@ export function channel(id = 'somechannelid', name = 'Some Channel', bannerUrl:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function chatMessage(room = false, id = 'somechatmessageid', text = 'Hello!'): entities.ChatMessage {
|
||||||
|
const fromUser = userLite();
|
||||||
|
const toRoom = chatRoom();
|
||||||
|
const toUser = userLite('touserid');
|
||||||
|
return {
|
||||||
|
id,
|
||||||
|
createdAt: '2016-12-28T22:49:51.000Z',
|
||||||
|
fromUserId: fromUser.id,
|
||||||
|
fromUser,
|
||||||
|
text,
|
||||||
|
isRead: false,
|
||||||
|
reactions: [],
|
||||||
|
...room ? {
|
||||||
|
toRoomId: toRoom.id,
|
||||||
|
toRoom,
|
||||||
|
} : {
|
||||||
|
toUserId: toUser.id,
|
||||||
|
toUser,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function chatRoom(id = 'somechatroomid', name = 'Some Chat Room'): entities.ChatRoom {
|
||||||
|
const owner = userLite('someownerid');
|
||||||
|
return {
|
||||||
|
id,
|
||||||
|
createdAt: '2016-12-28T22:49:51.000Z',
|
||||||
|
ownerId: owner.id,
|
||||||
|
owner,
|
||||||
|
name,
|
||||||
|
description: 'A chat room for testing',
|
||||||
|
isMuted: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export function clip(id = 'someclipid', name = 'Some Clip'): entities.Clip {
|
export function clip(id = 'someclipid', name = 'Some Clip'): entities.Clip {
|
||||||
return {
|
return {
|
||||||
id,
|
id,
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { http, HttpResponse } from 'msw';
|
||||||
|
import { action } from '@storybook/addon-actions';
|
||||||
|
import { chatMessage } from '../../.storybook/fakes';
|
||||||
|
import MkChatHistories from './MkChatHistories.vue';
|
||||||
|
import type { StoryObj } from '@storybook/vue3';
|
||||||
|
import type * as Misskey from 'misskey-js';
|
||||||
|
export const Default = {
|
||||||
|
render(args) {
|
||||||
|
return {
|
||||||
|
components: {
|
||||||
|
MkChatHistories,
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
return {
|
||||||
|
args,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
props() {
|
||||||
|
return {
|
||||||
|
...this.args,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
template: '<MkChatHistories v-bind="props" />',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
parameters: {
|
||||||
|
layout: 'centered',
|
||||||
|
msw: {
|
||||||
|
handlers: [
|
||||||
|
http.post('/api/chat/history', async ({ request }) => {
|
||||||
|
const body = await request.json() as Misskey.entities.ChatHistoryRequest;
|
||||||
|
action('POST /api/chat/history')(body);
|
||||||
|
return HttpResponse.json([chatMessage(body.room)]);
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} satisfies StoryObj<typeof MkChatHistories>;
|
|
@ -0,0 +1,7 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
import MkDisableSection from './MkDisableSection.vue';
|
||||||
|
void MkDisableSection;
|
|
@ -164,7 +164,6 @@ rt {
|
||||||
.ti {
|
.ti {
|
||||||
width: 1.28em;
|
width: 1.28em;
|
||||||
vertical-align: -12%;
|
vertical-align: -12%;
|
||||||
line-height: 1em;
|
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
font-size: 128%;
|
font-size: 128%;
|
||||||
|
|
Loading…
Reference in New Issue