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;
|
||||
position: string;
|
||||
align: string;
|
||||
bgColor: string;
|
||||
}
|
||||
|
||||
export interface Preferences {
|
||||
|
@ -28,6 +29,8 @@ export interface Preferences {
|
|||
lanPackURL: string;
|
||||
lan: string;
|
||||
theme: string;
|
||||
avatar: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
|
|
|
@ -17,11 +17,13 @@ export const resps = {
|
|||
data: {
|
||||
siteName: "",
|
||||
siteDesc: "",
|
||||
captchaEnabled: true,
|
||||
bg: {
|
||||
url: "clientCfg_bg_url",
|
||||
repeat: "clientCfg_bg_repeat",
|
||||
position: "clientCfg_bg_position",
|
||||
align: "clientCfg_bg_align",
|
||||
bgColor: "clientCfg_bg_bg_Color"
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -89,11 +89,14 @@ export const resps = {
|
|||
repeat: "bgRepeat",
|
||||
position: "bgPosition",
|
||||
align: "bgAlign",
|
||||
bgColor: "bgColor",
|
||||
},
|
||||
cssURL: "cssURL",
|
||||
lanPackURL: "lanPackURL",
|
||||
lan: "en_US",
|
||||
theme: "light",
|
||||
avatar: "avatar",
|
||||
email: "email",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -93,11 +93,14 @@ describe("Login", () => {
|
|||
repeat: "bgRepeat",
|
||||
position: "bgPosition",
|
||||
align: "bgAlign",
|
||||
bgColor: "bgColor",
|
||||
},
|
||||
cssURL: "cssURL",
|
||||
lanPackURL: "lanPackURL",
|
||||
lan: "en_US",
|
||||
theme: "light",
|
||||
avatar: "avatar",
|
||||
email: "email",
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -122,11 +125,13 @@ describe("Login", () => {
|
|||
isVertical: false,
|
||||
siteName: "",
|
||||
siteDesc: "",
|
||||
captchaEnabled: true,
|
||||
bg: {
|
||||
url: "clientCfg_bg_url",
|
||||
repeat: "clientCfg_bg_repeat",
|
||||
position: "clientCfg_bg_position",
|
||||
align: "clientCfg_bg_align",
|
||||
bgColor: "clientCfg_bg_bg_Color",
|
||||
},
|
||||
control: {
|
||||
controls: Map<string, string>({
|
||||
|
|
|
@ -109,11 +109,14 @@ describe("State Manager", () => {
|
|||
repeat: "bgRepeat",
|
||||
position: "bgPosition",
|
||||
align: "bgAlign",
|
||||
bgColor: "bgColor",
|
||||
},
|
||||
cssURL: "cssURL",
|
||||
lanPackURL: "lanPackURL",
|
||||
lan: "en_US",
|
||||
theme: "light",
|
||||
avatar: "avatar",
|
||||
email: "email",
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -326,11 +329,14 @@ describe("State Manager", () => {
|
|||
repeat: "",
|
||||
position: "",
|
||||
align: "",
|
||||
bgColor: "",
|
||||
},
|
||||
cssURL: "",
|
||||
lanPackURL: "",
|
||||
lan: "en_US",
|
||||
theme: "light",
|
||||
avatar: "",
|
||||
email: "",
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -351,6 +357,7 @@ describe("State Manager", () => {
|
|||
position: "clientCfg_bg_position",
|
||||
repeat: "clientCfg_bg_repeat",
|
||||
url: "clientCfg_bg_url",
|
||||
bgColor: "clientCfg_bg_bg_Color",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -139,11 +139,14 @@ describe("TopBar", () => {
|
|||
repeat: "",
|
||||
position: "",
|
||||
align: "",
|
||||
bgColor: "",
|
||||
},
|
||||
cssURL: "",
|
||||
lanPackURL: "",
|
||||
lan: "en_US",
|
||||
theme: "light",
|
||||
avatar: "",
|
||||
email: "",
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ export interface UIProps {
|
|||
repeat: string;
|
||||
position: string;
|
||||
align: string;
|
||||
bgColor: string;
|
||||
};
|
||||
control: {
|
||||
controls: Map<string, string>;
|
||||
|
@ -103,11 +104,14 @@ export function initState(): ICoreState {
|
|||
repeat: "",
|
||||
position: "",
|
||||
align: "",
|
||||
bgColor: "",
|
||||
},
|
||||
cssURL: "",
|
||||
lanPackURL: "",
|
||||
lan: "en_US",
|
||||
theme: "light",
|
||||
avatar: "",
|
||||
email: "",
|
||||
},
|
||||
},
|
||||
msg: {
|
||||
|
@ -123,6 +127,7 @@ export function initState(): ICoreState {
|
|||
repeat: "",
|
||||
position: "",
|
||||
align: "",
|
||||
bgColor: "",
|
||||
},
|
||||
captchaEnabled: true,
|
||||
control: {
|
||||
|
|
|
@ -830,6 +830,7 @@ export class BgCfg extends React.Component<BgProps, BgState, {}> {
|
|||
repeat: "repeat",
|
||||
position: "center",
|
||||
align: "fixed",
|
||||
bgColor: "",
|
||||
},
|
||||
});
|
||||
this.props.update(updater().updateUI);
|
||||
|
|
|
@ -618,11 +618,14 @@ export class Updater {
|
|||
repeat: "",
|
||||
position: "",
|
||||
align: "",
|
||||
bgColor: "",
|
||||
},
|
||||
cssURL: "",
|
||||
lanPackURL: "",
|
||||
lan: "en_US",
|
||||
theme: "light",
|
||||
avatar: "",
|
||||
email: "",
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -80,9 +80,6 @@ func NewFileInfoStore(store kvstore.IKVStore) (*FileInfoStore, error) {
|
|||
boltdb: boltdb,
|
||||
mtx: &sync.RWMutex{},
|
||||
}
|
||||
if err = migrate(fi); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return fi, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -457,6 +457,8 @@ func TestUsersHandlers(t *testing.T) {
|
|||
},
|
||||
CSSURL: "/cssurl",
|
||||
LanPackURL: "/lanpack",
|
||||
Avatar: "a1",
|
||||
Email: "email1",
|
||||
},
|
||||
&db.Preferences{
|
||||
Bg: &sitestore.BgConfig{
|
||||
|
@ -468,6 +470,8 @@ func TestUsersHandlers(t *testing.T) {
|
|||
},
|
||||
CSSURL: "/cssurl2",
|
||||
LanPackURL: "/lanpack2",
|
||||
Avatar: "a2",
|
||||
Email: "email2",
|
||||
},
|
||||
}
|
||||
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