Skip to content

Commit

Permalink
Merge branch 'openfoodfacts:develop' into contributors_box
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay1821 authored Apr 3, 2022
2 parents 757536f + 53fb69c commit 757e0cc
Show file tree
Hide file tree
Showing 223 changed files with 8,170 additions and 2,399 deletions.
11 changes: 11 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ dependancies:
ios:
- packages/smooth_app/ios/**/*

asset cache:
- packages/smooth_app/assets/cache/**/*

web:
- packages/smooth_app/web/**/*

Expand Down Expand Up @@ -61,6 +64,14 @@ knowledge panels:

robotoff:
- packages/smooth_app/lib/database/robotoff_questions_query.dart
- packages/smooth_app/lib/cards/product_cards/question_card.dart

summary card:
- packages/smooth_app/lib/pages/product/summary_card.dart

analytics:
- packages/smooth_app/lib/pages/onboarding/consent_analytics_page.dart
- packages/smooth_app/assets/onboarding/analytics.svg

goldens:
- packages/smooth_app/test/pages/goldens
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
- name: Version
run: echo ${{ env.RELEASE_VERSION }}

- name: Setup Java jdk
uses: actions/setup-java@v3.0.0
- name: Setup Java JDK
uses: actions/setup-java@v3.1.0
with:
distribution: 'zulu'
java-version: 12.x
java-version: 11

- name: Setup Ruby
uses: ruby/setup-ruby@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ios-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
bundler-cache: true
ruby-version: 3.0.2

- name: Setup Java jdk
uses: actions/setup-java@v3.0.0
- name: Setup Java JDK
uses: actions/setup-java@v3.1.0
with:
distribution: 'zulu'
java-version: "12.x"
java-version: 11

- name: Setup Flutter
uses: subosito/flutter-action@v2
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/merge-conflict-autolabel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
push:
branches:
- develop
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: mschilde/auto-label-merge-conflicts@master
with:
CONFLICT_LABEL_NAME: "merge conflicts"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAX_RETRIES: 5
WAIT_MS: 5000
27 changes: 16 additions & 11 deletions .github/workflows/postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,51 @@ jobs:
- name: "Checkout code"
uses: actions/checkout@v3

# Setup Java
- name: "Setup Java jdk"
uses: actions/setup-java@v3.0.0
- name: Setup Java JDK
uses: actions/setup-java@v3.1.0
with:
distribution: 'zulu'
java-version: '14.x'
java-version: 11

# Setup flutter
- uses: actions/checkout@v3
# Setup flutter
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
cache-key: flutter2.10 #change this to force refresh cache

- run: flutter --version

# Get dependencies.
- name: "Get dependencies"
- name: Get dependencies
run: ci/pub_upgrade.sh

# Check for formatting issues
- name: Check for formatting issues (run "flutter format . ")
run: flutter format --set-exit-if-changed .

# analyze Dart for errors
- name: "Analyze code"
- name: Analyze code
run: flutter analyze --fatal-infos --fatal-warnings .

# Run tests
- name: "Run Tests"
- name: Run Tests with coverage
run: ci/testing.sh

- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
verbose: true

# Build apk.
- name: "Build apk"
- name: Build APK
run: flutter build apk --debug
working-directory: ./packages/smooth_app

# Upload generated apk to the artifacts.
- name: "Upload APK"
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: release-apk
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: SmoothApp Presubmit Tests
name: SmoothApp Pre-Submit Tests

on: pull_request

Expand All @@ -8,32 +8,39 @@ jobs:
defaults:
run:
shell: bash

steps:
- name: "Checkout code"
- name: Checkout code
uses: actions/checkout@v3

# Setup flutter
- uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
cache-key: flutter2.10 #change this to force refresh cache

- run: flutter --version

# Get dependencies.
- name: "Get dependencies"
- name: Get dependencies
run: ci/pub_upgrade.sh

# Check for formatting issues
- name: Check for formatting issues (run "flutter format . ")
run: flutter format --set-exit-if-changed .

# analyze Dart for errors
- name: "Analyze code"
- name: Analyze code
run: flutter analyze --fatal-infos --fatal-warnings .

# Run tests
- name: "Run Tests"
- name: Run Tests with coverage
run: ci/testing.sh

- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
verbose: true

17 changes: 17 additions & 0 deletions .github/workflows/semantic-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Semantic PRs"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion ci/testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [[ "$SHARD" == "test" ]]; then
echo "Running tests."
for file in "$REPO_DIR/packages/"*; do
if [[ -d $file ]]; then
(cd "$file" && flutter test)
(cd "$file" && flutter test --coverage)
fi
done
fi
4 changes: 4 additions & 0 deletions packages/smooth_app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,9 @@
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
</application>
</manifest>
1 change: 1 addition & 0 deletions packages/smooth_app/assets/cache/agriculture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/smooth_app/assets/cache/palm-oil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"setting_name": "Organic farming",
"id": "labels_organic"
}, {
"description_short": "Fair trade products help producers in developping countries.",
"description_short": "Fair trade products help producers in developing countries.",
"icon_url": "https://static.openfoodfacts.org/images/attributes/fair-trade.svg",
"name": "Fair trade",
"description": "When you buy fair trade products, producers in developing countries are paid an higher and fairer price, which helps them improve and sustain higher social and often environmental standards.",
Expand Down
92 changes: 92 additions & 0 deletions packages/smooth_app/assets/onboarding/analytics.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/smooth_app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: e1ffd3daa5042cd516081f94f61b857c0deb822d

COCOAPODS: 1.11.3
COCOAPODS: 1.11.2
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import 'package:flutter/material.dart';
import 'package:openfoodfacts/model/KnowledgePanel.dart';
import 'package:openfoodfacts/model/KnowledgePanels.dart';
import 'package:provider/provider.dart';
import 'package:smooth_app/cards/product_cards/knowledge_panels/knowledge_panel_expanded_card.dart';
import 'package:smooth_app/cards/product_cards/knowledge_panels/knowledge_panel_summary_card.dart';
import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/generic_lib/widgets/smooth_card.dart';
import 'package:smooth_app/helpers/analytics_helper.dart';
import 'package:smooth_app/themes/smooth_theme.dart';
import 'package:smooth_app/themes/theme_provider.dart';

class KnowledgePanelCard extends StatelessWidget {
const KnowledgePanelCard({
Expand All @@ -21,7 +19,6 @@ class KnowledgePanelCard extends StatelessWidget {

@override
Widget build(BuildContext context) {
final ThemeProvider themeProvider = context.watch<ThemeProvider>();
final ThemeData themeData = Theme.of(context);
// If [expanded] = true, render all panel elements (including summary), otherwise just renders panel summary.
if (panel.expanded ?? false) {
Expand All @@ -42,7 +39,7 @@ class KnowledgePanelCard extends StatelessWidget {
builder: (BuildContext context) => Scaffold(
backgroundColor: SmoothTheme.getColor(
themeData.colorScheme,
SmoothTheme.getMaterialColor(themeProvider),
SmoothTheme.getMaterialColor(context),
ColorDestination.SURFACE_BACKGROUND,
),
appBar: AppBar(),
Expand Down
Loading

0 comments on commit 757e0cc

Please sign in to comment.