Compare commits
11 Commits
f6f6f0924e
...
jothi-patc
| Author | SHA1 | Date | |
|---|---|---|---|
| 9a7b42dea5 | |||
| 0ce59ebe22 | |||
|
|
053c07bcfb | ||
| c032cdc58d | |||
|
|
b09ed3481a | ||
| 4074374614 | |||
|
|
c2d840d772 | ||
| 15712c44b6 | |||
|
|
119262405c | ||
| 99f7450e5e | |||
|
|
84748c5e3d |
23
.github/workflows/gemini-pr-review.yaml
vendored
23
.github/workflows/gemini-pr-review.yaml
vendored
@@ -5,15 +5,20 @@ name: Gemini PR Review
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
review:
|
||||
gemini-pr-review:
|
||||
runs-on: ubuntu-latest
|
||||
name: Gemini PR Review
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0 # This fetches the full history
|
||||
|
||||
@@ -22,7 +27,6 @@ jobs:
|
||||
with:
|
||||
node-version: '24'
|
||||
|
||||
|
||||
- name: Get npm cache directory
|
||||
id: npm-cache-dir
|
||||
run: |
|
||||
@@ -36,8 +40,14 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-npm-global-
|
||||
|
||||
# - name: Install Gemini CLI globally
|
||||
# run: npm install -g --loglevel=http @google/gemini-cli
|
||||
- name: Install Gemini CLI globally (if not already installed)
|
||||
run: |
|
||||
if ! command -v gemini &> /dev/null; then
|
||||
echo "Gemini CLI not found, installing..."
|
||||
npm install -g --loglevel=http @google/gemini-cli
|
||||
else
|
||||
echo "Gemini CLI already installed."
|
||||
fi
|
||||
|
||||
- name: Generate git diff and review with Gemini
|
||||
id: review
|
||||
@@ -52,7 +62,6 @@ jobs:
|
||||
|
||||
cat /tmp/gemini-client-error*.json || true
|
||||
|
||||
|
||||
- name: Post output to PR comment
|
||||
id: post_comment
|
||||
run: |
|
||||
|
||||
@@ -454,6 +454,22 @@ class InvoiceInTransitResource extends Resource
|
||||
return;
|
||||
}
|
||||
|
||||
$mandatoryColumns = 23;
|
||||
|
||||
$firstRow = $rows[0] ?? [];
|
||||
|
||||
if (count($firstRow) < $mandatoryColumns) {
|
||||
|
||||
Notification::make()
|
||||
->title('Invalid Excel Format')
|
||||
->body('Few columns not found. Columns A to W are mandatory.')
|
||||
->danger()
|
||||
->persistent()
|
||||
->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($rows as $index => $row)
|
||||
{
|
||||
if ($index == 0) {
|
||||
|
||||
@@ -30,6 +30,19 @@ class TestingTempResource extends Resource
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('name')
|
||||
->label('File Name'),
|
||||
Forms\Components\Select::make('selected_file')
|
||||
->label('Select Uploaded File')
|
||||
->options(function () {
|
||||
return collect(Storage::disk('local')->files('uploads'))
|
||||
->mapWithKeys(function ($file) {
|
||||
return [
|
||||
$file => basename($file), // value => label
|
||||
];
|
||||
})
|
||||
->toArray();
|
||||
})
|
||||
->searchable()
|
||||
->reactive(),
|
||||
Forms\Components\FileUpload::make('attachment')
|
||||
->label('Upload')
|
||||
// ->acceptedFileTypes(['application/pdf'])
|
||||
@@ -41,6 +54,7 @@ class TestingTempResource extends Resource
|
||||
Forms\Components\Actions::make([
|
||||
Action::make('uploadNow')
|
||||
->label('File Upload')
|
||||
->color('success')
|
||||
->action(function ($get) {
|
||||
|
||||
$uploadedFiles = $get('attachment');
|
||||
@@ -76,41 +90,94 @@ class TestingTempResource extends Resource
|
||||
}
|
||||
}),
|
||||
|
||||
// Action::make('downloadAttachment')
|
||||
// ->label('Download File')
|
||||
// ->action(function ($get) {
|
||||
|
||||
// $fileName = basename($get('selected_file'));
|
||||
|
||||
// //dd($fileName);
|
||||
|
||||
// // if (!$fileName) {
|
||||
// // Notification::make()
|
||||
// // ->title('Enter file name to download')
|
||||
// // ->danger()
|
||||
// // ->send();
|
||||
// // return;
|
||||
// // }
|
||||
|
||||
// $files = Storage::disk('local')->files('uploads');
|
||||
|
||||
// foreach ($files as $file) {
|
||||
|
||||
// if (pathinfo($file, PATHINFO_FILENAME) === $fileName) {
|
||||
// dd($fileName);
|
||||
// Notification::make()
|
||||
// ->title("File downloaded successfully")
|
||||
// ->success()
|
||||
// ->send();
|
||||
|
||||
// return response()->download(
|
||||
// Storage::disk('local')->path($file)
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Notification::make()
|
||||
// // ->title('File not found')
|
||||
// // ->danger()
|
||||
// // ->send();
|
||||
// }),
|
||||
Action::make('downloadAttachment')
|
||||
->label('Download File')
|
||||
->action(function ($get) {
|
||||
|
||||
$fileName = $get('name');
|
||||
$filePath = $get('selected_file'); // uploads/filename.pdf
|
||||
|
||||
if (!$fileName) {
|
||||
if (!$filePath || !Storage::disk('local')->exists($filePath)) {
|
||||
Notification::make()
|
||||
->title('Enter file name to download')
|
||||
->title('File not found')
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$files = Storage::disk('local')->files('uploads');
|
||||
Notification::make()
|
||||
->title('File downloaded successfully')
|
||||
->success()
|
||||
->send();
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (pathinfo($file, PATHINFO_FILENAME) === $fileName) {
|
||||
return response()->download(
|
||||
Storage::disk('local')->path($filePath)
|
||||
);
|
||||
}),
|
||||
|
||||
Action::make('deleteAttachment')
|
||||
->label('Delete File')
|
||||
->color('danger')
|
||||
->requiresConfirmation()
|
||||
->action(function ($get) {
|
||||
|
||||
$filePath = $get('selected_file'); // uploads/filename.pdf
|
||||
|
||||
if (!$filePath || !Storage::disk('local')->exists($filePath)) {
|
||||
Notification::make()
|
||||
->title("File downloaded successfully")
|
||||
->success()
|
||||
->title('File not found')
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
return response()->download(
|
||||
Storage::disk('local')->path($file)
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Notification::make()
|
||||
->title('File not found')
|
||||
->danger()
|
||||
->send();
|
||||
}),
|
||||
Storage::disk('local')->delete($filePath);
|
||||
|
||||
Notification::make()
|
||||
->title('File deleted successfully')
|
||||
->success()
|
||||
->send();
|
||||
}),
|
||||
|
||||
]),
|
||||
Forms\Components\Hidden::make('created_by')
|
||||
->label('Created By')
|
||||
|
||||
Reference in New Issue
Block a user