Dropped the featured note injection column
ci/woodpecker/push/ociImagePush Pipeline was successful Details

This commit is contained in:
Natty 2023-08-06 16:41:00 +02:00
parent fded21f285
commit a29cea6cbc
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
8 changed files with 622 additions and 270 deletions

824
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -39,8 +39,8 @@ miette = "5.9"
percent-encoding = "2.2" percent-encoding = "2.2"
redis = "0.23" redis = "0.23"
reqwest = "0.11" reqwest = "0.11"
sea-orm = "0.11" sea-orm = "0.12"
sea-orm-migration = "0.11" sea-orm-migration = "0.12"
serde = "1" serde = "1"
serde_json = "1" serde_json = "1"
serde-wasm-bindgen = "0.5" serde-wasm-bindgen = "0.5"

View File

@ -48,8 +48,6 @@ pub struct Model {
pub room: Json, pub room: Json,
#[sea_orm(column_type = "JsonBinary")] #[sea_orm(column_type = "JsonBinary")]
pub integrations: Json, pub integrations: Json,
#[sea_orm(column_name = "injectFeaturedNote")]
pub inject_featured_note: bool,
#[sea_orm(column_name = "enableWordMute")] #[sea_orm(column_name = "enableWordMute")]
pub enable_word_mute: bool, pub enable_word_mute: bool,
#[sea_orm(column_name = "mutedWords", column_type = "JsonBinary")] #[sea_orm(column_name = "mutedWords", column_type = "JsonBinary")]

View File

@ -3,6 +3,7 @@ pub use sea_orm_migration::prelude::*;
mod m20220101_000001_bootstrap; mod m20220101_000001_bootstrap;
mod m20230729_201733_drop_messaging_integrations; mod m20230729_201733_drop_messaging_integrations;
mod m20230729_212237_user_unique_idx; mod m20230729_212237_user_unique_idx;
mod m20230806_142918_drop_featured_note_option;
pub struct Migrator; pub struct Migrator;
@ -13,6 +14,7 @@ impl MigratorTrait for Migrator {
Box::new(m20220101_000001_bootstrap::Migration), Box::new(m20220101_000001_bootstrap::Migration),
Box::new(m20230729_201733_drop_messaging_integrations::Migration), Box::new(m20230729_201733_drop_messaging_integrations::Migration),
Box::new(m20230729_212237_user_unique_idx::Migration), Box::new(m20230729_212237_user_unique_idx::Migration),
Box::new(m20230806_142918_drop_featured_note_option::Migration),
] ]
} }
} }

View File

@ -0,0 +1,33 @@
use sea_orm_migration::prelude::*;
#[derive(DeriveMigrationName)]
pub struct Migration;
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
let db = manager.get_connection();
db.execute_unprepared(
r#"
ALTER TABLE "user_profile" DROP COLUMN "injectFeaturedNote";
"#,
)
.await?;
Ok(())
}
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
let db = manager.get_connection();
db.execute_unprepared(
r#"
ALTER TABLE "user_profile" ADD COLUMN "injectFeaturedNote" BOOLEAN NOT NULL DEFAULT TRUE;
"#,
)
.await?;
Ok(())
}
}

View File

@ -695,7 +695,6 @@ export type Endpoints = {
preventAiLearning?: boolean; preventAiLearning?: boolean;
isBot?: boolean; isBot?: boolean;
isCat?: boolean; isCat?: boolean;
injectFeaturedNote?: boolean;
receiveAnnouncementEmail?: boolean; receiveAnnouncementEmail?: boolean;
alwaysMarkNsfw?: boolean; alwaysMarkNsfw?: boolean;
mutedWords?: string[][]; mutedWords?: string[][];

View File

@ -96,7 +96,6 @@ export type MeDetailed = UserDetailed & {
hasUnreadNotification: boolean; hasUnreadNotification: boolean;
hasUnreadSpecifiedNotes: boolean; hasUnreadSpecifiedNotes: boolean;
hideOnlineStatus: boolean; hideOnlineStatus: boolean;
injectFeaturedNote: boolean;
isDeleted: boolean; isDeleted: boolean;
isExplorable: boolean; isExplorable: boolean;
mutedWords: string[][]; mutedWords: string[][];

View File

@ -1,13 +1,5 @@
<template> <template>
<div class="_formRoot"> <div class="_formRoot">
<FormSwitch
v-model="$i.injectFeaturedNote"
class="_formBlock"
@update:modelValue="onChangeInjectFeaturedNote"
>
{{ i18n.ts.showFeaturedNotesInTimeline }}
</FormSwitch>
<!-- <!--
<FormSwitch v-model="reportError" class="_formBlock">{{ i18n.ts.sendErrorReports }}<template #caption>{{ i18n.ts.sendErrorReportsDescription }}</template></FormSwitch> <FormSwitch v-model="reportError" class="_formBlock">{{ i18n.ts.sendErrorReports }}<template #caption>{{ i18n.ts.sendErrorReportsDescription }}</template></FormSwitch>
--> -->
@ -29,27 +21,10 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent } from "vue";
import FormSwitch from "@/components/form/switch.vue";
import FormLink from "@/components/form/link.vue"; import FormLink from "@/components/form/link.vue";
import MkButton from "@/components/MkButton.vue";
import * as os from "@/os";
import { popup } from "@/os";
import { defaultStore } from "@/store";
import { $i } from "@/account";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
const reportError = computed(defaultStore.makeGetterSetter("reportError"));
function onChangeInjectFeaturedNote(v) {
os.api("i/update", {
injectFeaturedNote: v,
}).then((i) => {
$i!.injectFeaturedNote = i.injectFeaturedNote;
});
}
const headerActions = $computed(() => []); const headerActions = $computed(() => []);
const headerTabs = $computed(() => []); const headerTabs = $computed(() => []);