This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit ba821f59 authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Package updates, Compile Fixes in typescript

parent 21943aed
Branches
2 merge requests!91Bringing JHipster7.6.0 to production,!88Integrating Update to JHipster 7.6.0 back to Development
Showing
with 5369 additions and 29044 deletions
This diff is collapsed.
{
"name": "gitsearch",
"version": "0.0.1-SNAPSHOT",
"description": "Description for gitsearch",
"version": "1.1.0",
"description": "Sharing Plattform",
"private": true,
"license": "UNLICENSED",
"cacheDirectories": [
"node_modules"
],
"dependencies": {
"@angular/animations": "^10.2.5",
"@angular/common": "10.0.0",
"@angular/compiler": "10.0.0",
"@angular/core": "10.0.0",
"@angular/core": "^10.2.5",
"@angular/forms": "10.0.0",
"@angular/localize": "10.0.0",
"@angular/localize": "^10.0.0",
"@angular/platform-browser": "10.0.0",
"@angular/platform-browser-dynamic": "10.0.0",
"@angular/router": "10.0.0",
"@fortawesome/angular-fontawesome": "0.6.1",
"@fortawesome/fontawesome-svg-core": "1.2.29",
"@fortawesome/fontawesome-common-types": "^0.2.35",
"@fortawesome/fontawesome-free": "^5.15.3",
"@fortawesome/fontawesome-svg-core": "^1.2.29",
"@fortawesome/free-regular-svg-icons": "^5.15.3",
"@fortawesome/free-solid-svg-icons": "5.13.1",
"@fortawesome/free-regular-svg-icons": "5.15.3",
"@ng-bootstrap/ng-bootstrap": "6.1.0",
"@ng-select/ng-select": "5.1.0",
"@ng-bootstrap/ng-bootstrap": "^7.0.0",
"@ng-select/ng-select": "^4.0.4",
"@ngx-translate/core": "12.1.2",
"@ngx-translate/http-loader": "5.0.0",
"angular-tag-cloud-module": "5.3.0",
"bootstrap": "4.5.0",
"lodash": "4.17.21",
"angular-tag-cloud-module": "^5.3.0",
"anymatch": "^3.1.2",
"bootstrap": "^4.6.0",
"jquery": "^3.6.0",
"lodash": "^4.17.21",
"moment": "2.27.0",
"ng-jhipster": "0.15.0",
"ngx-chips": "3.0.0",
"ngx-cookie-service": "3.0.4",
"ng-jhipster": "^0.16.0",
"ngx-cookie-service": "^3.1.3",
"ngx-infinite-scroll": "9.0.0",
"ngx-markdown": "10.1.1",
"ngx-markdown": "^10.1.1",
"ngx-webstorage": "5.0.0",
"prismjs": "^1.20.0",
"rxjs": "6.5.5",
"swagger-ui-dist": "3.25.1",
"ts-color-class": "0.10.1",
"ts-color-class": "^0.10.1",
"tslib": "2.0.0",
"zone.js": "0.10.3"
},
"devDependencies": {
"@angular/cli": "10.0.0",
"@angular/cli": "^13.0.3",
"@angular/compiler-cli": "10.0.0",
"@nativescript/schematics": "^11.2.0",
"@ngqp/core": "^1.2.0",
"@ngtools/webpack": "10.0.0",
"@openapitools/openapi-generator-cli": "1.0.13-4.3.1",
......@@ -51,13 +57,14 @@
"@types/jest": "26.0.3",
"@types/lodash": "^4.14.170",
"@types/mocha": "7.0.2",
"@types/node": "13.13.4",
"@types/node": "^13.13.52",
"@types/prismjs": "^1.16.5",
"@types/selenium-webdriver": "4.0.9",
"@typescript-eslint/eslint-plugin": "2.30.0",
"@typescript-eslint/eslint-plugin-tslint": "2.30.0",
"@typescript-eslint/parser": "2.30.0",
"autoprefixer": "9.8.4",
"browser-sync": "2.26.7",
"browser-sync": "^2.26.13",
"browser-sync-webpack-plugin": "2.2.2",
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
......@@ -71,7 +78,7 @@
"eslint-loader": "4.0.2",
"file-loader": "6.0.0",
"friendly-errors-webpack-plugin": "1.7.0",
"generator-jhipster": "6.10.5",
"generator-jhipster": "^6.10.5",
"html-loader": "1.1.0",
"html-webpack-plugin": "4.3.0",
"husky": "4.2.5",
......@@ -83,17 +90,18 @@
"lint-staged": "8.2.1",
"merge-jsons-webpack-plugin": "1.0.21",
"mini-css-extract-plugin": "0.9.0",
"mocha": "8.0.1",
"mocha": "^8.4.0",
"moment-locales-webpack-plugin": "1.2.0",
"optimize-css-assets-webpack-plugin": "5.0.3",
"postcss-loader": "3.0.0",
"prettier": "2.1.2",
"prettier": "2.0.5",
"protractor": "7.0.0",
"rimraf": "3.0.2",
"sass": "1.26.9",
"sass-loader": "8.0.2",
"simple-progress-webpack-plugin": "1.1.2",
"style-loader": "1.2.1",
"swagger-ts-generator": "^1.2.11",
"terser-webpack-plugin": "3.0.6",
"thread-loader": "2.1.3",
"to-string-loader": "1.1.6",
......@@ -142,5 +150,8 @@
"jestSonar": {
"reportPath": "target/test-results/jest",
"reportFile": "TESTS-results-sonar.xml"
},
"jest": {
"testResultsProcessor": "jest-sonar-reporter"
}
}
......@@ -43,7 +43,7 @@ export class HealthComponent implements OnInit {
modalRef.componentInstance.health = health;
}
translateKeys(key: string) {
translateKeys(key: string):string {
if (key.startsWith('health.indicator.http')) return key.substr(17);
return this.translateService.instant(key);
}
......
......@@ -243,10 +243,10 @@ export class BookmarkComponent implements OnInit, OnDestroy {
}
}
isSelected(userWatchList: IUserWatchList) {
return (
this.watchlistManager.getCurrentWatchList() && userWatchList.id === this.watchlistManager.getCurrentWatchList()!.userWatchList.id
);
isSelected(userWatchList: IUserWatchList):boolean {
if(this.watchlistManager.getCurrentWatchList())
return userWatchList.id === this.watchlistManager.getCurrentWatchList()!.userWatchList.id
else return false;
}
protected paginateUserWatchLists(data: IUserWatchList[] | null, headers: HttpHeaders): void {
......@@ -262,7 +262,7 @@ export class BookmarkComponent implements OnInit, OnDestroy {
getCommonActions(): PluginActionInfo[] {
const result = lodash
.chain(this.results)
.map(function (ex: Exercise) {
.map(function (ex: Exercise):PluginActionInfo[] {
return ex.originalResult.supportedActions;
})
.flatten()
......@@ -274,14 +274,12 @@ export class BookmarkComponent implements OnInit, OnDestroy {
startAction(action: PluginActionInfo): void {
const selectedExercises = lodash
.chain(this.results)
.map(function (ex: Exercise) {
.map(function (ex: Exercise):SearchResultDTO {
return ex.originalResult;
})
.filter(function (sr: SearchResultDTO) {
return sr.supportedActions.some(function (a: PluginActionInfo) {
return equalPluginActionInfo(a, action);
});
});
.filter((sr: SearchResultDTO) => sr.supportedActions.some(function(a: PluginActionInfo): boolean {
return equalPluginActionInfo(a, action);
}));
const basketInfo: ShoppingBasketInfo = {
plugin: action.plugin,
action: action.action,
......
......@@ -59,13 +59,13 @@ export class PagesMarkDownViewerComponent implements OnInit, OnChanges, OnDestro
}
ngOnDestroy(): void {
ngOnDestroy(): void {
if (this.listenObj) {
this.listenObj();
}
}
private reloadContent() {
private reloadContent():void {
const lang = this.translateService.currentLang;
if (this.path)
this.pagesService.getPage(lang + this.path).subscribe(
......@@ -103,7 +103,7 @@ export class PagesMarkDownViewerComponent implements OnInit, OnChanges, OnDestro
}
public fixLinksToGoViaRouter() {
public fixLinksToGoViaRouter():void {
// because MarkdownComponent isn't 'compiled' the links don't use the angular router,
// so I'll catch the link click events here and pass them to the router...
if (this.pageMarkDown) {
......
......@@ -22,7 +22,7 @@ export class BookmarkInfoComponent {
this.watchlistManager.setCurrentWatchList(watchListName);
}
handleForCurrentWatchlist(exerciseId: string) {
handleForCurrentWatchlist(exerciseId: string): void {
alert(exerciseId);
}
}
......@@ -33,7 +33,7 @@ export class ExerciseCardComponent implements OnInit {
return this.watchlistManager.isExerciseOnCurrentWatchlist(e);
}
handleForCurrentWatchlist(e: Exercise) {
handleForCurrentWatchlist(e: Exercise):void {
this.watchlistManager.handleCheckForCurrentWatchlist(e);
}
......
......@@ -56,7 +56,7 @@ export class ExerciseDetailsComponent implements OnInit, OnDestroy {
return this.watchlistManager.isExerciseOnCurrentWatchlist(e);
}
handleForCurrentWatchlist(e: Exercise) {
handleForCurrentWatchlist(e: Exercise): void {
if (this.watchlistManager.isExerciseOnCurrentWatchlist(e)) {
e.numberOfWatchlistEntries = e.numberOfWatchlistEntries - 1;
} else {
......@@ -85,6 +85,7 @@ export class ExerciseDetailsComponent implements OnInit, OnDestroy {
this.exportProject(this.exercise!.originalResult.exerciseId);
}
// eslint-disable-next-line @typescript-eslint/tslint/config
exportProject(exerciseId: string) {
return this.searchService.exportProject(exerciseId).subscribe(
(response: HttpResponse<Blob>) => {
......
......@@ -37,13 +37,14 @@
</div>
<div class="form-group position-relative">
<label class="form-control-label" jhiTranslate="exercise.metadata.keyword.plural">Keywords</label>
<tag-input [(ngModel)]='exerciseInfo.keyword'
[modelAsStrings]="true"
<!-- <tag-input [(ngModel)]='exerciseInfo.keyword'
[addOnBlur]="true"
theme="bootstrap"
class="tag-input"
name="keywords"
[animationDuration]="{ enter: '200ms', leave: '200ms' }"></tag-input>
-->
<div *ngIf="exerciseInfo.keyword === undefined || exerciseInfo.keyword.length < 1" class="alert alert-danger">
<span jhiTranslate="exercise.validation.minKeywords"></span>
</div>
......@@ -154,6 +155,7 @@
</div>
<div class="form-group position-relative">
<label class="form-control-label" jhiTranslate="exercise.metadata.programmingLanguage.plural">Programming languages</label>
<!--
<tag-input [(ngModel)]='exerciseInfo.programmingLanguage'
[addOnBlur]="true"
[modelAsStrings]="true"
......@@ -161,6 +163,7 @@
class="tag-input"
name="Programming Languages"
[animationDuration]="{ enter: '200ms', leave: '200ms' }"></tag-input>
-->
</div>
<div class="form-group">
<label class="form-control-label" jhiTranslate="exercise.metadata.difficulty">Difficulty</label>
......
......@@ -37,7 +37,7 @@ export class ExerciseImportComponent implements OnInit {
private modalService: NgbModal
) {}
ngOnInit() {
ngOnInit(): void {
this.isLoading = true;
this.exerciseToken = this.route.snapshot.params['token'];
if (this.exerciseToken) {
......@@ -75,7 +75,7 @@ export class ExerciseImportComponent implements OnInit {
/**
* Actual import function submitting import form to server
*/
import() {
import(): void {
if (this.exerciseInfo!.difficulty !== null) {
this.exerciseInfo!.difficulty = this.exerciseInfo!.difficulty?.toLowerCase();
}
......@@ -106,6 +106,11 @@ export class ExerciseImportComponent implements OnInit {
/**
* Utility function used to open the Gitlab selector modal
*/
// TODO if you correct the signature below as
// openGitlabPathSelectorModal() : Promise<string>
// some real grave error occurs!
// eslint-disable-next-line @typescript-eslint/tslint/config
openGitlabPathSelectorModal() {
const modalRef = this.modalService.open(GitlabPathSelectorComponent, { size: 'xl', backdrop: 'static' });
return modalRef.result.then(group => {
......@@ -119,7 +124,7 @@ export class ExerciseImportComponent implements OnInit {
* At least one value must be set.
* @return true if invalid and false if valid
*/
hasValidationErrors() {
hasValidationErrors(): boolean {
if (
this.exerciseInfo?.keyword === undefined ||
this.exerciseInfo?.language === undefined ||
......@@ -139,7 +144,7 @@ export class ExerciseImportComponent implements OnInit {
* user's click
* @param difficulty to set
*/
setDifficulty(difficulty: string) {
setDifficulty(difficulty: string): void {
this.exerciseInfo!.difficulty = difficulty;
}
......@@ -147,7 +152,7 @@ export class ExerciseImportComponent implements OnInit {
* Used to add a language to the exercise
* @param language to add
*/
setLanguage(language: string) {
setLanguage(language: string): void {
if (this.exerciseInfo!.language.includes(language)) {
this.exerciseInfo!.language = this.exerciseInfo!.language.filter(lang => lang !== language);
} else {
......@@ -160,7 +165,7 @@ export class ExerciseImportComponent implements OnInit {
* @param person to add
* @param personList to add the given person to (ex. 'creators', 'publishers')
*/
addPerson(person: Person, personList: string) {
addPerson(person: Person, personList: string) : void{
if (this.validatePerson(person) && this.exerciseInfo) {
if (!personList.localeCompare('creator')) {
if (this.exerciseInfo.creator == null) {
......@@ -186,7 +191,7 @@ export class ExerciseImportComponent implements OnInit {
* @param personToRemove to remove
* @param personList to remove the given person from (ex. 'creators', 'publishers')
*/
removePerson(personToRemove: Person, personList: string) {
removePerson(personToRemove: Person, personList: string): void {
if (!personList.localeCompare('creator')) {
this.exerciseInfo!.creator = this.exerciseInfo!.creator.filter(person => person !== personToRemove);
} else if (!personList.localeCompare('publisher')) {
......@@ -200,7 +205,7 @@ export class ExerciseImportComponent implements OnInit {
* @param person to check
* @private
*/
private validatePerson(person: Person) {
private validatePerson(person: Person): boolean {
if (person.name === undefined || person.affiliation === undefined || person.email === undefined) {
return false;
}
......@@ -214,7 +219,7 @@ export class ExerciseImportComponent implements OnInit {
* Utility function used to turn words into title case
* @param word the word to turn into title case
*/
private toTitleCase(word: string) {
private toTitleCase(word: string): string {
return word[0].toUpperCase() + word.substr(1).toLowerCase();
}
......@@ -223,7 +228,7 @@ export class ExerciseImportComponent implements OnInit {
* the same as the imported exercise
* @param difficulty to check
*/
isDifficulty(difficulty: string) {
isDifficulty(difficulty: string): boolean {
if (this.exerciseInfo!.difficulty !== undefined) {
return this.exerciseInfo!.difficulty.toLowerCase() === difficulty.toLowerCase();
} else {
......@@ -236,21 +241,21 @@ export class ExerciseImportComponent implements OnInit {
* in the imported exercsie
* @param language
*/
isLanguage(language: string) {
isLanguage(language: string): boolean {
return this.exerciseInfo!.language !== undefined && this.exerciseInfo!.language.includes(language);
}
/**
* Used to validate language input
*/
isLanguageSet() {
isLanguageSet(): boolean {
return this.exerciseInfo!.language !== undefined && this.exerciseInfo!.language.length > 0;
}
/**
* Checks if at least one person is set for the given list of persons
*/
isPersonSet(personList: Person[]) {
isPersonSet(personList: Person[]): boolean {
return personList !== undefined && personList.length > 0;
}
}
......@@ -6,10 +6,10 @@ import { ExerciseImportComponent } from 'app/exercise/import/exercise-import.com
import { EXERCISE_IMPORT_ROUTE } from 'app/exercise/import/exercise-import.route';
import { GitlabModule } from 'app/shared/gitlab/gitlab.module';
import { GitsearchSharedModule } from 'app/shared/shared.module';
import { TagInputModule } from 'ngx-chips';
// import { TagInputModule } from 'ngx-chips';
@NgModule({
imports: [RouterModule.forChild(EXERCISE_IMPORT_ROUTE), GitsearchSharedModule, ExerciseModule, TagInputModule, GitlabModule, FormsModule],
imports: [RouterModule.forChild(EXERCISE_IMPORT_ROUTE), GitsearchSharedModule, ExerciseModule, /* TagInputModule, */ GitlabModule, FormsModule],
declarations: [ExerciseImportComponent],
exports: [ExerciseImportComponent],
})
......
......@@ -46,7 +46,7 @@ export class MarkDownViewerComponent implements OnInit, OnDestroy {
// this.readMeVisibleEvent.subscribe(e => this.loadVisible())
}
ngOnDestroy() {
ngOnDestroy(): void {
// needed if child gets re-created (eg on some model changes)
// note that subsequent subscriptions on the same subject will fail
// so the parent has to re-create parentSubject on changes
......
......@@ -88,7 +88,7 @@ export class ExerciseService {
* Submits an ArtemisExerciseInfo object to server and triggers its import
* @param exerciseInfo to submit and import
*/
public submitExerciseInfoForImport(exerciseInfo: ArtemisExerciseInfo, exerciseToken: string, gitlabGroupId: number) {
public submitExerciseInfoForImport(exerciseInfo: ArtemisExerciseInfo, exerciseToken: string, gitlabGroupId: number): Observable<ArtemisExerciseInfo> {
return this.http.post<ArtemisExerciseInfo>(`${this.exerciseUrl}import-exercise/${exerciseToken}/${gitlabGroupId}`, exerciseInfo);
}
}
......@@ -99,7 +99,7 @@ export class NavbarComponent implements OnInit {
return this.accountService.isAuthenticated();
}
toggleEditable(event: { target: { checked: any } }) {
toggleEditable(event: { target: { checked: any } }):void {
if (event.target.checked) {
this.contentEditable = true;
} else {
......
......@@ -39,7 +39,7 @@ export class GitlabPathSelectorComponent implements OnInit {
* Utility function used to retrieve the upper groups in the
* hierarchy
*/
getParentGroups() {
getParentGroups():GitlabGroup[]|undefined {
return this.groups?.filter(group => !group.parentId);
}
......@@ -48,11 +48,11 @@ export class GitlabPathSelectorComponent implements OnInit {
* a given group
* @param group to search for subGroups
*/
getSubGroupsOfGroup(group: GitlabGroup) {
getSubGroupsOfGroup(group: GitlabGroup):GitlabGroup[]|undefined {
return this.groups?.filter(subGroup => subGroup.parentId === group.id);
}
closeModal(group: GitlabGroup | undefined) {
closeModal(group: GitlabGroup | undefined):void {
this.activeModal.close(group);
}
}
......@@ -13,7 +13,7 @@ export interface SearchResultDTO {
downloads: number;
}
export function getPathOfExerciseId(exerciseId: string) {
export function getPathOfExerciseId(exerciseId: string):string {
if (exerciseId) {
const colonPos = exerciseId.indexOf(':"');
if (colonPos >= 0) return exerciseId.slice(colonPos + 1);
......@@ -27,6 +27,6 @@ export interface PluginActionInfo {
commandName: string;
}
export function equalPluginActionInfo(a: PluginActionInfo, b: PluginActionInfo) {
export function equalPluginActionInfo(a: PluginActionInfo, b: PluginActionInfo):boolean {
return a.action === b.action && a.commandName === b.commandName && a.plugin === b.plugin;
}
......@@ -93,7 +93,7 @@ export class WatchlistManager implements OnInit, OnDestroy {
return false;
}
private loadCurrentWatchList(wl: IUserWatchList) {
private loadCurrentWatchList(wl: IUserWatchList): void {
this.watchListEntryService.getWatchListContent(wl.id!).subscribe((wles: HttpResponse<IWatchListEntry[]>) => {
this.currentWatchlist = {
userWatchList: wl,
......@@ -110,7 +110,7 @@ export class WatchlistManager implements OnInit, OnDestroy {
return this.currentWatchlist;
}
public handleCheckForCurrentWatchlist(e: Exercise) {
public handleCheckForCurrentWatchlist(e: Exercise): void {
if (this.currentWatchlist) {
if (!this.isExerciseOnCurrentWatchlist(e)) {
// add
......
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment