git.iko.soy/dashared/hookah-tau
on develop help sign in
исправила карту гороховского, добавила адрес в просмотр брони, цифры количества броней в списке клиентов настоящие
commit74b3876743356d0f298d7bc95cb51ed22f779c09 authorDarya Rednikina <rednikina.com@yandex.ru> dateWed 8 Jan 2020, 14:07 (7 years ago) parent6a0891c
9 files changed+37−22
Hookah Tau/API/ClientsService/ClientsService.swift+1−1 Hookah Tau/API/ClientsService/Resolvers/ClientsListResolver.swift+1−1 Hookah Tau/Controllers/Admin/Clients/Cells/ClientTableViewCell.swift+2−1 Hookah Tau/Controllers/Admin/Clients/ClientsCoordinator.swift+5−2 Hookah Tau/Controllers/Admin/Clients/ClientsViewController.swift+1−2 Hookah Tau/Controllers/Admin/Reservations/AdminReservationEditingViewController.swift+2 Hookah Tau/Controllers/Admin/Reservations/List of reservations/AdminReservationsController.swift+1 Hookah Tau/Controllers/Client/Reservations/Maps/1/MapView1.xib+14−14 Hookah Tau/Models/User.swift+10−1
Hookah Tau/API/ClientsService/ClientsService.swift+1−1
@@ -15,7 +15,7 @@ class ClientsService {
1515 self.apiClient = apiClient
1616 }
1717
18− func loadClientsList(completion: @escaping ((Result<[FullUser], GeneralError>) -> Void)) {
18+ func loadClientsList(completion: @escaping ((Result<[Client], GeneralError>) -> Void)) {
1919 let resolver = ClientsListResolver<ClientsResponce>()
2020 let request = ApiRequest(resolver: resolver, httpMethod: .get)
2121
Hookah Tau/API/ClientsService/Resolvers/ClientsListResolver.swift+1−1
@@ -9,7 +9,7 @@
99import Foundation
1010
1111struct ClientsResponce: MyCodable {
12− var clients: [FullUser]
12+ var clients: [Client]
1313}
1414
1515class ClientsListResolver<Responce: MyCodable>: ApiResolver {
Hookah Tau/Controllers/Admin/Clients/Cells/ClientTableViewCell.swift+2−1
@@ -35,10 +35,11 @@ class ClientTableViewCell: UITableViewCell {
3535
3636 // MARK: - Bind
3737
38− func bind(withModel model: FullUser) {
38+ func bind(withModel model: Client) {
3939 let name = model.name ?? "❔"
4040 nameLabel.text = model.isAdmin ? "👑 " + name : name
4141 phoneNumberLabel.text = model.phoneNumber.formattedNumber()
42+ numberOfReservationsLabel.text = "\(model.reservationCount)"
4243 }
4344
4445}
Hookah Tau/Controllers/Admin/Clients/ClientsCoordinator.swift+5−2
@@ -21,9 +21,12 @@ class ClientsCoordinator: BaseCoordinator {
2121 }
2222
2323 /// TODO
24− func openUserProfile(_ profile: FullUser) {
24+ func openUserProfile(_ profile: Client) {
2525 let profileCoordinator = ClientProfileCoordinator(navigationController: navigationController)
26− profileCoordinator.user = profile
26+ profileCoordinator.user = FullUser(uuid: profile.uuid,
27+ name: profile.name,
28+ phoneNumber: profile.phoneNumber,
29+ isAdmin: profile.isAdmin)
2730
2831 self.addDependency(profileCoordinator)
2932 profileCoordinator.didEndFlow = {
Hookah Tau/Controllers/Admin/Clients/ClientsViewController.swift+1−2
@@ -12,9 +12,8 @@ class ClientsViewController: UITableViewController {
1212
1313 // MARK: - Properties
1414
15− var dataSource: [FullUser] = [] {
15+ var dataSource: [Client] = [] {
1616 didSet {
17− print(dataSource)
1817 tableView.reloadData()
1918 }
2019 }
Hookah Tau/Controllers/Admin/Reservations/AdminReservationEditingViewController.swift+2
@@ -82,6 +82,8 @@ class AdminReservationEditingViewController: BaseViewController {
8282 mapView = MapView2.loadFromNib()
8383 }
8484
85+ navigationItem.title = TotalStorage.standard.getEstablishment(model.establishment)?.address
86+
8587 mapView?.isUserInteractionEnabled = false
8688
8789 tableContentView.addSubviewThatFills(mapView)
Hookah Tau/Controllers/Admin/Reservations/List of reservations/AdminReservationsController.swift+1
@@ -70,6 +70,7 @@ class AdminReservationsController: BaseViewController {
7070
7171 func setupNavBar() {
7272 self.navigationItem.title = "Брони"
73+ navigationController?.navigationBar.prefersLargeTitles = true
7374 navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(book))
7475 }
7576
Hookah Tau/Controllers/Client/Reservations/Maps/1/MapView1.xib+14−14
@@ -1,9 +1,9 @@
11<?xml version="1.0" encoding="UTF-8"?>
2−<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33 <device id="retina4_7" orientation="portrait" appearance="light"/>
44 <dependencies>
55 <deployment identifier="iOS"/>
6− <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
6+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
77 <capability name="Safe area layout guides" minToolsVersion="9.0"/>
88 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99 </dependencies>
@@ -21,22 +21,22 @@
2121 <rect key="frame" x="0.0" y="0.0" width="536" height="636"/>
2222 </imageView>
2323 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Y23-Wu-4BW" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
24− <rect key="frame" x="44" y="37" width="102" height="117"/>
24+ <rect key="frame" x="44" y="37" width="102" height="119"/>
2525 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
2626 <constraints>
2727 <constraint firstAttribute="width" constant="102" id="EKZ-Ny-4RQ"/>
28− <constraint firstAttribute="height" constant="117" id="u1N-5d-cFR"/>
28+ <constraint firstAttribute="height" constant="119" id="u1N-5d-cFR"/>
2929 </constraints>
3030 <connections>
3131 <action selector="chooseFirstTable:" destination="iN0-l3-epB" eventType="touchUpInside" id="1O9-7Q-a8g"/>
3232 </connections>
3333 </button>
3434 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xsw-fJ-8cN" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
35− <rect key="frame" x="209" y="113" width="131" height="119"/>
35+ <rect key="frame" x="209" y="116" width="131" height="117"/>
3636 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
3737 <constraints>
3838 <constraint firstAttribute="width" constant="131" id="2xi-Oz-ceC"/>
39− <constraint firstAttribute="height" constant="119" id="xPD-fh-9Zg"/>
39+ <constraint firstAttribute="height" constant="117" id="xPD-fh-9Zg"/>
4040 </constraints>
4141 <connections>
4242 <action selector="chooseSecondTable:" destination="iN0-l3-epB" eventType="touchUpInside" id="5XE-gZ-DyJ"/>
@@ -54,10 +54,10 @@
5454 </connections>
5555 </button>
5656 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Fw9-l6-N8a" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
57− <rect key="frame" x="60" y="350" width="102" height="118"/>
57+ <rect key="frame" x="60" y="350" width="102" height="120"/>
5858 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
5959 <constraints>
60− <constraint firstAttribute="height" constant="118" id="2Vp-Ip-7cO"/>
60+ <constraint firstAttribute="height" constant="120" id="2Vp-Ip-7cO"/>
6161 <constraint firstAttribute="width" constant="102" id="2hI-75-UCM"/>
6262 </constraints>
6363 <connections>
@@ -65,10 +65,10 @@
6565 </connections>
6666 </button>
6767 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KJZ-Nl-7hH" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
68− <rect key="frame" x="222" y="272" width="104" height="119"/>
68+ <rect key="frame" x="222" y="273" width="104" height="120"/>
6969 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
7070 <constraints>
71− <constraint firstAttribute="height" constant="119" id="Ifu-kd-YHH"/>
71+ <constraint firstAttribute="height" constant="120" id="Ifu-kd-YHH"/>
7272 <constraint firstAttribute="width" constant="104" id="phm-aP-6dx"/>
7373 </constraints>
7474 <connections>
@@ -76,7 +76,7 @@
7676 </connections>
7777 </button>
7878 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mUw-im-1BC" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
79− <rect key="frame" x="222" y="431" width="92" height="67"/>
79+ <rect key="frame" x="222" y="433" width="92" height="67"/>
8080 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
8181 <constraints>
8282 <constraint firstAttribute="width" constant="92" id="AJ6-ku-4R3"/>
@@ -87,10 +87,10 @@
8787 </connections>
8888 </button>
8989 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aIM-Qn-Uhl" customClass="TableButton" customModule="Hookah_Tau" customModuleProvider="target">
90− <rect key="frame" x="386" y="116" width="130" height="119"/>
90+ <rect key="frame" x="386" y="116" width="131" height="119"/>
9191 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
9292 <constraints>
93− <constraint firstAttribute="width" constant="130" id="Lhq-jM-PQ0"/>
93+ <constraint firstAttribute="width" constant="131" id="Lhq-jM-PQ0"/>
9494 <constraint firstAttribute="height" constant="119" id="vsx-u8-L6o"/>
9595 </constraints>
9696 <connections>
@@ -123,7 +123,7 @@
123123 <constraint firstItem="mUw-im-1BC" firstAttribute="top" secondItem="KJZ-Nl-7hH" secondAttribute="bottom" constant="40" id="GaI-BE-NZy"/>
124124 <constraint firstItem="btD-Wl-3P6" firstAttribute="width" secondItem="FuE-LV-NBR" secondAttribute="width" priority="250" id="MDs-kk-aza"/>
125125 <constraint firstItem="btD-Wl-3P6" firstAttribute="top" secondItem="aIM-Qn-Uhl" secondAttribute="bottom" constant="-235" id="NwR-U0-V6F"/>
126− <constraint firstItem="mUw-im-1BC" firstAttribute="top" secondItem="btD-Wl-3P6" secondAttribute="bottom" constant="-205" id="UXz-DD-dPH"/>
126+ <constraint firstItem="mUw-im-1BC" firstAttribute="top" secondItem="btD-Wl-3P6" secondAttribute="bottom" constant="-203" id="UXz-DD-dPH"/>
127127 <constraint firstItem="mUw-im-1BC" firstAttribute="leading" secondItem="Fw9-l6-N8a" secondAttribute="trailing" constant="60" id="V4u-ko-iFV"/>
128128 <constraint firstItem="KJZ-Nl-7hH" firstAttribute="top" secondItem="xsw-fJ-8cN" secondAttribute="bottom" constant="40" id="XFV-l2-chC"/>
129129 <constraint firstItem="btD-Wl-3P6" firstAttribute="top" secondItem="onR-hl-Q2x" secondAttribute="bottom" constant="-332" id="XNT-i4-1l8"/>
Hookah Tau/Models/User.swift+10−1
@@ -15,10 +15,19 @@ struct User: MyCodable {
1515 var isAdmin: Bool
1616}
1717
18−/// При запросах на список пользователей в аккаунте администратора
18+/// При запросах на список пользователей в аккаунте администратора.
1919struct FullUser: MyCodable {
2020 var uuid: String
2121 var name: String?
2222 var phoneNumber: String
2323 var isAdmin: Bool
2424}
25+
26+/// `GET /admin/clients`
27+struct Client: MyCodable {
28+ var uuid: String
29+ var name: String?
30+ var phoneNumber: String
31+ var isAdmin: Bool
32+ var reservationCount: Int
33+}