Browse Source

upgrading the app to use json features@typescript

rohit.gowda 4 years ago
parent
commit
d4e43f21b9
12 changed files with 1414 additions and 345 deletions
  1. 1284 318
      app/package-lock.json
  2. 17 16
      app/package.json
  3. 2 1
      app/src/app/app.component.ts
  4. 12 9
      app/src/pages/home/home.ts
  5. 80 0
      app/src/pages/home/tweet.json
  6. 3 1
      app/tsconfig.json
  7. 5 0
      changes.txt
  8. 10 0
      error solution.txt
  9. 0 0
      home_timeline.json
  10. 1 0
      list.json
  11. 0 0
      show.json
  12. 0 0
      tweet.json

File diff suppressed because it is too large
+ 1284 - 318
app/package-lock.json


+ 17 - 16
app/package.json

@@ -22,38 +22,39 @@
     "@angular/platform-browser": "5.2.11",
     "@angular/platform-browser-dynamic": "5.2.11",
     "@ionic-native/core": "4.8.0",
-    "@ionic-native/photo-viewer": "^4.18.0",
-    "@ionic-native/secure-storage": "^4.18.0",
-    "@ionic-native/social-sharing": "^4.18.0",
+    "@ionic-native/photo-viewer": "^4.20.0",
+    "@ionic-native/secure-storage": "^4.20.0",
+    "@ionic-native/social-sharing": "^4.20.0",
     "@ionic-native/splash-screen": "4.8.0",
     "@ionic-native/status-bar": "4.8.0",
-    "@ionic-native/vibration": "^4.8.0",
+    "@ionic-native/vibration": "^4.20.0",
     "@ionic/storage": "2.1.3",
     "@types/twitter-text": "^2.0.0",
     "com-sarriaroman-photoviewer": "1.1.18",
     "cordova-android": "^7.1.4",
     "cordova-plugin-browsertab": "^0.2.0",
-    "cordova-plugin-buildinfo": "^2.0.2",
+    "cordova-plugin-buildinfo": "^2.0.3",
     "cordova-plugin-compat": "^1.2.0",
-    "cordova-plugin-device": "^2.0.2",
-    "cordova-plugin-inappbrowser": "^3.0.0",
-    "cordova-plugin-ionic-keyboard": "^2.1.3",
+    "cordova-plugin-device": "^2.0.3",
+    "cordova-plugin-inappbrowser": "^3.1.0",
+    "cordova-plugin-ionic-keyboard": "^2.2.0",
     "cordova-plugin-ionic-webview": "^1.2.1",
     "cordova-plugin-secure-storage": "^2.6.8",
-    "cordova-plugin-splashscreen": "^5.0.2",
+    "cordova-plugin-splashscreen": "^5.0.3",
     "cordova-plugin-vibration": "3.1.0",
-    "cordova-plugin-whitelist": "^1.3.3",
+    "cordova-plugin-whitelist": "^1.3.4",
     "cordova-plugin-x-socialsharing": "5.4.3",
     "cordova-support-android-plugin": "^1.0.1",
-    "cordova-support-google-services": "^1.2.1",
+    "cordova-support-google-services": "^1.3.1",
     "cordova-universal-links-plugin": "git+https://github.com/walteram/cordova-universal-links-plugin.git",
     "es6-promise-plugin": "4.2.2",
-    "firebase": "^5.7.1",
+    "firebase": "^5.11.1",
     "gun": "^0.9.9999991",
     "ionic-angular": "3.9.2",
     "ionicons": "3.0.0",
-    "javascript-time-ago": "^1.0.34",
-    "node-rsa": "^1.0.2",
+    "core-js": "3.1.3",
+    "javascript-time-ago": "^1.0.35",
+    "node-rsa": "^1.0.6",
     "rxjs": "5.5.11",
     "sw-toolbox": "3.6.0",
     "twit": "^2.2.11",
@@ -61,8 +62,8 @@
     "zone.js": "0.8.26"
   },
   "devDependencies": {
-    "@ionic/app-scripts": "^3.2.1",
-    "typescript": "~2.6.2"
+    "@ionic/app-scripts": "^3.2.4",
+    "typescript": "^3.6.3"
   },
   "description": "HybridOSN is a Twitter client and a so called Dapp which allows its users to exchange data also via a P2P network using blockchain technology.",
   "cordova": {

+ 2 - 1
app/src/app/app.component.ts

@@ -40,7 +40,7 @@ export class MyApp {
       statusBar.styleDefault();
       splashScreen.hide();
       this.initApp();
-
+      console.log('SUVSCRIBED EVENT RECVD');
       this.events.subscribe("user:login", () => this.setUser());
     });
 
@@ -64,6 +64,7 @@ export class MyApp {
 
   async setUser() {
     const userId = await this.storage.get("userId");
+    console.log('settings the user as:',userId);
     this.user = await this.twitter.fetchUser(userId);
   }
 

+ 12 - 9
app/src/pages/home/home.ts

@@ -34,7 +34,8 @@ export class HomePage {
     const loading = this.loadingCtrl.create();
     // loading.present();
     loading.dismiss();
-
+    // this.tweets = twt;
+    // console.log('tweets are:',twt);
     // this.feed
     //   .loadHomeTimeline()
     //   .then(tweets => (this.tweets = tweets))
@@ -68,7 +69,8 @@ export class HomePage {
   }
 
   get privateTweets() {
-    return this.tweets.filter(tweet => tweet.private_tweet);
+    // return this.tweets.filter(tweet => tweet.private_tweet);
+    return null;
   }
 
   get oldestPublicTweet() {
@@ -84,12 +86,13 @@ export class HomePage {
   }
 
   get oldestPrivateTweet() {
-    if (this.privateTweets.length > 0) {
-      return this.privateTweets.reduce((acc, cur) =>
-        new Date(acc.created_at) < new Date(cur.created_at) ? acc : cur
-      );
-    } else {
-      return undefined;
-    }
+    // if (this.privateTweets.length > 0) {
+    //   return this.privateTweets.reduce((acc, cur) =>
+    //     new Date(acc.created_at) < new Date(cur.created_at) ? acc : cur
+    //   );
+    // } else {
+    //   return undefined;
+    // }
+    return null;
   }
 }

+ 80 - 0
app/src/pages/home/tweet.json

@@ -0,0 +1,80 @@
+{
+  "created_at": "Wed Sep 25 19:54:41 +0000 2019",
+  "id": 1176948153297362947,
+  "id_str": "1176948153297362947",
+  "full_text": "Fgttgf",
+  "truncated": false,
+  "display_text_range": [
+    0,
+    6
+  ],
+  "entities": {
+    "hashtags": [],
+    "symbols": [],
+    "user_mentions": [],
+    "urls": []
+  },
+  "source": "<a href=\"https://www.tk.informatik.tu-darmstadt.de/de/telecooperation-group/\" rel=\"nofollow\">Private Twitter (TU Darmstadt)</a>",
+  "in_reply_to_status_id": null,
+  "in_reply_to_status_id_str": null,
+  "in_reply_to_user_id": null,
+  "in_reply_to_user_id_str": null,
+  "in_reply_to_screen_name": null,
+  "user": {
+    "id": 1176099783947235328,
+    "id_str": "1176099783947235328",
+    "name": "Thesis test",
+    "screen_name": "test_thesis",
+    "location": "",
+    "description": "",
+    "url": null,
+    "entities": {
+      "description": {
+        "urls": []
+      }
+    },
+    "protected": false,
+    "followers_count": 0,
+    "friends_count": 0,
+    "listed_count": 0,
+    "created_at": "Mon Sep 23 11:43:41 +0000 2019",
+    "favourites_count": 0,
+    "utc_offset": null,
+    "time_zone": null,
+    "geo_enabled": false,
+    "verified": false,
+    "statuses_count": 2,
+    "lang": null,
+    "contributors_enabled": false,
+    "is_translator": false,
+    "is_translation_enabled": false,
+    "profile_background_color": "F5F8FA",
+    "profile_background_image_url": null,
+    "profile_background_image_url_https": null,
+    "profile_background_tile": false,
+    "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
+    "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
+    "profile_link_color": "1DA1F2",
+    "profile_sidebar_border_color": "C0DEED",
+    "profile_sidebar_fill_color": "DDEEF6",
+    "profile_text_color": "333333",
+    "profile_use_background_image": true,
+    "has_extended_profile": false,
+    "default_profile": true,
+    "default_profile_image": true,
+    "following": false,
+    "follow_request_sent": false,
+    "notifications": false,
+    "translator_type": "none"
+  },
+  "geo": null,
+  "coordinates": null,
+  "place": null,
+  "contributors": null,
+  "is_quote_status": false,
+  "retweet_count": 0,
+  "favorite_count": 0,
+  "favorited": false,
+  "retweeted": false,
+  "lang": "tl"
+}

+ 3 - 1
app/tsconfig.json

@@ -2,6 +2,8 @@
   "compilerOptions": {
     "allowSyntheticDefaultImports": true,
     "declaration": false,
+    "resolveJsonModule": true,
+    "esModuleInterop": true,
     "emitDecoratorMetadata": true,
     "experimentalDecorators": true,
     "lib": [
@@ -25,4 +27,4 @@
   "atom": {
     "rewriteTsconfig": false
   }
-}
+}

+ 5 - 0
changes.txt

@@ -0,0 +1,5 @@
+Run npm update
+npm config set python /path/to/executable/python2.7
+npm install again
+open cmd as administrator
+npm install --global --production windows-build-tools

+ 10 - 0
error solution.txt

@@ -0,0 +1,10 @@
+ Build failed with an exception.
+
+* What went wrong:
+Execution failed for task ':app:processDebugManifest'.
+> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:CordovaLib] E:\HOSN-app\app\platforms\android\CordovaLib\build\intermediates\manifests\full\debug\AndroidManifest.xml as the library might be using APIs not available in 16
+        Suggestion: use a compatible library with a minSdk of at most 16,
+                or increase this project's minSdk version to at least 19,
+                or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)
+
+E:\hosn-app1\app\platforms\android\cordova-plugin-browsertab

File diff suppressed because it is too large
+ 0 - 0
home_timeline.json


+ 1 - 0
list.json

@@ -0,0 +1 @@
+{"users":[],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0","total_count":null}

File diff suppressed because it is too large
+ 0 - 0
show.json


File diff suppressed because it is too large
+ 0 - 0
tweet.json


Some files were not shown because too many files changed in this diff