mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-31 03:30:50 +00:00
fix: problem with empty project configuration with number #2066
This commit is contained in:
parent
4b9bc81f04
commit
fe7e37a177
1 changed files with 5 additions and 16 deletions
|
|
@ -20,18 +20,18 @@ import {
|
|||
import { Subscription } from 'rxjs';
|
||||
import { ProjectService } from '../../features/project/project.service';
|
||||
import { BASIC_PROJECT_CONFIG_FORM_CONFIG } from '../../features/project/project-form-cfg.const';
|
||||
import { ISSUE_PROVIDER_FORM_CFGS } from '../../features/issue/issue.const';
|
||||
import {
|
||||
ISSUE_PROVIDER_FORM_CFGS,
|
||||
DEFAULT_ISSUE_PROVIDER_CFGS,
|
||||
} from '../../features/issue/issue.const';
|
||||
import { GLOBAL_CONFIG_FORM_CONFIG } from '../../features/config/global-config-form-config.const';
|
||||
import { IS_ELECTRON } from '../../app.constants';
|
||||
import { DEFAULT_JIRA_CFG } from '../../features/issue/providers/jira/jira.const';
|
||||
import { DEFAULT_GITHUB_CFG } from '../../features/issue/providers/github/github.const';
|
||||
import {
|
||||
WorkContextAdvancedCfg,
|
||||
WorkContextThemeCfg,
|
||||
} from '../../features/work-context/work-context.model';
|
||||
import { WORK_CONTEXT_THEME_CONFIG_FORM_CONFIG } from '../../features/work-context/work-context.const';
|
||||
import { WorkContextService } from '../../features/work-context/work-context.service';
|
||||
import { DEFAULT_GITLAB_CFG } from 'src/app/features/issue/providers/gitlab/gitlab.const';
|
||||
import { distinctUntilChanged } from 'rxjs/operators';
|
||||
import { isObject } from '../../util/is-object';
|
||||
|
||||
|
|
@ -102,17 +102,6 @@ export class ProjectSettingsPageComponent implements OnInit, OnDestroy {
|
|||
// in case there are new ones...
|
||||
this.issueIntegrationCfgs = { ...project.issueIntegrationCfgs };
|
||||
|
||||
// Unfortunately needed, to make sure we have no empty configs
|
||||
// TODO maybe think of a better solution for the defaults
|
||||
if (!this.issueIntegrationCfgs.JIRA) {
|
||||
this.issueIntegrationCfgs.JIRA = DEFAULT_JIRA_CFG;
|
||||
}
|
||||
if (!this.issueIntegrationCfgs.GITHUB) {
|
||||
this.issueIntegrationCfgs.GITHUB = DEFAULT_GITHUB_CFG;
|
||||
}
|
||||
if (!this.issueIntegrationCfgs.GITLAB) {
|
||||
this.issueIntegrationCfgs.GITLAB = DEFAULT_GITLAB_CFG;
|
||||
}
|
||||
this._cd.detectChanges();
|
||||
}),
|
||||
);
|
||||
|
|
@ -179,7 +168,7 @@ export class ProjectSettingsPageComponent implements OnInit, OnDestroy {
|
|||
|
||||
getIssueIntegrationCfg(key: IssueProviderKey): IssueIntegrationCfg {
|
||||
if (!(this.issueIntegrationCfgs as any)[key]) {
|
||||
throw new Error('Invalid issue integration cfg');
|
||||
return DEFAULT_ISSUE_PROVIDER_CFGS[key];
|
||||
}
|
||||
return (this.issueIntegrationCfgs as any)[key];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue