Add a first draft for community-edit-form

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@51078 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
sofia.baltzi 2018-03-07 13:16:38 +00:00
parent b7cb9d221d
commit cca564c3ba
4 changed files with 46 additions and 19 deletions

View File

@ -29,7 +29,6 @@ import { PageContentFormComponent } from "./pages/helpcontent/page-help-content-
import { EditPageHelpContentComponent } from "./pages/helpcontent/edit-page-help-content.component";
import { CommunitiesComponent } from './pages/community/communities.component';
import { CommunityFormComponent } from './pages/community/community-form.component';
import { CommunityEditFormComponent } from './pages/community/community-edit-form/community-edit-form.component';
import { EntitiesComponent } from "./pages/entity/entities.component";
import { EntityFormComponent } from "./pages/entity/entity-form.component";
import { DivIdsComponent } from "./pages/divId/divIds.component";
@ -46,12 +45,14 @@ import {Meta} from './openaireLibrary/sharedComponents/metaService';
import {BottomModule} from './openaireLibrary/sharedComponents/bottom.module';
import {FeedbackModule} from './openaireLibrary/sharedComponents/feedback/feedback.module';
import {CommunityEditFormModule} from './pages/community/community-edit-form/community-edit-form.module';
import {FreeGuard} from './openaireLibrary/login/freeGuard.guard';
import { AdminLoginGuard} from './openaireLibrary/login/adminLoginGuard.guard';
import { ConnectAdminLoginGuard} from './openaireLibrary/login/connectAdminLoginGuard.guard';
import { EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
import{ClaimsAdminModule} from './openaireLibrary/claims/claimsAdmin/claimsAdmin.module';
import {ClaimsAdminModule} from './openaireLibrary/claims/claimsAdmin/claimsAdmin.module';
import {StatsComponent} from "./pages/stats/stats.component";
//, , ErrorModule CookieLawModule
@NgModule({
@ -67,7 +68,8 @@ import {StatsComponent} from "./pages/stats/stats.component";
ReactiveFormsModule,
// JWBootstrapSwitchModule,
CKEditorModule,
BottomModule, FeedbackModule, NavigationBarModule, CookieLawModule, ClaimsAdminModule
BottomModule, FeedbackModule, NavigationBarModule, CookieLawModule, ClaimsAdminModule,
CommunityEditFormModule,
// , CookieLawModule, ErrorModule
],
declarations: [
@ -87,7 +89,6 @@ import {StatsComponent} from "./pages/stats/stats.component";
EditPageHelpContentComponent,
CommunitiesComponent,
CommunityFormComponent,
CommunityEditFormComponent,
EntitiesComponent,
EntityFormComponent,
DivIdsComponent,

View File

@ -1,14 +1,12 @@
<div id="community-edit-form " class="uk-container">
<div class="entity-title uk-article-title">Edit your community</div>
<div>
<div class="entity-title uk-article-title">Edit your community</div>
<div *ngIf="communityId != null" >
<div>
<p> Name: <input placeholder="OpenAIRE" type="text" class="uk-input uk-width-medium"/> </p>
<p> Short Name: <input placeholder="shortName" type="text" class="uk-input uk-width-medium"/> </p>
<p> Description: <input placeholder="description" type="text" class="uk-input uk-width-medium"/> </p>
<p> Logo Url: <input placeholder="logoUrl" type="text" class="uk-input uk-width-medium"/></p>
</div>
<progress id="js-progressbar" class="uk-progress" value="0" max="100" hidden></progress>
</div>
<progress id="js-progressbar" class="uk-progress" value="0" max="100" hidden></progress>
</div>
</div>

View File

@ -1,6 +1,10 @@
import {Component, OnInit, Input} from '@angular/core';
import {FormGroup, FormArray, FormBuilder, Validators} from "@angular/forms";
import { HelpContentService } from "../../../services/help-content.service";
import {Component, OnInit, Input} from '@angular/core';
import {FormGroup, FormArray, FormBuilder, Validators} from "@angular/forms";
import {ActivatedRoute, Router} from '@angular/router';
import {HelpContentService} from "../../../services/help-content.service";
import {CommunityService} from "../../../openaireLibrary/connect/community/community.service";
import {EnvProperties} from '../../../openaireLibrary/utils/properties/env-properties';
@Component({
selector: 'community-edit-form',
@ -16,11 +20,35 @@ export class CommunityEditFormComponent implements OnInit{
public res=[];
constructor(public _fb: FormBuilder, private _helpContentService: HelpContentService){}
params: any;
public communityId = null;
public community = null;
public properties:EnvProperties = null;
constructor (private route: ActivatedRoute,
private _router: Router,
public _fb: FormBuilder,
private _helpContentService: HelpContentService,
private _communityService: CommunityService){ }
ngOnInit(){
ngOnInit() {
this.route.data .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.route.queryParams.subscribe(
communityId => {
this.communityId = communityId['communityId'];
if (this.communityId != null) {
this._communityService.getCommunity(this.properties.communityAPI+this.communityId).subscribe (
community => {
this.community = community;
this.params = {community: encodeURIComponent('"'+community.queryId+'"')};
console.log(community);
});
}
});
});
}
public get form() {

View File

@ -57,7 +57,7 @@
"adminToolsAPIURL" :"http://duffy.di.uoa.gr:8080/uoa-admin-tools/",
"adminToolsCommunity" :"openaire",
"communityAPI": "https://dev-openaire.d4science.org/openaire/community/",
"csvLimit": 2000,
"pagingLimit": 20,
"resultsPerPage": 10,