diff --git a/migration/1663226831484-expandTemplateLength.ts b/migration/1663226831484-expandTemplateLength.ts new file mode 100644 index 0000000..b36acd8 --- /dev/null +++ b/migration/1663226831484-expandTemplateLength.ts @@ -0,0 +1,13 @@ +import {MigrationInterface, QueryRunner} from 'typeorm'; + +export class expandTemplateLength1663226831484 implements MigrationInterface { + name = 'expandTemplateLength1663226831484' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "template" TYPE character varying(1024)'); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query('ALTER TABLE "user" ALTER COLUMN "template" TYPE character varying(280)'); + } +} diff --git a/src/backend/models/entities/user.ts b/src/backend/models/entities/user.ts index cba5eeb..ad08e85 100644 --- a/src/backend/models/entities/user.ts +++ b/src/backend/models/entities/user.ts @@ -76,7 +76,7 @@ export class User implements IUser { @Column({ type: 'varchar', - length: 280, + length: 1024, nullable: true, }) public template: string | null; diff --git a/src/frontend/pages/apps/misshai.scss b/src/frontend/pages/apps/misshai.scss index 4ad80dc..4048f11 100644 --- a/src/frontend/pages/apps/misshai.scss +++ b/src/frontend/pages/apps/misshai.scss @@ -14,4 +14,13 @@ > .templateSetting { flex: 5 0 300px; } +} + +.textarea-wrapper { + position: relative; + > .textarea-remaining { + position: absolute; + right: 16px; + bottom: 16px; + } } \ No newline at end of file diff --git a/src/frontend/pages/apps/misshai.tsx b/src/frontend/pages/apps/misshai.tsx index 1b009bd..ac3aec4 100644 --- a/src/frontend/pages/apps/misshai.tsx +++ b/src/frontend/pages/apps/misshai.tsx @@ -187,6 +187,8 @@ export const MisshaiPage: React.VFC = () => { const defaultTemplate = t('_template.default'); + const remaining = 1024 - (draft.template ?? defaultTemplate).length; + return session.isLoading || score.isLoading || !session.data || !score.data ? (
@@ -233,72 +235,83 @@ export const MisshaiPage: React.VFC = () => {

{t('settings')}

- -

{t('alertMode')}

-
- { alertModes.map((mode) => ( -