diff --git a/.forgejo/issue_template/bug.yaml b/.forgejo/issue_template/bug.yaml new file mode 100644 index 000000000..082ee496e --- /dev/null +++ b/.forgejo/issue_template/bug.yaml @@ -0,0 +1,87 @@ +name: 'Bug report' +about: 'Bug report for Pleroma FE' +labels: + - Bug +body: +- type: input + id: env-browser + attributes: + label: Browser and OS + description: What browser are you using, including version, and what OS are you running? + placeholder: Firefox 140, Arch Linux + validations: + required: true +- type: input + id: env-instance + attributes: + label: Instance URL + validations: + required: false +- type: input + id: env-backend + attributes: + label: Backend version information + description: Backend version being used. (See Settings->Show advanced->Developer) + placeholder: Pleroma BE 2.10 + validations: + required: true +- type: input + id: env-frontend + attributes: + label: Frontend version information + description: Frontend version being used. (See Settings->Show advanced->Developer) + placeholder: Pleroma FE 2.10 + validations: + required: true +- type: input + id: env-extensions + attributes: + label: Browser extensions + description: List of browser extensions you are using, like uBlock, rikaichamp etc. If none leave empty. + validations: + required: false +- type: input + id: env-modifications + attributes: + label: Known instance/user customizations + description: Whether you are using a Pleroma FE fork, any mods mods or instance level styles among others. + validations: + required: false +- type: textarea + id: bug-text + attributes: + label: Bug description + description: A short description of the bug. Images can be helpful. + validations: + required: true +- type: textarea + id: bug-reproducer + attributes: + label: Reproduction steps + description: Ordered list of reproduction steps needed to make the bug happen. If you don't have reproduction steps, leave this empty. + placeholder: | + 1. Log in with a fresh browser session + 2. Open timeline X + 3. Click on button Y + 4. Z broke + validations: + required: false +- type: textarea + id: bug-seriousness + attributes: + label: Bug seriousness + value: | + * How annoying it is: + * How often does it happen: + * How many people does it affect: + * Is there a workaround for it: +- type: checkboxes + id: duplicate-issues + attributes: + label: Duplicate issues + hide_label: true + description: Before submitting this issue, search for same or similar issues on the [Pleroma FE bug tracker](https://git.pleroma.social/pleroma/pleroma-fe/issues). + options: + - label: I've searched for same or similar issues before submitting this issue. + required: true + visible: [form] diff --git a/.forgejo/issue_template/suggestion.yaml b/.forgejo/issue_template/suggestion.yaml new file mode 100644 index 000000000..c1531d8e3 --- /dev/null +++ b/.forgejo/issue_template/suggestion.yaml @@ -0,0 +1,22 @@ +name: 'Feature request / Suggestion / Improvement' +about: 'Feature requests, suggestions and improvements for Pleroma FE' +labels: + - Feature Request / Enhancement +body: +- type: textarea + id: issue-text + attributes: + label: Proposal + placeholder: Make groups happen! + validations: + required: true +- type: checkboxes + id: duplicate-issues + attributes: + label: Duplicate issues + hide_label: true + description: Before submitting this issue, search for same or similar requests on the [Pleroma FE bug tracker](https://git.pleroma.social/pleroma/pleroma-fe/issues). + options: + - label: I've searched for same or similar requests before submitting this issue. + required: true + visible: [form] diff --git a/.forgejo/pull_request_template.md b/.forgejo/pull_request_template.md new file mode 100644 index 000000000..d2d7689bd --- /dev/null +++ b/.forgejo/pull_request_template.md @@ -0,0 +1,12 @@ +### Checklist +- [ ] Adding a changelog: In the `changelog.d` directory, create a file named `.`. + + diff --git a/README.md b/README.md index 6a37195d5..16d32dcd2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # For Translators -To translate Pleroma-FE, use our weblate server: https://translate.pleroma.social/. If you need to add your language it should be added as a json file in [src/i18n/](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/src/i18n/) folder and added in a list within [src/i18n/languages.js](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/src/i18n/languages.js). +To translate Pleroma-FE, use our weblate server: https://translate.pleroma.social/. If you need to add your language it should be added as a json file in [src/i18n/](https://git.pleroma.social/pleroma/pleroma-fe/src/src/i18n/) folder and added in a list within [src/i18n/languages.js](https://git.pleroma.social/pleroma/pleroma-fe/src/src/i18n/languages.js). Pleroma-FE will set your language by your browser locale, but you can change language in settings. @@ -32,10 +32,10 @@ yarn unit # For Contributors: -You can create file `/config/local.json` (see [example](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/config/local.example.json)) to enable some convenience dev options: +You can create file `/config/local.json` (see [example](https://git.pleroma.social/pleroma/pleroma-fe/src/config/local.example.json)) to enable some convenience dev options: * `target`: makes local dev server redirect to some existing instance's BE instead of local BE, useful for testing things in near-production environment and searching for real-life use-cases. -* `staticConfigPreference`: makes FE's `/static/config.json` take preference of BE-served `/api/statusnet/config.json`. Only works in dev mode. +* `staticConfigPreference`: makes FE's `/static/config.json` take preference of BE-served `/api/pleroma/frontend_configurations`. Only works in dev mode. FE Build process also leaves current commit hash in global variable `___pleromafe_commit_hash` so that you can easily see which pleroma-fe commit instance is running, also helps pinpointing which commit was used when FE was bundled into BE. diff --git a/changelog.d/attrs-parsing.fix b/changelog.d/attrs-parsing.fix new file mode 100644 index 000000000..e36e59a86 --- /dev/null +++ b/changelog.d/attrs-parsing.fix @@ -0,0 +1 @@ +Fix HTML attribute parsing for escaped quotes \ No newline at end of file diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index dfc5f9dc3..8ca076931 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -7,9 +7,9 @@ PleromaFE gets its configuration from several sources, in order of preference (the one above overrides ones below it) -1. `/api/statusnet/config.json` - this is generated on Backend and contains multiple things including instance name, char limit etc. It also contains FE/Client-specific data, PleromaFE uses `pleromafe` field of it. For more info on changing config on BE, look [here](../backend/configuration/cheatsheet.md#frontend_configurations) -2. `/static/config.json` - this is a static FE-provided file, containing only FE specific configuration. This file is completely optional and could be removed but is useful as a fallback if some configuration JSON property isn't present in BE-provided config. It's also a reference point to check what default configuration are and what JSON properties even exist. In local dev mode it could be used to override BE configuration, more about that in HACKING.md. File is located [here](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/static/config.json). -3. Built-in defaults. Those are hard-coded defaults that are used when `/static/config.json` is not available and BE-provided configuration JSON is missing some JSON properties. ( [Code](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/src/modules/instance.js) ) +1. `/api/pleroma/frontend_configurations` - this is generated by backend and includes FE/Client-specific data. PleromaFE uses the `pleroma_fe` field of it. For more info on changing config on BE, look [here](../backend/configuration/cheatsheet.md#frontend_configurations) +2. `/static/config.json` - this is a static FE-provided file, containing only FE specific configuration. This file is completely optional and could be removed but is useful as a fallback if some configuration JSON property isn't present in BE-provided config. It's also a reference point to check what default configuration are and what JSON properties even exist. In local dev mode it could be used to override BE configuration, more about that in HACKING.md. File is located [here](https://git.pleroma.social/pleroma/pleroma-fe/src/public/static/config.json). +3. Built-in defaults. Those are hard-coded defaults that are used when `/static/config.json` is not available and BE-provided configuration JSON is missing some JSON properties. ( [Code](https://git.pleroma.social/pleroma/pleroma-fe/src/src/stores/instance.js) ) ## Instance-defaults diff --git a/docs/HACKING.md b/docs/HACKING.md index a5c491136..88760b77a 100644 --- a/docs/HACKING.md +++ b/docs/HACKING.md @@ -79,7 +79,7 @@ server { In 99% cases PleromaFE uses [MastoAPI](https://docs.joinmastodon.org/api/) with [Pleroma Extensions](../backend/API/differences_in_mastoapi_responses.md) to fetch the data. The rest is either QvitterAPI leftovers or pleroma-exclusive APIs. QvitterAPI doesn't exactly have documentation and uses different JSON structure and sometimes different parameters and workflows, [this](https://twitter-api.readthedocs.io/en/latest/index.html) could be a good reference though. Some pleroma-exclusive API may still be using QvitterAPI JSON structure. -PleromaFE supports both formats by transforming them into internal format which is basically QvitterAPI one with some additions and renaming. All data is passed trough [Entity Normalizer](https://git.pleroma.social/pleroma/pleroma-fe/-/blob/develop/src/services/entity_normalizer/entity_normalizer.service.js) which can serve as a reference of API and what's actually used, it's also a host for all the hacks and data transformation. +PleromaFE supports both formats by transforming them into internal format which is basically QvitterAPI one with some additions and renaming. All data is passed trough [Entity Normalizer](https://git.pleroma.social/pleroma/pleroma-fe/src/src/services/entity_normalizer/entity_normalizer.service.js) which can serve as a reference of API and what's actually used, it's also a host for all the hacks and data transformation. For most part, PleromaFE tries to store all the info it can get in global vuex store - every user and post are passed trough updating mechanism where data is either added or merged with existing data, reactively updating the information throughout UI, so if in newest request user's post counter increased, it will be instantly updated in open user profile cards. This is also used to find users, posts and sometimes to build timelines and/or request parameters. diff --git a/package.json b/package.json index 1d0382d46..85e79a1d3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "pleroma_fe", "version": "2.10.1", "description": "Pleroma frontend, the default frontend of Pleroma social network server", - "author": "Pleroma contributors ", + "author": "Pleroma contributors ", "private": false, "scripts": { "dev": "node build/update-emoji.js && vite dev", diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index e1f24c1fd..2fb8064d9 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -1,7 +1,6 @@ import { mapState } from 'pinia' import nsfwImage from '../../assets/nsfw.png' -import fileTypeService from '../../services/file_type/file_type.service.js' import Flash from '../flash/flash.vue' import StillImage from '../still-image/still-image.vue' import VideoAttachment from '../video_attachment/video_attachment.vue' @@ -62,9 +61,7 @@ const Attachment = { hideNsfwLocal: useSyncConfigStore().mergedConfig.hideNsfw, preloadImage: useSyncConfigStore().mergedConfig.preloadImage, loading: false, - img: - fileTypeService.fileType(this.attachment.mimetype) === 'image' && - document.createElement('img'), + img: this.attachment.type === 'image' && document.createElement('img'), modalOpen: false, showHidden: false, flashLoaded: false, @@ -85,7 +82,7 @@ const Attachment = { '-editable': this.edit !== undefined, '-compact': this.compact, }, - '-type-' + this.type, + '-type-' + this.attachment.type, this.size && '-size-' + this.size, `-${this.useContainFit ? 'contain' : 'cover'}-fit`, ] @@ -98,14 +95,14 @@ const Attachment = { }, placeholderName() { if (this.attachment.description === '' || !this.attachment.description) { - return this.type.toUpperCase() + return this.attachment.type.toUpperCase() } return this.attachment.description }, placeholderIconClass() { - if (this.type === 'image') return 'image' - if (this.type === 'video') return 'video' - if (this.type === 'audio') return 'music' + if (this.attachment.type === 'image') return 'image' + if (this.attachment.type === 'video') return 'video' + if (this.attachment.type === 'audio') return 'music' return 'file' }, referrerpolicy() { @@ -113,14 +110,11 @@ const Attachment = { ? '' : 'no-referrer' }, - type() { - return fileTypeService.fileType(this.attachment.mimetype) - }, hidden() { return this.nsfw && this.hideNsfwLocal && !this.showHidden }, isEmpty() { - return this.type === 'html' && !this.attachment.oembed + return this.attachment.type === 'html' && !this.attachment.oembed }, useModal() { let modalTypes = [] @@ -135,7 +129,7 @@ const Attachment = { : ['image'] break } - return modalTypes.includes(this.type) + return modalTypes.includes(this.attachment.type) }, videoTag() { return this.useModal ? 'button' : 'span' @@ -160,7 +154,7 @@ const Attachment = { if (this.useModal) { this.$emit('setMedia') useMediaViewerStore().setCurrentMedia(this.attachment) - } else if (this.type === 'unknown') { + } else if (this.attachment.type === 'unknown') { window.open(this.attachment.url) } }, @@ -193,7 +187,7 @@ const Attachment = { if ( this.mergedConfig.useOneClickNsfw && !this.showHidden && - (this.type !== 'video' || this.mergedConfig.playVideosInModal) + (this.attachment.type !== 'video' || this.mergedConfig.playVideosInModal) ) { this.openModal(event) return diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 696d3bb8a..0db86ff8a 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -6,7 +6,7 @@ @click="openModal" > @@ -80,7 +80,7 @@ class="attachment-buttons" >