-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b2ffc2
commit 6730f34
Showing
13 changed files
with
174 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
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
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
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
.lastItem { | ||
padding-bottom: 66px; | ||
} | ||
|
||
.pivotContent { | ||
margin-top: 15px; | ||
} |
109 changes: 109 additions & 0 deletions
109
src/Views/CopySettings/Components/AdvancedItemMapping2.tsx
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 |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import * as React from "react"; | ||
|
||
import { css } from "office-ui-fabric-react/lib/Utilities"; | ||
import { Dropdown, IDropdownOption } from "office-ui-fabric-react/lib/Dropdown"; | ||
import { IBoardColumnDifferences, IColumnMapping } from "src/Views/CopySettings/Models/CopySettingsInterfaces"; | ||
import { Pivot, PivotItem } from "office-ui-fabric-react/lib/Pivot"; | ||
import { List } from "office-ui-fabric-react/lib/List"; | ||
import * as Constants from "src/Shared/Constants"; | ||
|
||
import "./AdvancedItemMapping.scss"; | ||
|
||
export interface IAdvancedItemMappingProps { | ||
show: boolean; | ||
headerText: string; | ||
onClosed: () => void; | ||
onMappingChanged: (selectedId: string, sourceId) => void; | ||
mappings: IBoardColumnDifferences[]; | ||
selectedLevels: string[]; | ||
} | ||
|
||
export class AdvancedItemMapping extends React.Component<IAdvancedItemMappingProps, {}> { | ||
private _itemsCount: number; | ||
|
||
constructor(props: IAdvancedItemMappingProps) { | ||
super(props); | ||
this._itemsCount = 0; | ||
} | ||
|
||
public render() { | ||
let mappingItems: IColumnMapping[] = []; | ||
let startIndex = 0; | ||
if (!this.props.mappings || !this.props.show) { | ||
return null; | ||
} | ||
|
||
let mappingsOfInterest: IBoardColumnDifferences[] = []; | ||
|
||
this.props.mappings.forEach(mapping => { | ||
if (this.props.selectedLevels.indexOf(mapping.backlog) >= 0) { | ||
mappingsOfInterest.push(mapping); | ||
} | ||
}); | ||
this._itemsCount = mappingItems.length; | ||
return ( | ||
<div> | ||
<div className={css("ms-font-m")}> | ||
{Constants.MappingsDescription} | ||
</div> | ||
<div> | ||
<Pivot> | ||
{mappingsOfInterest.map((mapping, mapIndex, allMappings) => { | ||
return ( | ||
<PivotItem linkText={mapping.backlog}> | ||
{this._renderPivotContent(mapping)} | ||
</PivotItem> | ||
); | ||
})} | ||
</Pivot> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
private _renderPivotContent(mapping: IBoardColumnDifferences): JSX.Element { | ||
let content: JSX.Element; | ||
|
||
let multipleMappings = mapping.mappings.filter(m => m.potentialMatches.length > 1); | ||
if (multipleMappings.length === 0) { | ||
content = | ||
<div className={css("pivotContent", "ms-font-m")}> | ||
{Constants.NoMappingsAvailable} | ||
</div>; | ||
} else { | ||
content = | ||
<List | ||
items={multipleMappings} | ||
onRenderCell={this._onRenderCell} />; | ||
} | ||
return content; | ||
} | ||
|
||
private _onRenderCell = (item: IColumnMapping, itemIndex: number) => { | ||
let dropdownOptions: IDropdownOption[] = []; | ||
item.potentialMatches.forEach(match => { | ||
dropdownOptions.push({ | ||
key: match.id, | ||
text: match.name, | ||
data: item.targetColumn.id | ||
}); | ||
}); | ||
let className = ""; | ||
if (itemIndex === this._itemsCount - 1) { | ||
className = css("lastItem"); | ||
} | ||
return ( | ||
<div className={className}> | ||
<Dropdown | ||
options={dropdownOptions} | ||
selectedKey={item.sourceColumn.id} | ||
label={item.targetColumn.name} | ||
onChanged={this._onMappingChanged} /> | ||
</div> | ||
); | ||
} | ||
|
||
private _onMappingChanged = (item: IDropdownOption) => { | ||
this.props.onMappingChanged(item.key.toString(), item.data.toString()); | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as React from "react"; | ||
import { css } from "office-ui-fabric-react/lib/Utilities"; | ||
|
||
export interface ISettingsToCopyProps { | ||
selectedSettings: string[]; | ||
} | ||
|
||
export class SettingsToCopy extends React.Component<ISettingsToCopyProps, {}> { | ||
public render() { | ||
return ( | ||
<div> | ||
The following styles will be copied: {this.props.selectedSettings.map((value, index, values) => { | ||
let content = index < values.length - 1 ? | ||
<span><span className={css("boldFont")}>{value}</span>, </span> : <span><span className={css("boldFont")}>{value}</span>.</span>; | ||
return content; | ||
})} | ||
</div> | ||
); | ||
} | ||
} |
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
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
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
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
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
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