revert: remove federatedDescription category field, closes #13757

This commit is contained in:
Julian Lam
2025-11-05 12:55:03 -05:00
parent a8e45587bc
commit ed83bc5b83
4 changed files with 4 additions and 21 deletions

View File

@@ -15,9 +15,6 @@
"handle": "Category Handle",
"handle.help": "Your category handle is used as a representation of this category across other networks, similar to a username. A category handle must not match an existing username or user group.",
"description": "Category Description",
"federatedDescription": "Federated Description",
"federatedDescription.help": "This text will be appended to the category description when queried by other websites/apps.",
"federatedDescription.default": "This is a forum category containing topical discussion. You can start new discussions by mentioning this category.",
"topic-template": "Topic Template",
"topic-template.help": "Define a template for new topics created in this category.",
"bg-color": "Background Colour",

View File

@@ -521,11 +521,11 @@ Mocks.actors.user = async (uid) => {
};
Mocks.actors.category = async (cid) => {
let {
const {
name, handle: preferredUsername, slug,
descriptionParsed: summary, federatedDescription, backgroundImage,
descriptionParsed: summary, backgroundImage,
} = await categories.getCategoryFields(cid,
['name', 'handle', 'slug', 'description', 'descriptionParsed', 'federatedDescription', 'backgroundImage']);
['name', 'handle', 'slug', 'description', 'descriptionParsed', 'backgroundImage']);
const publicKey = await activitypub.getPublicKey('cid', cid);
let icon;
@@ -546,10 +546,6 @@ Mocks.actors.category = async (cid) => {
};
}
// Append federated desc.
const fallback = await translator.translate('[[admin/manage/categories:federatedDescription.default]]');
summary += `<hr /><p dir="auto">${federatedDescription || fallback}</p>\n`;
return {
'@context': [
'https://www.w3.org/ns/activitystreams',

View File

@@ -117,7 +117,7 @@ function modifyCategory(category, fields) {
db.parseIntFields(category, intFields, fields);
const escapeFields = ['name', 'nickname', 'description', 'federatedDescription', 'color', 'bgColor', 'backgroundImage', 'imageClass', 'class', 'link'];
const escapeFields = ['name', 'nickname', 'description', 'color', 'bgColor', 'backgroundImage', 'imageClass', 'class', 'link'];
escapeFields.forEach((field) => {
if (category.hasOwnProperty(field)) {
category[field] = validator.escape(String(category[field] || ''));

View File

@@ -36,16 +36,6 @@
<textarea id="cid-{category.cid}-description" data-name="description" class="form-control category_description description" rows="4" />{category.description}</textarea>
</div>
<div class="mb-3">
<label class="form-label" for="cid-{category.cid}-federatedDescription">
[[admin/manage/categories:federatedDescription]]
</label>
<textarea id="cid-{category.cid}-federatedDescription" data-name="federatedDescription" class="form-control" rows="2" placeholder="[[admin/manage/categories:federatedDescription.default]]" />{category.federatedDescription}</textarea>
<p class="form-text">
[[admin/manage/categories:federatedDescription.help]]
</p>
</div>
<div class="mb-3">
<label class="form-label" for="cid-{category.cid}-topic-template">
[[admin/manage/categories:topic-template]]