Skip to content

Commit

Permalink
Restore configurations other than uri and license fields
Browse files Browse the repository at this point in the history
They were deleted by mistake
  • Loading branch information
abelgomez committed Oct 9, 2024
1 parent 41467f7 commit 1d3a6e2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ConfigurationProperty } from 'src/app/core/shared/configuration-propert
import { Item } from 'src/app/core/shared/item.model';
import { getFirstCompletedRemoteData, getRemoteDataPayload } from 'src/app/core/shared/operators';

Check failure on line 15 in src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Imports must be broken into multiple lines if there are more than 1 elements

Check failure on line 15 in src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts

View workflow job for this annotation

GitHub Actions / tests (20.x)

Imports must be broken into multiple lines if there are more than 1 elements
import { MetadataFieldWrapperComponent } from 'src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component';
import { AppConfig } from 'src/config/app-config.interface';

@Component({
selector: 'ds-item-page-cc-license-field',
Expand All @@ -34,7 +35,7 @@ export class ItemPageCcLicenseFieldComponent implements OnInit {
* 'full' variant shows image, a disclaimer (optional) and name (always), better for the item page content.
* 'small' variant shows image and name (optional), better for the item page sidebar
*/
@Input() variant?: 'small' | 'full' = 'small';
@Input() variant?: 'small' | 'full' = this.appConfig.ccLicense.variant;;

Check failure on line 38 in src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Unnecessary semicolon

Check failure on line 38 in src/app/item-page/simple/field-components/specific-field/cc-license/item-page-cc-license-field.component.ts

View workflow job for this annotation

GitHub Actions / tests (20.x)

Unnecessary semicolon

/**
* Shows the CC license name with the image. Always show if image fails to load
Expand All @@ -54,6 +55,7 @@ export class ItemPageCcLicenseFieldComponent implements OnInit {
imgSrc: string;

constructor(
public appConfig: AppConfig,
private configService: ConfigurationDataService,
) {
this.configService.findByPropertyName('cc.license.uri').pipe(
Expand Down
2 changes: 2 additions & 0 deletions src/config/app-config.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { SubmissionConfig } from './submission-config.interface';
import { SuggestionConfig } from './suggestion-config.interfaces';
import { ThemeConfig } from './theme.config';
import { UIServerConfig } from './ui-server-config.interface';
import { CreativeCommonsLicenseConfig } from './creative-commons-license-config.interface';


interface AppConfig extends Config {
Expand Down Expand Up @@ -66,6 +67,7 @@ interface AppConfig extends Config {
search: SearchConfig;
notifyMetrics: AdminNotifyMetricsRow[];
liveRegion: LiveRegionConfig;
ccLicense: CreativeCommonsLicenseConfig;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions src/config/default-app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { CacheConfig } from './cache-config.interface';
import { CollectionPageConfig } from './collection-page-config.interface';
import { CommunityListConfig } from './community-list-config.interface';
import { CommunityPageConfig } from './community-page-config.interface';
import { CreativeCommonsLicenseConfig } from './creative-commons-license-config.interface';
import { DiscoverySortConfig } from './discovery-sort.config';
import { FilterVocabularyConfig } from './filter-vocabulary-config';
import { FormConfig } from './form-config.interfaces';
Expand Down Expand Up @@ -598,4 +599,11 @@ export class DefaultAppConfig implements AppConfig {
messageTimeOutDurationMs: 30000,
isVisible: false,
};

// Metadatafields to determine the CC license variant
ccLicense: CreativeCommonsLicenseConfig = {
variant: 'small',
showName: true,
showDisclaimer: true,
};
}
6 changes: 6 additions & 0 deletions src/environments/environment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,4 +427,10 @@ export const environment: BuildConfig = {
messageTimeOutDurationMs: 30000,
isVisible: false,
},

ccLicense: {
variant: 'small',
showName: true,
showDisclaimer: true,
},
};

0 comments on commit 1d3a6e2

Please sign in to comment.