Project

General

Profile

« Previous | Next » 

Revision 60892

[Connect | Trunk]

- Update affiliations layout
- Use customization class to create the css
- Create preview/ demo component
- Clean up piwik helper file
- updates on customization css

View differences:

app.component.ts
36 36
              [showMenu]=showMenu [properties]="properties" [enableSearch]="false"
37 37
              searchRoute="/search/find/research-outcomes"
38 38
              [showHomeMenuItem]="false"></navbar>
39
<!--      <customization *ngIf="properties &&  showMenu && communityId && communityId.length > 0 && layout" [properties]="properties"-->
40
<!--                     [communityId]="communityId" [layout]="layout" ></customization>-->
41
      <customization *ngIf="properties &&  showMenu && communityId && communityId.length > 0" [properties]="properties"
42
                     [communityId]="communityId"  ></customization>
39
      <customization *ngIf="properties &&  showMenu && communityId && communityId.length > 0 && layout" [properties]="properties"
40
                     [communityId]="communityId" [layout]="layout" ></customization>
43 41
      <schema2jsonld *ngIf="properties && showMenu && !community" [URL]="properties.domain + properties.baseLink"
44 42
                     [logoURL]="properties.domain + properties.baseLink+'/assets/common-assets/logo-small-connect.png'"
45 43
                     type="home"
......
139 137
      this.user = user;
140 138
      this.init();
141 139
    }, error => this.init()));
142
/*    this.subscriptions.push(this.route.queryParams.subscribe(params => {
143
      console.log(" params changed!" + params['layout'])
144
      if(params['layout']) {
145
        this.layout = JSON.parse(StringUtils.URIDecode(params['layout']));
146
      }
147
    }));*/
148 140
  }
149 141
  
150 142
  get isManager() {
......
168 160
  initAdminToolCommunity(communityId) {
169 161
    if (communityId) {
170 162
      this.properties.adminToolsPortalType = "community";
171
      // this.initLayout(communityId);
163
      this.initLayout(communityId);
172 164
    }
173 165
    this.configurationService.initCommunityInformation(this.properties, (communityId) ? communityId : this.properties.adminToolsPortalType);
174 166
  }
175 167
  initLayout(communityId){
176
    if(!this.layout) {
168
    if(!this.layout && this.properties.environment == "development") {
177 169
      this._layoutService.getLayout(this.properties, communityId).subscribe(
178 170
        layout => {
179
          console.debug(layout);
180

  
181 171
          if (layout) {
182
            console.debug("service");
183
            this.layout = layout.layoutOptions;
172
            this.layout = CustomizationOptions.checkForObsoleteVersion(layout.layoutOptions,this.communityId);
184 173
          } else {
185 174
            this.layout = new CustomizationOptions(CustomizationOptions.getIdentity(communityId).mainColor, CustomizationOptions.getIdentity(communityId).secondaryColor);
186
            console.debug("default");
187 175
          }
188 176

  
189 177
        },
190 178
        error => {
191
          console.log(" Layout not found - use default");
192 179
          this.layout = new CustomizationOptions(CustomizationOptions.getIdentity(communityId).mainColor, CustomizationOptions.getIdentity(communityId).secondaryColor);
193
          console.debug("error  - default");
194

  
195 180
        }
196 181
      );
182
    }else{
183
      this.layout = new CustomizationOptions(CustomizationOptions.getIdentity(communityId).mainColor, CustomizationOptions.getIdentity(communityId).secondaryColor);
197 184
    }
198 185
  }
199 186
  public buildMenu(communityId: string) {

Also available in: Unified diff