Skip to content

Commit 8ee55ca

Browse files
committed
Merge branch 'TS34'
2 parents 93fdb27 + 9cfb521 commit 8ee55ca

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

Signum.React/Scripts/Operations/ContextualOperations.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from '../Operations'
1313
import { DropdownItem } from "../Components/DropdownItem";
1414
import { UncontrolledTooltip } from "../Components/Tooltip";
15+
import { IconProp } from "@fortawesome/fontawesome-svg-core";
1516

1617
export function getConstructFromManyContextualItems(ctx: ContextualItemsContext<Entity>): Promise<MenuItemBlock | undefined> | undefined {
1718
if (ctx.lites.length == 0)
@@ -195,7 +196,7 @@ export namespace MenuItemConstructor { //To allow monkey patching
195196
simplifyName(coc.operationInfo.niceName);
196197

197198
const color = coc.settings && coc.settings.color || coc.entityOperationSettings && coc.entityOperationSettings.color || Defaults.getColor(coc.operationInfo);
198-
const icon = coc.settings && coc.settings.icon || coc.entityOperationSettings && coc.entityOperationSettings.icon;
199+
const icon = coalesceIcon(coc.settings && coc.settings.icon, coc.entityOperationSettings && coc.entityOperationSettings.icon);
199200
const iconColor = coc.settings && coc.settings.iconColor || coc.entityOperationSettings && coc.entityOperationSettings.iconColor;
200201

201202
const disabled = !!coc.canExecute;
@@ -215,7 +216,7 @@ export namespace MenuItemConstructor { //To allow monkey patching
215216
data-operation={coc.operationInfo.key}>
216217
{icon ? <FontAwesomeIcon icon={icon} className="icon" color={iconColor} fixedWidth /> :
217218
color ? <span className={classes("icon", "empty-icon", "btn-" + color)}></span> : undefined}
218-
{(icon || color) && " "}
219+
{(icon != null || color != null) && " "}
219220
{text}
220221
</DropdownItem>,
221222
coc.canExecute ? <UncontrolledTooltip placement="right" target={() => innerRef!}>{coc.canExecute}</UncontrolledTooltip> : undefined
@@ -273,5 +274,15 @@ export function defaultContextualClick(coc: ContextualOperationContext<any>, ...
273274
}
274275
}).done();
275276

277+
278+
279+
}
280+
281+
282+
export function coalesceIcon(icon: IconProp | undefined, icon2: IconProp | undefined): IconProp | undefined{ //Till the error is fixed
283+
if (icon != null)
284+
return icon;
285+
286+
return icon2;
276287
}
277288

Signum.React/Signum.React.csproj

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.2</TargetFramework>
5-
<TypeScriptToolsVersion>3.3</TypeScriptToolsVersion>
5+
<TypeScriptToolsVersion>3.4</TypeScriptToolsVersion>
66
<LangVersion>latest</LangVersion>
77
<OutputType>Library</OutputType>
88
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.AspNetCore.App" />
15-
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.3.1">
15+
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.4.0">
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
1717
<PrivateAssets>all</PrivateAssets>
1818
</PackageReference>
@@ -42,12 +42,5 @@
4242
<TypeScriptCompile Include="**\*.ts" />
4343
</ItemGroup>
4444

45-
<ItemGroup>
46-
<Content Remove="package.json" />
47-
</ItemGroup>
48-
49-
<ItemGroup>
50-
<None Include="package.json" />
51-
</ItemGroup>
5245

5346
</Project>

0 commit comments

Comments
 (0)