fix(metadata): update package metadata and align company schema integration with latest tsclass types
This commit is contained in:
@@ -11,14 +11,14 @@ export type TLevelState = 'enabled' | 'disabled';
|
||||
export class TagLevel {
|
||||
public tagManagerRef: TagManager;
|
||||
|
||||
private titleStore: string;
|
||||
private titleStore?: string;
|
||||
public set title(titleArg: string) {
|
||||
this.titleStore = titleArg;
|
||||
if (this.state === 'enabled') {
|
||||
document.title = this.titleStore;
|
||||
}
|
||||
}
|
||||
public get title() {
|
||||
public get title(): string | undefined {
|
||||
return this.titleStore;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ export class TagLevel {
|
||||
|
||||
constructor(tagManagerRefArg: TagManager, levelType: TBaseLevelType) {
|
||||
this.tagManagerRef = tagManagerRefArg;
|
||||
this.type = levelType;
|
||||
}
|
||||
|
||||
public addTag(tagArg: Tag | Tag[]) {
|
||||
@@ -44,34 +45,34 @@ export class TagLevel {
|
||||
}
|
||||
}
|
||||
|
||||
public async addCompanyInfo(companyDataArg: plugins.tsclass.business.ICompany) {
|
||||
public async addCompanyInfo(companyDataArg: plugins.tsclass.business.TCompany) {
|
||||
this.addTag(JsonLdTag.createCompanyJsonLd(companyDataArg));
|
||||
|
||||
// lets care about open graph
|
||||
this.addTag(new OpengraphTag('og:type', 'business.business'));
|
||||
this.addTag(new OpengraphTag('og:title', companyDataArg.name));
|
||||
this.addTag(new OpengraphTag('og:url', companyDataArg.contact.website));
|
||||
this.addTag(new OpengraphTag('og:image', companyDataArg.contact.logoUrl));
|
||||
this.addTag(new OpengraphTag('og:url', companyDataArg.website ?? ''));
|
||||
this.addTag(new OpengraphTag('og:image', companyDataArg.logoUrl ?? ''));
|
||||
this.addTag(
|
||||
new OpengraphTag(
|
||||
'business:contact_data:street_address',
|
||||
`${companyDataArg.contact.address.streetName} ${companyDataArg.contact.address.houseNumber}`
|
||||
`${companyDataArg.address.streetName} ${companyDataArg.address.houseNumber}`
|
||||
)
|
||||
);
|
||||
this.addTag(
|
||||
new OpengraphTag('business:contact_data:locality', companyDataArg.contact.address.postalCode)
|
||||
new OpengraphTag('business:contact_data:locality', companyDataArg.address.postalCode)
|
||||
);
|
||||
this.addTag(
|
||||
new OpengraphTag('business:contact_data:region', companyDataArg.contact.address.city)
|
||||
new OpengraphTag('business:contact_data:region', companyDataArg.address.city)
|
||||
);
|
||||
this.addTag(
|
||||
new OpengraphTag(
|
||||
'business:contact_data:postal_code',
|
||||
companyDataArg.contact.address.postalCode
|
||||
companyDataArg.address.postalCode
|
||||
)
|
||||
);
|
||||
this.addTag(
|
||||
new OpengraphTag('business:contact_data:country_name', companyDataArg.contact.address.country)
|
||||
new OpengraphTag('business:contact_data:country_name', companyDataArg.address.country)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -80,7 +81,7 @@ export class TagLevel {
|
||||
this.addTag(OpengraphTag.createNewsArticleOgTags(articleArg));
|
||||
}
|
||||
|
||||
public addProductInfo(productArg: plugins.tsclass.saas.IProduct, companyArg: plugins.tsclass.business.ICompany) {
|
||||
public addProductInfo(productArg: plugins.tsclass.saas.IProduct, companyArg?: plugins.tsclass.business.TCompany) {
|
||||
this.addTag(JsonLdTag.createProductJsonLd(productArg, companyArg));
|
||||
this.addTag(OpengraphTag.createProductOgTags(productArg));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user