Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests-readonly.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Read-only e2e tests
on:
pull_request:
branches: [ main ]
branches: [ main, live ]
jobs:
test:
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests-readwrite.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Read-write e2e tests
on:
pull_request:
branches: [ main ]
branches: [ main, live ]
jobs:
test:
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Unit tests
on:
pull_request:
branches: [ main ]
branches: [ main, live ]
jobs:
test:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.0.0
2 changes: 2 additions & 0 deletions src/intl/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,11 @@ export default {
statuses: 'Toots',
follows: 'Follows',
followers: 'Followers',
joined: 'Joined',
moreOptions: 'More options',
followersLabel: 'Followed by {count}',
followingLabel: 'Follows {count}',
joinedLabel: 'Joined on {date}',
followLabel: `Follow {requested, select,
true {(follow requested)}
other {}
Expand Down
18 changes: 17 additions & 1 deletion src/routes/_components/profile/AccountProfileDetails.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<h2 class="sr-only">{intl.statisticsAndMoreOptions}</h2>
<div class="account-profile-details">
<span class="account-profile-details-item"
aria-label={joinedLabel}
>
<span class="account-profile-details-item-datum">
{joinDate}
</span>
<span class="account-profile-details-item-title">
{intl.joined}
</span>
</span>
<div class="account-profile-details-item">
<span class="account-profile-details-item-datum">
{numStatusesDisplay}
Expand Down Expand Up @@ -93,6 +103,7 @@ <h2 class="sr-only">{intl.statisticsAndMoreOptions}</h2>
import { LOCALE } from '../../_static/intl.js'
import { formatIntl } from '../../_utils/formatIntl.js'
import { thunk } from '../../_utils/thunk.js'
import { shortAbsoluteDateOnlyFormatter } from '../../_utils/formatters.js'

const numberFormat = thunk(() => new Intl.NumberFormat(LOCALE))

Expand All @@ -114,7 +125,12 @@ <h2 class="sr-only">{intl.statisticsAndMoreOptions}</h2>
),
followingLabel: ({ numFollowing }) => (
formatIntl('intl.followingLabel', { count: numFollowing })
)
),
joinedLabel: ({ joinDate }) => (
formatIntl('intl.joinedLabel', { date: joinDate })
),
createdAtDateTS: ({ account }) => new Date(account.created_at).getTime(),
joinDate: ({ createdAtDateTS }) => shortAbsoluteDateOnlyFormatter().format(createdAtDateTS)
}
}
</script>
10 changes: 8 additions & 2 deletions src/routes/_components/status/StatusPoll.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<div class={computedClass} aria-busy={loading} >
{#if voted || expired }
<ul class="poll-choices" aria-label="{intl.pollResults}">
{#each options as option}
{#each options as option, i}
<li class="poll-choice option">
<div class="option-text">
<strong>{option.share}%</strong> <span>{@html cleanTitle(option.title)}</span>
<strong>{option.share}%</strong><span>{@html cleanTitle(option.title)}</span>
{#if own_votes == i || Object.values(own_votes).includes(i)}
<SvgIcon className="poll-icon" href="#fa-check" />
{/if}
</div>
<svg aria-hidden="true">
<line x1="0" y1="0" x2="{option.share}%" y2="0" />
Expand Down Expand Up @@ -109,6 +112,8 @@
word-wrap: break-word;
white-space: pre-wrap;
font-size: 1.1em;
display: flex;
gap: .5em;
}

svg {
Expand Down Expand Up @@ -303,6 +308,7 @@
// Misskey reports the "voters_count" as null, so just use the "votes_count"
votersOrVotesCount: ({ votersCount, votesCount }) => typeof votersCount === 'number' ? votersCount : votesCount,
voted: ({ poll }) => poll.voted,
own_votes: ({ poll }) => poll.own_votes,
multiple: ({ poll }) => poll.multiple,
expired: ({ poll }) => poll.expired,
expiresAt: ({ poll }) => poll.expires_at,
Expand Down
6 changes: 6 additions & 0 deletions src/routes/_utils/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ export const dayOnlyAbsoluteDateFormatter = thunk(() => safeFormatter(new Intl.D
month: 'short',
day: 'numeric'
})))

export const shortAbsoluteDateOnlyFormatter = thunk(() => safeFormatter(new Intl.DateTimeFormat(LOCALE, {
year: 'numeric',
month: 'short',
day: 'numeric'
})))