Skip to content

Commit

Permalink
Merge pull request #110 from RishabhTayal/add-tester
Browse files Browse the repository at this point in the history
Add new tester
  • Loading branch information
RishabhTayal authored Jan 9, 2018
2 parents 2d3ce5a + 05f7e9b commit 63b603c
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 1 deletion.
Binary file removed .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ fastlane/report.xml
ReviewMonitor.app.dSYM.zip

ReviewMonitor.ipa

.DS_Store
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
- Add new Testflight testers. [@Rishabh Tayal](https://github.com/RishabhTayal)
- Fixed app share link. [@Rishabh Tayal](https://github.com/RishabhTayal)
- Added Edit server url on login. [@Eliottiosdevs](https://github.com/Eliottiosdevs)

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ReviewMonitor

[![Build Status](https://travis-ci.org/RishabhTayal/ReviewMonitor.svg?branch=master)](https://travis-ci.org/RishabhTayal/ReviewMonitor)
<!--[![Build Status](https://travis-ci.org/RishabhTayal/ReviewMonitor.svg?branch=master)](https://travis-ci.org/RishabhTayal/ReviewMonitor)-->
[![Build Status](https://www.bitrise.io/app/099415a1bcf4a25a/status.svg?token=VuY22jFJYDnnR9Fmrg83EA)](https://www.bitrise.io/app/099415a1bcf4a25a)
[![Version](https://img.shields.io/github/release/RishabhTayal/ReviewMonitor.svg)](https://github.com/RishabhTayal/ReviewMonitor/releases/latest)
[![GitHub contributors](https://img.shields.io/github/contributors/RishabhTayal/ReviewMonitor.svg)](https://GitHub.com/RishabhTayal/ReviewMonitor/graphs/contributors/)
[![License](https://img.shields.io/badge/license-MIT-999999.svg)](https://github.com/RishabhTayal/ReviewMonitor/blob/master/LICENSE)
Expand Down
8 changes: 8 additions & 0 deletions ReviewMonitor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
690DA5631F622142000DD28F /* ReviewsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 690DA5621F622142000DD28F /* ReviewsViewController.swift */; };
690DA5651F622177000DD28F /* Review.swift in Sources */ = {isa = PBXBuildFile; fileRef = 690DA5641F622177000DD28F /* Review.swift */; };
6918E3841F6321F800709F2F /* AppsListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6918E3831F6321F800709F2F /* AppsListTableViewCell.swift */; };
692A6C53200552B900121637 /* AddTesterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 692A6C51200552B900121637 /* AddTesterViewController.swift */; };
692A6C54200552B900121637 /* AddTesterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 692A6C52200552B900121637 /* AddTesterViewController.xib */; };
6934BC8D1FFFD887003A87E6 /* AppVersion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6934BC8C1FFFD887003A87E6 /* AppVersion.swift */; };
6934BC901FFFE284003A87E6 /* AppMetadataTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6934BC8E1FFFE284003A87E6 /* AppMetadataTableViewCell.swift */; };
6934BC911FFFE284003A87E6 /* AppMetadataTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6934BC8F1FFFE284003A87E6 /* AppMetadataTableViewCell.xib */; };
Expand Down Expand Up @@ -57,6 +59,8 @@
690DA5621F622142000DD28F /* ReviewsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewsViewController.swift; sourceTree = "<group>"; };
690DA5641F622177000DD28F /* Review.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Review.swift; sourceTree = "<group>"; };
6918E3831F6321F800709F2F /* AppsListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppsListTableViewCell.swift; sourceTree = "<group>"; };
692A6C51200552B900121637 /* AddTesterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddTesterViewController.swift; sourceTree = "<group>"; };
692A6C52200552B900121637 /* AddTesterViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AddTesterViewController.xib; sourceTree = "<group>"; };
6934BC8C1FFFD887003A87E6 /* AppVersion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppVersion.swift; sourceTree = "<group>"; };
6934BC8E1FFFE284003A87E6 /* AppMetadataTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppMetadataTableViewCell.swift; sourceTree = "<group>"; };
6934BC8F1FFFE284003A87E6 /* AppMetadataTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AppMetadataTableViewCell.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -219,6 +223,8 @@
isa = PBXGroup;
children = (
69591E101F7A0DE4003D7E27 /* TestersViewController.swift */,
692A6C51200552B900121637 /* AddTesterViewController.swift */,
692A6C52200552B900121637 /* AddTesterViewController.xib */,
);
path = "Testers View Controller";
sourceTree = "<group>";
Expand Down Expand Up @@ -371,6 +377,7 @@
69015E1A1F69FE0100D2EFF2 /* ResponseEditorViewController.xib in Resources */,
69A627701F6343D600415AC8 /* LoginViewController.xib in Resources */,
696235D91F6F7AB600176A60 /* ReviewFilterViewController.xib in Resources */,
692A6C54200552B900121637 /* AddTesterViewController.xib in Resources */,
69C845AA1F6393E100C65AB2 /* AccountsViewController.xib in Resources */,
6934BC961FFFEB7D003A87E6 /* AppVersionDetailViewController.xib in Resources */,
C97D38D11FF902F600EBFA35 /* AuthCell.xib in Resources */,
Expand Down Expand Up @@ -506,6 +513,7 @@
6934BC8D1FFFD887003A87E6 /* AppVersion.swift in Sources */,
694282951F64747F0053BBF3 /* AccountManger.swift in Sources */,
69A6276F1F6343D600415AC8 /* LoginViewController.swift in Sources */,
692A6C53200552B900121637 /* AddTesterViewController.swift in Sources */,
6918E3841F6321F800709F2F /* AppsListTableViewCell.swift in Sources */,
C99F436F1FFF7DF70053E421 /* ReachabilityManager.swift in Sources */,
C99D85C11FFEEAA5001DD508 /* Reachability.swift in Sources */,
Expand Down
6 changes: 6 additions & 0 deletions ReviewMonitor/ServiceCaller.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class ServiceCaller: NSObject {
case ratings
case response
case testers
case addTester = "tester"
case processing_builds
case meta = "app/metadata"
case app_live_version_metadata = "/app/live_version_metadata"
Expand Down Expand Up @@ -140,6 +141,11 @@ class ServiceCaller: NSObject {
makeAPICall(endPoint: .testers, params: params, completionBlock: completion)
}

class func addNewTester(bundleId: String, firstName: String, lastName: String, email: String, completion: CompletionBlock?) {
let params = ["bundle_id": bundleId, "email": email, "first_name": firstName, "last_name": lastName]
makeAPICall(endPoint: .addTester, params: params, httpMethod: .POST, completionBlock: completion)
}

class func getProcessingBuilds(bundleId: String, completion: CompletionBlock?) {
let params = ["bundle_id": bundleId]
makeAPICall(endPoint: .processing_builds, params: params, completionBlock: completion)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//
// AddTesterViewController.swift
// ReviewMonitor
//
// Created by Tayal, Rishabh on 1/9/18.
// Copyright © 2018 Tayal, Rishabh. All rights reserved.
//

import UIKit
import MBProgressHUD

class AddTesterViewController: UIViewController {

var app: App!

@IBOutlet var firstNameTF: UITextField!
@IBOutlet var lastNameTF: UITextField!
@IBOutlet var emailTF: UITextField!

init() {
super.init(nibName: "AddTesterViewController", bundle: nil)
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func viewDidLoad() {
super.viewDidLoad()

title = "Add new tester"

navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancelTapped(_:)))
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Save", style: .done, target: self, action: #selector(saveTapped(_:)))
}

@objc func cancelTapped(_ sender: Any) {
dismiss(animated: true, completion: nil)
}

@objc func saveTapped(_ sender: Any) {
MBProgressHUD.showAdded(to: view, animated: true)
navigationItem.rightBarButtonItem?.isEnabled = false
navigationItem.leftBarButtonItem?.isEnabled = false
ServiceCaller.addNewTester(bundleId: app.bundleId, firstName: firstNameTF.text!, lastName: lastNameTF.text!, email: emailTF.text!) { result, error in
DispatchQueue.main.async {
self.navigationItem.rightBarButtonItem?.isEnabled = true
self.navigationItem.leftBarButtonItem?.isEnabled = true
MBProgressHUD.hide(for: self.view, animated: true)
self.dismiss(animated: true, completion: nil)
}
}
}
}
59 changes: 59 additions & 0 deletions ReviewMonitor/Testers View Controller/AddTesterViewController.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AddTesterViewController" customModule="ReviewMonitor" customModuleProvider="target">
<connections>
<outlet property="emailTF" destination="5A7-pC-Doj" id="aya-0V-Q6I"/>
<outlet property="firstNameTF" destination="TU7-Y6-Bqu" id="FVL-pt-hV7"/>
<outlet property="lastNameTF" destination="MkI-1I-XBh" id="fMB-ks-yeo"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="kvQ-El-cRP">
<rect key="frame" x="10" y="70" width="355" height="120"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="First Name" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="TU7-Y6-Bqu">
<rect key="frame" x="0.0" y="0.0" width="355" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="no"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Last Name" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="MkI-1I-XBh">
<rect key="frame" x="0.0" y="45" width="355" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="no"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Email*" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="5A7-pC-Doj">
<rect key="frame" x="0.0" y="90" width="355" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="emailAddress" textContentType="email"/>
</textField>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="kvQ-El-cRP" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="50" id="8Cq-PP-qoq"/>
<constraint firstItem="kvQ-El-cRP" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="10" id="YQ6-QR-1RT"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="kvQ-El-cRP" secondAttribute="trailing" constant="10" id="xQI-Rw-Hcq"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
</view>
</objects>
</document>
12 changes: 12 additions & 0 deletions ReviewMonitor/Testers View Controller/TestersViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ class TestersViewController: UIViewController {
tableView.tableFooterView = UIView()
tableView.autoresizingMask = UIViewAutoresizing(rawValue: UIViewAutoresizing.RawValue(UInt8(UIViewAutoresizing.flexibleWidth.rawValue) | UInt8(UIViewAutoresizing.flexibleHeight.rawValue)))
view.addSubview(tableView)

navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(addTesterTapped(_:)))
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(true)
getTesters()
}

Expand All @@ -52,6 +58,12 @@ class TestersViewController: UIViewController {
}
}
}

@objc func addTesterTapped(_ sender: Any) {
let addTester = AddTesterViewController()
addTester.app = app
present(UINavigationController(rootViewController: addTester), animated: true, completion: nil)
}
}

extension TestersViewController: UITableViewDataSource {
Expand Down

0 comments on commit 63b603c

Please sign in to comment.