Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Refactor config #512

Merged
merged 10 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ubiquibot-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ priority-labels:
- name: "Priority: 4 (Emergency)"
weight: 5
auto-pay-mode: true
analytics-mode: true
disable-analytics: true
BeanieMen marked this conversation as resolved.
Show resolved Hide resolved
comment-incentives: true
max-concurrent-bounties: 2
promotion-comment: "\n<h6>If you enjoy the DevPool experience, please follow <a href='https://github.com/ubiquity'>Ubiquity on GitHub</a> and star <a href='https://github.com/ubiquity/devpool-directory'>this repo</a> to show your support. It helps a lot!</h6>"
Expand Down
8 changes: 4 additions & 4 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ export const getAutoPayMode = (parsedRepo?: WideRepoConfig, parsedOrg?: WideOrgC
};

export const getAnalyticsMode = (parsedRepo: WideRepoConfig | undefined, parsedOrg: WideOrgConfig | undefined): boolean => {
if (parsedRepo && parsedRepo["analytics-mode"] && typeof parsedRepo["analytics-mode"] === "boolean") {
return parsedRepo["analytics-mode"];
} else if (parsedOrg && parsedOrg["analytics-mode"] && typeof parsedOrg["analytics-mode"] === "boolean") {
return parsedOrg["analytics-mode"];
if (parsedRepo && parsedRepo["disable-analytics"] && typeof parsedRepo["disable-analytics"] === "boolean") {
return parsedRepo["disable-analytics"];
} else if (parsedOrg && parsedOrg["disable-analytics"] && typeof parsedOrg["disable-analytics"] === "boolean") {
return parsedOrg["disable-analytics"];
} else {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface WideConfig {
"priority-labels"?: WideLabel[];
"auto-pay-mode"?: boolean;
"promotion-comment"?: string;
"analytics-mode"?: boolean;
"disable-analytics"?: boolean;
"comment-incentives"?: boolean;
"max-concurrent-assigns"?: number;
"comment-element-pricing"?: Record<string, number>;
Expand Down