Introduce group basic federation, event new page and notifications

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-02-18 08:57:00 +01:00
parent 300ef8f245
commit 4144e9ffd0
416 changed files with 32220 additions and 16750 deletions

View File

@@ -1,10 +1,10 @@
import { Component, Mixins, Vue } from 'vue-property-decorator';
import { Person } from '@/types/actor';
import { Component, Mixins, Vue } from "vue-property-decorator";
import { Person } from "@/types/actor";
@Component({})
export default class IdentityEditionMixin extends Mixins(Vue) {
identity: Person = new Person();
oldDisplayName: string | null = null;
autoUpdateUsername(newDisplayName: string | null) {
@@ -18,18 +18,21 @@ export default class IdentityEditionMixin extends Mixins(Vue) {
}
private static convertToUsername(value: string | null) {
if (!value) return '';
if (!value) return "";
// https://stackoverflow.com/a/37511463
return value.toLocaleLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.replace(/ /g, '_')
.replace(/[^a-z0-9_]/g, '')
;
// https://stackoverflow.com/a/37511463
return value
.toLocaleLowerCase()
.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "")
.replace(/ /g, "_")
.replace(/[^a-z0-9_]/g, "");
}
validateUsername() {
return this.identity.preferredUsername === IdentityEditionMixin.convertToUsername(this.identity.preferredUsername);
return (
this.identity.preferredUsername ===
IdentityEditionMixin.convertToUsername(this.identity.preferredUsername)
);
}
}