Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Mismatch Finder to Production #884

Merged
merged 84 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
0422da1
Localisation updates from https://translatewiki.net. (#722)
translatewiki Nov 1, 2023
292f0f5
Update vue and peers (#758)
itamargiv Nov 10, 2023
7c30131
Merge pull request #749 from wmde/main
itamargiv Nov 10, 2023
855f55b
Replace wikit button with codex button (#764)
guergana Nov 16, 2023
29ea3da
Update deps (#766)
chukarave Nov 20, 2023
3ab8c30
Update php deps (#768)
chukarave Nov 20, 2023
dcdcb6d
update chore docs after Vue3 upgrade (#767)
chukarave Nov 20, 2023
79279ca
Replace wikit Message by Codex Message component (#769)
guergana Nov 20, 2023
29d0c16
Localisation updates from https://translatewiki.net. (#748)
translatewiki Nov 21, 2023
18292a8
Bump browserify-sign from 4.2.1 to 4.2.2 (#750)
dependabot[bot] Nov 21, 2023
0024625
Bump sass from 1.69.0 to 1.69.5 (#737)
dependabot[bot] Nov 21, 2023
39fd4bc
Bump actions/setup-node from 3.8.1 to 4.0.0 (#747)
dependabot[bot] Nov 21, 2023
75a1cea
Bump eslint-plugin-vue from 9.17.0 to 9.18.1 (#745)
dependabot[bot] Nov 21, 2023
94647d7
Bump actions/checkout from 3 to 4 (#746)
dependabot[bot] Nov 21, 2023
9eb617f
Migrate to codex checkbox (#770)
hasanakg Nov 22, 2023
769fe8d
Remove CSS not allowing CdxMessage to wrap in small screens (#774)
guergana Nov 22, 2023
d26e04f
Fix cdx-dialog styling and remove old wikit-dialog styles (#776)
hasanakg Nov 24, 2023
5dcac4a
Fix cdx-select width problems below 462px viewport width (#775)
hasanakg Nov 27, 2023
04d72e0
Create Vue 3 version of the custom LanguageSelector component (#773)
hasanakg Nov 28, 2023
b607309
Replace WikitLink component with Codex styles (#772)
chukarave Dec 5, 2023
94fe907
Replace results progress bar with codex component (#790)
chukarave Dec 19, 2023
f88bb49
Replace Wikit Textarea with Codex Textarea component (#771)
guergana Dec 19, 2023
0e8c231
Localisation updates from https://translatewiki.net. (#777)
translatewiki Dec 21, 2023
d947a2a
Localisation updates from https://translatewiki.net. (#797)
translatewiki Dec 21, 2023
59d2fdc
Use composition Api in Error.vue Page (#795)
guergana Dec 21, 2023
03163fe
Remove Playground Page (#796)
guergana Dec 22, 2023
3358e75
Refactor Home page to Vue3 (#798)
guergana Dec 22, 2023
10d21c4
Updates December 2023 (#799)
itamargiv Dec 28, 2023
a4b91a8
Localisation updates from https://translatewiki.net. (#801)
translatewiki Dec 28, 2023
25c0a6f
Rewrite Layout Page using Vue3 syntax (#802)
guergana Dec 28, 2023
df9d939
Fix indentation in Home Page (#803)
guergana Dec 28, 2023
cc921b0
Improve links (#793)
chukarave Jan 5, 2024
960988d
Rewrite WikidataToolFooter in Vue3 script setup syntax (#824)
guergana Jan 8, 2024
19b8919
Rewrite LoadingOverlay in Vue3 script setup syntax (#825)
guergana Jan 8, 2024
6d3adc8
Rewrite AuthWidget in Vue3 script setup syntax (#827)
guergana Jan 8, 2024
f7cfcc0
Rewrite Results Page in Vue 3 syntax (#805)
guergana Jan 8, 2024
2be5ad5
Rewrite MismatchesTable with Vue3 syntax (#828)
guergana Jan 9, 2024
7d21f2c
Rewrite MismatchRow in Vue3 script setup syntax (#826)
guergana Jan 9, 2024
b56cac2
Add type null to User type to remove warnings (#829)
guergana Jan 10, 2024
fcdb533
Update composer laravel-socialite-mediawiki/ package (#834)
chukarave Jan 12, 2024
13b47c7
Fix design errors (#831)
guergana Jan 16, 2024
89e0a47
Reassign css to proper div to remove white space below footer (#832)
guergana Jan 16, 2024
c1d3478
Replace all wikit variables in app.scss and _typography.scss (#792)
chukarave Jan 17, 2024
608f30a
Improve links (#830)
chukarave Jan 17, 2024
fe33887
Create a reusable custom variables file and use it for mismatch finde…
chukarave Jan 17, 2024
5fbf186
Replace tokens in pages (#800)
chukarave Jan 17, 2024
e5d930e
Replace tokens in remaining components (#823)
chukarave Jan 18, 2024
9da2f8b
Find a way around icon - text misalignment issue in codex buttons (#837)
chukarave Jan 22, 2024
866d77b
Fix :visited:hover color for auth widget links (#838)
chukarave Jan 22, 2024
f3e0159
fix focus border outline for the store download button (#839)
chukarave Jan 24, 2024
94a3606
Update linting rules to Vue3 (#836)
guergana Jan 24, 2024
9e5e804
Add stylelint to project (#841)
guergana Jan 24, 2024
0aeca69
Adapt layout to codex's grid system (#849)
chukarave Jan 26, 2024
3128abb
Bump eslint from 8.54.0 to 8.56.0 (#807)
dependabot[bot] Jan 29, 2024
237afa3
Bump @types/jest from 29.5.10 to 29.5.11 (#810)
dependabot[bot] Jan 29, 2024
beb067e
Bump typescript from 5.3.2 to 5.3.3 (#814)
dependabot[bot] Jan 29, 2024
6e045e7
Bump actions/upload-artifact from 3 to 4 (#821)
dependabot[bot] Jan 29, 2024
72ee5f7
Bump actions/setup-node from 4.0.0 to 4.0.1 (#822)
dependabot[bot] Jan 29, 2024
977002b
Bump sass-loader from 13.3.2 to 14.0.0 (#844)
dependabot[bot] Jan 29, 2024
de25b0b
Bump @vue/runtime-dom from 3.3.9 to 3.4.15 (#845)
dependabot[bot] Jan 29, 2024
e5eedae
Bump @vue/compiler-sfc from 3.3.8 to 3.4.15 (#851)
dependabot[bot] Jan 29, 2024
0147146
Bump axios from 1.6.2 to 1.6.7 (#852)
dependabot[bot] Jan 29, 2024
08a27ec
Bump date-fns from 2.30.0 to 3.3.1 (#853)
dependabot[bot] Jan 29, 2024
30055e5
Bump @typescript-eslint/eslint-plugin from 6.13.1 to 6.20.0 (#854)
dependabot[bot] Jan 29, 2024
d56f426
Bump @typescript-eslint/parser from 6.13.1 to 6.20.0 (#855)
dependabot[bot] Jan 29, 2024
ed3129a
Port the table component from Wikit back to the Mismatch Finder (#850)
chukarave Jan 30, 2024
518cf68
Chore: Upgrade eslint-plugin-vue (#860)
guergana Jan 30, 2024
9f8e1b9
Chore: Update sass
guergana Jan 30, 2024
f823038
Chores: update ts-loader (#863)
guergana Jan 30, 2024
7c2325d
add max-width for store unintentionally removed (#861)
chukarave Jan 31, 2024
bf617dd
Add overwritten button text span items (#864)
chukarave Jan 31, 2024
7ccb748
Remove Wikit MenuItem import (#865)
guergana Feb 5, 2024
21df5e6
Remove compat build (#875)
hasanakg Feb 5, 2024
ac6c4b7
Bump eslint-plugin-vue from 9.20.1 to 9.21.1 (#867)
dependabot[bot] Feb 5, 2024
4142e85
Bump sass-loader from 14.0.0 to 14.1.0 (#868)
dependabot[bot] Feb 5, 2024
ee4caff
Bump @vue/test-utils from 2.4.3 to 2.4.4 (#869)
dependabot[bot] Feb 5, 2024
114bb03
Add last layout and grid improvements (#874)
chukarave Feb 6, 2024
a905c86
Bump stylelint from 16.2.0 to 16.2.1 (#870)
dependabot[bot] Feb 6, 2024
820eb19
Bump @wikimedia/language-data from 1.1.5 to 1.1.6 (#871)
dependabot[bot] Feb 6, 2024
58a269c
Bump @types/jest from 29.5.11 to 29.5.12 (#872)
dependabot[bot] Feb 6, 2024
4b2b39c
Don't show outline on logo (#877)
chukarave Feb 6, 2024
c182673
Remove Wikit Leftovers (#879)
chukarave Feb 12, 2024
2c4e64b
remove link to broken tool (#878)
chukarave Feb 12, 2024
cb98549
Ignore already reviewed mismatches on reupload (#880)
guergana Feb 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ module.exports = {
extends: [
'eslint:recommended',
'@vue/typescript/recommended',
'plugin:vue/essential',
'plugin:vue/vue3-strongly-recommended',
],
parser: 'vue-eslint-parser',
rules: {
'max-len': [ 'error', 120 ],
'no-multiple-empty-lines' : ['error', { 'max': 1 }],
'vue/multi-word-component-names' : [ 'off' ]
},
},
};
2 changes: 1 addition & 1 deletion .github/workflows/deploy-app-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v4.0.1
with:
node-version: '18.x'
- name: Install composer dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v4.0.1
with:
node-version: '18.x'
- name: Install composer dependencies
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v4.0.1
with:
node-version: '18.x'

- name: Install Dependencies
run: npm ci

- name: Run ESLint
- name: Run ESlint and Stylelint
run: npm run lint

- name: Run i18 Validation
run: npm run i18n:validate

2 changes: 1 addition & 1 deletion .github/workflows/schedule-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: development
- name: Branch out Release
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v4.0.1
with:
node-version: '18.x'

Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
php-version: '7.3'

- name: Setup Node.js
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v4.0.1
with:
node-version: '18.x'

Expand Down Expand Up @@ -110,21 +110,21 @@ jobs:

- name: Upload Laravel Logs
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: logs
path: ./storage/logs

- name: Upload Screenshots
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: screenshots
path: tests/Browser/screenshots

- name: Upload Console Logs
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: console
path: tests/Browser/console
9 changes: 9 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"rules": {
"selector-class-pattern": [null]
},
"extends": [
"stylelint-config-standard-scss",
"stylelint-config-recommended-vue/scss"
]
}
4 changes: 2 additions & 2 deletions app/Http/Controllers/ResultsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public function index(MismatchGetRequest $request, WikibaseAPIClient $wikidata):
$props = array_merge(
[
'user' => $user,
'item_ids' => $requestedItemIds,
'itemIds' => $requestedItemIds,
// Use wikidata to fetch labels for found entity ids
'labels' => $wikidata->getLabels($entityIds, $lang),
'formatted_values' => $formattedTimeValues,
'formattedValues' => $formattedTimeValues,
],
// only add 'results' prop if mismatches have been found
$mismatches->isNotEmpty() ? [ 'results' => $mismatches->groupBy('item_id') ] : []
Expand Down
83 changes: 75 additions & 8 deletions app/Jobs/ImportCSV.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,58 @@ public function handle(CSVImportReader $reader)
$filepath = Storage::disk('local')
->path('mismatch-files/' . $this->meta->filename);

DB::transaction(function () use ($reader, $filepath) {
$reader->lines($filepath)->each(function ($mismatchLine) {
$mismatch = Mismatch::make($mismatchLine);
if ($mismatch->type == null) {
$mismatch->type = 'statement';
$mismatch_attrs = (new Mismatch())->getFillable();

DB::transaction(function () use ($reader, $filepath, $mismatch_attrs) {
$new_mismatches = [];
$where_clauses = [];

$mismatches_per_upload_user = DB::table('mismatches')
->select($mismatch_attrs)
->join('import_meta', 'mismatches.import_id', '=', 'import_meta.id')
->where('import_meta.user_id', '=', $this->meta->user->id);

$reader->lines($filepath)->each(function ($mismatchLine) use (
&$new_mismatches,
&$where_clauses
) {

$new_mismatch = $this->createMismatch($mismatchLine);
$new_mismatches[] = $new_mismatch;
$where_clause = [['review_status', '!=', 'pending']];
foreach ($new_mismatch->getAttributes() as $key => $attribute) {
if ($key == 'review_status') {
continue;
}
$where_clause[] = [$key, $attribute];
}
$where_clauses[] = $where_clause;
});

$mismatches_per_upload_user->where(function ($query) use ($where_clauses) {
foreach ($where_clauses as $where_clause) {
$query->orWhere(function ($query) use ($where_clause) {
$query->where($where_clause);
});
}
$mismatch->importMeta()->associate($this->meta);
$mismatch->save();
});

$existing_mismatches = $mismatches_per_upload_user->get();

foreach ($new_mismatches as $new_mismatch) {
if ($existing_mismatches->doesntContain(function ($value) use ($new_mismatch) {
$metaAttrs = $new_mismatch->getAttributes();
foreach ($metaAttrs as $attrKey => $attr) {
if ($attrKey != 'review_status' && $value->{$attrKey} != $attr) {
return false;
}
}
return true;
})) {
$this->saveMismatch($new_mismatch);
}
}

$this->meta->status = 'completed';
$this->meta->save();
});
Expand All @@ -64,7 +106,7 @@ public function handle(CSVImportReader $reader)
/**
* Handle a job failure.
*
* @param \Throwable $exception
* @param \Throwable $exception
* @return void
*/
public function failed(Throwable $exception)
Expand All @@ -78,4 +120,29 @@ public function failed(Throwable $exception)
$this->meta->status = 'failed';
$this->meta->save();
}


private function createMismatch($mismatch_data)
{
$new_mismatch = Mismatch::make($mismatch_data);

if ($new_mismatch->type == null) {
$new_mismatch->type = 'statement';
}

return $new_mismatch;
}

/**
* Save mismatch to database
*
* @param \Mismatch $new_mismatch
* @return void
*/
private function saveMismatch($new_mismatch)
{
// if review_status == pending -> save
$new_mismatch->importMeta()->associate($this->meta);
$new_mismatch->save();
}
}
8 changes: 0 additions & 8 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\App;

class RouteServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -49,13 +48,6 @@ public function boot()
->namespace($this->namespace)
->group(base_path('routes/auth.php'));

if (App::environment('local')) {
Route::prefix('dev')
->middleware('web')
->namespace($this->namespace)
->group(base_path('routes/dev.php'));
}

Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
Expand Down
12 changes: 9 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.2.0",
"guzzlehttp/guzzle": "^7.8",
"inertiajs/inertia-laravel": "^0.6.10",
"kevinrob/guzzle-cache-middleware": "^4.1.2",
"inertiajs/inertia-laravel": "^0.6.11",
"kevinrob/guzzle-cache-middleware": "^5.1.0",
"laravel/framework": "^8.83.26",
"laravel/sanctum": "^2.15.1",
"laravel/socialite": "^5.9",
"laravel/tinker": "^2.8",
"taavi/laravel-socialite-mediawiki": "^1.4"
"taavi/laravel-socialite-mediawiki": "dev-main"
},
"require-dev": {
"facade/ignition": "^2.17.7",
Expand Down Expand Up @@ -72,6 +72,12 @@
"php": "7.3"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/wmde/laravel-socialite-mediawiki"
}
],
"minimum-stability": "dev",
"prefer-stable": true
}
Loading