feat(users): support avatar, email and bgColor in fe
This commit is contained in:
parent
817ced61de
commit
95e5be092a
12 changed files with 36 additions and 3 deletions
|
@ -20,6 +20,7 @@ export interface BgConfig {
|
||||||
repeat: string;
|
repeat: string;
|
||||||
position: string;
|
position: string;
|
||||||
align: string;
|
align: string;
|
||||||
|
bgColor: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Preferences {
|
export interface Preferences {
|
||||||
|
@ -28,6 +29,8 @@ export interface Preferences {
|
||||||
lanPackURL: string;
|
lanPackURL: string;
|
||||||
lan: string;
|
lan: string;
|
||||||
theme: string;
|
theme: string;
|
||||||
|
avatar: string;
|
||||||
|
email: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface User {
|
export interface User {
|
||||||
|
|
|
@ -17,11 +17,13 @@ export const resps = {
|
||||||
data: {
|
data: {
|
||||||
siteName: "",
|
siteName: "",
|
||||||
siteDesc: "",
|
siteDesc: "",
|
||||||
|
captchaEnabled: true,
|
||||||
bg: {
|
bg: {
|
||||||
url: "clientCfg_bg_url",
|
url: "clientCfg_bg_url",
|
||||||
repeat: "clientCfg_bg_repeat",
|
repeat: "clientCfg_bg_repeat",
|
||||||
position: "clientCfg_bg_position",
|
position: "clientCfg_bg_position",
|
||||||
align: "clientCfg_bg_align",
|
align: "clientCfg_bg_align",
|
||||||
|
bgColor: "clientCfg_bg_bg_Color"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -89,11 +89,14 @@ export const resps = {
|
||||||
repeat: "bgRepeat",
|
repeat: "bgRepeat",
|
||||||
position: "bgPosition",
|
position: "bgPosition",
|
||||||
align: "bgAlign",
|
align: "bgAlign",
|
||||||
|
bgColor: "bgColor",
|
||||||
},
|
},
|
||||||
cssURL: "cssURL",
|
cssURL: "cssURL",
|
||||||
lanPackURL: "lanPackURL",
|
lanPackURL: "lanPackURL",
|
||||||
lan: "en_US",
|
lan: "en_US",
|
||||||
theme: "light",
|
theme: "light",
|
||||||
|
avatar: "avatar",
|
||||||
|
email: "email",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -93,11 +93,14 @@ describe("Login", () => {
|
||||||
repeat: "bgRepeat",
|
repeat: "bgRepeat",
|
||||||
position: "bgPosition",
|
position: "bgPosition",
|
||||||
align: "bgAlign",
|
align: "bgAlign",
|
||||||
|
bgColor: "bgColor",
|
||||||
},
|
},
|
||||||
cssURL: "cssURL",
|
cssURL: "cssURL",
|
||||||
lanPackURL: "lanPackURL",
|
lanPackURL: "lanPackURL",
|
||||||
lan: "en_US",
|
lan: "en_US",
|
||||||
theme: "light",
|
theme: "light",
|
||||||
|
avatar: "avatar",
|
||||||
|
email: "email",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -122,11 +125,13 @@ describe("Login", () => {
|
||||||
isVertical: false,
|
isVertical: false,
|
||||||
siteName: "",
|
siteName: "",
|
||||||
siteDesc: "",
|
siteDesc: "",
|
||||||
|
captchaEnabled: true,
|
||||||
bg: {
|
bg: {
|
||||||
url: "clientCfg_bg_url",
|
url: "clientCfg_bg_url",
|
||||||
repeat: "clientCfg_bg_repeat",
|
repeat: "clientCfg_bg_repeat",
|
||||||
position: "clientCfg_bg_position",
|
position: "clientCfg_bg_position",
|
||||||
align: "clientCfg_bg_align",
|
align: "clientCfg_bg_align",
|
||||||
|
bgColor: "clientCfg_bg_bg_Color",
|
||||||
},
|
},
|
||||||
control: {
|
control: {
|
||||||
controls: Map<string, string>({
|
controls: Map<string, string>({
|
||||||
|
|
|
@ -109,11 +109,14 @@ describe("State Manager", () => {
|
||||||
repeat: "bgRepeat",
|
repeat: "bgRepeat",
|
||||||
position: "bgPosition",
|
position: "bgPosition",
|
||||||
align: "bgAlign",
|
align: "bgAlign",
|
||||||
|
bgColor: "bgColor",
|
||||||
},
|
},
|
||||||
cssURL: "cssURL",
|
cssURL: "cssURL",
|
||||||
lanPackURL: "lanPackURL",
|
lanPackURL: "lanPackURL",
|
||||||
lan: "en_US",
|
lan: "en_US",
|
||||||
theme: "light",
|
theme: "light",
|
||||||
|
avatar: "avatar",
|
||||||
|
email: "email",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -326,11 +329,14 @@ describe("State Manager", () => {
|
||||||
repeat: "",
|
repeat: "",
|
||||||
position: "",
|
position: "",
|
||||||
align: "",
|
align: "",
|
||||||
|
bgColor: "",
|
||||||
},
|
},
|
||||||
cssURL: "",
|
cssURL: "",
|
||||||
lanPackURL: "",
|
lanPackURL: "",
|
||||||
lan: "en_US",
|
lan: "en_US",
|
||||||
theme: "light",
|
theme: "light",
|
||||||
|
avatar: "",
|
||||||
|
email: "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -351,6 +357,7 @@ describe("State Manager", () => {
|
||||||
position: "clientCfg_bg_position",
|
position: "clientCfg_bg_position",
|
||||||
repeat: "clientCfg_bg_repeat",
|
repeat: "clientCfg_bg_repeat",
|
||||||
url: "clientCfg_bg_url",
|
url: "clientCfg_bg_url",
|
||||||
|
bgColor: "clientCfg_bg_bg_Color",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -139,11 +139,14 @@ describe("TopBar", () => {
|
||||||
repeat: "",
|
repeat: "",
|
||||||
position: "",
|
position: "",
|
||||||
align: "",
|
align: "",
|
||||||
|
bgColor: "",
|
||||||
},
|
},
|
||||||
cssURL: "",
|
cssURL: "",
|
||||||
lanPackURL: "",
|
lanPackURL: "",
|
||||||
lan: "en_US",
|
lan: "en_US",
|
||||||
theme: "light",
|
theme: "light",
|
||||||
|
avatar: "",
|
||||||
|
email: "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ export interface UIProps {
|
||||||
repeat: string;
|
repeat: string;
|
||||||
position: string;
|
position: string;
|
||||||
align: string;
|
align: string;
|
||||||
|
bgColor: string;
|
||||||
};
|
};
|
||||||
control: {
|
control: {
|
||||||
controls: Map<string, string>;
|
controls: Map<string, string>;
|
||||||
|
@ -103,11 +104,14 @@ export function initState(): ICoreState {
|
||||||
repeat: "",
|
repeat: "",
|
||||||
position: "",
|
position: "",
|
||||||
align: "",
|
align: "",
|
||||||
|
bgColor: "",
|
||||||
},
|
},
|
||||||
cssURL: "",
|
cssURL: "",
|
||||||
lanPackURL: "",
|
lanPackURL: "",
|
||||||
lan: "en_US",
|
lan: "en_US",
|
||||||
theme: "light",
|
theme: "light",
|
||||||
|
avatar: "",
|
||||||
|
email: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
msg: {
|
msg: {
|
||||||
|
@ -123,6 +127,7 @@ export function initState(): ICoreState {
|
||||||
repeat: "",
|
repeat: "",
|
||||||
position: "",
|
position: "",
|
||||||
align: "",
|
align: "",
|
||||||
|
bgColor: "",
|
||||||
},
|
},
|
||||||
captchaEnabled: true,
|
captchaEnabled: true,
|
||||||
control: {
|
control: {
|
||||||
|
|
|
@ -830,6 +830,7 @@ export class BgCfg extends React.Component<BgProps, BgState, {}> {
|
||||||
repeat: "repeat",
|
repeat: "repeat",
|
||||||
position: "center",
|
position: "center",
|
||||||
align: "fixed",
|
align: "fixed",
|
||||||
|
bgColor: "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.props.update(updater().updateUI);
|
this.props.update(updater().updateUI);
|
||||||
|
|
|
@ -618,11 +618,14 @@ export class Updater {
|
||||||
repeat: "",
|
repeat: "",
|
||||||
position: "",
|
position: "",
|
||||||
align: "",
|
align: "",
|
||||||
|
bgColor: "",
|
||||||
},
|
},
|
||||||
cssURL: "",
|
cssURL: "",
|
||||||
lanPackURL: "",
|
lanPackURL: "",
|
||||||
lan: "en_US",
|
lan: "en_US",
|
||||||
theme: "light",
|
theme: "light",
|
||||||
|
avatar: "",
|
||||||
|
email: "",
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -80,9 +80,6 @@ func NewFileInfoStore(store kvstore.IKVStore) (*FileInfoStore, error) {
|
||||||
boltdb: boltdb,
|
boltdb: boltdb,
|
||||||
mtx: &sync.RWMutex{},
|
mtx: &sync.RWMutex{},
|
||||||
}
|
}
|
||||||
if err = migrate(fi); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return fi, nil
|
return fi, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -457,6 +457,8 @@ func TestUsersHandlers(t *testing.T) {
|
||||||
},
|
},
|
||||||
CSSURL: "/cssurl",
|
CSSURL: "/cssurl",
|
||||||
LanPackURL: "/lanpack",
|
LanPackURL: "/lanpack",
|
||||||
|
Avatar: "a1",
|
||||||
|
Email: "email1",
|
||||||
},
|
},
|
||||||
&db.Preferences{
|
&db.Preferences{
|
||||||
Bg: &sitestore.BgConfig{
|
Bg: &sitestore.BgConfig{
|
||||||
|
@ -468,6 +470,8 @@ func TestUsersHandlers(t *testing.T) {
|
||||||
},
|
},
|
||||||
CSSURL: "/cssurl2",
|
CSSURL: "/cssurl2",
|
||||||
LanPackURL: "/lanpack2",
|
LanPackURL: "/lanpack2",
|
||||||
|
Avatar: "a2",
|
||||||
|
Email: "email2",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, prefer := range prefers {
|
for _, prefer := range prefers {
|
||||||
|
|
BIN
src/server/testdata/test_quickshare.db
vendored
BIN
src/server/testdata/test_quickshare.db
vendored
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue