-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance FilterSearchBox to correctly parse user names from SharePoint…
… results
- Loading branch information
1 parent
e17d9d9
commit 1d50bef
Showing
2 changed files
with
57 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,8 +121,20 @@ export class FilterSearchBox extends React.Component<IFilterSearchBoxProps, IFil | |
let propsitemname:string = props.item.name; | ||
if(props.item.name.indexOf("i:0#.f") > -1) | ||
{ | ||
propsitemname = props.item.name.split('|')[1] | ||
// propsitemname = "testing" | ||
//From localSharePointResults: Admin@tcwlv.onmicrosoft.com | Kasper Larsen | 693A30232E667C6D656D626572736869707C61646D696E407463776C762E6F6E6D6963726F736F66742E636F6D i:0#.f|membership|[email protected] | ||
//From localPeopleResults: i:0#.f|membership|[email protected] | ||
if(props.item.name.indexOf("i:0#.f") === 0) | ||
{ | ||
propsitemname = props.item.name.split('|')[2] | ||
} | ||
else | ||
{ | ||
propsitemname = props.item.name.split('|')[1] | ||
|
||
} | ||
|
||
|
||
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,24 +136,51 @@ | |
<div class="filter--values-list"> | ||
{{#each filter.values}} | ||
|
||
<!-- From localSharePointResults: [email protected] | Kasper Larsen | 693A30232E667C6D656D626572736869707C61646D696E407463776C762E6F6E6D6963726F736F66742E636F6D i:0#.f|membership|[email protected] --> | ||
<!-- From localPeopleResults: i:0#.f|membership|[email protected] --> | ||
|
||
<!-- <div title="{{#with (split name '|')}}{{[1]}}({{[0]}}){{/with}} {{#if ../showCount}}({{count}}){{/if}}" class="filter--value"> --> | ||
|
||
{{#eq (itemAt (split name "|") 1) "membership"}} <!-- this must be from localPeopleResults --> | ||
<div title="{{#with (split name '|')}}{{[2]}}{{/with}} {{#if ../showCount}}({{count}}){{/if}}" class="filter--value"> | ||
<pnp-filtercheckbox | ||
data-instance-id="{{@root.instanceId}}" | ||
data-filter-name="{{filter.filterName}}" | ||
data-name= "{{#with (split name '|')}}{{[2]}}{{/with}}" | ||
data-value="{{value}}" | ||
data-selected="{{selected}}" | ||
data-disabled="{{disabled}}" | ||
data-count="{{count}}" | ||
data-is-multi="{{../isMulti}}" | ||
data-theme-variant="{{JSONstringify @root.theme}}" | ||
> | ||
</pnp-filtercheckbox> | ||
{{#if ../showCount}} | ||
<span data-ui-test-id="filterCount">({{count}})</span> | ||
{{/if}} | ||
</div> | ||
{{else}} | ||
<div title="{{#with (split name '|')}}{{[1]}}{{/with}} {{#if ../showCount}}({{count}}){{/if}}" class="filter--value"> | ||
<pnp-filtercheckbox | ||
data-instance-id="{{@root.instanceId}}" | ||
data-filter-name="{{filter.filterName}}" | ||
data-name= "{{#with (split name '|')}}{{[1]}}{{/with}}" | ||
data-value="{{value}}" | ||
data-selected="{{selected}}" | ||
data-disabled="{{disabled}}" | ||
data-count="{{count}}" | ||
data-is-multi="{{../isMulti}}" | ||
data-theme-variant="{{JSONstringify @root.theme}}" | ||
> | ||
</pnp-filtercheckbox> | ||
{{#if ../showCount}} | ||
<span data-ui-test-id="filterCount">({{count}})</span> | ||
{{/if}} | ||
</div> | ||
<pnp-filtercheckbox | ||
data-instance-id="{{@root.instanceId}}" | ||
data-filter-name="{{filter.filterName}}" | ||
data-name= "{{#with (split name '|')}}{{[1]}}{{/with}}" | ||
data-value="{{value}}" | ||
data-selected="{{selected}}" | ||
data-disabled="{{disabled}}" | ||
data-count="{{count}}" | ||
data-is-multi="{{../isMulti}}" | ||
data-theme-variant="{{JSONstringify @root.theme}}" | ||
> | ||
</pnp-filtercheckbox> | ||
{{#if ../showCount}} | ||
<span data-ui-test-id="filterCount">({{count}})</span> | ||
{{/if}} | ||
</div> | ||
{{/eq}} | ||
|
||
|
||
|
||
{{/each}} | ||
</div> | ||
{{else}} | ||
|