-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit 32b9cf7.
- Loading branch information
1 parent
32b9cf7
commit a1ec40b
Showing
28 changed files
with
227 additions
and
737 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+260 Bytes
(100%)
.creevey/images/Mobile/TriggerInfo/Not everyday/chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+260 Bytes
(100%)
.creevey/images/Mobile/TriggerInfo/With throttling/chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+252 Bytes
(100%)
.creevey/images/Mobile/TriggerInfo/WithLogMessageError/chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+245 Bytes
(100%)
.creevey/images/Mobile/TriggerInfo/WithLongDescription/chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+257 Bytes
(100%)
.creevey/images/Mobile/TriggerInfo/WithLongName With spaces/chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+262 Bytes
(100%)
.creevey/images/Mobile/TriggerInfoPage/Not everyday/chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+61 Bytes
(100%)
.creevey/images/Mobile/TriggerInfoPage/With throttling/chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+105 Bytes
(100%)
.creevey/images/Mobile/TriggerInfoPage/WithError/chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
3 changes: 3 additions & 0 deletions
3
src/Components/Mobile/MobileTriggerInfo/MobileTriggerInfo.less
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,5 +1,8 @@ | ||
@import '../Styles/variables.less'; | ||
|
||
.root { | ||
} | ||
|
||
.description { | ||
overflow: hidden; | ||
word-break: break-word; | ||
|
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 was deleted.
Oops, something went wrong.
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,123 @@ | ||
import React from "react"; | ||
import { Team } from "../../Domain/Team"; | ||
import { | ||
ValidationContainer, | ||
ValidationInfo, | ||
ValidationWrapper, | ||
} from "@skbkontur/react-ui-validations"; | ||
import { Button, Gapped, Input, Modal, Textarea } from "@skbkontur/react-ui"; | ||
import { Grid } from "../Grid/Grid"; | ||
import { isEmptyString } from "../../helpers/isEmptyString"; | ||
import { GridCell } from "../Grid/GridCell"; | ||
|
||
interface TeamEditorProps { | ||
team?: Team; | ||
onAddTeam?: (team: Partial<Team>) => void; | ||
onSaveTeam?: (team: Team) => void; | ||
onClose: () => void; | ||
} | ||
|
||
type TeamEditorState = { | ||
name: string; | ||
description: string; | ||
}; | ||
|
||
export class TeamEditor extends React.Component<TeamEditorProps, TeamEditorState> { | ||
private validation = React.createRef<ValidationContainer>(); | ||
public state: TeamEditorState = { | ||
name: this.props.team?.name ?? "", | ||
description: this.props.team?.description ?? "", | ||
}; | ||
|
||
public render(): React.ReactElement { | ||
return ( | ||
<ValidationContainer ref={this.validation}> | ||
<Modal width={600} onClose={this.props.onClose}> | ||
<Modal.Header> | ||
{this.props.team ? `Edit team ${this.props.team.name} ` : "Add Team"} | ||
</Modal.Header> | ||
<Modal.Body> | ||
<Grid columns="120px 400px" gap="16px"> | ||
{this.props.team ? null : ( | ||
<> | ||
Name: | ||
<ValidationWrapper validationInfo={this.validateName()}> | ||
<Input | ||
value={this.state.name} | ||
onValueChange={this.handleNameChange} | ||
width={"100%"} | ||
disabled={Boolean(this.props.team)} | ||
/> | ||
</ValidationWrapper> | ||
</> | ||
)} | ||
<GridCell align={"flex-start"} margin="8px 0 0"> | ||
Description: | ||
</GridCell> | ||
<Textarea | ||
value={this.state.description} | ||
onValueChange={this.handleDescriptionChange} | ||
width="100%" | ||
autoResize | ||
/> | ||
</Grid> | ||
</Modal.Body> | ||
<Modal.Footer> | ||
<Gapped gap={8}> | ||
{this.props.team ? ( | ||
<Button use={"primary"} onClick={this.handleSaveTeam} width={100}> | ||
Save | ||
</Button> | ||
) : ( | ||
<Button use={"primary"} onClick={this.handleAddTeam} width={100}> | ||
Add | ||
</Button> | ||
)} | ||
<Button onClick={this.props.onClose}>Cancel</Button> | ||
</Gapped> | ||
</Modal.Footer> | ||
</Modal> | ||
</ValidationContainer> | ||
); | ||
} | ||
|
||
private handleNameChange = (name: string) => { | ||
this.setState({ name: name }); | ||
}; | ||
private handleDescriptionChange = (description: string) => { | ||
this.setState({ description: description }); | ||
}; | ||
|
||
private handleAddTeam = async () => { | ||
const isValid = await this.validation.current?.validate(); | ||
if (!isValid) { | ||
return; | ||
} | ||
|
||
this.props.onAddTeam?.({ | ||
name: this.state.name, | ||
description: this.state.description, | ||
}); | ||
}; | ||
|
||
private handleSaveTeam = async () => { | ||
const isValid = await this.validation.current?.validate(); | ||
if (!isValid || !this.props.team) { | ||
return; | ||
} | ||
|
||
this.props.onSaveTeam?.({ | ||
...this.props.team, | ||
description: this.state.description, | ||
}); | ||
}; | ||
|
||
private validateName = (): ValidationInfo | undefined => { | ||
return isEmptyString(this.state.name) | ||
? { | ||
type: "submit", | ||
message: "Can't be empty", | ||
} | ||
: undefined; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.