Giter Club home page Giter Club logo

mobile-travel-sample's People

Contributors

amarantha-k avatar biozal avatar bkaneatwork avatar bmeike avatar borrrden avatar djpongh avatar dugbonsai avatar grantnp avatar ibsoln avatar jamesnocentini avatar jayahariv avatar jflath avatar krugster avatar osfameron avatar rajagp avatar rayoffiah avatar velicuvlad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobile-travel-sample's Issues

Bookmarked hotels display bug

Step:

  1. Search San Francisco
  2. Bookmark the first one from the search result.
  3. Search London
  4. The first one on the Long list was bookmarked.

Java: Implement Search Screen

Tab controller for hotel/flight search. Shows hotel search by default.

  • TabbedPane that contains hotel/flight panels
  • Third TabbedPane with flight/hotel bookings

Android: It is not clear where "hotels" document comes from? Is it a property of `bookmarkedhotels` document?

  • Develop
    2) The Basics
    • Delete a Document

http://docs-build.sc.couchbase.com:9000/develop/java#/2/1/2

The code below deletes the "hotels" document from the database every time a hotel is unbookmarked.

In addition to deleting the "hotels" document, the unbookmarking process updates the "bookmarkedhotels" document by removing the the hotel Id hotels array.

In Data Modeling section, It seems none of documen types is hotels. It seems hotels is one of the properties of bookmarkedhotels document. So Above sentences do not make sense?


Again, guestDoc.setArray("hotels", hotelIds); is unnecessary

Document guestDoc = database.getDocument("user::guest");
Array hotelIds = guestDoc.getArray("hotels");
for (int i = 0; i < hotelIds.count(); i++) {
    if (hotelIds.getString(i).equals((String) bookmark.get("id"))) {
        hotelIds.remove(i);
    }
}
guestDoc.setArray("hotels", hotelIds); <<<<<<<
try {
    database.save(guestDoc);
} catch (CouchbaseLiteException e) {
    e.printStackTrace();
}

Some comments for Swift

  1. .init is not necessary.
    https://github.com/couchbaselabs/mobile-travel-sample/blob/connect_sv/ios/TravelSample/TravelSample/Presenter/HotelPresenter.swift#L48

  2. Do not need to re-setting the array object.
    https://github.com/couchbaselabs/mobile-travel-sample/blob/connect_sv/ios/TravelSample/TravelSample/Presenter/HotelPresenter.swift#L70

  3. .init is not necessary.
    https://github.com/couchbaselabs/mobile-travel-sample/blob/connect_sv/ios/TravelSample/TravelSample/Presenter/HotelPresenter.swift#L83

  4. Unclear why the app needs to create/save the hotel doc when bookmarking (Android code doesn't have it).
    https://github.com/couchbaselabs/mobile-travel-sample/blob/connect_sv/ios/TravelSample/TravelSample/Presenter/HotelPresenter.swift#L76-L86

  5. .init is not necessary.
    https://github.com/couchbaselabs/mobile-travel-sample/blob/connect_sv/ios/TravelSample/TravelSample/Presenter/HotelPresenter.swift#L133

  6. Develop > Security > User Management
    In the search box, enter "user:demo" is not correct. It should be "user::demo"

  7. Develop > Security > Access Control
    In Try in out section, Typo in "Run the following command in yout terminal."

  8. The replicator's activity issue should be fixed in DB18. The workaround is not necessary.
    https://github.com/couchbaselabs/mobile-travel-sample/blob/connect_sv/ios/TravelSample/TravelSample/Model/DatabaseManager.swift#L243-L248

  9. It is kind of redundant to create a folder named guest as by default the Database will also create a folder with the database name which is already guest. The default director that the guest folder will be created is also the Application Support folder.
    https://github.com/couchbaselabs/mobile-travel-sample/blob/connect_sv/ios/TravelSample/TravelSample/Model/DatabaseManager.swift#L89-L97

Fix inline links to docker

Reported by Douglas Bonser:
Sync Gateway 2.0 section
The docker link in the following statement on the Manual installation option page does not work (the dropdown at the top of the page works correctly though)
If you would prefer to use a docker container instead, please proceed to the docker section

Xamarin.Android TravelSample InvalidCastException on UserDialogs.Init() in MainActivity.cs

I am running the sample app in Visual Studio for Mac 8.0.8 with Xcode 10.2.1. The NuGets have not been updated, the Xamarin Forms is 2.5.0.91635. I do not have a backend installed, so looking up a hotel in Hotel Search throws an exception and the alert dialog for "Error fetching hotels" is triggered. The initialisation for Acr.UserDialogs (6.5.1) is done using:
UserDialogs.Init(() => (Activity)ApplicationContext);
in MainActivity.cs. Instead of showing the alert dialog this fails with an InvalidCastException.

[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.InvalidCastException: Specified cast is not valid.
[MonoDroid] at TravelSample.Droid.MainActivity.b__0_0 () [0x00000] in /Users/bdegroot/Downloads/mobile-travel-sample-master/dotnet/TravelSample/TravelSample.Android/MainActivity.cs:47
[MonoDroid] at Acr.UserDialogs.UserDialogsImpl.Alert (Acr.UserDialogs.AlertConfig config) [0x0000d] in C:\dev\acr\userdialogs\src\Acr.UserDialogs.Android\UserDialogsImpl.cs:34
[MonoDroid] at Acr.UserDialogs.AbstractUserDialogs.AlertAsync (Acr.UserDialogs.AlertConfig config, System.Nullable`1[T] cancelToken) [0x00054] in C:\dev\acr\userdialogs\src\Acr.UserDialogs.Interface\AbstractUserDialogs.cs:130
[MonoDroid] at TravelSample.Core.ViewModels.HotelListViewModel.LookupAsync () [0x00146] in /Users/bdegroot/Downloads/mobile-travel-sample-master/dotnet/TravelSample/TravelSample.Core/ViewModels/HotelListViewModel.cs:268
[MonoDroid] at TravelSample.Core.ViewModels.HotelListViewModel.<get_LookupCommand>b__13_0 () [0x0001f] in /Users/bdegroot/Downloads/mobile-travel-sample-master/dotnet/TravelSample/TravelSample.Core/ViewModels/HotelListViewModel.cs:221
[MonoDroid] at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_0 (System.Object state) [0x00000] in <58604b4522f748968296166e317b04b4>:0
[MonoDroid] at Android.App.SyncContext+<>c__DisplayClass2_0.b__0 () [0x00000] in <788a34f7a7b84486905dfde786529d42>:0
[MonoDroid] at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <788a34f7a7b84486905dfde786529d42>:0
[MonoDroid] at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <788a34f7a7b84486905dfde786529d42>:0
[MonoDroid] at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.34(intptr,intptr)

Changing the line to:
UserDialogs.Init(this);
fixes the problem (in this case).

Java: Implement Login Screen

Tasks:

  • user login
  • guest login

Questions:

  1. What is the difference b/w user and guest login?
  2. Is there a user model?

Android: App: non appropriate way of checking existing db

http://docs-build.sc.couchbase.com:9000/develop/java#/2/4/0

We don't recommend to check Database existence by checking if the file exists.

        File dbFile = new File(context.getFilesDir(), "travel-sample.cblite2");
        if (!dbFile.exists()) {
            DatabaseManager.installPrebuiltDatabase(context, "travel-sample.cblite2.zip");
        }

We recommend using following Database static method.

public static boolean exists(String name, File directory)

http://docs.couchbase.com/mobile/2.0/couchbase-lite-java/db018/com/couchbase/lite/Database.html#exists-java.lang.String-java.io.File-

Clarify Overview and Install guide

  • Need for Windows 10
  • Couchbase Server manual instructions (which version etc)
  • Instructions for instructions for Python web app
  • Specify any deviations for Windows system installation

Cochabse lire dependency is werong

In mobile-travel-sample/android/TravelSample/app/build.gradle file:

implementation 'com.couchbase.lite:couchbase-lite-android-ee:2.7.0'

should be replaced by implementation 'com.couchbase.lite:couchbase-lite-android:2.7.1'

(remove "ee" and use the latest version).

Android App : Remove the default entries for flight reservations

Its very tedious to delete the default entries for airports and dates and re-enter. We want to show auto completion of airports as it demos querying of local database.
Also, once we fix the case where the return dates are optional, it does not make much sense to have default return dates

Cleanup of Vagrant install guide

During workshop, quite a few folks were a bit confused with the vagrant install guide
Specifically the statement

  • "If you're not running this on the day of Couchbase Connect, or don't want to take advantage of the pre-supplied files and instead let them get downloaded automatically, skip the rest of this section and move on to Spin Up & Install: Couchbase Server"

    • Remove references to Couchbase Connect
    • Clarify what "pre-supplied" files refer to. There will be no "pre-supplied" or USB sticks going forward. Please upload relevant stuff to GitHub and update the instructions accordingly
    • What is meant by "downloaded automatically". Specifically what do you mean by "automatically"
  • "If you're running through this workshop on the day at Couchbase Connect Silicon Valley, "

    • Remove all references to Couchbase Connect in the guide and make the instructions generic
  • Clarify the use of "connect_sv.box" . Basically , update the content so that we assume that users will download installers from GitHub

CC @JFlath

Java: Implement Flight Search

Tasks:

  • flight model
  • implement flight search by origin, destination, and date
  • flight list screen
  • book the selected flights

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.