Compare commits

...

24 commits

Author SHA1 Message Date
floatingghost 3e86db24d3 Update .woodpecker.yml
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-05-28 21:33:15 +00:00
floatingghost 7789c5def6 Update .woodpecker.yml 2024-05-28 21:31:46 +00:00
Floatingghost f3934afbd8 make sure we normalise interfaceLanguage
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
2024-05-28 04:17:04 +01:00
Floatingghost 0b437ab6fd remove line left over in conflict 2024-05-28 04:15:35 +01:00
floatingghost 8964dce609 Merge pull request 'Make animated emojis in reactions pause' (#378) from sarayalth/akkoma-fe:pause-animated-reaction into develop
Reviewed-on: AkkomaGang/akkoma-fe#378
2024-05-28 02:25:02 +00:00
floatingghost 1a49a1b3ac Merge pull request 'Expand Unicode emoji map' (#385) from Oneric/akkoma-fe:emoji_update into develop
Reviewed-on: AkkomaGang/akkoma-fe#385
2024-05-28 02:24:06 +00:00
Floatingghost 1adef56603 Merge remote-tracking branch 'partizan/386-default-post-lang' into develop 2024-05-28 03:22:03 +01:00
Floatingghost 5aaa605df0 add asdf tool file 2024-05-28 03:14:50 +01:00
Floatingghost 71e287d56c update CI to v2 2024-05-28 03:14:37 +01:00
floatingghost 70275684bf Merge pull request 'Fix posting for "special" interface languages' (#377) from Oneric/akkoma-fe:post-language-specialcodes into develop
Reviewed-on: AkkomaGang/akkoma-fe#377
2024-05-28 02:10:15 +00:00
floatingghost 29ff2ef455 Merge pull request 'Fix ordering of favourites timeline' (#392) from Oneric/akkoma-fe:favourite-ordering into develop
Reviewed-on: AkkomaGang/akkoma-fe#392
2024-05-28 02:07:15 +00:00
Oneric 62e0dd858c Fix ordering of favourites timeline
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
The backend returns them order by when the post was favourited;
reordering them by post date jumbles everything up each addition
and serves no purpose.

Fixes: AkkomaGang/akkoma-fe#391
2024-05-15 18:47:47 +02:00
sarah cc709394c5 remove unused classes on notifications
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2024-05-14 18:09:21 +02:00
Serhii Tereshchenko 57beea6a0d fix: Use label and key for options
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2024-05-13 16:13:58 +03:00
Serhii Tereshchenko 042e8c78dc feat: Add "Default post language" option
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
Refs #386
2024-04-20 16:07:03 +03:00
Oneric 0e07d88afa Expand Unicode emoji map
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
This pulls in 267 new emoji:
  - all 258 non-deprecated country or macro region
    flags (composed by two regional indicators)
  - all 3 regional flags currently recommended for general use
    (Wales, Scotland, England)
  - a few random ones i picked out
    - goose
    - heart on fire
    - heart mending
    - transgender flag
    - rainbow flag
    - pirate flag

The new names are derived from official Unicode names
with minor modifications to fit into the usual shortcode scheme
and dropping the flag_ prefix from country indicators.
Due to a naming conflict the old "japan" emoji
U+1F5FE SILHOUETTE OF JAPAN was renamed to "japan_silhouette".
2024-04-04 21:52:33 +02:00
sarah 1f5f8665c8 make animated reactions pause unless hovered on notifications
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2024-03-01 20:02:19 +01:00
Oneric 428ed70b0d Fix posting for special interface languages
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
Easy Japanses (ja_easy) and traditional Chinses (zh_Hant) use
(custom) non-ISO codes in the interface. Because MastoAPI only accepts
ISO 639 codes, the backend will return an error rendering users
unable to do anything unless the post’s language was explicitly set.
2024-02-26 08:05:55 +01:00
floatingghost ed0b403c33 Merge pull request 'Auto-approve followbacks (frontend part)' (#365) from Oneric/akkoma-fe:followbacks-fe into develop
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: AkkomaGang/akkoma-fe#365
2024-02-20 16:24:37 +00:00
floatingghost 0f842b300b Merge pull request 'Display profile background of other users' (#371) from Oneric/akkoma-fe:profile-backgrounds into develop
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: AkkomaGang/akkoma-fe#371
2024-02-20 16:20:14 +00:00
floatingghost 865cb6f96a Merge pull request 'Add Indonesian translation' (#366) from leap123/akkoma-fe:leap123-patch-1 into develop
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: AkkomaGang/akkoma-fe#366
2024-02-19 14:04:34 +00:00
Oneric 050c7df2e6 Display profile background of other users
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
And add a new frontend setting to hide other people's background.
2024-02-14 18:44:57 +01:00
Oneric a77a9e04d9 Expose new server-side permit_followback setting
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
Added to backend in AkkomaGang/akkoma#674
2024-02-04 22:19:14 +01:00
leap123 a57334991e Add Indonesian translation
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
The Indonesian translation is technically almost complete, just not added to messages.js
2024-01-19 04:27:26 +00:00
21 changed files with 405 additions and 32 deletions

1
.tool-versions Normal file
View file

@ -0,0 +1 @@
nodejs 20.12.2

View file

@ -1,10 +1,12 @@
platform: linux/amd64
pipeline:
labels:
platform: linux/amd64
steps:
lint:
when:
event:
- pull_request
image: node:18
image: node:20
commands:
- yarn
- yarn lint
@ -14,11 +16,11 @@ pipeline:
when:
event:
- pull_request
image: node:18
image: node:20
commands:
- apt update
- apt install firefox-esr -y --no-install-recommends
- yarn
- yarn
- yarn unit
build:
@ -28,7 +30,7 @@ pipeline:
branch:
- develop
- stable
image: node:18
image: node:20
commands:
- yarn
- yarn build
@ -40,15 +42,15 @@ pipeline:
branch:
- develop
- stable
image: node:18
image: node:20
secrets:
- SCW_ACCESS_KEY
- SCW_SECRET_KEY
- SCW_DEFAULT_ORGANIZATION_ID
commands:
- apt-get update && apt-get install -y rclone wget zip
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_linux_amd64
- mv scaleway-cli_2.5.1_linux_amd64 scaleway-cli
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.30.0/scaleway-cli_2.30.0_linux_amd64
- mv scaleway-cli_2.30.0_linux_amd64 scaleway-cli
- chmod +x scaleway-cli
- ./scaleway-cli object config install type=rclone
- zip akkoma-fe.zip -r dist
@ -70,8 +72,8 @@ pipeline:
- SCW_DEFAULT_ORGANIZATION_ID
commands:
- apt-get update && apt-get install -y rclone wget git zip
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_linux_amd64
- mv scaleway-cli_2.5.1_linux_amd64 scaleway-cli
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.30.0/scaleway-cli_2.30.0_linux_amd64
- mv scaleway-cli_2.30.0_linux_amd64 scaleway-cli
- chmod +x scaleway-cli
- ./scaleway-cli object config install type=rclone
- cd docs
@ -79,4 +81,4 @@ pipeline:
- mkdocs build
- zip -r docs.zip site/*
- cd site
- rclone copy . scaleway:akkoma-docs/frontend/$CI_COMMIT_BRANCH/
- rclone copy . scaleway:akkoma-docs/frontend/$CI_COMMIT_BRANCH/

View file

@ -64,6 +64,11 @@ export default {
'-' + this.layoutType
]
},
pageBackground () {
return this.mergedConfig.displayPageBackgrounds
? this.$store.state.users.displayBackground
: null
},
currentUser () { return this.$store.state.users.currentUser },
userBackground () { return this.currentUser.background_image },
instanceBackground () {
@ -71,7 +76,7 @@ export default {
? null
: this.$store.state.instance.background
},
background () { return this.userBackground || this.instanceBackground },
background () { return this.pageBackground || this.userBackground || this.instanceBackground },
bgStyle () {
if (this.background) {
return {

View file

@ -6,6 +6,7 @@ import UserCard from '../user_card/user_card.vue'
import Timeago from '../timeago/timeago.vue'
import RichContent from 'src/components/rich_content/rich_content.jsx'
import ConfirmModal from '../confirm_modal/confirm_modal.vue'
import StillImage from '../still-image/still-image.vue'
import { isStatusNotification } from '../../services/notification_utils/notification_utils.js'
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
@ -50,7 +51,8 @@ const Notification = {
Timeago,
Status,
RichContent,
ConfirmModal
ConfirmModal,
StillImage
},
methods: {
toggleUserExpanded () {

View file

@ -116,12 +116,13 @@
scope="global"
keypath="notifications.reacted_with"
>
<img
<still-image
v-if="notification.emoji_url !== null"
class="notification-reaction-emoji"
:src="notification.emoji_url"
:name="notification.emoji"
>
:title="notification.emoji"
:alt="notification.emoji"
/>
<span
v-else
class="emoji-reaction-emoji"

View file

@ -9,11 +9,12 @@ import StatusContent from '../status_content/status_content.vue'
import fileTypeService from '../../services/file_type/file_type.service.js'
import { findOffset } from '../../services/offset_finder/offset_finder.service.js'
import { reject, map, uniqBy, debounce } from 'lodash'
import { usePostLanguageOptions } from 'src/lib/post_language'
import suggestor from '../emoji_input/suggestor.js'
import { mapGetters, mapState } from 'vuex'
import Checkbox from '../checkbox/checkbox.vue'
import Select from '../select/select.vue'
import iso6391 from 'iso-639-1'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
@ -62,6 +63,13 @@ const deleteDraft = (draftKey) => {
localStorage.setItem('drafts', JSON.stringify(draftData));
}
const interfaceToISOLanguage = (ilang) => {
const sep = ilang.indexOf("_");
return sep < 0 ?
ilang :
ilang.substr(0, sep);
}
const PostStatusForm = {
props: [
'statusId',
@ -129,6 +137,13 @@ const PostStatusForm = {
this.$refs.textarea.focus()
}
},
setup() {
const {postLanguageOptions} = usePostLanguageOptions()
return {
postLanguageOptions,
}
},
data () {
const preset = this.$route.query.message
let statusText = preset || ''
@ -138,7 +153,8 @@ const PostStatusForm = {
statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser)
}
const { postContentType: contentType, sensitiveByDefault, sensitiveIfSubject, interfaceLanguage, alwaysShowSubjectInput } = this.$store.getters.mergedConfig
const { postContentType: contentType, postLanguage: defaultPostLanguage, sensitiveByDefault, sensitiveIfSubject, interfaceLanguage, alwaysShowSubjectInput } = this.$store.getters.mergedConfig
const postLanguage = defaultPostLanguage || interfaceToISOLanguage(interfaceLanguage)
let statusParams = {
spoilerText: this.subject || '',
@ -149,7 +165,7 @@ const PostStatusForm = {
poll: {},
mediaDescriptions: {},
visibility: this.suggestedVisibility(),
language: interfaceLanguage,
language: postLanguage,
contentType
}
@ -164,7 +180,7 @@ const PostStatusForm = {
poll: this.statusPoll || {},
mediaDescriptions: this.statusMediaDescriptions || {},
visibility: this.statusScope || this.suggestedVisibility(),
language: this.statusLanguage || interfaceLanguage,
language: this.statusLanguage || postLanguage,
contentType: statusContentType
}
}
@ -309,9 +325,6 @@ const PostStatusForm = {
...mapState({
mobileLayout: state => state.interface.mobileLayout
}),
isoLanguages () {
return iso6391.getAllCodes();
}
},
watch: {
'newStatus': {

View file

@ -208,11 +208,11 @@
class="form-control"
>
<option
v-for="language in isoLanguages"
:key="language"
:value="language"
v-for="language in postLanguageOptions"
:key="language.key"
:value="language.value"
>
{{ language }}
{{ language.label }}
</option>
</Select>
</div>

View file

@ -4,6 +4,7 @@ import ScopeSelector from 'src/components/scope_selector/scope_selector.vue'
import IntegerSetting from '../helpers/integer_setting.vue'
import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue'
import { usePostLanguageOptions } from 'src/lib/post_language'
import SharedComputedObject from '../helpers/shared_computed_object.js'
import ServerSideIndicator from '../helpers/server_side_indicator.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
@ -17,6 +18,11 @@ library.add(
)
const GeneralTab = {
setup() {
const {postLanguageOptions} = usePostLanguageOptions()
return {postLanguageOptions}
},
data () {
return {
subjectLineOptions: ['email', 'noop', 'masto'].map(mode => ({
@ -118,6 +124,12 @@ const GeneralTab = {
this.$store.dispatch('setOption', { name: 'translationLanguage', value: val })
}
},
postLanguage: {
get: function () { return this.$store.getters.mergedConfig.postLanguage },
set: function (val) {
this.$store.dispatch('setOption', { name: 'postLanguage', value: val })
}
},
...SharedComputedObject()
},
methods: {

View file

@ -146,6 +146,11 @@
{{ $t('settings.show_wider_shortcuts') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting path="displayPageBackgrounds">
{{ $t('settings.show_page_backgrounds') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting path="stopGifs">
{{ $t('settings.stop_gifs') }}
@ -580,6 +585,15 @@
{{ $t('settings.post_status_content_type') }}
</ChoiceSetting>
</li>
<li>
<ChoiceSetting
id="postLanguage"
path="postLanguage"
:options="postLanguageOptions"
>
{{ $t('settings.post_language') }}
</ChoiceSetting>
</li>
<li>
<BooleanSetting
path="alwaysShowNewPostButton"

View file

@ -33,6 +33,7 @@ const ProfileTab = {
newName: this.$store.state.users.currentUser.name_unescaped,
newBio: unescape(this.$store.state.users.currentUser.description),
newLocked: this.$store.state.users.currentUser.locked,
newPermitFollowback: this.$store.state.users.currentUser.permit_followback,
newFields: this.$store.state.users.currentUser.fields.map(field => ({ name: field.name, value: field.value })),
showRole: this.$store.state.users.currentUser.show_role,
role: this.$store.state.users.currentUser.role,
@ -135,6 +136,7 @@ const ProfileTab = {
bot: this.bot,
show_role: this.showRole,
status_ttl_days: this.expirePosts ? this.newPostTTLDays : -1,
permit_followback: this.permit_followback,
accepts_direct_messages_from: this.userAcceptsDirectMessagesFrom
/* eslint-enable camelcase */
}

View file

@ -259,6 +259,19 @@
<BooleanSetting path="serverSide_locked">
{{ $t('settings.lock_account_description') }}
</BooleanSetting>
<ul
class="setting-list suboptions"
:class="[{disabled: !serverSide_locked}]"
>
<li>
<BooleanSetting
path="serverSide_permitFollowback"
:disabled="!serverSide_locked"
>
{{ $t('settings.permit_followback_description') }}
</BooleanSetting>
</li>
</ul>
</li>
<li>
<BooleanSetting path="serverSide_discoverable">

View file

@ -145,10 +145,12 @@ const UserProfile = {
if (user) {
loadById(user.id)
this.note = user.relationship.note
this.$store.dispatch('setDisplayBackground', user.background_image)
} else {
this.$store.dispatch('fetchUser', userNameOrId)
.then(({ id, relationship }) => {
.then(({ id, relationship, background_image }) => {
this.note = relationship.note
this.$store.dispatch('setDisplayBackground', background_image)
return loadById(id)
})
.catch((reason) => {
@ -225,6 +227,9 @@ const UserProfile = {
Conversation,
RichContent,
FollowedTagList
},
beforeRouteLeave(to, from) {
this.$store.dispatch('setDisplayBackground', null)
}
}

View file

@ -601,6 +601,7 @@
"list_aliases_error": "Error fetching aliases: {error}",
"list_backups_error": "Error fetching backup list: {error}",
"lock_account_description": "Restrict your account to approved followers only",
"permit_followback_description": "Automatically approve requests from already followed users",
"loop_video": "Loop videos",
"loop_video_silent_only": "Loop only videos without sound (i.e. Mastodon's \"gifs\")",
"mascot": "Mastodon FE Mascot",
@ -683,6 +684,7 @@
"play_videos_in_modal": "Play videos in a popup frame",
"post_look_feel": "Posts Look & Feel",
"post_status_content_type": "Default post content type",
"post_language": "Default post language",
"posts": "Posts",
"preload_images": "Preload images",
"presets": "Presets",
@ -750,6 +752,7 @@
"show_nav_shortcuts": "Show extra navigation shortcuts in top panel",
"show_panel_nav_shortcuts": "Show timeline navigation shortcuts at the top of the panel",
"show_scrollbars": "Show side column's scrollbars",
"show_page_backgrounds": "Show page-specific backgrounds, e.g. for user profiles",
"show_wider_shortcuts": "Show wider gap between top panel shortcuts",
"show_yous": "Show (You)s",
"stop_gifs": "Pause animated images until you hover on them",

View file

@ -21,6 +21,7 @@ const loaders = {
ga: () => import('./ga.json'),
he: () => import('./he.json'),
hu: () => import('./hu.json'),
id: () => import('./id.json'),
it: () => import('./it.json'),
ja: () => import('./ja_pedantic.json'),
ja_easy: () => import('./ja_easy.json'),

16
src/lib/post_language.js Normal file
View file

@ -0,0 +1,16 @@
import iso6391 from 'iso-639-1'
import { computed } from 'vue'
export const usePostLanguageOptions = () => {
const postLanguageOptions = computed(() => {
return iso6391.getAllCodes().map(lang => ({
key: lang,
value: lang,
label: lang,
}));
})
return {
postLanguageOptions,
}
}

View file

@ -55,6 +55,7 @@ export const defaultState = {
alwaysShowNewPostButton: false,
autohideFloatingPostButton: false,
pauseOnUnfocused: true,
displayPageBackgrounds: true,
stopGifs: undefined,
replyVisibility: 'all',
thirdColumnMode: 'notifications',
@ -115,6 +116,7 @@ export const defaultState = {
conversationTreeFadeAncestors: undefined, // instance default
maxDepthInThread: undefined, // instance default
translationLanguage: undefined, // instance default,
postLanguage: undefined, // instance default,
supportedTranslationLanguages: {}, // instance default
userProfileDefaultTab: 'statuses',
useBlurhash: true,

View file

@ -47,6 +47,10 @@ export const settingsMap = {
},
// Privacy
'locked': 'locked',
'permitFollowback': {
get: 'akkoma.permit_followback',
set: 'permit_followback'
},
'allowFollowingMove': {
get: 'pleroma.allow_following_move',
set: 'allow_following_move'

View file

@ -314,7 +314,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
})
// Keep the visible statuses sorted
if (timeline && !(timeline === 'bookmarks')) {
if (timeline && !(['bookmarks', 'favorites'].includes(timeline))) {
sortTimeline(timelineObject)
}
}

View file

@ -135,6 +135,10 @@ export const mutations = {
const user = state.usersObject[id]
user['deactivated'] = deactivated
},
setDisplayBackground(state, url) {
console.log("Commiting user profile bg mutation")
state.displayBackground = url
},
setCurrentUser (state, user) {
state.lastLoginName = user.screen_name
state.currentUser = mergeWith(state.currentUser || {}, user, mergeArrayLength)
@ -307,6 +311,7 @@ export const defaultState = {
currentUser: false,
users: [],
usersObject: {},
displayBackground: null,
signUpPending: false,
signUpErrors: [],
relationships: {},
@ -319,6 +324,10 @@ const users = {
mutations,
getters,
actions: {
setDisplayBackground (store, url) {
console.log("Performing user profile bg action...")
store.commit('setDisplayBackground', url)
},
fetchUserIfMissing (store, id) {
if (!store.getters.findUser(id)) {
store.dispatch('fetchUser', id)

View file

@ -95,6 +95,7 @@ export const parseUser = (data) => {
if (data.akkoma) {
output.instance = data.akkoma.instance
output.status_ttl_days = data.akkoma.status_ttl_days
output.permit_followback = data.akkoma.permit_followback
}
if (data.pleroma) {

File diff suppressed because it is too large Load diff