-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into eslint-update
- Loading branch information
Showing
122 changed files
with
1,077 additions
and
821 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
plugins: ['@typescript-eslint', 'deprecation'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
}, | ||
rules: { | ||
'deprecation/deprecation': 'error', | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Changed files ESLint check | ||
|
||
on: | ||
workflow_call: | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches-ignore: [staging, production] | ||
paths: ['**.js', '**.ts', '**.tsx', '**.json', '**.mjs', '**.cjs', 'config/.editorconfig', '.watchmanconfig', '.imgbotconfig'] | ||
|
||
concurrency: | ||
group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-changed-lint | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint-changed: | ||
name: Changed files ESLint check | ||
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: ./.github/actions/composite/setupNode | ||
|
||
- name: Run ESLint to check for deprecation warnings | ||
run: | | ||
# This will just fetch the latest commit from main | ||
git fetch origin main --no-tags --depth=1 | ||
# shellcheck disable=SC2046 | ||
npm run lint-changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Prettier check | ||
|
||
on: | ||
workflow_call: | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches-ignore: [staging, production] | ||
paths: ['**.js', '**.ts', '**.tsx', '**.json', '**.mjs', '**.cjs', 'config/.editorconfig', '.watchmanconfig', '.imgbotconfig'] | ||
|
||
concurrency: | ||
group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-prettier | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
prettier: | ||
name: Prettier check | ||
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: ./.github/actions/composite/setupNode | ||
|
||
- name: Verify there's no Prettier diff | ||
run: | | ||
npm run prettier -- --loglevel silent | ||
if ! git diff --name-only --exit-code; then | ||
# shellcheck disable=SC2016 | ||
echo 'Error: Prettier diff detected! Please run `npm run prettier` and commit the changes.' | ||
exit 1 | ||
fi | ||
- name: Run unused style searcher | ||
shell: bash | ||
run: ./.github/scripts/findUnusedKeys.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...oid/app/src/main/java/com/expensify/chat/shortcutManagerModule/ShortcutManagerModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.expensify.chat.shortcutManagerModule; | ||
|
||
import static androidx.core.app.NotificationCompat.CATEGORY_MESSAGE; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.graphics.Bitmap; | ||
import android.net.Uri; | ||
import android.util.Log; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.core.app.Person; | ||
import androidx.core.content.pm.ShortcutInfoCompat; | ||
import androidx.core.content.pm.ShortcutManagerCompat; | ||
import androidx.core.graphics.drawable.IconCompat; | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule; | ||
import com.facebook.react.bridge.ReactMethod; | ||
|
||
import java.util.Collections; | ||
|
||
import com.expensify.chat.customairshipextender.CustomNotificationProvider; | ||
|
||
public class ShortcutManagerModule extends ReactContextBaseJavaModule { | ||
private ReactApplicationContext context; | ||
|
||
public ShortcutManagerModule(ReactApplicationContext context) { | ||
super(context); | ||
this.context = context; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getName() { | ||
return "ShortcutManager"; | ||
} | ||
|
||
@ReactMethod | ||
public void removeAllDynamicShortcuts() { | ||
ShortcutManagerUtils.removeAllDynamicShortcuts(context); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...id/app/src/main/java/com/expensify/chat/shortcutManagerModule/ShortcutManagerPackage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.expensify.chat.shortcutManagerModule; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.facebook.react.ReactPackage; | ||
import com.facebook.react.bridge.NativeModule; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.uimanager.ViewManager; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class ShortcutManagerPackage implements ReactPackage { | ||
|
||
@NonNull | ||
@Override | ||
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) { | ||
List<NativeModule> modules = new ArrayList<>(); | ||
modules.add(new ShortcutManagerModule(reactContext)); | ||
return modules; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
android/app/src/main/java/com/expensify/chat/shortcutManagerModule/ShortcutManagerUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.expensify.chat.shortcutManagerModule; | ||
|
||
import static androidx.core.app.NotificationCompat.CATEGORY_MESSAGE; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.graphics.Bitmap; | ||
import android.net.Uri; | ||
|
||
import androidx.core.app.Person; | ||
import androidx.core.content.pm.ShortcutInfoCompat; | ||
import androidx.core.content.pm.ShortcutManagerCompat; | ||
import androidx.core.graphics.drawable.IconCompat; | ||
|
||
import java.util.Collections; | ||
|
||
public class ShortcutManagerUtils { | ||
public static void removeAllDynamicShortcuts(Context context) { | ||
ShortcutManagerCompat.removeAllDynamicShortcuts(context); | ||
} | ||
|
||
public static void addDynamicShortcut(Context context, long reportID, String name, String accountID, Bitmap personIcon, Person person) { | ||
Intent intent = new Intent(Intent.ACTION_VIEW, | ||
Uri.parse("new-expensify://r/" + reportID)); | ||
|
||
ShortcutInfoCompat shortcutInfo = new ShortcutInfoCompat.Builder(context, accountID) | ||
.setShortLabel(name) | ||
.setLongLabel(name) | ||
.setCategories(Collections.singleton(CATEGORY_MESSAGE)) | ||
.setIntent(intent) | ||
.setLongLived(true) | ||
.setPerson(person) | ||
.setIcon(IconCompat.createWithBitmap(personIcon)) | ||
.build(); | ||
ShortcutManagerCompat.pushDynamicShortcut(context, shortcutInfo); | ||
} | ||
|
||
} |
Oops, something went wrong.