Skip to content

Commit

Permalink
#3327: added further components, implemented ways of translation
Browse files Browse the repository at this point in the history
  • Loading branch information
moellerth committed May 3, 2024
1 parent 0fcd9fe commit f20569e
Show file tree
Hide file tree
Showing 26 changed files with 576 additions and 89 deletions.
54 changes: 54 additions & 0 deletions mdm-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion mdm-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"start": "ng serve --proxy-config proxy.conf.json",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
"test": "ng test",
"i18n:extract": "ng extract-i18n --output-path='src/locale' --format=json"
},
"private": true,
"dependencies": {
Expand All @@ -22,6 +23,8 @@
"@angular/router": "^16.1.5",
"@angular/upgrade": "^16.1.5",
"@citation-js/plugin-doi": "0.5.4",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"angular": "1.8.2",
"angular-animate": "1.8.2",
"angular-aria": "1.8.2",
Expand Down
6 changes: 5 additions & 1 deletion mdm-frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, Inject } from '@angular/core';

@Component({
selector: 'app-root',
Expand All @@ -7,4 +7,8 @@ import { Component } from '@angular/core';
})
export class AppComponent {
title = 'mdm-frontend';
localesList = [
{ code: 'en', label: 'English' },
{ code: 'de', label: 'Deutsch' }
];
}
23 changes: 22 additions & 1 deletion mdm-frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,28 @@ import { DataacquisitionprojectmanagementModule } from './dataacquisitionproject
UpgradeModule,
DataacquisitionprojectmanagementModule
],
// providers: [],
providers: [
{
provide: 'CommonDialogsService',
useFactory: ($injector: any) => $injector.get('CommonDialogsService'),
deps: ['$injector']
},
{
provide: 'SearchDao',
useFactory: ($injector: any) => $injector.get('SearchDao'),
deps: ['$injector']
},
{
provide: 'ProjectSaveService',
useFactory: ($injector: any) => $injector.get('ProjectSaveService'),
deps: ['$injector']
},
{
provide: 'CurrentProjectService',
useFactory: ($injector: any) => $injector.get('CurrentProjectService'),
deps: ['$injector']
}
],
// bootstrap: [AppComponent]
})
export class AppModule implements DoBootstrap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class AssigneeStatusBadgeComponent implements OnInit {
publishersAssigned = false;

ngOnInit(): void {
if(this.assigneeGroup && this.assigneeGroup === "PUBLISHERS") {
if(this.assigneeGroup && this.assigneeGroup === "PUBLISHER") {
this.publishersAssigned = true;
} else {
this.publishersAssigned = false;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface ProjectRequirements {

export interface ProjectPartState {
publisherReady: boolean;
dataproviderReady: boolean;
dataProviderReady: boolean;
}

export interface Release {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injector, NgModule } from '@angular/core';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DataacquisitionprojectSearchService } from './dataacquisitionproject.search.service';
import { UpgradeModule } from '@angular/upgrade/static';
Expand All @@ -15,6 +15,10 @@ import { HttpClientModule } from '@angular/common/http';
import { ReleaseStatusBadgeComponent } from './release-status-badge/release-status-badge.component';
import { AssigneeStatusBadgeComponent } from './assignee-status-badge/assignee-status-badge.component';
import { ReleaseButtonComponent } from './release-button/release-button.component';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { StateCardComponent } from './project-cockpit/components/state-card/state-card.component';
import { FormsModule } from '@angular/forms';
import { NgxTranslateModule } from '../translate/translate.module';



Expand All @@ -23,7 +27,8 @@ import { ReleaseButtonComponent } from './release-button/release-button.componen
ProjectCockpitComponent,
ReleaseStatusBadgeComponent,
AssigneeStatusBadgeComponent,
ReleaseButtonComponent
ReleaseButtonComponent,
StateCardComponent
],
imports: [
CommonModule,
Expand All @@ -35,7 +40,10 @@ import { ReleaseButtonComponent } from './release-button/release-button.componen
MatChipsModule,
MatButtonModule,
MatTooltipModule,
HttpClientModule
MatCheckboxModule,
HttpClientModule,
FormsModule,
NgxTranslateModule
],
providers: [
DataacquisitionprojectSearchService,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.state-card {
background-color: white;
box-shadow: 2px 2px 3px #c3c3c3;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<mat-card class="state-card">
<mat-card-header>
<a ui-sref="search({type: searchState})" class="md-headline" layout="row" layout-align="start center">
<!-- Möglichkeit für variable Übersetzungsstrings -->
<!-- <span i18n="@@state-card.card-title">{type, select, dataPackages {Datenpakete} variables {Variablen}}</span> -->
<span>{{'test.title.'+type | translate }} ({{counts}})</span>
</a>
</mat-card-header>
<mat-card-content>
<div style="display: flex; flex-direction: row;">
<mat-checkbox [(ngModel)]="dataProviderReady" (change)="onDataProviderStateChanged($event)" i18n="@@state-card-provider-ready">Datengeber:innen fertig</mat-checkbox>
<mat-checkbox [(ngModel)]="publisherReady" i18n="@@state-card-publisher-ready">Publisher fertig</mat-checkbox>
</div>
</mat-card-content>
<mat-card-actions style="display: flex; flex-direction: row; justify-content: end;">
<button mat-raised-button disabled i18n="@@state-card-delete-btn">
Löschen
</button>
<button mat-raised-button disabled i18n="@@state-card-edit-btn">
Bearbeiten
</button>
</mat-card-actions>
</mat-card>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { StateCardComponent } from './state-card.component';

describe('StateCardComponent', () => {
let component: StateCardComponent;
let fixture: ComponentFixture<StateCardComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [StateCardComponent]
});
fixture = TestBed.createComponent(StateCardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading

0 comments on commit f20569e

Please sign in to comment.