mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-22 18:30:09 +00:00
refactor: migrate all issue logs to IssueLog context
- Replace all Log.* calls with IssueLog.* in features/issue directory - Modified 17 files with 42 total changes - All issue-related logs now have [issue] context prefix - Fixed unused Log import in jira-api.service.ts
This commit is contained in:
parent
de3d1106bd
commit
53bc1af61c
18 changed files with 205 additions and 59 deletions
146
scripts/migrate-to-issue-log.ts
Executable file
146
scripts/migrate-to-issue-log.ts
Executable file
|
|
@ -0,0 +1,146 @@
|
|||
#!/usr/bin/env ts-node
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as glob from 'glob';
|
||||
|
||||
interface Replacement {
|
||||
pattern: RegExp;
|
||||
replacement: string;
|
||||
}
|
||||
|
||||
const replacements: Replacement[] = [
|
||||
// Replace Log.log with IssueLog.log
|
||||
{ pattern: /\bLog\.log\(/g, replacement: 'IssueLog.log(' },
|
||||
// Replace Log.err with IssueLog.err
|
||||
{ pattern: /\bLog\.err\(/g, replacement: 'IssueLog.err(' },
|
||||
// Replace Log.info with IssueLog.info
|
||||
{ pattern: /\bLog\.info\(/g, replacement: 'IssueLog.info(' },
|
||||
// Replace Log.debug with IssueLog.debug
|
||||
{ pattern: /\bLog\.debug\(/g, replacement: 'IssueLog.debug(' },
|
||||
// Replace Log.verbose with IssueLog.verbose
|
||||
{ pattern: /\bLog\.verbose\(/g, replacement: 'IssueLog.verbose(' },
|
||||
// Replace Log.critical with IssueLog.critical
|
||||
{ pattern: /\bLog\.critical\(/g, replacement: 'IssueLog.critical(' },
|
||||
];
|
||||
|
||||
function updateImports(content: string): string {
|
||||
// Check if file already imports IssueLog
|
||||
const hasIssueLogImport =
|
||||
/import\s*{[^}]*\bIssueLog\b[^}]*}\s*from\s*['"][^'"]*\/log['"]/.test(content);
|
||||
|
||||
if (hasIssueLogImport) {
|
||||
// If IssueLog is already imported, just remove Log from the import if it's not used elsewhere
|
||||
return content;
|
||||
}
|
||||
|
||||
// Find existing Log import and add IssueLog to it
|
||||
const logImportRegex = /import\s*{([^}]*\bLog\b[^}]*)}\s*from\s*(['"][^'"]*\/log['"])/;
|
||||
const match = content.match(logImportRegex);
|
||||
|
||||
if (match) {
|
||||
const [fullMatch, imports, importPath] = match;
|
||||
const importList = imports.split(',').map((s) => s.trim());
|
||||
|
||||
// Add IssueLog if not already there
|
||||
if (!importList.includes('IssueLog')) {
|
||||
importList.push('IssueLog');
|
||||
}
|
||||
|
||||
// Check if Log is still used after replacements
|
||||
let tempContent = content;
|
||||
for (const { pattern, replacement } of replacements) {
|
||||
tempContent = tempContent.replace(pattern, replacement);
|
||||
}
|
||||
|
||||
// Remove the import statement from check
|
||||
tempContent = tempContent.replace(logImportRegex, '');
|
||||
|
||||
// If Log is no longer used, remove it from imports
|
||||
const logStillUsed = /\bLog\b/.test(tempContent);
|
||||
if (!logStillUsed) {
|
||||
const logIndex = importList.indexOf('Log');
|
||||
if (logIndex > -1) {
|
||||
importList.splice(logIndex, 1);
|
||||
}
|
||||
}
|
||||
|
||||
const newImports = importList.join(', ');
|
||||
const newImportStatement = `import { ${newImports} } from ${importPath}`;
|
||||
content = content.replace(fullMatch, newImportStatement);
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
function processFile(filePath: string): { modified: boolean; changes: number } {
|
||||
try {
|
||||
let content = fs.readFileSync(filePath, 'utf8');
|
||||
const originalContent = content;
|
||||
let changeCount = 0;
|
||||
|
||||
// Count and apply replacements
|
||||
for (const { pattern, replacement } of replacements) {
|
||||
const matches = content.match(pattern);
|
||||
if (matches) {
|
||||
changeCount += matches.length;
|
||||
content = content.replace(pattern, replacement);
|
||||
}
|
||||
}
|
||||
|
||||
// Update imports if changes were made
|
||||
if (changeCount > 0) {
|
||||
content = updateImports(content);
|
||||
}
|
||||
|
||||
const modified = content !== originalContent;
|
||||
|
||||
if (modified) {
|
||||
fs.writeFileSync(filePath, content, 'utf8');
|
||||
}
|
||||
|
||||
return { modified, changes: changeCount };
|
||||
} catch (error) {
|
||||
console.error(`Error processing ${filePath}:`, error);
|
||||
return { modified: false, changes: 0 };
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
console.log('Migrating Log to IssueLog in features/issue directory...\n');
|
||||
|
||||
// Find all TypeScript files in features/issue directory
|
||||
const files = glob.sync('src/app/features/issue/**/*.ts', {
|
||||
ignore: ['**/*.spec.ts', '**/node_modules/**'],
|
||||
absolute: true,
|
||||
});
|
||||
|
||||
console.log(`Found ${files.length} TypeScript files in features/issue directory\n`);
|
||||
|
||||
const modifiedFiles: { path: string; changes: number }[] = [];
|
||||
let totalChanges = 0;
|
||||
|
||||
for (const file of files) {
|
||||
const result = processFile(file);
|
||||
if (result.modified) {
|
||||
modifiedFiles.push({ path: file, changes: result.changes });
|
||||
totalChanges += result.changes;
|
||||
}
|
||||
}
|
||||
|
||||
console.log('\nMigration complete!\n');
|
||||
console.log(`Total changes: ${totalChanges}`);
|
||||
console.log(`Modified ${modifiedFiles.length} files:\n`);
|
||||
|
||||
modifiedFiles
|
||||
.sort((a, b) => b.changes - a.changes)
|
||||
.forEach(({ path: filePath, changes }) => {
|
||||
console.log(` - ${path.relative(process.cwd(), filePath)} (${changes} changes)`);
|
||||
});
|
||||
|
||||
if (modifiedFiles.length === 0) {
|
||||
console.log(' No files needed modification.');
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
|
|
@ -48,7 +48,7 @@ import { MatButton } from '@angular/material/button';
|
|||
import { MatIcon } from '@angular/material/icon';
|
||||
import { IS_ANDROID_WEB_VIEW } from '../../../util/is-android-web-view';
|
||||
import { devError } from '../../../util/dev-error';
|
||||
import { Log } from '../../../core/log';
|
||||
import { IssueLog } from '../../../core/log';
|
||||
|
||||
@Component({
|
||||
selector: 'dialog-edit-issue-provider',
|
||||
|
|
@ -149,7 +149,7 @@ export class DialogEditIssueProviderComponent {
|
|||
}
|
||||
|
||||
customCfgCmpSave(cfgUpdates: IssueIntegrationCfg): void {
|
||||
Log.log('customCfgCmpSave()', cfgUpdates);
|
||||
IssueLog.log('customCfgCmpSave()', cfgUpdates);
|
||||
this.updateModel(cfgUpdates);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ import { HANDLED_ERROR_PROP_STR } from '../../app.constants';
|
|||
import { IssueProviderKey } from './issue.model';
|
||||
import { getErrorTxt } from '../../util/get-error-text';
|
||||
import { SnackService } from '../../core/snack/snack.service';
|
||||
import { Log } from '../../core/log';
|
||||
import { IssueLog } from '../../core/log';
|
||||
|
||||
export const handleIssueProviderHttpError$ = <T>(
|
||||
issueProviderKey: IssueProviderKey,
|
||||
snackService: SnackService,
|
||||
error: HttpErrorResponse,
|
||||
): ObservableInput<T> => {
|
||||
Log.log(error);
|
||||
IssueLog.log(error);
|
||||
if (error.error instanceof ErrorEvent) {
|
||||
// A client-side or network error occurred. Handle it accordingly.
|
||||
snackService.open({
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import { IssueServiceInterface } from './issue-service-interface';
|
|||
import { JiraCommonInterfacesService } from './providers/jira/jira-common-interfaces.service';
|
||||
import { GithubCommonInterfacesService } from './providers/github/github-common-interfaces.service';
|
||||
import { catchError, map, switchMap } from 'rxjs/operators';
|
||||
import { Log } from '../../core/log';
|
||||
import { IssueLog } from '../../core/log';
|
||||
import { GitlabCommonInterfacesService } from './providers/gitlab/gitlab-common-interfaces.service';
|
||||
import { CaldavCommonInterfacesService } from './providers/caldav/caldav-common-interfaces.service';
|
||||
import { OpenProjectCommonInterfacesService } from './providers/open-project/open-project-common-interfaces.service';
|
||||
|
|
@ -325,7 +325,7 @@ export class IssueService {
|
|||
|
||||
for (const pKey of Object.keys(tasksIssueIdsByIssueProviderKey)) {
|
||||
const providerKey = pKey as IssueProviderKey;
|
||||
Log.log(
|
||||
IssueLog.log(
|
||||
'POLLING CHANGES FOR ' + providerKey,
|
||||
tasksIssueIdsByIssueProviderKey[providerKey],
|
||||
);
|
||||
|
|
@ -427,7 +427,7 @@ export class IssueService {
|
|||
|
||||
const { title = null, ...additionalFromProviderIssueService } =
|
||||
this.ISSUE_SERVICE_MAP[issueProviderKey].getAddTaskData(issueDataReduced);
|
||||
Log.log({ title, additionalFromProviderIssueService });
|
||||
IssueLog.log({ title, additionalFromProviderIssueService });
|
||||
|
||||
const getProjectOrTagId = async (): Promise<Partial<TaskCopy>> => {
|
||||
const defaultProjectId = (
|
||||
|
|
@ -547,7 +547,7 @@ export class IssueService {
|
|||
// this.ISSUE_SERVICE_MAP[issueProviderKey].getAddTaskData(freshIssueData);
|
||||
// this._taskService.update(taskId, {});
|
||||
// } catch (e) {
|
||||
// Log.err(e);
|
||||
// IssueLog.err(e);
|
||||
// this._taskService.remove(taskId);
|
||||
// // TODO show error msg
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import { T } from '../../../../t.const';
|
|||
import { catchError } from 'rxjs/operators';
|
||||
import { HANDLED_ERROR_PROP_STR } from '../../../../app.constants';
|
||||
import { throwHandledError } from '../../../../util/throw-handled-error';
|
||||
import { Log } from '../../../../core/log';
|
||||
import { IssueLog } from '../../../../core/log';
|
||||
|
||||
interface ClientCache {
|
||||
client: DavClient;
|
||||
|
|
@ -115,7 +115,7 @@ export class CaldavClientService {
|
|||
const todo = comp.getFirstSubcomponent('vtodo');
|
||||
|
||||
if (!todo) {
|
||||
Log.log(task);
|
||||
IssueLog.log(task);
|
||||
throw new Error('No todo found for task');
|
||||
}
|
||||
|
||||
|
|
@ -398,7 +398,7 @@ export class CaldavClientService {
|
|||
const todo = comp.getFirstSubcomponent('vtodo');
|
||||
|
||||
if (!todo) {
|
||||
Log.err('No todo found for task', task);
|
||||
IssueLog.err('No todo found for task', task);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { IssueProviderCalendar } from '../../issue.model';
|
|||
import { CalendarProviderCfg } from './calendar.model';
|
||||
import { ISSUE_PROVIDER_FF_DEFAULT_PROJECT } from '../../common-issue-form-stuff.const';
|
||||
import { IS_ELECTRON } from '../../../../app.constants';
|
||||
import { Log } from '../../../../core/log';
|
||||
import { IssueLog } from '../../../../core/log';
|
||||
|
||||
export const DEFAULT_CALENDAR_CFG: CalendarProviderCfg = {
|
||||
isEnabled: false,
|
||||
|
|
@ -46,7 +46,7 @@ export const CALENDAR_FORM_CFG_NEW: ConfigFormSection<IssueProviderCalendar> = {
|
|||
key: 'checkUpdatesEvery',
|
||||
hooks: {
|
||||
onInit: (field) => {
|
||||
Log.log(field?.formControl?.value);
|
||||
IssueLog.log(field?.formControl?.value);
|
||||
if (!field?.formControl?.value) {
|
||||
field?.formControl?.setValue(2 * 60 * 60000);
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ export const CALENDAR_FORM_CFG_NEW: ConfigFormSection<IssueProviderCalendar> = {
|
|||
key: 'showBannerBeforeThreshold',
|
||||
hooks: {
|
||||
onInit: (field) => {
|
||||
Log.log(field?.formControl?.value);
|
||||
IssueLog.log(field?.formControl?.value);
|
||||
if (!field?.formControl?.value && field?.formControl?.value !== null) {
|
||||
field?.formControl?.setValue(2 * 60 * 60000);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import { HANDLED_ERROR_PROP_STR } from '../../../../app.constants';
|
|||
import { T } from '../../../../t.const';
|
||||
import { throwHandledError } from '../../../../util/throw-handled-error';
|
||||
import { GITHUB_TYPE, ISSUE_PROVIDER_HUMANIZED } from '../../issue.const';
|
||||
import { Log } from '../../../../core/log';
|
||||
import { IssueLog } from '../../../../core/log';
|
||||
|
||||
const BASE = GITHUB_API_BASE_URL;
|
||||
|
||||
|
|
@ -145,7 +145,7 @@ query Issues {
|
|||
try {
|
||||
return mapGithubGraphQLSearchResult(res);
|
||||
} catch (e) {
|
||||
Log.err(e);
|
||||
IssueLog.err(e);
|
||||
this._snackService.open({
|
||||
type: 'ERROR',
|
||||
msg: T.F.GITHUB.S.CONFIG_ERROR,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ import { MsToClockStringPipe } from '../../../../../ui/duration/ms-to-clock-stri
|
|||
import { MatTooltip } from '@angular/material/tooltip';
|
||||
import { InlineInputComponent } from '../../../../../ui/inline-input/inline-input.component';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { Log } from '../../../../../core/log';
|
||||
import { IssueLog } from '../../../../../core/log';
|
||||
|
||||
interface TmpTask {
|
||||
id: string;
|
||||
|
|
@ -210,7 +210,7 @@ export class DialogGitlabSubmitWorklogForDayComponent {
|
|||
});
|
||||
this.close();
|
||||
} catch (e) {
|
||||
Log.err(e);
|
||||
IssueLog.err(e);
|
||||
this._snackService.open({
|
||||
type: 'ERROR',
|
||||
// TODO translate
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import { SearchResultItem } from '../../../issue.model';
|
|||
import { GITLAB_TYPE, ISSUE_PROVIDER_HUMANIZED } from '../../../issue.const';
|
||||
import { assertTruthy } from '../../../../../util/assert-truthy';
|
||||
import { handleIssueProviderHttpError$ } from '../../../handle-issue-provider-http-error';
|
||||
import { Log } from '../../../../../core/log';
|
||||
import { IssueLog } from '../../../../../core/log';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
|
@ -44,7 +44,7 @@ export class GitlabApiService {
|
|||
private _http = inject(HttpClient);
|
||||
|
||||
getById$(id: string, cfg: GitlabCfg): Observable<GitlabIssue> {
|
||||
Log.log(this._issueApiLink(cfg, id));
|
||||
IssueLog.log(this._issueApiLink(cfg, id));
|
||||
|
||||
return this._sendIssuePaginatedRequest$(
|
||||
{
|
||||
|
|
@ -308,7 +308,7 @@ export class GitlabApiService {
|
|||
responseType: params.responseType,
|
||||
},
|
||||
];
|
||||
Log.log(allArgs);
|
||||
IssueLog.log(allArgs);
|
||||
|
||||
const req = new HttpRequest(p.method, p.url, ...allArgs);
|
||||
|
||||
|
|
@ -326,7 +326,7 @@ export class GitlabApiService {
|
|||
}
|
||||
|
||||
private _issueApiLink(cfg: GitlabCfg, issueId: string): string {
|
||||
Log.log(issueId);
|
||||
IssueLog.log(issueId);
|
||||
const { projectIssueId } = getPartsFromGitlabIssueId(issueId);
|
||||
return `${this._apiLink(cfg)}/issues/${projectIssueId}`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import { MsToStringPipe } from '../../../../../ui/duration/ms-to-string.pipe';
|
|||
import { SortPipe } from '../../../../../ui/pipes/sort.pipe';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { SnackService } from '../../../../../core/snack/snack.service';
|
||||
import { Log } from '../../../../../core/log';
|
||||
import { IssueLog } from '../../../../../core/log';
|
||||
|
||||
interface JiraSubtaskWithUrl extends JiraSubtask {
|
||||
href: string;
|
||||
|
|
@ -103,7 +103,7 @@ export class JiraIssueContentComponent {
|
|||
}),
|
||||
).pipe(
|
||||
catchError((e) => {
|
||||
Log.err(e);
|
||||
IssueLog.err(e);
|
||||
this._snackService.open({
|
||||
type: 'ERROR',
|
||||
msg: 'Failed to load subtasks for Jira Issue',
|
||||
|
|
@ -148,7 +148,7 @@ export class JiraIssueContentComponent {
|
|||
try {
|
||||
this.description = i && i.description && j2m.to_markdown(i.description);
|
||||
} catch (e) {
|
||||
Log.log(i);
|
||||
IssueLog.log(i);
|
||||
devError(e);
|
||||
this.description = (i && i.description) || undefined;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ import { DialogPromptComponent } from '../../../../ui/dialog-prompt/dialog-promp
|
|||
import { stripTrailing } from '../../../../util/strip-trailing';
|
||||
import { IS_ANDROID_WEB_VIEW } from '../../../../util/is-android-web-view';
|
||||
import { formatJiraDate } from '../../../../util/format-jira-date';
|
||||
import { Log } from '../../../../core/log';
|
||||
import { IssueLog } from '../../../../core/log';
|
||||
|
||||
const BLOCK_ACCESS_KEY = 'SUP_BLOCK_JIRA_ACCESS';
|
||||
const API_VERSION = 'latest';
|
||||
|
|
@ -150,7 +150,7 @@ export class JiraApiService {
|
|||
// switchMap((res) =>
|
||||
// res.length > 0 ? of(res) : this.issuePicker$(searchTerm, cfg),
|
||||
// ),
|
||||
tap((v) => Log.log('AAAAA', v)),
|
||||
tap((v) => IssueLog.log('AAAAA', v)),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -422,7 +422,7 @@ export class JiraApiService {
|
|||
}
|
||||
|
||||
if (this._isBlockAccess && !isForce) {
|
||||
Log.err('Blocked Jira Access to prevent being shut out');
|
||||
IssueLog.err('Blocked Jira Access to prevent being shut out');
|
||||
this._bannerService.open({
|
||||
id: BannerId.JiraUnblock,
|
||||
msg: T.F.JIRA.BANNER.BLOCK_ACCESS_MSG,
|
||||
|
|
@ -514,8 +514,8 @@ export class JiraApiService {
|
|||
}),
|
||||
).pipe(
|
||||
catchError((err) => {
|
||||
Log.log(err);
|
||||
Log.log(getErrorTxt(err));
|
||||
IssueLog.log(err);
|
||||
IssueLog.log(getErrorTxt(err));
|
||||
const errTxt = `Jira: ${getErrorTxt(err)}`;
|
||||
this._snackService.open({ type: 'ERROR', msg: errTxt });
|
||||
return throwError({ [HANDLED_ERROR_PROP_STR]: errTxt });
|
||||
|
|
@ -528,8 +528,8 @@ export class JiraApiService {
|
|||
this._globalProgressBarService.countUp(url);
|
||||
return fromPromise(promise).pipe(
|
||||
catchError((err) => {
|
||||
Log.log(err);
|
||||
Log.log(getErrorTxt(err));
|
||||
IssueLog.log(err);
|
||||
IssueLog.log(getErrorTxt(err));
|
||||
const errTxt = `Jira: ${getErrorTxt(err)}`;
|
||||
this._snackService.open({ type: 'ERROR', msg: errTxt });
|
||||
return throwError({ [HANDLED_ERROR_PROP_STR]: errTxt });
|
||||
|
|
@ -626,7 +626,7 @@ export class JiraApiService {
|
|||
jiraCfg,
|
||||
|
||||
timeoutId: window.setTimeout(() => {
|
||||
Log.log('ERROR', 'Jira Request timed out', requestInit);
|
||||
IssueLog.log('ERROR', 'Jira Request timed out', requestInit);
|
||||
this._blockAccess();
|
||||
// delete entry for promise
|
||||
this._snackService.open({
|
||||
|
|
@ -648,7 +648,7 @@ export class JiraApiService {
|
|||
|
||||
// resolve saved promise
|
||||
if (!res || res.error) {
|
||||
Log.err('JIRA_RESPONSE_ERROR', res, currentRequest);
|
||||
IssueLog.err('JIRA_RESPONSE_ERROR', res, currentRequest);
|
||||
// let msg =
|
||||
if (
|
||||
res?.error &&
|
||||
|
|
@ -662,15 +662,15 @@ export class JiraApiService {
|
|||
|
||||
currentRequest.reject(res);
|
||||
} else {
|
||||
// Log.log('JIRA_RESPONSE', res);
|
||||
// IssueLog.log('JIRA_RESPONSE', res);
|
||||
if (currentRequest.transform) {
|
||||
// data can be invalid, that's why we check
|
||||
try {
|
||||
currentRequest.resolve(currentRequest.transform(res, currentRequest.jiraCfg));
|
||||
} catch (e) {
|
||||
Log.log(res);
|
||||
Log.log(currentRequest);
|
||||
Log.err(e);
|
||||
IssueLog.log(res);
|
||||
IssueLog.log(currentRequest);
|
||||
IssueLog.err(e);
|
||||
this._snackService.open({
|
||||
type: 'ERROR',
|
||||
msg: T.F.JIRA.S.INVALID_RESPONSE,
|
||||
|
|
@ -683,7 +683,7 @@ export class JiraApiService {
|
|||
// delete entry for promise afterwards
|
||||
delete this._requestsLog[res.requestId];
|
||||
} else {
|
||||
Log.err('Jira: Response Request ID not existing', res && res.requestId);
|
||||
IssueLog.err('Jira: Response Request ID not existing', res && res.requestId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -727,7 +727,7 @@ async function streamToJsonIfPossible(stream: ReadableStream): Promise<any> {
|
|||
try {
|
||||
return JSON.parse(text);
|
||||
} catch (e) {
|
||||
Log.err('Jira: Could not parse response', text);
|
||||
IssueLog.err('Jira: Could not parse response', text);
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import { isJiraEnabled } from './is-jira-enabled.util';
|
|||
import { JIRA_POLL_INTERVAL } from './jira.const';
|
||||
import { IssueProviderService } from '../../issue-provider.service';
|
||||
import { assertTruthy } from '../../../../util/assert-truthy';
|
||||
import { Log } from '../../../../core/log';
|
||||
import { IssueLog } from '../../../../core/log';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
|
@ -64,7 +64,7 @@ export class JiraCommonInterfacesService implements IssueServiceInterface {
|
|||
this.isEnabled(jiraCfg)
|
||||
? this._jiraApiService
|
||||
.issuePicker$(searchTerm, jiraCfg)
|
||||
.pipe(tap((v) => Log.log('jira.issuePicker$', v)))
|
||||
.pipe(tap((v) => IssueLog.log('jira.issuePicker$', v)))
|
||||
: of([]),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@ import { IssueProviderKey, SearchResultItem } from '../../issue.model';
|
|||
import { TaskAttachment } from '../../../tasks/task-attachment/task-attachment.model';
|
||||
import { dedupeByKey } from '../../../../util/de-dupe-by-key';
|
||||
import { JIRA_TYPE } from '../../issue.const';
|
||||
import { Log } from '../../../../core/log';
|
||||
import { IssueLog } from '../../../../core/log';
|
||||
|
||||
export const mapToSearchResults = (res: any): SearchResultItem[] => {
|
||||
Log.log(res);
|
||||
IssueLog.log(res);
|
||||
|
||||
const issues = dedupeByKey(
|
||||
res.response.sections.map((sec: any) => sec.issues).flat(),
|
||||
|
|
@ -51,7 +51,7 @@ export const mapToSearchResults = (res: any): SearchResultItem[] => {
|
|||
};
|
||||
|
||||
export const mapToSearchResultsForJQL = (res: any): SearchResultItem[] => {
|
||||
Log.log(res);
|
||||
IssueLog.log(res);
|
||||
|
||||
const issues = dedupeByKey(res.response.issues, 'key').map((issue: any) => {
|
||||
return {
|
||||
|
|
@ -83,7 +83,7 @@ export const mapIssueResponse = (res: any, cfg: JiraCfg): JiraIssue =>
|
|||
export const mapIssue = (issue: JiraIssueOriginal, cfg: JiraCfg): JiraIssue => {
|
||||
const issueCopy = Object.assign({}, issue);
|
||||
const fields = issueCopy.fields;
|
||||
Log.log(fields);
|
||||
IssueLog.log(fields);
|
||||
|
||||
return {
|
||||
key: issueCopy.key,
|
||||
|
|
@ -114,7 +114,7 @@ export const mapIssue = (issue: JiraIssueOriginal, cfg: JiraCfg): JiraIssue => {
|
|||
};
|
||||
|
||||
const mapIssueLinks = (issueLinks: JiraOriginalIssueLink[]): JiraRelatedIssue[] => {
|
||||
Log.log(issueLinks);
|
||||
IssueLog.log(issueLinks);
|
||||
|
||||
return issueLinks.map((il) => {
|
||||
const isInwardIssue = !!il.inwardIssue;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import {
|
|||
} from './format-open-project-work-package-subject.util';
|
||||
import { IssueProviderService } from '../../issue-provider.service';
|
||||
import { getWorklogStr } from '../../../../util/get-work-log-str';
|
||||
import { Log } from '../../../../core/log';
|
||||
import { IssueLog } from '../../../../core/log';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
|
@ -168,7 +168,7 @@ export class OpenProjectCommonInterfacesService implements IssueServiceInterface
|
|||
allExistingIssueIds: number[] | string[],
|
||||
): Promise<OpenProjectWorkPackageReduced[]> {
|
||||
const cfg = await this._getCfgOnce$(issueProviderId).toPromise();
|
||||
Log.log(
|
||||
IssueLog.log(
|
||||
await this._openProjectApiService
|
||||
.getLast100WorkPackagesForCurrentOpenProjectProject$(cfg)
|
||||
.toPromise(),
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ import { MatOption, MatSelect } from '@angular/material/select';
|
|||
import { formatLocalIsoWithoutSeconds } from '../../../../../../util/format-local-iso-without-seconds';
|
||||
import { formatDateYYYYMMDD } from '../../../../../../util/format-date-yyyy-mm-dd';
|
||||
import { msToIsoDuration } from '../../../../../../util/ms-to-iso-duration';
|
||||
import { Log } from '../../../../../../core/log';
|
||||
import { IssueLog } from '../../../../../../core/log';
|
||||
|
||||
@Component({
|
||||
selector: 'dialog-open-project-track-time',
|
||||
|
|
@ -153,7 +153,7 @@ export class DialogOpenProjectTrackTimeComponent implements OnDestroy {
|
|||
);
|
||||
|
||||
constructor() {
|
||||
this._issueProviderIdOnce$.subscribe((v) => Log.log(`_issueProviderIdOnce$`, v));
|
||||
this._issueProviderIdOnce$.subscribe((v) => IssueLog.log(`_issueProviderIdOnce$`, v));
|
||||
|
||||
this.timeSpent = this.data.task.timeSpent;
|
||||
this.workPackage = this.data.workPackage;
|
||||
|
|
@ -184,7 +184,7 @@ export class DialogOpenProjectTrackTimeComponent implements OnDestroy {
|
|||
}
|
||||
|
||||
async postTime(): Promise<void> {
|
||||
Log.log({
|
||||
IssueLog.log({
|
||||
wp: this.workPackage,
|
||||
started: this.started,
|
||||
timeSpent: this.timeSpent,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import {
|
|||
IssueProviderState,
|
||||
} from '../issue.model';
|
||||
import { ICAL_TYPE } from '../issue.const';
|
||||
import { Log } from '../../../core/log';
|
||||
import { IssueLog } from '../../../core/log';
|
||||
|
||||
export const selectIssueProviderState = createFeatureSelector<IssueProviderState>(
|
||||
ISSUE_PROVIDER_FEATURE_KEY,
|
||||
|
|
@ -49,7 +49,7 @@ export const selectIssueProviderById = <T extends IssueProvider>(
|
|||
throw new Error(`No issueProvider found for id ${id}`);
|
||||
}
|
||||
if (issueProviderKey && issueProvider.issueProviderKey !== issueProviderKey) {
|
||||
Log.log(issueProviderKey, issueProvider);
|
||||
IssueLog.log(issueProviderKey, issueProvider);
|
||||
throw new Error(
|
||||
`IssueProvider found for id ${id} is not of type ${issueProviderKey} but ${issueProvider.issueProviderKey}`,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import { IssueProvider } from '../issue.model';
|
|||
import { SnackService } from '../../../core/snack/snack.service';
|
||||
import { getErrorTxt } from '../../../util/get-error-text';
|
||||
import { DELAY_BEFORE_ISSUE_POLLING } from '../issue.const';
|
||||
import { Log } from '../../../core/log';
|
||||
import { IssueLog } from '../../../core/log';
|
||||
|
||||
@Injectable()
|
||||
export class PollToBacklogEffects {
|
||||
|
|
@ -72,7 +72,7 @@ export class PollToBacklogEffects {
|
|||
this._issueService.getPollInterval(provider.issueProviderKey),
|
||||
).pipe(
|
||||
takeUntil(this.pollToBacklogActions$),
|
||||
tap(() => Log.log('POLL ' + provider.issueProviderKey)),
|
||||
tap(() => IssueLog.log('POLL ' + provider.issueProviderKey)),
|
||||
switchMap(() =>
|
||||
this._issueService.checkAndImportNewIssuesToBacklogForProject(
|
||||
provider.issueProviderKey,
|
||||
|
|
@ -80,7 +80,7 @@ export class PollToBacklogEffects {
|
|||
),
|
||||
),
|
||||
catchError((e) => {
|
||||
Log.err(e);
|
||||
IssueLog.err(e);
|
||||
this._snackService.open({
|
||||
type: 'ERROR',
|
||||
// TODO translate
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { Update } from '@ngrx/entity/src/models';
|
|||
import { Store } from '@ngrx/store';
|
||||
import { __updateMultipleTaskSimple } from '../../tasks/store/task.actions';
|
||||
import { TaskArchiveService } from '../../time-tracking/task-archive.service';
|
||||
import { Log } from '../../../core/log';
|
||||
import { IssueLog } from '../../../core/log';
|
||||
|
||||
@Injectable()
|
||||
export class UnlinkAllTasksOnProviderDeletionEffects {
|
||||
|
|
@ -72,7 +72,7 @@ export class UnlinkAllTasksOnProviderDeletionEffects {
|
|||
|
||||
await this._taskArchiveService.updateTasks(archiveTaskUpdates);
|
||||
|
||||
Log.log('unlinkAllTasksOnProviderDeletion$', {
|
||||
IssueLog.log('unlinkAllTasksOnProviderDeletion$', {
|
||||
regularTasks,
|
||||
archiveTasks,
|
||||
taskUpdates,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue