Skip to content

Commit a46de71

Browse files
author
Philipp Tessenow
authored
[#36204] Add new GitHub plugin tab enabling users to copy git actions (opf#9027)
* Let GitHub integration show changes in a separate tab * added new github integration icons to icon font * add tab content: working tab-header and copy-menu * modernise github_integrations ruby code * refactored some code to be more modern ruby (if wrote most of it 7 years ago and couldn't look at some parts without squinting too much) * make some intended-to-be-private module methods actually private * fixed all rubocop errors in the /modules/github_integration * re-organized tests a little * gave our rubocop.yml some RSpec-related defaults -- happy to discuss these, but I think we can live with these as a good starting point 👆 all without actually (intentionally) changing the behaviour * removed dead angular template code * codeclimate found more things than rubocop :) * removed create-pr-button since we decided against implementing that feature * added missing translations * properly cache the github related part of the wp api * lower case pull requests in translations * fix specs
1 parent ebbe5ec commit a46de71

File tree

49 files changed

+2175
-1047
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2175
-1047
lines changed

.rubocop.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ AllCops:
77
Exclude:
88
- db/schema.rb
99

10+
11+
Gemspec/RequiredRubyVersion:
12+
Exclude:
13+
- modules/**/*.gemspec
14+
15+
1016
Layout/ConditionPosition:
1117
Enabled: false
1218

@@ -282,5 +288,12 @@ Style/HashTransformKeys:
282288
Style/HashTransformValues:
283289
Enabled: true
284290

285-
Rspec/MultipleMemoizedHelpers:
291+
292+
RSpec/MultipleMemoizedHelpers:
293+
Max: 15
294+
295+
RSpec/MultipleExpectations:
286296
Max: 15
297+
298+
RSpec/ExampleLength:
299+
Max: 25

docker/ci/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if [ "$1" == "setup-tests" ]; then
5151
done
5252

5353
execute "time bundle install -j$JOBS"
54-
execute "TEST_ENV_NUMBER=0 time bundle exec rake db:create db:migrate db:schema:dump webdrivers:chromedriver:update webdrivers:geckodriver:update"
54+
execute "TEST_ENV_NUMBER=0 time bundle exec rake db:create db:migrate db:schema:dump webdrivers:chromedriver:update webdrivers:geckodriver:update openproject:plugins:register_frontend"
5555
execute "time bundle exec rake parallel:create parallel:load_schema"
5656
fi
5757

frontend/angular.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"builder": "@angular-devkit/build-angular:dev-server",
8989
"options": {
9090
"browserTarget": "OpenProject:build",
91-
"proxyConfig": "cli_to_rails_proxy.js",
91+
"proxyConfig": "cli_to_rails_proxy.js"
9292
},
9393
"configurations": {
9494
"production": {
@@ -105,6 +105,7 @@
105105
"test": {
106106
"builder": "@angular-devkit/build-angular:karma",
107107
"options": {
108+
"preserveSymlinks": true,
108109
"main": "src/test.ts",
109110
"karmaConfig": "./karma.conf.js",
110111
"tsConfig": "src/tsconfig.spec.json",
@@ -124,7 +125,8 @@
124125
"lintFilePatterns": [
125126
"src/**/*.ts",
126127
"src/**/*.html"
127-
]
128+
],
129+
"preserveSymlinks": true
128130
}
129131
}
130132
}

frontend/doc/TESTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ OpenProject is a hybrid application with most parts being Rails, along with some
1111

1212

1313

14-
The Angular frontend services and components can be tested with frontend specs. A good isolated example on how to set up an Angular TestBed to test components is `frontend/src/app/modules/a11y/accessible-by-keyboard.component.spec.ts`
14+
The Angular frontend services and components can be tested with frontend specs. A good isolated example on how to set up an Angular TestBed to test components is `frontend/src/app/modules/a11y/accessible-by-keyboard.component.spec.ts`
1515

1616

1717

frontend/npm-shrinkwrap.json

Lines changed: 98 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"chart.js": "2.9.3",
7878
"chartjs-plugin-datalabels": "^0.6.0",
7979
"codemirror": "^5.48.4",
80+
"copy-text-to-clipboard": "^3.0.0",
8081
"core-js": "^3.2.1",
8182
"crossvent": "^1.5.4",
8283
"dom-autoscroller": "^2.2.8",
@@ -106,6 +107,7 @@
106107
"rxjs": "^6.6.6",
107108
"screenfull": "^4.2.1",
108109
"tablesorter": "^2.31.3",
110+
"tickety-tick-formatter": "github:bitcrowd/tickety-tick-formatter",
109111
"typedjson": "^1.5.1",
110112
"typescript": "~4.1.2",
111113
"urijs": "^1.19.2",

frontend/src/app/components/datetime/timezone.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('TimezoneService', function () {
5959
]
6060
});
6161

62-
timezoneService = TestBed.get(TimezoneService);
62+
timezoneService = TestBed.inject(TimezoneService);
6363
};
6464

6565
describe('without time zone set', function () {

frontend/src/app/components/op-context-menu/op-context-menu-handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ export abstract class OpContextMenuHandler extends UntilDestroyedMixin {
1818
* Called when the service closes this context menu
1919
*/
2020
public onClose() {
21-
this.afterFocusOn.focus();
21+
this.afterFocusOn.trigger('focus');
2222
}
2323

2424
public onOpen(menu:JQuery) {
25-
menu.find('.menu-item').first().focus();
25+
menu.find('.menu-item').first().trigger('focus');
2626
}
2727

2828
/**

frontend/src/app/components/wp-edit-form/work-package-filter-values.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe('WorkPackageFilterValues', () => {
9797
]
9898
}).compileComponents();
9999

100-
injector = TestBed.get(Injector);
100+
injector = TestBed.inject(Injector);
101101
halResourceService = injector.get(HalResourceService);
102102

103103
resource = halResourceService.createHalResourceOfClass(WorkPackageResource, source, true);

frontend/src/app/modules/bim/bcf/api/bcf-api.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('BcfApiService', function () {
4343
})
4444
.compileComponents()
4545
.then(() => {
46-
service = TestBed.get(BcfApiService);
46+
service = TestBed.inject(BcfApiService);
4747
});
4848
}));
4949

0 commit comments

Comments
 (0)