Skip to content

Commit 7d0804c

Browse files
committed
Merge remote-tracking branch 'origin/bootstrap5'
# Conflicts: # Signum.Engine.Extensions/Migrations/MigrationLogic.cs # Signum.Entities.Extensions/Mailing/ImageAttachmentEntity.cs # Signum.React.Extensions/TypeHelp/TypeHelpComponent.tsx # Signum.Upgrade/CodeFile.cs # Signum.Upgrade/UpgradeContext.cs
2 parents 9e4dce9 + 002bcc9 commit 7d0804c

130 files changed

Lines changed: 1183 additions & 1018 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Signum.Engine.Extensions/Migrations/MigrationLogic.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public static void Start(SchemaBuilder sb)
4949
if (count > 0)
5050
{
5151
Console.Write("The database ");
52-
SafeConsole.WriteLineColor(ConsoleColor.White, Connector.Current.DatabaseName());
52+
SafeConsole.WriteColor(ConsoleColor.Yellow, Connector.Current.DatabaseName());
5353
Console.Write(" contains ");
54-
SafeConsole.WriteLineColor(ConsoleColor.White, count.ToString());
55-
Console.Write(" Sql Migrations!");
54+
SafeConsole.WriteColor(ConsoleColor.Yellow, count.ToString());
55+
Console.WriteLine(" Sql Migrations!");
5656

5757
if (SafeConsole.Ask("Do you want to create a new SQL Migration instead?"))
5858
{
@@ -107,7 +107,7 @@ public static void EnsureMigrationTable<T>() where T : Entity
107107
}
108108

109109
SafeConsole.WriteLineColor(ConsoleColor.White, "Table " + table.Name + " auto-generated...");
110-
110+
111111
tr.Commit();
112112
}
113113
}
@@ -138,7 +138,7 @@ public static void EnsureMigrationTable<T>() where T : Entity
138138
return null;
139139
}
140140
catch (Exception e)
141-
{
141+
{
142142
Console.WriteLine();
143143

144144
SafeConsole.WriteColor(ConsoleColor.Red, e.GetType() + ": ");

Signum.Entities.Extensions/Mailing/ImageAttachmentEntity.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public string? FileName
2525

2626
public EmailAttachmentType Type { get; set; }
2727

28-
28+
2929
public FileEmbedded File { get; set; }
3030

3131
[AutoExpressionField]
32-
public override string ToString() => As.Expression(() => FileName ?? File.FileName);
32+
public override string ToString() => As.Expression(() => FileName ?? (File == null ? "" : File.FileName));
3333
}

Signum.React.Extensions/Alerts/AlertDropdown.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function AlertDropdownImp(props: { checkForChangesEvery: number, keepRingingFor:
146146
<>
147147
<div className="nav-link sf-bell-container" onClick={handleOnToggle}>
148148
<FontAwesomeIcon icon="bell" className={classes("sf-bell", ringing && "ringing", isOpen && "open", countResult && countResult.numAlerts > 0 && "active")} />
149-
{countResult && countResult.numAlerts > 0 && <span className="badge badge-danger badge-pill sf-alerts-badge">{countResult.numAlerts}</span>}
149+
{countResult && countResult.numAlerts > 0 && <span className="badge btn-danger badge-pill sf-alerts-badge">{countResult.numAlerts}</span>}
150150
</div>
151151
{isOpen && <div className="sf-alerts-toasts">
152152
{alertsGroups == null ? <Toast> <Toast.Body>{JavascriptMessage.loading.niceToString()}</Toast.Body></Toast> :
@@ -164,7 +164,7 @@ function AlertDropdownImp(props: { checkForChangesEvery: number, keepRingingFor:
164164
<Toast onClose={() => handleOnCloseAlerts(alerts!.map(a=>a))}>
165165
<Toast.Header>
166166
<strong >{AlertMessage._0SimilarAlerts.niceToString(alertsGroups.filter((a, i) => i >= showAlerts).sum(gr => gr.elements.length))}</strong>
167-
<a href="#" className="mr-auto ml-auto" onClick={e => { e.preventDefault(); setShowAlert(a => a + 3); }}><small>{AlertMessage.ViewMore.niceToString()}</small></a>
167+
<a href="#" className="me-auto ms-auto" onClick={e => { e.preventDefault(); setShowAlert(a => a + 3); }}><small>{AlertMessage.ViewMore.niceToString()}</small></a>
168168
<small>{AlertMessage.CloseAll.niceToString()}</small>
169169
</Toast.Header>
170170
</Toast>
@@ -213,8 +213,8 @@ export function AlertToast(p: { alert: AlertEntity, onClose: (e: AlertEntity[])
213213
return (
214214
<Toast onClose={() => p.onClose([p.alert])} className={p.className}>
215215
<Toast.Header>
216-
{icon && <span className="mr-2">{icon}</span>}
217-
<strong className="mr-auto">{AlertsClient.getTitle(p.alert.titleField, p.alert.alertType)}</strong>
216+
{icon && <span className="me-2">{icon}</span>}
217+
<strong className="me-auto">{AlertsClient.getTitle(p.alert.titleField, p.alert.alertType)}</strong>
218218
<small>{DateTime.fromISO(p.alert.alertDate!).toRelative()}</small>
219219
</Toast.Header>
220220
<Toast.Body style={{ whiteSpace: "pre-wrap" }}>
@@ -242,9 +242,9 @@ export function AlertGroupToast(p: { alerts: Array<AlertEntity>, onClose: (e: Al
242242
p.alerts.length > showAlerts &&
243243
<Toast className="mt-0" onClose={() => p.onClose(p.alerts)}>
244244
<Toast.Header>
245-
{icon && <span className="mr-2">{icon}</span>}
245+
{icon && <span className="me-2">{icon}</span>}
246246
<strong >{AlertMessage._0SimilarAlerts.niceToString(p.alerts.length - showAlerts)}</strong>
247-
<a href="#" className="mr-auto ml-auto" onClick={e => { e.preventDefault(); setShowAlert(a => a + 3); }}><small>{AlertMessage.ViewMore.niceToString()}</small></a>
247+
<a href="#" className="me-auto ms-auto" onClick={e => { e.preventDefault(); setShowAlert(a => a + 3); }}><small>{AlertMessage.ViewMore.niceToString()}</small></a>
248248
<small>{AlertMessage.CloseAll.niceToString()}</small>
249249
</Toast.Header>
250250
</Toast>

Signum.React.Extensions/Alerts/AlertsClient.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ export function start(options: { routes: JSX.Element[], showAlerts?: (typeName:
5252
}));
5353

5454
Operations.addSettings(new EntityOperationSettings(AlertOperation.Delay, {
55-
onClick: (eoc) => chooseDate().then(d => d && eoc.defaultClick(d.toISO())).done(),
55+
onClick: (eoc) => chooseDate().then(d => d && eoc.defaultClick(d.toISO())),
5656
hideOnCanExecute: true,
57-
contextual: { onClick: (coc) => chooseDate().then(d => d && coc.defaultContextualClick(d.toISO())).done() },
58-
contextualFromMany: { onClick: (coc) => chooseDate().then(d => d && coc.defaultContextualClick(d.toISO())).done() },
57+
contextual: { onClick: (coc) => chooseDate().then(d => d && coc.defaultContextualClick(d.toISO())) },
58+
contextualFromMany: { onClick: (coc) => chooseDate().then(d => d && coc.defaultContextualClick(d.toISO())) },
5959
}));
6060

6161
var cellFormatter = new Finder.CellFormatter((cell, ctx) => {

Signum.React.Extensions/Authorization/ActiveDirectoryClient.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function start(options: { routes: JSX.Element[] }) {
3131
return (
3232
{
3333
order: -1,
34-
button: <button className="btn btn-info ml-2"
34+
button: <button className="btn btn-info ms-2"
3535
onClick={e => {
3636
e.preventDefault();
3737
var promise = ValueLineModal.show({

Signum.React.Extensions/Authorization/Login/LoginDropdown.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ export default function LoginDropdown(p: {
4141
var extraButtons = p.extraButons && p.extraButons(user);
4242

4343
return (
44-
<NavDropdown className="sf-login-dropdown" id="sfLoginDropdown" title={p.renderName ? p.renderName(user) : user.userName!} alignRight >
45-
{pv && <NavDropdown.Item id="sf-auth-profile" onClick={handleProfileClick}><FontAwesomeIcon icon="user-edit" fixedWidth className="mr-2" /> {LoginAuthMessage.MyProfile.niceToString()}</NavDropdown.Item>}
44+
<NavDropdown className="sf-login-dropdown" id="sfLoginDropdown" title={p.renderName ? p.renderName(user) : user.userName!} align="end">
45+
{pv && <NavDropdown.Item id="sf-auth-profile" onClick={handleProfileClick}><FontAwesomeIcon icon="user-edit" fixedWidth className="me-2" /> {LoginAuthMessage.MyProfile.niceToString()}</NavDropdown.Item>}
4646
{cpv && <LinkContainer to="~/auth/changePassword">
47-
<NavDropdown.Item><FontAwesomeIcon icon="key" fixedWidth className="mr-2" /> {LoginAuthMessage.ChangePassword.niceToString()}</NavDropdown.Item>
47+
<NavDropdown.Item><FontAwesomeIcon icon="key" fixedWidth className="me-2" /> {LoginAuthMessage.ChangePassword.niceToString()}</NavDropdown.Item>
4848
</LinkContainer>}
4949
{extraButtons}
5050
{(cpv || pv || extraButtons) && <NavDropdown.Divider />}
51-
{suv && <LinkContainer to="~/auth/login"><NavDropdown.Item><FontAwesomeIcon icon="user-friends" className="mr-2" /> {LoginAuthMessage.SwitchUser.niceToString()}</NavDropdown.Item></LinkContainer>}
52-
<NavDropdown.Item id="sf-auth-logout" onClick={() => AuthClient.logout()}><FontAwesomeIcon icon="sign-out-alt" fixedWidth className="mr-2"/> {LoginAuthMessage.Logout.niceToString()}</NavDropdown.Item>
51+
{suv && <LinkContainer to="~/auth/login"><NavDropdown.Item><FontAwesomeIcon icon="user-friends" className="me-2" /> {LoginAuthMessage.SwitchUser.niceToString()}</NavDropdown.Item></LinkContainer>}
52+
<NavDropdown.Item id="sf-auth-logout" onClick={() => AuthClient.logout()}><FontAwesomeIcon icon="sign-out-alt" fixedWidth className="me-2"/> {LoginAuthMessage.Logout.niceToString()}</NavDropdown.Item>
5353
</NavDropdown>
5454
);
5555
}

Signum.React.Extensions/Authorization/Login/LoginPage.tsx

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ export default function LoginPage() {
3838
{showLoginForm && <LoginForm ctx={ctx} />}
3939
{LoginPage.customLoginButtons && LoginPage.customLoginButtons(ctx)}
4040
{LoginPage.showLoginForm == "initially_not" && showLoginForm == false &&
41-
<div className="col-md-6 offset-md-3 mt-2">
42-
<a href="#" onClick={e => {
43-
e.preventDefault();
44-
setShowLoginForm(true);
45-
}}>
46-
{LoginAuthMessage.ShowLoginForm.niceToString()}
47-
</a>
41+
<div className="row">
42+
<div className="col-md-6 offset-md-3 mt-2">
43+
<a href="#" className="ms-1" onClick={e => {
44+
e.preventDefault();
45+
setShowLoginForm(true);
46+
}}>
47+
{LoginAuthMessage.ShowLoginForm.niceToString()}
48+
</a>
49+
</div>
4850
</div>
4951
}
5052
</div>
@@ -110,12 +112,10 @@ export function LoginForm(p: { ctx: LoginContext }) {
110112
</div>
111113
<div className="row">
112114
<div className="col-md-6 offset-md-3">
113-
<div className={classes("form-group", error("userName") && "has-error")}>
115+
<div className={classes("form-group mb-3", error("userName") && "has-error")}>
114116
<label className="sr-only" htmlFor="userName">{LoginAuthMessage.Username.niceToString()}</label>
115117
<div className="input-group mb-2 mr-sm-2 mb-sm-0">
116-
<div className="input-group-prepend">
117-
<div className="input-group-text"><FontAwesomeIcon icon="user" style={{ width: "16px" }} /></div>
118-
</div>
118+
<div className="input-group-text"><FontAwesomeIcon icon="user" style={{ width: "16px" }} /></div>
119119
<input type="text" className="form-control" id="userName" ref={userName} placeholder={LoginAuthMessage.Username.niceToString()} disabled={p.ctx.loading != null} />
120120
</div>
121121
{error("userName") && <span className="help-block text-danger">{error("userName")}</span>}
@@ -124,12 +124,10 @@ export function LoginForm(p: { ctx: LoginContext }) {
124124
</div>
125125
<div className="row">
126126
<div className="col-md-6 offset-md-3">
127-
<div className={classes("form-group", error("password") && "has-error")}>
127+
<div className={classes("form-group mb-3", error("password") && "has-error")}>
128128
<label className="sr-only" htmlFor="password">{LoginAuthMessage.Password.niceToString()}</label>
129129
<div className="input-group mb-2 mr-sm-2 mb-sm-0">
130-
<div className="input-group-prepend">
131-
<div className="input-group-text"><FontAwesomeIcon icon="key" style={{ width: "16px" }} /></div>
132-
</div>
130+
<div className="input-group-text"><FontAwesomeIcon icon="key" style={{ width: "16px" }} /></div>
133131
<input ref={password} type="password" name="password" className="form-control" id="password" placeholder={LoginAuthMessage.Password.niceToString()} disabled={p.ctx.loading != null} />
134132
</div>
135133
{error("password") && <span className="help-block text-danger">{error("password")}</span>}
@@ -138,11 +136,10 @@ export function LoginForm(p: { ctx: LoginContext }) {
138136
</div>
139137
{AuthClient.Options.userTicket &&
140138
<div className="row">
141-
<div className="col-md-6 offset-md-3" style={{ paddingTop: ".35rem" }}>
139+
<div className="col-md-6 offset-md-3">
142140
<div className="form-check mb-2 mr-sm-2 mb-sm-0">
143-
<label className="sf-remember-me">
144-
<input ref={rememberMe} name="remember" type="checkbox" disabled={p.ctx.loading != null} /> {LoginAuthMessage.RememberMe.niceToString()}
145-
</label>
141+
<input ref={rememberMe} name="remember" id="rememberMe" className="form-check-input" type="checkbox" disabled={p.ctx.loading != null} />
142+
<label className="sf-remember-me form-check-label" htmlFor="rememberMe" >{LoginAuthMessage.RememberMe.niceToString()}</label>
146143
</div>
147144
</div>
148145
</div>
@@ -153,15 +150,15 @@ export function LoginForm(p: { ctx: LoginContext }) {
153150
<button type="submit" id="login" className="btn btn-success" disabled={p.ctx.loading != null}>
154151
{p.ctx.loading == "password" ?
155152
<FontAwesomeIcon icon="cog" fixedWidth style={{ fontSize: "larger" }} spin /> : < FontAwesomeIcon icon="sign-in-alt" />}
156-
&nbsp;
153+
&nbsp;
157154
{p.ctx.loading == "password" ? JavascriptMessage.loading.niceToString() : AuthClient.currentUser() ? LoginAuthMessage.SwitchUser.niceToString() : LoginAuthMessage.Login.niceToString()}
158155
</button>
159156
{error("login") && <span className="help-block text-danger" style={{ color: "red" }}>{error("login")}</span>}
160157
{AuthClient.Options.resetPassword && !p.ctx.loading &&
161158
<span>
162159
&nbsp;
163160
&nbsp;
164-
<Link to="~/auth/forgotPasswordEmail">{LoginAuthMessage.IHaveForgottenMyPassword.niceToString()}</Link>
161+
<Link to="~/auth/forgotPasswordEmail">{LoginAuthMessage.IHaveForgottenMyPassword.niceToString()}</Link>
165162
</span>
166163
}
167164
</div>

Signum.React.Extensions/Authorization/Templates/DoublePassword.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ export function DoublePassword(p: { ctx: TypeContext<string>, isNew: boolean, ma
4242
return (
4343
<div>
4444
<FormGroup ctx={p.ctx} labelText={LoginAuthMessage.NewPassword.niceToString()}>
45-
<input type="password" ref={newPass} autoComplete="off" className={classes(p.ctx.formControlClass, p.mandatory && !newPass.current?.value ? "sf-mandatory" : null)} onBlur={handlePasswordBlur} />
45+
<input type="password" ref={newPass} autoComplete="off" placeholder={LoginAuthMessage.NewPassword.niceToString()} className={classes(p.ctx.formControlClass, p.mandatory && !newPass.current?.value ? "sf-mandatory" : null)} onBlur={handlePasswordBlur} />
4646
</FormGroup>
4747
<FormGroup ctx={p.ctx} labelText={LoginAuthMessage.ConfirmNewPassword.niceToString()}>
48-
<input type="password" ref={newPass2} autoComplete="off" className={classes(p.ctx.formControlClass, p.mandatory && !newPass2.current?.value ? "sf-mandatory" : null)} onBlur={handlePasswordBlur} />
48+
<input type="password" ref={newPass2} autoComplete="off" placeholder={LoginAuthMessage.ConfirmNewPassword.niceToString()} className={classes(p.ctx.formControlClass, p.mandatory && !newPass2.current?.value ? "sf-mandatory" : null)} onBlur={handlePasswordBlur} />
4949
</FormGroup>
5050
</div>
5151
);

Signum.React.Extensions/Basics/Templates/CollapsableCard.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ function isControlled(p: CollapsableCardProps): [boolean, (isOpen: boolean) => v
5757
export default function CollapsableCard(p: CollapsableCardProps) {
5858

5959
const [isOpen, setIsOpen] = isControlled(p);
60-
const isRTL = React.useMemo(() => document.body.classList.contains("rtl"), []);
6160
return (
6261
<div className={classes("card", cardStyleClasses(p.cardStyle), p.size && ("card-" + p.size))}>
6362
<div className={classes("card-header", cardStyleClasses(p.headerStyle))} style={{ cursor: "pointer" }} onClick={() => setIsOpen(!isOpen)}>
6463
{(p.collapsable == undefined || p.collapsable == true) &&
6564
<span
66-
className={isRTL ? "float-left" : "float-right"}
65+
className={"float-end"}
6766
style={{ cursor: "pointer" }}
6867
onClick={() => setIsOpen(!isOpen)}>
6968
<FontAwesomeIcon icon={isOpen ? "chevron-up" : "chevron-down"} />

Signum.React.Extensions/Basics/Templates/PropertyRouteCombo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function PropertyRouteCombo(p : PropertyRouteComboProps){
3131
var routes = p.routes ?? Dic.getValues(getTypeInfo(p.type.cleanName).members).filter(p.filter!).map(mi => PropertyRoute.parse(p.type.cleanName, mi.name));
3232

3333
return (
34-
<select className={ctx.formControlClass} value={ctx.value?.path ?? ""} onChange={handleChange} >
34+
<select className={ctx.formSelectClass} value={ctx.value?.path ?? ""} onChange={handleChange} >
3535
<option value=""> - </option>
3636
{routes.map(r => r.propertyPath()).map(path =>
3737
<option key={path} value={path}>{path}</option>

0 commit comments

Comments
 (0)