Skip to content

Commit

Permalink
Merge branch 'feature/places'
Browse files Browse the repository at this point in the history
# Conflicts:
#	assets/translations/en.json
#	assets/translations/it.json
#	ios/Podfile.lock
#	package-lock.json
#	package.json
  • Loading branch information
lpezzolla committed Oct 13, 2023
2 parents 751ef8f + f2deeca commit 647b7f8
Show file tree
Hide file tree
Showing 103 changed files with 4,148 additions and 428 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
API_BASE_PATH=https://app.didattica.polito.it/mock/api
MAPBOX_TOKEN=
MAPBOX_TOKEN=
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"rules": {
"react-native/split-platform-components": 2,
"react-native/no-color-literals": 1,
"react-native/no-raw-text": 2,
"react-native/no-raw-text": 0,
"react-native/no-single-element-style-arrays": 2
},
"overrides": [
Expand Down
29 changes: 7 additions & 22 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
outputs:
version: ${{ steps.configure.outputs.version }}
build_no: ${{ steps.configure.outputs.build_no }}
build_piece: ${{ steps.configure.outputs.build_piece }}
push_to_testflight: ${{ steps.configure.outputs.push_to_testflight }}
push_to_playstore: ${{ steps.configure.outputs.push_to_playstore }}
steps:
Expand Down Expand Up @@ -112,12 +111,11 @@ jobs:
BUILD_NO=$(( MAJOR*1000000 + MINOR*10000 + SUBV*100 + BUILD_PIECE ))
echo "build_no=$BUILD_NO" >> $GITHUB_OUTPUT
echo "version=$MAJOR.$MINOR.$SUBV" >> $GITHUB_OUTPUT
echo "build_piece=$BUILD_PIECE" >> $GITHUB_OUTPUT
elif [[ "$VERSION" != "" ]]; then
echo "INVALID VERSION FORMAT: $VERSION"
exit 2
fi
echo "push_to_playstore=$PUSH_PLAYSTORE" >> $GITHUB_OUTPUT
echo "push_to_testflight=$PUSH_TESTFLIGHT" >> $GITHUB_OUTPUT
echo "CONFIGURED:"
Expand All @@ -132,18 +130,7 @@ jobs:
run: printf '@polito:registry=https://npm.pkg.github.com\n//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}\n' > .npmrc
- name: Install npm dependencies
run: npm install
- name: Sentry Release
uses: getsentry/[email protected]
if: steps.configure.outputs.build_no != ''
env:
SENTRY_URL: ${{ vars.SENTRY_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
with:
environment: 'production'
ignore_missing: true
version: it.polito.students@${{ steps.configure.outputs.version }}+${{ steps.configure.outputs.build_piece }}


build-android:
name: ${{ needs.configure.outputs.push_to_playstore == 'false' && 'Build' || 'Build & Deploy' }} Android
Expand All @@ -153,7 +140,6 @@ jobs:
LANG: en_US.UTF-8
CI: 'true'
BUILD_NO: ${{ needs.configure.outputs.build_no }}
BUILD_PIECE: ${{ needs.configure.outputs.build_piece }}
APP_VERSION: ${{ needs.configure.outputs.version }}
SUPPLY_GOOGLE_JSON_PATH: './pc-api-secret.json'
KEYSTORE_PW: ${{ secrets.ANDROID_KEYSTORE_PW }}
Expand All @@ -163,8 +149,10 @@ jobs:
uses: actions/checkout@v3
- name: Set .env
run:
echo "APP_VERSION=${{ needs.configure.outputs.version }}" >> .env
echo "APP_BUILD=${{ needs.configure.outputs.build_piece }}" >> .env
echo "MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }}" >> .env
- name: Set local.properties
run:
echo "MAPBOX_DOWNLOADS_TOKEN=${{ secrets.MAPBOX_TOKEN }}" >> android/local.properties
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Setup Ruby
Expand Down Expand Up @@ -235,7 +223,6 @@ jobs:
LANG: en_US.UTF-8
CI: 'true'
BUILD_NO: ${{ needs.configure.outputs.build_no }}
BUILD_PIECE: ${{ needs.configure.outputs.build_piece }}
APP_VERSION: ${{ needs.configure.outputs.version }}
MATCH_PASSWORD: ${{ secrets.FASTLANE_MATCH_KEY }}
MATCH_GIT_PRIVATE_KEY: "./github_access.pk"
Expand All @@ -253,8 +240,7 @@ jobs:
uses: actions/checkout@v3
- name: Set .env
run:
echo "APP_VERSION=${{ needs.configure.outputs.version }}" >> .env
echo "APP_BUILD=${{ needs.configure.outputs.build_piece }}" >> .env
echo "MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }}" >> .env
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down Expand Up @@ -326,4 +312,3 @@ jobs:
generateReleaseNotes: true
skipIfReleaseExists: true
artifacts: ./android-release/*.apk
tag: v1.4.0
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"bracketSpacing": true,
"endOfLine": "auto",
"semi": true,
"importOrder": ["^react", "^@(?!ui/)(.*)$", "^\\w", "^@ui/(.*)$", "^[./]"],
"importOrder": ["react-native-gesture-handler", "^react", "^@(?!ui/)(.*)$", "^\\w", "^@ui/(.*)$", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
17 changes: 16 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ the [gallium](https://nodejs.org/download/release/v16.16.0/) LTS release).
[Nvm](https://github.com/nvm-sh/nvm) can be used to automatically select the correct version enforced
by [.nvmrc](./.nvmrc), see [Deeper Shell integration](https://github.com/nvm-sh/nvm#deeper-shell-integration).

### Adding a GitHub personal access token to pull from package repositories
### Add a GitHub Personal Access Token

GitHub requires the usage of a personal access token to pull from public registries.

Expand All @@ -31,6 +31,21 @@ Windows) with the following content:
//npm.pkg.github.com/:_authToken=YOUR_TOKEN_HERE
```

### Add a MapBox token

MapBox requires a token in order to install the `@rnmapbox/maps` npm package and pull native dependencies. Create a
MapBox account and [create a new token](https://account.mapbox.com/access-tokens/create) with all the public scopes and
the `DOWNLOADS:READ` scope. Paste the generated token in the following files:

- `.env`
- `android/local.properties`
- a `.netrc` file in your home directory with the following content:
```
machine api.mapbox.com
login mapbox
password <TOKEN HERE>
```

## Project setup

```shell
Expand Down
26 changes: 26 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,42 @@ buildscript {
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
RNMapboxMapsImpl = "mapbox"

// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}

repositories {
google()
mavenCentral()
}

dependencies {
classpath("com.android.tools.build:gradle:7.4.2")
classpath("com.facebook.react:react-native-gradle-plugin")
}
}


def localPropertiesFile = rootProject.file("local.properties")
def localProperties = new Properties()
localProperties.load(new FileInputStream(localPropertiesFile))

allprojects {
repositories {
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = 'mapbox'
// Use the secret token you stored in gradle.properties as the password
password = localProperties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
}
}
}
}
Binary file added assets/map-icons/bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/bed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/bike.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/car.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/classroom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/conference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/door.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/lab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/library.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/medical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/office.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/pin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/post.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/print.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/restaurant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/restroom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/service.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/stairs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/study.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map-icons/water.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 37 additions & 1 deletion assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@
"areYouSure?": "Are you sure?",
"booking": "Booking",
"booking_plural": "Bookings",
"building": "Building",
"cache": "Cache",
"cacheMiss": "Come back online to view",
"camera": "Camera",
"campus": "Campus",
"cancel": "Cancel",
"capacity": "Capacity",
"classroomsNotSpecified": "Classroom not specified",
"cleanCourseFiles": "Remove all course files",
"close": "Close",
Expand Down Expand Up @@ -116,22 +119,28 @@
"unavailable": "Unavailable"
},
"externalLink": "External link. By pressing the link you will be redirected to an external browser",
"facilities": "Facilities",
"file": "File",
"file_plural": "Files",
"floor": "Floor",
"follow": "Follow",
"free": "Free",
"grade": "Grade",
"hours": "Hour",
"icon": "Icon",
"inYourAgenda": "in your agenda",
"it": "Italian",
"language": "Language",
"lecture": "Lecture",
"lecture_plural": "Lectures",
"loading": "Loading",
"logout": "Logout",
"minutes": "Minutes",
"navigate": "Navigate",
"newItems": "New item",
"newItems_plural": "New items",
"noInternet": "You are offline, some features may not be available",
"notFound": "Not found",
"notice": "Notice",
"notice_plural": "Notices",
"notifications": "Notifications",
Expand All @@ -156,6 +165,7 @@
"play": "Play",
"preferences": "Preferences",
"profilePic": "Profile picture",
"recentlyViewed": "Recently viewed",
"refresh": "Refresh",
"remove": "Remove",
"retract": "Retract",
Expand All @@ -169,6 +179,7 @@
"status": "Status",
"stop": "Stop",
"stopFollowing": "Stop following",
"structure": "Structure",
"switchCareerLabel": "Tap to switch career",
"teacher": "Teacher",
"theme": "Theme",
Expand All @@ -179,6 +190,7 @@
"tomorrow": "Tomorrow",
"transcript": "Transcript",
"unnamedFile": "Unnamed file",
"untitled": "Untitled",
"updatedAt": "Updated at",
"upload": "Upload",
"username": "Student ID",
Expand Down Expand Up @@ -337,6 +349,9 @@
"title": "Exam calls",
"total": "There are {{ total }} exam calls"
},
"freeRoomsScreen": {
"title": "Free rooms"
},
"grades": {
"absent": "Abs",
"fail": "Fail",
Expand Down Expand Up @@ -434,8 +449,29 @@
"sentEmail": "Send e-mail",
"totalCourses": "There are {{total}} courses"
},
"placeCategories": {
"classrooms": "Classrooms",
"libraries": "Libraries",
"studyRooms": "Study rooms"
},
"placeScreen": {
"capacity": "{{count}} seat",
"capacity_plural": "{{count}} seats",
"placeNotFound": "Place not found",
"title": "Place"
},
"placesScreen": {
"title": "Places"
"changeFloor": "Change floor",
"goToMyPosition": "Go to my position",
"multipleFloors": "Results are on multiple floors",
"noCategoriesFound": "No categories found",
"noPlacesFound": "No places found",
"searchCategories": "Search categories",
"title": "Places",
"viewWholeCampus": "View the whole campus"
},
"placesSearchScreen": {
"searchPlaceholder": "Try with \"Room 1\""
},
"profileScreen": {
"careerStatus": "Career status:",
Expand Down
Loading

0 comments on commit 647b7f8

Please sign in to comment.