Skip to content

Commit

Permalink
feat: introduce default config for organic-keywords report (SITES-193…
Browse files Browse the repository at this point in the history
…17) (#118)
  • Loading branch information
dzehnder authored Jan 30, 2024
1 parent 815b447 commit 4301556
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/spacecat-shared-data-access/src/models/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Base } from './base.js';

export const AUDIT_TYPE_404 = '404';
export const AUDIT_TYPE_BROKEN_BACKLINKS = 'broken-backlinks';
export const AUDIT_TYPE_ORGANIC_KEYWORDS = 'organic-keywords';
export const AUDIT_TYPE_CWV = 'cwv';
export const AUDIT_TYPE_LHS_DESKTOP = 'lhs-desktop';
export const AUDIT_TYPE_LHS_MOBILE = 'lhs-mobile';
Expand All @@ -24,6 +25,7 @@ const EXPIRES_IN_DAYS = 30;
const AUDIT_TYPE_PROPERTIES = {
[AUDIT_TYPE_404]: [],
[AUDIT_TYPE_BROKEN_BACKLINKS]: [],
[AUDIT_TYPE_ORGANIC_KEYWORDS]: [],
[AUDIT_TYPE_CWV]: [],
[AUDIT_TYPE_LHS_DESKTOP]: ['performance', 'seo', 'accessibility', 'best-practices'],
[AUDIT_TYPE_LHS_MOBILE]: ['performance', 'seo', 'accessibility', 'best-practices'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@
*/

import AuditConfigType from './audit-config-type.js';
import { AUDIT_TYPE_BROKEN_BACKLINKS } from '../audit.js';
import {
AUDIT_TYPE_BROKEN_BACKLINKS,
AUDIT_TYPE_ORGANIC_KEYWORDS,
} from '../audit.js';

const AUDIT_TYPE_DISABLED_DEFAULTS = {
[AUDIT_TYPE_BROKEN_BACKLINKS]: true,
[AUDIT_TYPE_ORGANIC_KEYWORDS]: true,
};

function getAuditTypeConfigs(auditTypeConfigs, auditsDisabled) {
if (!auditTypeConfigs || Object.keys(auditTypeConfigs).length === 0) {
return {
[AUDIT_TYPE_BROKEN_BACKLINKS]: AuditConfigType({ disabled: true }),
[AUDIT_TYPE_ORGANIC_KEYWORDS]: AuditConfigType({ disabled: true }),
};
}
return Object.entries(auditTypeConfigs || {}).reduce((acc, [key, value]) => {
Expand Down

0 comments on commit 4301556

Please sign in to comment.