Listing Css Link colore

Fix Text Area  Peace Holder
Default Value Requierd
Finalize Button On Dmp Fix
Fix Nav Button Colors
This commit is contained in:
Diamantis Tziotzios 2019-02-08 11:04:12 +02:00
parent 0039da7c3c
commit 5fa776bb39
15 changed files with 75 additions and 32 deletions

View File

@ -29,7 +29,7 @@ public class TextAreaData extends FieldData<TextAreaData> {
@Override @Override
public TextAreaData fromXml(Element item) { public TextAreaData fromXml(Element item) {
item.setAttribute("label", this.getLabel()); this.setLabel(item.getAttribute("label"));
return this; return this;
} }
} }

View File

@ -1,4 +1,4 @@
<div *ngFor="let item of items | limitTo:urlLimit"> <div *ngFor="let item of items | limitTo:urlLimit">
<a (click)="navigate(item.url)">{{item.label}}</a> <a class="url-listing-item" (click)="navigate(item.url)">{{item.label}}</a>
</div> </div>
<a *ngIf="this.items.length > this.urlLimit" (click)="navigate(items[0].all)">{{'URL-LISTING-COMPONENT.SHOW-MORE'|translate}}</a> <a class="url-listing-item" *ngIf="this.items.length > this.urlLimit" (click)="navigate(items[0].all)">{{'URL-LISTING-COMPONENT.SHOW-MORE'|translate}}</a>

View File

@ -0,0 +1,8 @@
.url-listing-item:hover {
color: #0056b3 !important;
text-decoration: underline !important;
}
.url-listing-item {
color: #007bff !important;
}

View File

@ -4,7 +4,8 @@ import { UrlListingItem } from "./url-listing-item";
@Component({ @Component({
selector: 'app-url-listing', selector: 'app-url-listing',
templateUrl: './url-listing.component.html' templateUrl: './url-listing.component.html',
styleUrls: ['./url-listing.component.scss']
}) })
export class UrlListingComponent { export class UrlListingComponent {

View File

@ -24,7 +24,7 @@ export class PageEditorModel extends BaseFormModel {
buildForm(): FormGroup { buildForm(): FormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
title: [this.title, [Validators.required]], title: [this.title, [Validators.required]],
id: [this.id, [Validators.required,Validators.pattern('^[^<_>]+$')]], id: [this.id, [Validators.required]],
ordinal: [this.ordinal] ordinal: [this.ordinal]
}); });
return formGroup; return formGroup;

View File

@ -26,15 +26,17 @@
<!-- Default Value --> <!-- Default Value -->
<app-component-profile-editor-default-value-component *ngIf="form.get('viewStyle').get('renderStyle').value" class="col" <app-component-profile-editor-default-value-component *ngIf="form.get('viewStyle').get('renderStyle').value" class="col"
[viewStyle]="form.get('viewStyle').get('renderStyle').value" [form]="this.form.get('defaultValue').get('value')" [viewStyle]="form.get('viewStyle').get('renderStyle').value" [form]="this.form.get('defaultValue').get('value')"
[formArrayOptions]="this.form.get('data')?.get('options')" [comboBoxType]="this.form.get('data')?.get('type')?.value" [formArrayOptions]="form.get('data')?.get('options')" [comboBoxType]="this.form.get('data')?.get('type')?.value"
placeHolder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.DEFAULT-VALUE' | translate}}" required="false"></app-component-profile-editor-default-value-component> placeHolder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.DEFAULT-VALUE' | translate}}" [required]="defaulValueRequired(form.get('viewStyle').get('renderStyle').value)"></app-component-profile-editor-default-value-component>
<mat-form-field class="col">
<mat-form-field class="col" *ngIf="!(defaulValueRequired(form.get('viewStyle').get('renderStyle').value))">
<mat-select placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.VALIDATION' | translate}}" [formControl]="this.form.get('validations')" <mat-select placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.VALIDATION' | translate}}" [formControl]="this.form.get('validations')"
multiple> multiple>
<mat-option [value]="validationTypeEnum.Required">{{enumUtils.toDatasetProfileFieldValidationTypeString(validationTypeEnum.Required)}}</mat-option> <mat-option [value]="validationTypeEnum.Required">{{enumUtils.toDatasetProfileFieldValidationTypeString(validationTypeEnum.Required)}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="row" [ngSwitch]="form.get('viewStyle').get('renderStyle').value"> <div class="row" [ngSwitch]="form.get('viewStyle').get('renderStyle').value">
<app-dataset-profile-editor-combo-box-field-component *ngSwitchCase="viewStyleEnum.ComboBox" class="col-12" [form]="form"></app-dataset-profile-editor-combo-box-field-component> <app-dataset-profile-editor-combo-box-field-component *ngSwitchCase="viewStyleEnum.ComboBox" class="col-12" [form]="form"></app-dataset-profile-editor-combo-box-field-component>

View File

@ -28,6 +28,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
viewStyleEnum = DatasetProfileFieldViewStyle; viewStyleEnum = DatasetProfileFieldViewStyle;
isFieldMultiplicityEnabled = false; isFieldMultiplicityEnabled = false;
constructor( constructor(
public enumUtils: EnumUtils public enumUtils: EnumUtils
) { super(); } ) { super(); }
@ -70,6 +71,23 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
}); });
} }
defaulValueRequired(viewStile: DatasetProfileFieldViewStyle): boolean {
switch (viewStile) {
case DatasetProfileFieldViewStyle.CheckBox:
return true;
case DatasetProfileFieldViewStyle.RadioBox:
case DatasetProfileFieldViewStyle.TextArea:
case DatasetProfileFieldViewStyle.FreeText:
case DatasetProfileFieldViewStyle.ComboBox:
case DatasetProfileFieldViewStyle.BooleanDecision:
return false;
default:
return false;
}
}
onIsFieldMultiplicityEnabledChange(isFieldMultiplicityEnabled: boolean) { onIsFieldMultiplicityEnabledChange(isFieldMultiplicityEnabled: boolean) {
if (!isFieldMultiplicityEnabled) { if (!isFieldMultiplicityEnabled) {
(<FormControl>this.form.get('multiplicity').get('min')).setValue(0); (<FormControl>this.form.get('multiplicity').get('min')).setValue(0);

View File

@ -4,8 +4,8 @@
<mat-form-field class="col"> <mat-form-field class="col">
<input matInput type="text" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.PAGES.PAGE-INPUT-TITLE' | translate}}" <input matInput type="text" placeholder="{{'DATASET-PROFILE-EDITOR.STEPS.PAGES.PAGE-INPUT-TITLE' | translate}}"
[formControl]="pageControl.get('title')" required> [formControl]="pageControl.get('title')" required>
</mat-form-field>
<mat-error *ngIf="pageControl.get('title').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="pageControl.get('title').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
<button mat-icon-button type="button" class="col-auto" (click)="removePage(i)"> <button mat-icon-button type="button" class="col-auto" (click)="removePage(i)">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>

View File

@ -16,6 +16,8 @@ import { DmpListingComponent } from './listing/dmp-listing.component';
import { DmpWizardComponent } from './wizard/dmp-wizard.component'; import { DmpWizardComponent } from './wizard/dmp-wizard.component';
import { DmpWizardEditorComponent } from './wizard/editor/dmp-wizard-editor.component'; import { DmpWizardEditorComponent } from './wizard/editor/dmp-wizard-editor.component';
import { DmpWizardDatasetListingComponent } from './wizard/listing/dmp-wizard-dataset-listing.component'; import { DmpWizardDatasetListingComponent } from './wizard/listing/dmp-wizard-dataset-listing.component';
import { UserDialogComponent } from '../misc/navigation/user-dialog/user-dialog.component';
import { DmpFinalizeDialogComponent } from './editor/dmp-finalize-dialog/dmp-finalize-dialog.component';
@NgModule({ @NgModule({
imports: [ imports: [
@ -42,12 +44,14 @@ import { DmpWizardDatasetListingComponent } from './wizard/listing/dmp-wizard-da
// DynamicFieldsProjectComponent, // DynamicFieldsProjectComponent,
// DynamicFieldProjectComponent, // DynamicFieldProjectComponent,
// DMPFinaliseDialogComponent // DMPFinaliseDialogComponent
DmpFinalizeDialogComponent
], ],
entryComponents: [ entryComponents: [
DmpInvitationDialogComponent, DmpInvitationDialogComponent,
AddResearcherComponent, AddResearcherComponent,
AvailableProfilesComponent, AvailableProfilesComponent,
// DMPFinaliseDialogComponent // DMPFinaliseDialogComponent
DmpFinalizeDialogComponent
] ]
}) })
export class DmpModule { } export class DmpModule { }

View File

@ -3,7 +3,7 @@
</div> </div>
<div mat-dialog-content *ngIf="datasetsFinalized && datasetsDraft"> <div mat-dialog-content *ngIf="datasetsFinalized && datasetsDraft">
<div *ngIf="datasetsFinalized.length > 0"> <div *ngIf="datasetsFinalized.length > 0">
{{'DMP-FINALISE-DIALOG.ALREADY-FINALISED-DATASETS' | translate}} <h4>{{'DMP-FINALISE-DIALOG.ALREADY-FINALISED-DATASETS' | translate}}</h4>
<mat-list> <mat-list>
<mat-list-item *ngFor="let dataset of datasetsFinalized; let len = length"> <mat-list-item *ngFor="let dataset of datasetsFinalized; let len = length">
<div>{{ dataset.label }}</div> <div>{{ dataset.label }}</div>
@ -11,9 +11,9 @@
</mat-list> </mat-list>
</div> </div>
<div *ngIf="datasetsDraft.length > 0"> <div *ngIf="datasetsDraft.length > 0">
{{'DMP-FINALISE-DIALOG.FINALISE-TITLE' | translate}} <h4>{{'DMP-FINALISE-DIALOG.FINALISE-TITLE' | translate}}</h4>
<mat-selection-list #datasetsDraftSelectionList [formControl]="this.formGroup.get('datasets')"> <mat-selection-list #datasetsDraftSelectionList [formControl]="this.formGroup.get('datasets')">
<mat-list-option *ngFor="let dataset of datasetsDraft; let len = length" [value]='dataset'> <mat-list-option class="styleBorder" *ngFor="let dataset of datasetsDraft; let len = length" [value]='dataset'>
{{ dataset.label }} {{ dataset.label }}
</mat-list-option> </mat-list-option>
</mat-selection-list> </mat-selection-list>
@ -23,7 +23,7 @@
</div> </div>
<div mat-dialog-actions> <div mat-dialog-actions>
<div class="full-width"> <div class="full-width">
<button mat-raised-button type="submit"> <button mat-raised-button color="primary" type="submit">
{{'DMP-FINALISE-DIALOG.SUBMIT' | translate}} {{'DMP-FINALISE-DIALOG.SUBMIT' | translate}}
</button> </button>
</div> </div>

View File

@ -0,0 +1,5 @@
.styleBorder {
border: 1px solid lightgray;
border-radius: 0.5em;
margin-bottom: 0.5em;
}

View File

@ -6,6 +6,7 @@ import { ExploreDatasetListingComponent } from './explore-dataset-listing.compon
import { ExploreDatasetRoutingModule } from './explore-dataset.routing'; import { ExploreDatasetRoutingModule } from './explore-dataset.routing';
import { ExploreDatasetFilterItemComponent } from './filters/explore-dataset-filter-item/explore-dataset-filter-item.component'; import { ExploreDatasetFilterItemComponent } from './filters/explore-dataset-filter-item/explore-dataset-filter-item.component';
import { ExploreDatasetFiltersComponent } from './filters/explore-dataset-filters.component'; import { ExploreDatasetFiltersComponent } from './filters/explore-dataset-filters.component';
import { UserDialogComponent } from '../misc/navigation/user-dialog/user-dialog.component';
@NgModule({ @NgModule({
imports: [ imports: [

View File

@ -7,7 +7,7 @@
<h5 *ngIf="this.form.get('extendedDescription').value && !isChild" class="col-12"><i>{{this.form.get('extendedDescription').value}}</i></h5> <h5 *ngIf="this.form.get('extendedDescription').value && !isChild" class="col-12"><i>{{this.form.get('extendedDescription').value}}</i></h5>
<mat-form-field *ngSwitchCase="datasetProfileFieldViewStyleEnum.FreeText" class="col-12"> <mat-form-field *ngSwitchCase="datasetProfileFieldViewStyleEnum.FreeText" class="col-12">
<input matInput formControlName="value" placeholder="{{form.get('data').value.label}}" [required]="form.get('validationRequired').value"> <input matInput [formControl]="form.get('value')" placeholder="{{form.get('data').value.label}}" [required]="form.get('validationRequired').value">
<mat-error *ngIf="form.get('value')['errors'] && form.get('value')['errors']['required']">{{'GENERAL.VALIDATION.REQUIRED' <mat-error *ngIf="form.get('value')['errors'] && form.get('value')['errors']['required']">{{'GENERAL.VALIDATION.REQUIRED'
| translate}}</mat-error> | translate}}</mat-error>
</mat-form-field> </mat-form-field>
@ -35,8 +35,8 @@
</div> </div>
<mat-form-field *ngSwitchCase="datasetProfileFieldViewStyleEnum.TextArea" class="col-12"> <mat-form-field *ngSwitchCase="datasetProfileFieldViewStyleEnum.TextArea" class="col-12">
<textarea matInput formControlName="value" matTextareaAutosize matAutosizeMinRows="2" matAutosizeMaxRows="10" <textarea matInput [formControl]="form.get('value')" matTextareaAutosize matAutosizeMinRows="2" matAutosizeMaxRows="10"
[required]="form.get('validationRequired').value"></textarea> [required]="form.get('validationRequired').value" placeholder="{{ form.get('data').value.label | translate }}"></textarea>
<button mat-icon-button *ngIf="!form.get('value').disabled && form.get('value').value" matSuffix aria-label="Clear" <button mat-icon-button *ngIf="!form.get('value').disabled && form.get('value').value" matSuffix aria-label="Clear"
(click)="this.form.patchValue({'value': ''})"> (click)="this.form.patchValue({'value': ''})">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
@ -50,6 +50,7 @@
<mat-radio-button class="radio-button-item" name="{{form.get('id').value}}" value="true">Yes</mat-radio-button> <mat-radio-button class="radio-button-item" name="{{form.get('id').value}}" value="true">Yes</mat-radio-button>
<!-- <br> --> <!-- <br> -->
<mat-radio-button class="radio-button-item" name="{{form.get('id').value}}" value="false">No</mat-radio-button> <mat-radio-button class="radio-button-item" name="{{form.get('id').value}}" value="false">No</mat-radio-button>
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-radio-group> </mat-radio-group>
</div> </div>
@ -57,6 +58,7 @@
<mat-radio-group [formControl]="form.get('value')" [required]="form.get('validationRequired').value"> <mat-radio-group [formControl]="form.get('value')" [required]="form.get('validationRequired').value">
<mat-radio-button *ngFor="let option of form.get('data').value.options let index = index" class="radio-button-item" <mat-radio-button *ngFor="let option of form.get('data').value.options let index = index" class="radio-button-item"
[value]="option.value">{{option.label}}</mat-radio-button> [value]="option.value">{{option.label}}</mat-radio-button>
<mat-error *ngIf="form.get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-radio-group> </mat-radio-group>
</div> </div>
</div> </div>

View File

@ -6,24 +6,26 @@
<a mat-button class="buttonNav navbar-button" routerLink="/explore">{{'NAV-BAR.PUBLIC-DATASETS' | translate}}</a> <a mat-button class="buttonNav navbar-button" routerLink="/explore">{{'NAV-BAR.PUBLIC-DATASETS' | translate}}</a>
</div> </div>
<div *ngIf="isAuthenticated()" class="col-auto"> <div *ngIf="isAuthenticated()" class="col-auto">
<a mat-button class="buttonNav navbar-button" routerLink="/projects">{{this.languageResolver.getBy('navbar') | translate}}</a> <a mat-button class="buttonNav navbar-button" routerLink="/projects">{{this.languageResolver.getBy('navbar') |
translate}}</a>
<a mat-button class="buttonNav navbar-button" routerLink="/plans">{{'NAV-BAR.DMPS' | translate}}</a> <a mat-button class="buttonNav navbar-button" routerLink="/plans">{{'NAV-BAR.DMPS' | translate}}</a>
<a mat-button class="buttonNav navbar-button" routerLink="/datasets">{{'NAV-BAR.DATASETS' | translate}}</a> <a mat-button class="buttonNav navbar-button" routerLink="/datasets">{{'NAV-BAR.DATASETS' | translate}}</a>
<a *ngIf="isAdmin()" mat-button class="buttonNav navbar-button" routerLink="/users">{{'NAV-BAR.USERS' | translate}}</a> <a *ngIf="isAdmin()" mat-button class="buttonNav navbar-button" routerLink="/users">{{'NAV-BAR.USERS' | translate}}</a>
<a *ngIf="isAdmin()" mat-button class="buttonNav navbar-button" routerLink="/dmp-profiles">{{'NAV-BAR.DMP-PROFILES' | translate}}</a> <a *ngIf="isAdmin()" mat-button class="buttonNav navbar-button" routerLink="/dmp-profiles">{{'NAV-BAR.DMP-PROFILES' |
<a *ngIf="isAdmin()" mat-button class="buttonNav navbar-button" routerLink="/dataset-profiles">{{'NAV-BAR.DATASETS-ADMIN' | translate}}</a> translate}}</a>
<a *ngIf="isAdmin()" mat-button class="buttonNav navbar-button" routerLink="/dataset-profiles">{{'NAV-BAR.DATASETS-ADMIN'
| translate}}</a>
</div> </div>
<!--<button mat-button class="navbar-button" routerLink="/about">{{'NAV-BAR.ABOUT' | translate}}</button>--> <!--<button mat-button class="navbar-button" routerLink="/about">{{'NAV-BAR.ABOUT' | translate}}</button>-->
<div class="col"></div> <div class="col"></div>
<div *ngIf="search && this.isAuthenticated()" class="col-auto"> <div *ngIf="search && this.isAuthenticated()" class="col-auto">
<mat-form-field floatLabel="never"> <mat-form-field floatLabel="never">
<input type="text" placeholder="{{'DASHBOARD.SEARCH' | translate}}" matInput [formControl]="searchControl" [matAutocomplete]="auto"> <input type="text" placeholder="{{'DASHBOARD.SEARCH' | translate}}" matInput [formControl]="searchControl"
[matAutocomplete]="auto">
<mat-autocomplete autoActiveFirstOption #auto="matAutocomplete" (optionSelected)="onOptionSelected($event)"> <mat-autocomplete autoActiveFirstOption #auto="matAutocomplete" (optionSelected)="onOptionSelected($event)">
<mat-option *ngFor="let option of filteredOptions | async" [value]="option" class="transformation-value-mat-option"> <mat-option *ngFor="let option of filteredOptions | async" [value]="option" class="transformation-value-mat-option">
<span>{{option.label}}</span> <small>{{transformType(option.type)}} : {{option.label}}</small>
<br>
<small>{{transformType(option.type)}}</small>
</mat-option> </mat-option>
</mat-autocomplete> </mat-autocomplete>
</mat-form-field> </mat-form-field>

View File

@ -18,8 +18,8 @@
"SUCCESSFUL-LOGOUT": "Successful Logout", "SUCCESSFUL-LOGOUT": "Successful Logout",
"UNSUCCESSFUL-LOGOUT": "Unsuccessful Logout", "UNSUCCESSFUL-LOGOUT": "Unsuccessful Logout",
"UNSUCCESSFUL-LOGIN": "Unsuccessful Login", "UNSUCCESSFUL-LOGIN": "Unsuccessful Login",
"SUCCESSFUL-DATASET-PROFILE-DELETE":"Successful Delete this Profile", "SUCCESSFUL-DATASET-PROFILE-DELETE":"Successful Delete",
"UNSUCCESSFUL-DATASET-PROFILE-DELETE":"Unsuccessful This Profile can not Delete" "UNSUCCESSFUL-DATASET-PROFILE-DELETE":"This profile can not deleted, because Datasets are associated with it"
}, },
"ERRORS": { "ERRORS": {
"HTTP-REQUEST-ERROR": "An Unexpected Error Has Occured" "HTTP-REQUEST-ERROR": "An Unexpected Error Has Occured"