{t("title.signup", "Sing Up")}
diff --git a/components/auth/register/registerUser.tsx b/components/auth/register/registerUser.tsx
index f0868b52..96ef499b 100644
--- a/components/auth/register/registerUser.tsx
+++ b/components/auth/register/registerUser.tsx
@@ -103,6 +103,17 @@ const RegisterUser: React.FC = ({ viewModel }) => {
/>
{errors.telephone}
+
+
+ (viewModel.address = evt.target.value)}
+ disabled={isSubmitting}
+ />
+ {errors.address}
+
{viewModel.submitError.length > 0 && (
{viewModel.submitError}
)}
diff --git a/components/auth/register/viewModel.ts b/components/auth/register/viewModel.ts
index d09badf9..acb4e900 100644
--- a/components/auth/register/viewModel.ts
+++ b/components/auth/register/viewModel.ts
@@ -23,6 +23,7 @@ export class RegisterViewModel {
_lastName: string = "";
_email: string = "";
_telephone: string = "";
+ _address: string = "";
_authorityName: string = "";
fieldErrors: { [key: string]: string } = {};
@@ -57,6 +58,8 @@ export class RegisterViewModel {
email: computed,
_telephone: observable,
telephone: computed,
+ _address: observable,
+ address: computed,
fieldErrors: observable,
submitError: observable,
checkInvitationCode: action,
@@ -162,6 +165,17 @@ export class RegisterViewModel {
}
}
+ public get address(): string {
+ return this._address;
+ }
+ public set address(value: string) {
+ this._address = value;
+ delete this.fieldErrors["address"];
+ if (this.submitError.length > 0) {
+ this.submitError = "";
+ }
+ }
+
public get isValid(): boolean {
return Object.keys(this.fieldErrors).length === 0;
}
@@ -199,7 +213,8 @@ export class RegisterViewModel {
this.firstName,
this.lastName,
this.email,
- this.telephone
+ this.telephone,
+ this.address
);
this.isSubmitting = false;
if (result.success) {
diff --git a/graphql.schema.json b/graphql.schema.json
index eaceade6..f78dab65 100644
--- a/graphql.schema.json
+++ b/graphql.schema.json
@@ -1193,6 +1193,18 @@
"name": "AdminAuthorityUserCreateSuccess",
"description": null,
"fields": [
+ {
+ "name": "address",
+ "description": null,
+ "args": [],
+ "type": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
{
"name": "authority",
"description": null,
@@ -11367,6 +11379,18 @@
"name": "AuthorityUserType",
"description": null,
"fields": [
+ {
+ "name": "address",
+ "description": null,
+ "args": [],
+ "type": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
{
"name": "authority",
"description": null,
@@ -14894,6 +14918,18 @@
"name": "adminAuthorityUserCreate",
"description": null,
"args": [
+ {
+ "name": "address",
+ "description": null,
+ "type": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ },
+ "defaultValue": "null",
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
{
"name": "authorityId",
"description": null,
@@ -15052,6 +15088,18 @@
"name": "adminAuthorityUserUpdate",
"description": null,
"args": [
+ {
+ "name": "address",
+ "description": null,
+ "type": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ },
+ "defaultValue": "null",
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
{
"name": "authorityId",
"description": null,
@@ -18778,6 +18826,18 @@
"name": "adminUserUpdateProfile",
"description": null,
"args": [
+ {
+ "name": "address",
+ "description": null,
+ "type": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ },
+ "defaultValue": "null",
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
{
"name": "firstName",
"description": null,
@@ -18860,6 +18920,18 @@
"name": "authorityUserRegister",
"description": null,
"args": [
+ {
+ "name": "address",
+ "description": null,
+ "type": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ },
+ "defaultValue": "null",
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
{
"name": "email",
"description": null,
@@ -30113,6 +30185,18 @@
"name": "UserProfileType",
"description": null,
"fields": [
+ {
+ "name": "address",
+ "description": null,
+ "args": [],
+ "type": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
{
"name": "authorityId",
"description": null,
diff --git a/i18n/translations.en.json b/i18n/translations.en.json
index 96177975..c1fd372b 100644
--- a/i18n/translations.en.json
+++ b/i18n/translations.en.json
@@ -63,6 +63,7 @@
"lastName": "Last Name",
"email": "Email",
"telephone": "Telephone",
+ "address": "Address",
"inherits": "Inherits",
"area": "Area",
"category": "Category",
@@ -153,6 +154,7 @@
"lastName": "Last Name",
"email": "Email",
"telephone": "Telephone",
+ "address": "Address",
"inherits": "Inherits",
"area": "Area",
"category": "Category",
diff --git a/i18n/translations.la.json b/i18n/translations.la.json
index 90d412d5..1d0fb2f5 100644
--- a/i18n/translations.la.json
+++ b/i18n/translations.la.json
@@ -64,6 +64,7 @@
"lastName": "ນາມສະກຸນ",
"email": "ອີເມວ",
"telephone": "ເບີໂທລະສັບ",
+ "address": "ທີ່ຢູ່",
"inherits": "ສືບທອດ",
"area": "ພື້ນທີ່",
"category": "ກຸ່ມ",
@@ -154,6 +155,7 @@
"lastName": "ນາມສະກຸນ",
"email": "ອີເມວ",
"telephone": "ເບີໂທລະສັບ",
+ "address": "ທີ່ຢູ່",
"inherits": "ສືບທອດ",
"area": "ພື້ນທີ່",
"category": "ກຸ່ມ",
diff --git a/i18n/translations.th.json b/i18n/translations.th.json
index ce6b6fb5..7ea65421 100644
--- a/i18n/translations.th.json
+++ b/i18n/translations.th.json
@@ -61,6 +61,7 @@
"lastName": "นามสกุล",
"email": "อีเมล",
"telephone": "โทรศัพท์",
+ "address": "ที่อยู่",
"inherits": "สืบทอด",
"area": "พื้นที่",
"category": "หมวดหมู่",
@@ -150,6 +151,7 @@
"lastName": "นามสกุล",
"email": "อีเมล",
"telephone": "โทรศัพท์",
+ "address": "ที่อยู่",
"inherits": "สืบทอด",
"area": "พื้นที่",
"category": "หมวดหมู่",
diff --git a/lib/generated/graphql.tsx b/lib/generated/graphql.tsx
index e98a7d87..d4cc0357 100644
--- a/lib/generated/graphql.tsx
+++ b/lib/generated/graphql.tsx
@@ -207,6 +207,7 @@ export type AdminAuthorityUserCreateResult =
export type AdminAuthorityUserCreateSuccess = {
__typename?: "AdminAuthorityUserCreateSuccess";
+ address?: Maybe;
authority: AdminAuthorityCreateSuccess;
avatar?: Maybe;
avatarUrl?: Maybe;
@@ -1496,6 +1497,7 @@ export type AuthorityUserRegisterMutation = {
export type AuthorityUserType = {
__typename?: "AuthorityUserType";
+ address?: Maybe;
authority: AdminAuthorityCreateSuccess;
email: Scalars["String"];
firstName: Scalars["String"];
@@ -1972,6 +1974,7 @@ export type MutationAdminAuthorityUpdateArgs = {
};
export type MutationAdminAuthorityUserCreateArgs = {
+ address?: InputMaybe;
authorityId?: InputMaybe;
email: Scalars["String"];
firstName: Scalars["String"];
@@ -1987,6 +1990,7 @@ export type MutationAdminAuthorityUserDeleteArgs = {
};
export type MutationAdminAuthorityUserUpdateArgs = {
+ address?: InputMaybe;
authorityId?: InputMaybe;
email: Scalars["String"];
firstName: Scalars["String"];
@@ -2345,6 +2349,7 @@ export type MutationAdminUserChangePasswordArgs = {
};
export type MutationAdminUserUpdateProfileArgs = {
+ address?: InputMaybe;
firstName: Scalars["String"];
lastName: Scalars["String"];
telephone?: InputMaybe;
@@ -2355,6 +2360,7 @@ export type MutationAdminUserUploadAvatarArgs = {
};
export type MutationAuthorityUserRegisterArgs = {
+ address?: InputMaybe;
email: Scalars["String"];
firstName: Scalars["String"];
invitationCode: Scalars["String"];
@@ -3632,6 +3638,7 @@ export type UserMessageTypeNodeConnection = {
export type UserProfileType = {
__typename?: "UserProfileType";
+ address?: Maybe;
authorityId?: Maybe;
authorityName?: Maybe;
avatarUrl?: Maybe;
@@ -5722,6 +5729,7 @@ export type MeQuery = {
role?: string | null;
email?: string | null;
telephone?: string | null;
+ address?: string | null;
features?: Array | null;
} | null;
};
@@ -5742,6 +5750,7 @@ export type UserUpdateProfileMutationVariables = Exact<{
firstName: Scalars["String"];
lastName: Scalars["String"];
telephone?: InputMaybe;
+ address?: InputMaybe;
}>;
export type UserUpdateProfileMutation = {
@@ -5801,6 +5810,7 @@ export type UserRegisterMutationVariables = Exact<{
invitationCode: Scalars["String"];
lastName: Scalars["String"];
telephone?: InputMaybe;
+ address?: InputMaybe;
username: Scalars["String"];
}>;
@@ -5824,6 +5834,7 @@ export type UserRegisterMutation = {
isSuperuser?: boolean | null;
email?: string | null;
telephone?: string | null;
+ address?: string | null;
features?: Array | null;
} | null;
} | null;
@@ -7031,6 +7042,7 @@ export type UserCreateMutationVariables = Exact<{
password: Scalars["String"];
telephone?: InputMaybe;
username: Scalars["String"];
+ address?: InputMaybe;
role?: InputMaybe;
}>;
@@ -7065,6 +7077,7 @@ export type UserUpdateMutationVariables = Exact<{
lastName: Scalars["String"];
telephone?: InputMaybe;
username: Scalars["String"];
+ address?: InputMaybe;
role?: InputMaybe;
}>;
@@ -7093,6 +7106,7 @@ export type UserUpdateMutation = {
email: string;
telephone?: string | null;
role?: AccountsAuthorityUserRoleChoices | null;
+ address?: string | null;
authority: {
__typename?: "AdminAuthorityCreateSuccess";
id: string;
@@ -7160,6 +7174,7 @@ export type GetUserQuery = {
lastName: string;
email: string;
telephone?: string | null;
+ address?: string | null;
role?: AccountsAuthorityUserRoleChoices | null;
authority: { __typename?: "AdminAuthorityCreateSuccess"; id: string };
} | null;
@@ -17247,6 +17262,7 @@ export const MeDocument = {
{ kind: "Field", name: { kind: "Name", value: "role" } },
{ kind: "Field", name: { kind: "Name", value: "email" } },
{ kind: "Field", name: { kind: "Name", value: "telephone" } },
+ { kind: "Field", name: { kind: "Name", value: "address" } },
{ kind: "Field", name: { kind: "Name", value: "features" } },
],
},
@@ -17354,6 +17370,14 @@ export const UserUpdateProfileDocument = {
},
type: { kind: "NamedType", name: { kind: "Name", value: "String" } },
},
+ {
+ kind: "VariableDefinition",
+ variable: {
+ kind: "Variable",
+ name: { kind: "Name", value: "address" },
+ },
+ type: { kind: "NamedType", name: { kind: "Name", value: "String" } },
+ },
],
selectionSet: {
kind: "SelectionSet",
@@ -17386,6 +17410,14 @@ export const UserUpdateProfileDocument = {
name: { kind: "Name", value: "telephone" },
},
},
+ {
+ kind: "Argument",
+ name: { kind: "Name", value: "address" },
+ value: {
+ kind: "Variable",
+ name: { kind: "Name", value: "address" },
+ },
+ },
],
selectionSet: {
kind: "SelectionSet",
@@ -17618,6 +17650,15 @@ export const UserRegisterDocument = {
type: { kind: "NamedType", name: { kind: "Name", value: "String" } },
defaultValue: { kind: "NullValue" },
},
+ {
+ kind: "VariableDefinition",
+ variable: {
+ kind: "Variable",
+ name: { kind: "Name", value: "address" },
+ },
+ type: { kind: "NamedType", name: { kind: "Name", value: "String" } },
+ defaultValue: { kind: "NullValue" },
+ },
{
kind: "VariableDefinition",
variable: {
@@ -17680,6 +17721,14 @@ export const UserRegisterDocument = {
name: { kind: "Name", value: "telephone" },
},
},
+ {
+ kind: "Argument",
+ name: { kind: "Name", value: "address" },
+ value: {
+ kind: "Variable",
+ name: { kind: "Name", value: "address" },
+ },
+ },
{
kind: "Argument",
name: { kind: "Name", value: "username" },
@@ -17737,6 +17786,10 @@ export const UserRegisterDocument = {
kind: "Field",
name: { kind: "Name", value: "telephone" },
},
+ {
+ kind: "Field",
+ name: { kind: "Name", value: "address" },
+ },
{
kind: "Field",
name: { kind: "Name", value: "features" },
@@ -23771,6 +23824,15 @@ export const UserCreateDocument = {
},
},
},
+ {
+ kind: "VariableDefinition",
+ variable: {
+ kind: "Variable",
+ name: { kind: "Name", value: "address" },
+ },
+ type: { kind: "NamedType", name: { kind: "Name", value: "String" } },
+ defaultValue: { kind: "NullValue" },
+ },
{
kind: "VariableDefinition",
variable: { kind: "Variable", name: { kind: "Name", value: "role" } },
@@ -23840,6 +23902,14 @@ export const UserCreateDocument = {
name: { kind: "Name", value: "username" },
},
},
+ {
+ kind: "Argument",
+ name: { kind: "Name", value: "address" },
+ value: {
+ kind: "Variable",
+ name: { kind: "Name", value: "address" },
+ },
+ },
{
kind: "Argument",
name: { kind: "Name", value: "role" },
@@ -24024,6 +24094,15 @@ export const UserUpdateDocument = {
},
},
},
+ {
+ kind: "VariableDefinition",
+ variable: {
+ kind: "Variable",
+ name: { kind: "Name", value: "address" },
+ },
+ type: { kind: "NamedType", name: { kind: "Name", value: "String" } },
+ defaultValue: { kind: "NullValue" },
+ },
{
kind: "VariableDefinition",
variable: { kind: "Variable", name: { kind: "Name", value: "role" } },
@@ -24093,6 +24172,14 @@ export const UserUpdateDocument = {
name: { kind: "Name", value: "username" },
},
},
+ {
+ kind: "Argument",
+ name: { kind: "Name", value: "address" },
+ value: {
+ kind: "Variable",
+ name: { kind: "Name", value: "address" },
+ },
+ },
{
kind: "Argument",
name: { kind: "Name", value: "role" },
@@ -24161,6 +24248,10 @@ export const UserUpdateDocument = {
kind: "Field",
name: { kind: "Name", value: "role" },
},
+ {
+ kind: "Field",
+ name: { kind: "Name", value: "address" },
+ },
{
kind: "Field",
name: { kind: "Name", value: "authority" },
@@ -24464,6 +24555,7 @@ export const GetUserDocument = {
{ kind: "Field", name: { kind: "Name", value: "lastName" } },
{ kind: "Field", name: { kind: "Name", value: "email" } },
{ kind: "Field", name: { kind: "Name", value: "telephone" } },
+ { kind: "Field", name: { kind: "Name", value: "address" } },
{ kind: "Field", name: { kind: "Name", value: "role" } },
{
kind: "Field",
diff --git a/lib/services/profile/me.ts b/lib/services/profile/me.ts
index f00af812..78cf5a58 100644
--- a/lib/services/profile/me.ts
+++ b/lib/services/profile/me.ts
@@ -12,6 +12,7 @@ export type Me = {
isSuperUser: boolean;
email: string;
telephone: string;
+ address: string;
features: Array;
};
diff --git a/lib/services/profile/profile.graphql b/lib/services/profile/profile.graphql
index c3fa256d..31073bef 100644
--- a/lib/services/profile/profile.graphql
+++ b/lib/services/profile/profile.graphql
@@ -12,6 +12,7 @@ query me {
role
email
telephone
+ address
features
}
}
@@ -26,11 +27,13 @@ mutation userUpdateProfile(
$firstName: String!
$lastName: String!
$telephone: String
+ $address: String
) {
adminUserUpdateProfile(
firstName: $firstName
lastName: $lastName
telephone: $telephone
+ address: $address
) {
success
}
diff --git a/lib/services/profile/profileService.ts b/lib/services/profile/profileService.ts
index ca047787..73b8432d 100644
--- a/lib/services/profile/profileService.ts
+++ b/lib/services/profile/profileService.ts
@@ -19,7 +19,8 @@ export interface IProfileService extends IService {
updateProfile(
firstName: string,
lastName: string,
- telephone?: string
+ telephone?: string,
+ address?: string
): Promise>;
deleteMyAccount(): Promise>;
@@ -54,6 +55,7 @@ export class ProfileService implements IProfileService {
isSuperUser: me.isSuperuser || false,
email: me.email || "",
telephone: me.telephone || "",
+ address: me.address || "",
features: me.features as Array,
};
} else {
@@ -115,7 +117,8 @@ export class ProfileService implements IProfileService {
async updateProfile(
firstName: string,
lastName: string,
- telephone?: string
+ telephone?: string,
+ address?: string
): Promise> {
const updateResult = await this.client.mutate({
mutation: UserUpdateProfileDocument,
@@ -123,6 +126,7 @@ export class ProfileService implements IProfileService {
firstName,
lastName,
telephone,
+ address,
},
});
diff --git a/lib/services/register/register.graphql b/lib/services/register/register.graphql
index 467f951d..b31b4228 100644
--- a/lib/services/register/register.graphql
+++ b/lib/services/register/register.graphql
@@ -15,6 +15,7 @@ mutation UserRegister(
$invitationCode: String!
$lastName: String!
$telephone: String = null
+ $address: String = null
$username: String!
) {
authorityUserRegister(
@@ -23,6 +24,7 @@ mutation UserRegister(
invitationCode: $invitationCode
lastName: $lastName
telephone: $telephone
+ address: $address
username: $username
) {
me {
@@ -38,6 +40,7 @@ mutation UserRegister(
isSuperuser
email
telephone
+ address
features
}
refreshToken
diff --git a/lib/services/register/registerService.ts b/lib/services/register/registerService.ts
index 46ffd678..8497c543 100644
--- a/lib/services/register/registerService.ts
+++ b/lib/services/register/registerService.ts
@@ -14,7 +14,8 @@ export interface IRegisterService extends IService {
firstName?: string,
lastName?: string,
email?: string,
- phone?: string
+ phone?: string,
+ address?: string
): Promise;
}
@@ -56,7 +57,8 @@ export class RegisterService implements IRegisterService {
firstName: string,
lastName: string,
email: string,
- telephone?: string
+ telephone?: string,
+ address?: string
): Promise {
const registerResult = await this.client.mutate({
mutation: UserRegisterDocument,
@@ -67,6 +69,7 @@ export class RegisterService implements IRegisterService {
lastName: lastName,
email: email,
telephone: telephone,
+ address: address,
},
fetchPolicy: "network-only",
});
@@ -96,6 +99,7 @@ export class RegisterService implements IRegisterService {
isSuperUser: me.isSuperuser || false,
email: me.email || "",
telephone: me.telephone || "",
+ address: me.address || "",
features: me.features as Array,
},
tokenAuth: {
diff --git a/lib/services/user/user.graphql b/lib/services/user/user.graphql
index 47084cc0..150d22e1 100644
--- a/lib/services/user/user.graphql
+++ b/lib/services/user/user.graphql
@@ -43,6 +43,7 @@ mutation UserCreate(
$password: String!
$telephone: String = null
$username: String!
+ $address: String = null
$role: String
) {
adminAuthorityUserCreate(
@@ -53,6 +54,7 @@ mutation UserCreate(
password: $password
telephone: $telephone
username: $username
+ address: $address
role: $role
) {
result {
@@ -80,6 +82,7 @@ mutation UserUpdate(
$lastName: String!
$telephone: String = null
$username: String!
+ $address: String = null
$role: String
) {
adminAuthorityUserUpdate(
@@ -90,6 +93,7 @@ mutation UserUpdate(
lastName: $lastName
telephone: $telephone
username: $username
+ address: $address
role: $role
) {
result {
@@ -103,6 +107,7 @@ mutation UserUpdate(
email
telephone
role
+ address
authority {
id
}
@@ -154,6 +159,7 @@ query GetUser($id: ID!) {
lastName
email
telephone
+ address
role
authority {
id
diff --git a/lib/services/user/user.ts b/lib/services/user/user.ts
index 694fabb3..d6e21261 100644
--- a/lib/services/user/user.ts
+++ b/lib/services/user/user.ts
@@ -5,6 +5,7 @@ export type User = {
lastName: string;
email: string;
telephone?: string;
+ address?: string;
avatarUrl?: string;
role?: string | null;
authorityId?: number;
diff --git a/lib/services/user/userService.ts b/lib/services/user/userService.ts
index 50e13b28..9a22604e 100644
--- a/lib/services/user/userService.ts
+++ b/lib/services/user/userService.ts
@@ -43,6 +43,7 @@ export interface IUserService extends IService {
lastName: string,
email: string,
telephone: string,
+ address: string,
role: string
): Promise>;
@@ -54,6 +55,7 @@ export interface IUserService extends IService {
lastName: string,
email: string,
telephone: string,
+ address: string,
role: string
): Promise>;
@@ -150,6 +152,7 @@ export class UserService implements IUserService {
lastName: user.lastName,
email: user.email,
telephone: user.telephone || "",
+ address: user.address || "",
role: user.role,
authorityId: parseInt(user.authority.id),
};
@@ -167,6 +170,7 @@ export class UserService implements IUserService {
lastName: string,
email: string,
telephone: string,
+ address: string,
role: string
): Promise> {
const createResult = await this.client.mutate({
@@ -179,6 +183,7 @@ export class UserService implements IUserService {
lastName,
email,
telephone,
+ address,
role,
},
refetchQueries: [
@@ -231,6 +236,7 @@ export class UserService implements IUserService {
lastName: string,
email: string,
telephone: string,
+ address: string,
role: string
): Promise> {
const updateResult = await this.client.mutate({
@@ -243,6 +249,7 @@ export class UserService implements IUserService {
lastName,
email,
telephone,
+ address,
role,
},
refetchQueries: [