[plugins-functionality | DONE | CHANGED ] update plan values

This commit is contained in:
argirok 2024-05-09 10:23:42 +03:00
parent b0df5c0f31
commit 2bfd744ab8
6 changed files with 11 additions and 7 deletions

View File

@ -102,6 +102,7 @@ export class CommunityService {
community.claim = resData.claim;
community.membership = resData.membership;
community.type = resData.type;
community.plan = resData.plan?resData.plan:"Default";
community.otherZenodoCommunities = resData.otherZenodoCommunities;
if (resData.hasOwnProperty('status')) {
community.status = resData.status;

View File

@ -24,7 +24,7 @@ export class CommunityInfo {
fos: string[] = [];
sdg: string[] = []
selectionCriteria: SelectionCriteria;
plan: "starter" | "extended";
plan: "Standard" | "Advanced" | "Premium" | "National" | "Default" ;
public static checkIsUpload(response: CommunityInfo | CommunityInfo[]): any | any[] {
if (Array.isArray(response)) {

View File

@ -143,7 +143,7 @@
class="uk-heading-divider uk-h6 uk-margin-left uk-padding-remove-left uk-text-capitalize ">{{placement.value}}</div>
<ng-container *ngFor="let pluginGroup of pluginsByPlacement.get(placement.value) ; let i=index">
<ng-container *ngIf="(pluginGroup.template.portalSpecific.length == 0 || pluginGroup.template.portalSpecific.indexOf(communityInfo.communityId) != -1 ) &&
(pluginGroup.template.plan == 'starter'|| pluginGroup.template.plan == communityInfo.plan )">
(pluginGroup.template.plan == 'Standard' || pluginGroup.template.plan == 'Default' || pluginGroup.template.plan == communityInfo.plan )">
<div class="uk-card uk-card-default uk-margin-bottom">
<div class="uk-card-body uk-flex">
<div class="uk-width-expand uk-text-small">

View File

@ -58,8 +58,8 @@
<h6>{{template.name}}</h6>
<div class="uk-margin-small-bottom">
<span class="uk-label uk-padding-xsmall uk-text-capitalize"
[class.uk-label-success]="template.plan !='extended'"
[class.uk-label-danger]="template.plan =='extended'">Plan: {{template.plan}} </span>
[class.uk-label-success]="template.plan =='Standard'"
[class.uk-label-danger]="template.plan !='Standard'">Plan: {{template.plan}} </span>
<span *ngIf="template.portalSpecific && template.portalSpecific.length > 0"
class="uk-label uk-label-primary uk-padding-xsmall uk-text-capitalize uk-margin-left">Communities: {{template.portalSpecific.join(', ')}} </span>
<span *ngIf="template.defaultIsActive"

View File

@ -196,7 +196,7 @@ export class PluginTemplatesComponent implements OnInit {
_id: this._fb.control(null),
name: this._fb.control(''),
code: this._fb.control('', Validators.required),
plan: this._fb.control('starter', Validators.required),
plan: this._fb.control('standard', Validators.required),
description: this._fb.control(''),
page: this._fb.control(this.page?this.getPageById(this.page):'', Validators.required),
portalType: this._fb.control('community', Validators.required),

View File

@ -46,8 +46,11 @@ export class PluginUtils{
{label:"Left", value:"left"},
];
public planOptions: Option[] = [
{value: 'starter', label: 'Starter'},
{value: 'extended', label: 'Extended'}
{value: 'Default', label: 'Default'},
{value: 'Standard', label: 'Standard'},
{value: 'Advanced', label: 'Advanced'},
{value: 'Premium', label: 'Premium'},
{value: 'National', label: 'National'}
];