Skip to content

Commit

Permalink
🔥 Remove Agent Availability mentions in code
Browse files Browse the repository at this point in the history
Not supported, see #16
  • Loading branch information
aguilaair committed Dec 26, 2020
1 parent 69c5d58 commit cd31bd7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ class _MyHomePageState extends State<MyHomePage> {
),
greeting: "Welcome to the test app!",
subtitle: "How can we help you?",
showAgentAvailability: false,
customer: kDebugMode
? CustomerMetadata(
email: "[email protected]",
Expand Down
12 changes: 6 additions & 6 deletions lib/models/classes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ class Props {
String enterEmailPlaceholer;

/// This text will be shown if the showAgentAvailability is true and you are online.
String agentAvailableText;
//String agentAvailableText;

/// This text will be shown if the showAgentAvailability is true and you are offline.
String agentUnavailableText;
//String agentUnavailableText;

/// This allows you to choose if you want to show your status.
bool showAgentAvailability;
//bool showAgentAvailability;

/// This Will allow you to require an emial to chat. Not recommended for an app.
bool requireEmailUpfront;
Expand All @@ -95,16 +95,16 @@ class Props {
//Class definition.
Props({
@required this.accountId,
this.agentAvailableText,
this.agentUnavailableText,
//this.agentAvailableText,
//this.agentUnavailableText,
this.baseUrl = "app.papercups.io",
this.customer,
this.greeting,
this.newMessagePlaceholder = "Start typing...",
this.primaryColor,
this.requireEmailUpfront = false,
this.scrollEnabled = true,
this.showAgentAvailability = false,
//this.showAgentAvailability = false,
this.subtitle = "How can we help you?",
this.title = "Welcome!",
this.companyName = "Bot",
Expand Down
6 changes: 3 additions & 3 deletions lib/papercups_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PaperCupsWidget extends StatefulWidget {
/// For example `"es"` or `"en-UK"`.
final String dateLocale;

/// Locale for the sent x ago. Check timeago locales. For example `EsMessages()`.
/// Locale for the fuzzy timestamps. Check timeago locales. For example `EsMessages()`.
/// Check https://github.com/andresaraujo/timeago.dart/tree/master/timeago/lib/src/messages
/// for the available classes.
final timeagoLocale;
Expand Down Expand Up @@ -252,8 +252,8 @@ class _PaperCupsWidgetState extends State<PaperCupsWidget> {
mainAxisSize: MainAxisSize.min,
children: [
Header(props: widget.props),
if (widget.props.showAgentAvailability)
AgentAvailability(widget.props),
// if (widget.props.showAgentAvailability)
// AgentAvailability(widget.props),
Expanded(
child: ChatMessages(
widget.props,
Expand Down
12 changes: 6 additions & 6 deletions test/papercups_flutter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ void main() {
);

expect(props.accountId, "this-is-an-account-id");
expect(props.agentAvailableText, null);
//expect(props.agentAvailableText, null);
expect(props.baseUrl, "app.papercups.io");
expect(props.agentUnavailableText, null);
//expect(props.agentUnavailableText, null);
expect(props.companyName, "Bot");
expect(props.newMessagePlaceholder, "Start typing...");
expect(props.primaryColor, null);
Expand All @@ -29,8 +29,8 @@ void main() {
test('are loaded correctly', () {
props = Props(
accountId: "this-is-an-account-id",
agentAvailableText: "test",
agentUnavailableText: "unavailable",
//agentAvailableText: "test",
//agentUnavailableText: "unavailable",
baseUrl: "app.papercups.io",
companyName: "name",
greeting: "greeting",
Expand All @@ -41,9 +41,9 @@ void main() {
customer: CustomerMetadata());

expect(props.accountId, "this-is-an-account-id");
expect(props.agentAvailableText, "test");
//expect(props.agentAvailableText, "test");
expect(props.baseUrl, "app.papercups.io");
expect(props.agentUnavailableText, "unavailable");
//expect(props.agentUnavailableText, "unavailable");
expect(props.companyName, "name");
expect(props.newMessagePlaceholder, "placeHolder");
expect(props.primaryColor, Color(0xffffff));
Expand Down

0 comments on commit cd31bd7

Please sign in to comment.