This file contains hidden or 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
| import React from "react" | |
| import Avatar from "../avatar/Avatar" | |
| function Profile(props) { | |
| return ( | |
| <div className="container"> | |
| <Avatar | |
| avatarData = {{imageUrl: props.avatar_url, | |
| imageAlt: props.login}} |
This file contains hidden or 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
| import React, { Component } from "react" | |
| import Profile from "../profile/Profile"; | |
| class Search extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| searchText: "", | |
| isOrganizationSearchChecked: false, |
This file contains hidden or 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
| import React from "react" | |
| class App extends React.Component { | |
| render() { | |
| return( | |
| <div> | |
| <img src="https://media.giphy.com/media/11vhCpFcD3um7m/giphy.gif" alt="code works gif" | |
| onMouseOver={() => alert("A mouse over event")}/> | |
| <br /> |
This file contains hidden or 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
| version: "3.8" | |
| services: | |
| jenkins-docker: | |
| image: docker:dind | |
| restart: always | |
| privileged: "true" | |
| environment: | |
| - DOCKER_TLS_CERTDIR=/certs | |
| ports: | |
| - "2376:2376" |
This file contains hidden or 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
| @Test | |
| void givenEmptyPerson_thenShouldHaveEmptyJson() throws JsonProcessingException { | |
| String returnedJson = convertToJson(Person.builder().build()).orElse("{}"); | |
| assertThat(returnedJson).isNotEmpty(); | |
| Map<String, Object> personMap = of(returnedJson); | |
| assertThat(personMap).isEmpty(); | |
| } |
This file contains hidden or 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
| @Test | |
| void givenPersonHasEmptyFirstName_thenJsonShouldNotHaveFirstNameProperty() throws JsonProcessingException { | |
| Person personWithEmptyFirstname = Person.builder().firstName("").lastName("Last name").gender(FEMALE) | |
| .address(Address.builder().addressLine1("Address Line 1").addressLine2("Address Line 2").postcode("The Post Code") | |
| .build()).build(); | |
| Map<String, Object> personMap = of(convertToJson(personWithEmptyFirstname).orElse("")); | |
| assertThat(personMap).doesNotContainKey("firstName"); | |
| } |
This file contains hidden or 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
| @Data | |
| @Builder(toBuilder = true) | |
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | |
| public class Address { | |
| private final String addressLine1; | |
| private final String addressLine2; | |
| private final String postcode; | |
| } |
This file contains hidden or 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
| @Data | |
| @Builder(toBuilder = true) | |
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | |
| public class Person { | |
| private final String firstName; | |
| private final String lastName; | |
| private final Gender gender; | |
| private Address address; | |
| } |
This file contains hidden or 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
| static Future<Map<String, dynamic>> findVisitor(final String email) async { | |
| Map<String, dynamic> visitorData; | |
| if (email.isNotEmpty) { | |
| // wait for result to be returned | |
| await _firestore.collection(Constants.visitors) | |
| .document(email) | |
| .get().then((visitorSnapshot) { | |
| visitorData = visitorSnapshot.data; | |
| }).catchError((error) { | |
| visitorData = new Map(); |
This file contains hidden or 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
| static void saveOrUpdateVisitor(final Visitor visitor, final bool signIn) async { | |
| if (visitor != null) { | |
| // _firestore is a private variable declared using -> static Firestore _firestore = Firestore.instance; | |
| await _firestore.collection(Constants.visitors)/// create the collection where Visitors will be saved | |
| .document(visitor.emailAddress)/// construct a path (more like reference) | |
| .setData(Visitor.toMap(visitor, signIn));/// save data | |
| } | |
| } |