-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix(frontend): chart in MkInstanceCardMini
is no longer displayed
#13932
Merged
syuilo
merged 5 commits into
misskey-dev:develop
from
zyoshoka:fix-chart-instance-card-mini-is-no-longer-displayed
Jun 15, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3424356
fix(frontend): chart in `MkInstanceCardMini` is no longer displayed
zyoshoka 72f776a
Update CHANGELOG.md
zyoshoka 61a121a
Merge branch 'develop' into fix-chart-instance-card-mini-is-no-longer…
zyoshoka be0af2d
test: add `MkInstanceCardMini` story
zyoshoka 8e7dd4d
Merge branch 'develop' into fix-chart-instance-card-mini-is-no-longer…
syuilo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
packages/frontend/src/components/MkInstanceCardMini.stories.impl.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and misskey-project | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
/* eslint-disable @typescript-eslint/explicit-function-return-type */ | ||
import { StoryObj } from '@storybook/vue3'; | ||
import { HttpResponse, http } from 'msw'; | ||
import { federationInstance } from '../../.storybook/fakes.js'; | ||
import { commonHandlers } from '../../.storybook/mocks.js'; | ||
import MkInstanceCardMini from './MkInstanceCardMini.vue'; | ||
import { getChartResolver } from './MkChart.stories.impl.js'; | ||
export const Default = { | ||
render(args) { | ||
return { | ||
components: { | ||
MkInstanceCardMini, | ||
}, | ||
setup() { | ||
return { | ||
args, | ||
}; | ||
}, | ||
computed: { | ||
props() { | ||
return { | ||
...this.args, | ||
}; | ||
}, | ||
}, | ||
template: '<MkInstanceCardMini v-bind="props" />', | ||
}; | ||
}, | ||
args: { | ||
instance: federationInstance(), | ||
}, | ||
parameters: { | ||
layout: 'centered', | ||
msw: { | ||
handlers: [ | ||
...commonHandlers, | ||
http.get('/undefined/preview.webp', async ({ request }) => { | ||
const urlStr = new URL(request.url).searchParams.get('url'); | ||
if (urlStr == null) { | ||
return new HttpResponse(null, { status: 404 }); | ||
} | ||
const url = new URL(urlStr); | ||
|
||
if (url.href.startsWith('https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/')) { | ||
const image = await (await fetch(`client-assets/${url.pathname.split('/').pop()}`)).blob(); | ||
return new HttpResponse(image, { | ||
headers: { | ||
'Content-Type': 'image/jpeg', | ||
}, | ||
}); | ||
} else { | ||
return new HttpResponse(null, { status: 404 }); | ||
} | ||
}), | ||
http.get('/api/charts/instance', getChartResolver(['requests.received'])), | ||
], | ||
}, | ||
}, | ||
} satisfies StoryObj<typeof MkInstanceCardMini>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resが返ってる時点でrequests.recievedは存在すると言えそうなので大丈夫そう