conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
import { TREE_SEP } from '@sqltools/util/constants';
import { parse as queryParse } from '@sqltools/util/query';
=======
import LegacyQueries from './legacy/queries';
import { TREE_SEP } from '@sqltools/core/constants';
>>>>>>>
import { TREE_SEP } from '@sqltools/util/constants';
import { parse as queryParse } from '@sqltools/util/query';
import LegacyQueries from './legacy/queries'; |
<<<<<<<
children: React.ReactElement[] | React.ReactElement
HeaderComponent?: React.JSXElementConstructor<TabBarProps<T>>
TabBarComponent?: React.JSXElementConstructor<TabBarProps<T>>
=======
children: React.ReactElement[]
HeaderComponent?: (props: TabBarProps<T>) => React.ReactElement
TabBarComponent?: (props: TabBarProps<T>) => React.ReactElement
>>>>>>>
children: React.ReactElement[] | React.ReactElement
HeaderComponent?: (props: TabBarProps<T>) => React.ReactElement
TabBarComponent?: (props: TabBarProps<T>) => React.ReactElement |
<<<<<<<
<<<<<<< HEAD
export { default as Popover } from "./Popover";
export { default as TextField } from "./TextField";
=======
=======
export { default as RelativeTime } from "./RelativeTime";
export { default as UIContext, UIContextProps } from "./UIContext";
>>>>>>>
export { default as Popover } from "./Popover";
export { default as TextField } from "./TextField";
export { default as RelativeTime } from "./RelativeTime";
export { default as UIContext, UIContextProps } from "./UIContext"; |
<<<<<<<
import { CapsuleExt } from '../../capsule';
=======
import { Extension } from '../../harmony';
import { CapsuleExt } from '../capsule';
>>>>>>>
import { CapsuleExt } from '../capsule'; |
<<<<<<<
export default async function provideSnap(config: SnapConfig, [paper, workspace, scope]: SnapDeps) {
const snap = new Snap(workspace, scope);
paper.register(new SnapCommand(snap));
return snap;
=======
export default async function provideSnap(config: SnapConfig, [paper, workspace, scope]: SnapDeps, harmony: Harmony) {
// const snap = new Snap(workspace, scope);
// paper.register(new SnapCommand(snap));
// return snap;
>>>>>>>
export default async function provideSnap(config: SnapConfig, [paper, workspace, scope]: SnapDeps) {
// const snap = new Snap(workspace, scope);
// paper.register(new SnapCommand(snap));
// return snap; |
<<<<<<<
export default async function provideWorkspace(
config: WorkspaceCoreConfig,
[workspaceConfig, scope, component, capsule]: WorkspaceDeps
) {
=======
export default async function provideWorkspace(config: WorkspaceConfig, [scope, component, network]: WorkspaceDeps) {
>>>>>>>
export default async function provideWorkspace(
config: WorkspaceCoreConfig,
[workspaceConfig, scope, component, network]: WorkspaceDeps
) {
<<<<<<<
const workspace = new Workspace(consumer, workspaceConfig, scope, component, capsule);
=======
const workspace = new Workspace(consumer, scope, component, network);
>>>>>>>
const workspace = new Workspace(consumer, workspaceConfig, scope, component, network); |
<<<<<<<
import { WorkspaceConfigExt } from '../workspace-config';
=======
import { ReporterExt } from '../reporter';
>>>>>>>
import { WorkspaceConfigExt } from '../workspace-config';
import { ReporterExt } from '../reporter';
<<<<<<<
dependencies: [WorkspaceConfigExt, ScopeExt, ComponentFactoryExt, IsolatorExt],
=======
dependencies: [ScopeExt, ComponentFactoryExt, IsolatorExt, ReporterExt],
>>>>>>>
dependencies: [WorkspaceConfigExt, ScopeExt, ComponentFactoryExt, IsolatorExt, ReporterExt], |
<<<<<<<
export { Bundler, BundlerComponentResult } from './bundler';
export type { BundlerMain } from './bundler.main.runtime';
export { BundlerAspect } from './bundler.aspect';
=======
export { Bundler, BundlerComponentResult } from './bundler';
export { ComponentDir } from './get-entry';
export { ComponentServer } from './component-server';
>>>>>>>
export { Bundler, BundlerComponentResult } from './bundler';
export type { BundlerMain } from './bundler.main.runtime';
export { BundlerAspect } from './bundler.aspect';
export { ComponentDir } from './get-entry';
export { ComponentServer } from './component-server'; |
<<<<<<<
import { BIT_WORKSPACE_TMP_DIRNAME, COMPILER_ENV_TYPE, TESTER_ENV_TYPE } from '../../src/constants';
import { statusWorkspaceIsCleanMsg } from '../../src/cli/commands/public-cmds/status-cmd';
=======
import InvalidConfigDir from '../../src/consumer/bit-map/exceptions/invalid-config-dir';
import { COMPONENT_DIR, BIT_WORKSPACE_TMP_DIRNAME, COMPILER_ENV_TYPE, TESTER_ENV_TYPE } from '../../src/constants';
>>>>>>>
import { BIT_WORKSPACE_TMP_DIRNAME, COMPILER_ENV_TYPE, TESTER_ENV_TYPE } from '../../src/constants';
<<<<<<<
=======
describe('change envs files', () => {
describe('change a compiler file', () => {
let compilerFile;
before(() => {
compilerFile = path.join(helper.scopes.localPath, compilerFilesFolder, '.babelrc');
helper.scopeHelper.getClonedLocalScope(importedScopeBeforeChanges);
helper.fs.createFile(compilerFilesFolder, '.babelrc', '{"some": "thing"}');
});
it('should show the component as modified', () => {
const statusOutput = helper.command.status();
expect(statusOutput).to.have.string('modified components');
expect(statusOutput).to.have.string('comp/my-comp ... ok');
});
describe('running eject-conf without --force flag', () => {
let output;
before(() => {
output = helper.general.runWithTryCatch('bit inject-conf comp/my-comp');
});
it('should throw an error', () => {
expect(output).to.have.string('unable to inject-conf');
});
it('should not delete the configuration file', () => {
expect(compilerFile).to.be.a.file();
});
});
describe('running eject-conf with --force flag', () => {
let output;
before(() => {
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
output = helper.command.injectConf('comp/my-comp --force');
});
it('should show a success message', () => {
expect(output).to.have.string('successfully injected');
});
it('should delete the configuration file', () => {
expect(compilerFile).to.not.be.a.path();
});
});
});
describe('rename a compiler file', () => {
before(() => {
helper.scopeHelper.getClonedLocalScope(importedScopeBeforeChanges);
fs.moveSync(path.join(fullComponentFolder, '.babelrc'), path.join(fullComponentFolder, '.babelrc2'));
helper.bitJson.addFileToEnv(fullComponentFolder, '.babelrc', './.babelrc2', COMPILER_ENV_TYPE);
});
it('should show the component as modified', () => {
const statusOutput = helper.command.status();
expect(statusOutput).to.have.string('modified components');
expect(statusOutput).to.have.string('comp/my-comp ... ok');
});
it('bit-diff should show the changes', () => {
const diffOutput = helper.command.diff('comp/my-comp');
expect(diffOutput).to.have.string('- [ .babelrc => .babelrc ]');
expect(diffOutput).to.have.string('+ [ .babelrc => .babelrc2 ]');
});
});
describe('change a tester file', () => {
before(() => {
helper.scopeHelper.getClonedLocalScope(importedScopeBeforeChanges);
helper.fs.createFile(testerFilesFolder, 'mocha-config.opts', 'something');
});
it('should show the component as modified', () => {
const statusOutput = helper.command.status();
expect(statusOutput).to.have.string('modified components');
expect(statusOutput).to.have.string('comp/my-comp ... ok');
});
});
});
});
describe('with custom ejectedEnvsDirectory', () => {
const ejectedEnvsDirectory = 'custom-envs-config';
let envFilesFolder;
let envFilesFullFolder;
let compilerFilesFolder;
let compilerFilesFullFolder;
let testerFilesFolder;
let testerFilesFullFolder;
before(() => {
envFilesFolder = path.join(ejectedEnvsDirectory);
envFilesFullFolder = path.join(helper.scopes.localPath, envFilesFolder);
compilerFilesFolder = path.join(envFilesFolder, COMPILER_ENV_TYPE);
compilerFilesFullFolder = path.join(envFilesFullFolder, COMPILER_ENV_TYPE);
testerFilesFolder = path.join(envFilesFolder, TESTER_ENV_TYPE);
testerFilesFullFolder = path.join(envFilesFullFolder, TESTER_ENV_TYPE);
helper.scopeHelper.reInitLocalScope();
helper.scopeHelper.addRemoteScope();
helper.scopeHelper.addRemoteEnvironment();
helper.bitJson.addKeyVal(
helper.scopes.localPath,
'ejectedEnvsDirectory',
`${ejectedEnvsDirectory}/{ENV_TYPE}`
);
helper.command.importComponentWithOptions('comp/my-comp', { '-conf': '' });
fullComponentFolder = path.join(helper.scopes.localPath, 'components', 'comp', 'my-comp');
bitJsonPath = path.join(fullComponentFolder, 'bit.json');
importedScopeBeforeChanges = helper.scopeHelper.cloneLocalScope();
});
it('should store the files under the custom directory', () => {
bitJsonPath = path.join(envFilesFullFolder, 'bit.json');
expect(bitJsonPath).to.be.file();
const babelrcPath = path.join(compilerFilesFullFolder, '.babelrc');
expect(babelrcPath).to.be.file();
const mochaConfig = path.join(testerFilesFullFolder, 'mocha-config.opts');
expect(mochaConfig).to.be.file();
});
// @todo: this has been skipped temporarily since the change of overriding envs via package.json, see PR #1576
it.skip('should build the component successfully', () => {
// Chaning the component to make sure we really run a rebuild and not taking the dist from the models
helper.scopeHelper.getClonedLocalScope(importedScopeBeforeChanges);
helper.fs.createFile(componentFolder, 'objRestSpread.js', fixtures.objectRestSpreadWithChange);
const output = helper.command.build('comp/my-comp');
expect(output).to.have.string(path.join('dist', 'objRestSpread.js.map'));
expect(output).to.have.string(path.join('dist', 'objRestSpread.js'));
const distFilePath = path.join(
helper.scopes.localPath,
'components',
'comp',
'my-comp',
'dist',
'objRestSpread.js'
);
const distContent = fs.readFileSync(distFilePath).toString();
expect(distContent).to.have.string(
'var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var g=5;var x={a:"a",b:"c"};var y={c:"c"};var z=_extends({},x,y);'
);
});
describe.skip('deleting the custom config directory', () => {
before(() => {
helper.scopeHelper.getClonedLocalScope(importedScopeBeforeChanges);
helper.fs.deletePath(envFilesFolder);
});
it('bit status should not throw an error', () => {
const statusFunc = () => helper.command.status();
expect(statusFunc).not.to.throw();
});
});
describe('a file added to ejectedEnvsDirectory', () => {
before(() => {
helper.scopeHelper.getClonedLocalScope(importedScopeBeforeChanges);
helper.fs.createFile(
compilerFilesFolder,
'someFile.js',
JSON.stringify({ someConfKey: 'someConfVal' }, null, 2)
);
helper.fs.createFile(
testerFilesFolder,
'someFile.js',
JSON.stringify({ someConfKey: 'someConfVal' }, null, 2)
);
});
// @todo: this has been skipped temporarily since the change of overriding envs via package.json, see PR #1576
it.skip('should not show the component as modified', () => {
helper.command.expectStatusToBeClean();
});
});
describe('change envs files', () => {
beforeEach(() => {
// Restore to clean state of the scope
helper.scopeHelper.getClonedLocalScope(importedScopeBeforeChanges);
envFilesFolder = ejectedEnvsDirectory;
envFilesFullFolder = path.join(helper.scopes.localPath, envFilesFolder);
compilerFilesFolder = path.join(envFilesFolder, COMPILER_ENV_TYPE);
testerFilesFolder = path.join(envFilesFolder, TESTER_ENV_TYPE);
});
it('should show the component as modified if compiler file has been changed', () => {
helper.fs.createFile(compilerFilesFolder, '.babelrc', '{"some": "thing"}');
const statusOutput = helper.command.status();
expect(statusOutput).to.have.string('modified components');
expect(statusOutput).to.have.string('comp/my-comp ... ok');
});
it('should show the component as modified if tester file has been changed', () => {
helper.fs.createFile(testerFilesFolder, 'mocha-config.opts', 'something');
const statusOutput = helper.command.status();
expect(statusOutput).to.have.string('modified components');
expect(statusOutput).to.have.string('comp/my-comp ... ok');
});
});
>>>>>>>
<<<<<<<
=======
describe('envs with relative paths', function() {
this.timeout(0);
let helper: Helper;
before(() => {
helper = new Helper();
});
before(() => {
helper.scopeHelper.setNewLocalAndRemoteScopes();
helper.env.importCompiler();
const dest = path.join(helper.scopes.localPath, 'base');
helper.fixtures.copyFixtureFile(
path.join('compilers', 'webpack-relative', 'base', 'base.config.js'),
'base.config.js',
dest
);
helper.fixtures.copyFixtureFile(path.join('compilers', 'webpack-relative', 'dev.config.js'));
helper.npm.addNpmPackage('webpack-merge', '4.1.4');
helper.npm.addNpmPackage('webpack', '4.16.5');
helper.bitJson.addFileToEnv(undefined, 'base.config.js', './base/base.config.js', 'compiler');
helper.bitJson.addFileToEnv(undefined, 'dev.config.js', './dev.config.js', 'compiler');
helper.fixtures.createComponentBarFoo();
helper.fixtures.addComponentBarFoo();
});
after(() => {
helper.scopeHelper.destroy();
});
describe('tagging the component', () => {
before(() => {
helper.command.tagAllComponents();
});
it('should save the relative paths of the compiler files', () => {
const catComponent = helper.command.catComponent('bar/foo@latest');
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
expect(catComponent.compiler.files).to.have.lengthOf(2);
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
expect(catComponent.compiler.files[0].relativePath).to.equal('base/base.config.js');
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
expect(catComponent.compiler.files[1].relativePath).to.equal('dev.config.js');
});
describe('exporting and importing the component with --conf', () => {
before(() => {
helper.command.exportAllComponents();
helper.scopeHelper.reInitLocalScope();
helper.scopeHelper.addRemoteScope();
helper.command.importComponent('bar/foo --conf');
});
it('should write the configuration files according to their relativePaths', () => {
expect(path.join(helper.scopes.localPath, 'components/bar/foo/base/base.config.js')).to.be.a.file();
expect(path.join(helper.scopes.localPath, 'components/bar/foo/dev.config.js')).to.be.a.file();
});
it('should not show the component as modified', () => {
helper.command.expectStatusToBeClean();
});
});
});
});
>>>>>>> |
<<<<<<<
runTask(taskName: string) {
return this.runCmd(`bit run ${taskName}`);
}
create(name: string) {
return this.runCmd(`bit create ${name}`);
}
=======
moveComponent(id: string, to: string) {
return this.runCmd(`bit move ${id} ${path.normalize(to)} --component`);
}
>>>>>>>
runTask(taskName: string) {
return this.runCmd(`bit run ${taskName}`);
}
create(name: string) {
return this.runCmd(`bit create ${name}`);
}
moveComponent(id: string, to: string) {
return this.runCmd(`bit move ${id} ${path.normalize(to)} --component`);
} |
<<<<<<<
export { default as TrapFocus } from "./TrapFocus";
export { default as ClickOutside } from "./ClickOutside";
=======
export { default as TrapFocus } from "./TrapFocus";
export { default as Popup } from "./Popup";
>>>>>>>
export { default as TrapFocus } from "./TrapFocus";
export { default as ClickOutside } from "./ClickOutside";
export { default as Popup } from "./Popup"; |
<<<<<<<
import { Capsule } from '../../capsule';
import { Build } from '../build';
=======
import { Capsule } from '../capsule';
import { BitCli } from '../cli';
>>>>>>>
import { BitCli } from '../cli';
import { Build } from '../build'; |
<<<<<<<
=======
appAuthHTML: resolveSrc("core/client/auth/index.html"),
appAuthLocalesTemplate: resolveSrc("core/client/auth/locales.ts"),
appAuthIndex: resolveSrc("core/client/auth/index.tsx"),
>>>>>>>
appAuthHTML: resolveSrc("core/client/auth/index.html"),
appAuthLocalesTemplate: resolveSrc("core/client/auth/locales.ts"),
appAuthIndex: resolveSrc("core/client/auth/index.tsx"), |
<<<<<<<
import { Harmony, ExtensionManifest } from '@teambit/harmony';
import { difference, groupBy } from 'ramda';
import { compact } from 'ramda-adjunct';
=======
import { Harmony, ExtensionManifest } from '@teambit/harmony';
import { difference, groupBy } from 'ramda';
>>>>>>>
import { Harmony, ExtensionManifest } from '@teambit/harmony';
import { difference, groupBy } from 'ramda';
import { compact } from 'ramda-adjunct';
<<<<<<<
import { MissingBitMapComponent } from '../../consumer/bit-map/exceptions';
import GeneralError from '../../error/general-error';
import { ExtensionConfigList, ExtensionConfigEntry } from '../workspace-config/extension-config-list';
import { coreConfigurableExtensions } from './core-configurable-extensions';
import { ComponentScopeDirMap } from '../workspace-config/workspace-settings';
=======
import { MissingBitMapComponent } from '../../consumer/bit-map/exceptions';
import GeneralError from '../../error/general-error';
import { ExtensionConfigList, ExtensionConfigEntry } from '../workspace-config/extension-config-list';
import { coreConfigurableExtensions } from './core-configurable-extensions';
>>>>>>>
import { MissingBitMapComponent } from '../../consumer/bit-map/exceptions';
import GeneralError from '../../error/general-error';
import { ExtensionConfigList, ExtensionConfigEntry } from '../workspace-config/extension-config-list';
import { coreConfigurableExtensions } from './core-configurable-extensions';
import { ComponentScopeDirMap } from '../workspace-config/workspace-settings';
<<<<<<<
private componentList: ComponentsList = new ComponentsList(consumer),
=======
private componentList: ComponentsList = new ComponentsList(consumer),
/**
* private reference to the instance of Harmony.
*/
private harmony: Harmony
) {}
>>>>>>>
private componentList: ComponentsList = new ComponentsList(consumer),
<<<<<<<
async loadWorkspaceExtensions() {
const extensionsConfig = this.config.workspaceSettings.extensionsConfig;
const extensionsConfigGroups = this.groupByCoreExtensions(extensionsConfig);
// Do not load workspace extension again
const coreExtensionsWithoutWorkspaceConfig = extensionsConfigGroups.true.filter(
config => config.id !== 'workspace'
);
const coreExtensionsManifests = coreExtensionsWithoutWorkspaceConfig.map(
configEntry => coreConfigurableExtensions[configEntry.id]
);
const externalExtensionsManifests = await this.resolveExtensions(extensionsConfigGroups.false.ids);
await this.loadExtensions([...coreExtensionsManifests, ...externalExtensionsManifests]);
}
private groupByCoreExtensions(
extensionsConfig: ExtensionConfigList
): { true: ExtensionConfigList; false: ExtensionConfigList } {
const coreNames = Object.keys(coreConfigurableExtensions);
const isCore = (config: ExtensionConfigEntry): boolean => {
return coreNames.includes(config.id);
};
const groups = groupBy(isCore, extensionsConfig);
groups.false = ExtensionConfigList.fromArray(groups.false);
groups.true = ExtensionConfigList.fromArray(groups.true);
return groups;
}
async loadExtensionsByConfig(extensionsConfig: ExtensionConfigList) {
const extensionsManifests = await this.resolveExtensions(extensionsConfig.ids);
if (extensionsManifests && extensionsManifests.length) {
await this.loadExtensions(extensionsManifests);
}
}
private async loadExtensions(extensionsManifests: ExtensionManifest[]) {
await this.harmony.set(extensionsManifests);
}
/**
* load all of bit's extensions.
* :TODO must be refactored by @gilad
*/
private async resolveExtensions(extensionsIds: string[]): Promise<ExtensionManifest[]> {
// const extensionsIds = extensionsConfig.ids;
if (!extensionsIds || !extensionsIds.length) {
return [];
}
const allRegisteredExtensionIds = this.harmony.extensionsIds;
const nonRegisteredExtensions = difference(extensionsIds, allRegisteredExtensionIds);
let extensionsComponents;
// TODO: improve this, instead of catching an error, add some api in workspace to see if something from the list is missing
try {
extensionsComponents = await this.getMany(nonRegisteredExtensions);
} catch (e) {
if (e instanceof MissingBitMapComponent) {
throw new GeneralError(
`could not find an extension "${e.id}" or a known config with this name defined in the workspace config`
);
}
}
const isolatedNetwork = await this.isolateEnv.createNetworkFromConsumer(
extensionsComponents.map(c => c.id.toString()),
this.consumer,
{ packageManager: 'yarn' }
);
const manifests = isolatedNetwork.capsules.map(({ value, id }) => {
const extPath = value.wrkDir;
// eslint-disable-next-line global-require, import/no-dynamic-require
const mod = require(extPath);
mod.name = id.toString();
return mod;
});
return manifests;
}
=======
async loadWorkspaceExtensions() {
const extensionsConfig = this.config.extensions || {};
const extensionsConfigGroups = this.groupByCoreExtensions(ExtensionConfigList.fromObject(extensionsConfig));
// Do not load workspace extension again
const coreExtensionsWithoutWorkspaceConfig = extensionsConfigGroups.true.filter(
config => config.id !== 'workspace'
);
const coreExtensionsManifests = coreExtensionsWithoutWorkspaceConfig.map(
configEntry => coreConfigurableExtensions[configEntry.id]
);
const externalExtensionsWithoutLegacy = extensionsConfigGroups.false._filterLegacy();
const externalExtensionsManifests = await this.resolveExtensions(externalExtensionsWithoutLegacy.ids);
await this.loadExtensions([...coreExtensionsManifests, ...externalExtensionsManifests]);
}
private groupByCoreExtensions(
extensionsConfig: ExtensionConfigList
): { true: ExtensionConfigList; false: ExtensionConfigList } {
const coreNames = Object.keys(coreConfigurableExtensions);
const isCore = (config: ExtensionConfigEntry): boolean => {
return coreNames.includes(config.id);
};
const groups = groupBy(isCore, extensionsConfig);
groups.false = ExtensionConfigList.fromArray(groups.false);
groups.true = ExtensionConfigList.fromArray(groups.true);
return groups;
}
async loadExtensionsByConfig(extensionsConfig: ExtensionConfigList) {
const extensionsManifests = await this.resolveExtensions(extensionsConfig.ids);
if (extensionsManifests && extensionsManifests.length) {
await this.loadExtensions(extensionsManifests);
}
}
private async loadExtensions(extensionsManifests: ExtensionManifest[]) {
await this.harmony.set(extensionsManifests);
}
/**
* load all of bit's extensions.
* :TODO must be refactored by @gilad
*/
private async resolveExtensions(extensionsIds: string[]): Promise<ExtensionManifest[]> {
if (!extensionsIds || !extensionsIds.length) {
return [];
}
const allRegisteredExtensionIds = this.harmony.extensionsIds;
const nonRegisteredExtensions = difference(extensionsIds, allRegisteredExtensionIds);
let extensionsComponents;
// TODO: improve this, instead of catching an error, add some api in workspace to see if something from the list is missing
try {
extensionsComponents = await this.getMany(nonRegisteredExtensions);
} catch (e) {
if (e instanceof MissingBitMapComponent) {
throw new GeneralError(
`could not find an extension "${e.id}" or a known config with this name defined in the workspace config`
);
}
}
const isolatedNetwork = await this.isolateEnv.createNetworkFromConsumer(
extensionsComponents.map(c => c.id.toString()),
this.consumer,
{ packageManager: 'yarn' }
);
const manifests = isolatedNetwork.capsules.map(({ value, id }) => {
const extPath = value.wrkDir;
// eslint-disable-next-line global-require, import/no-dynamic-require
const mod = require(extPath);
mod.name = id.toString();
return mod;
});
return manifests;
}
>>>>>>>
async loadWorkspaceExtensions() {
const extensionsConfig = this.config.workspaceSettings.extensionsConfig;
const extensionsConfigGroups = this.groupByCoreExtensions(extensionsConfig);
// Do not load workspace extension again
const coreExtensionsWithoutWorkspaceConfig = extensionsConfigGroups.true.filter(
config => config.id !== 'workspace'
);
const coreExtensionsManifests = coreExtensionsWithoutWorkspaceConfig.map(
configEntry => coreConfigurableExtensions[configEntry.id]
);
const externalExtensionsWithoutLegacy = extensionsConfigGroups.false._filterLegacy();
const externalExtensionsManifests = await this.resolveExtensions(externalExtensionsWithoutLegacy.ids);
await this.loadExtensions([...coreExtensionsManifests, ...externalExtensionsManifests]);
}
private groupByCoreExtensions(
extensionsConfig: ExtensionConfigList
): { true: ExtensionConfigList; false: ExtensionConfigList } {
const coreNames = Object.keys(coreConfigurableExtensions);
const isCore = (config: ExtensionConfigEntry): boolean => {
return coreNames.includes(config.id);
};
const groups = groupBy(isCore, extensionsConfig);
groups.false = ExtensionConfigList.fromArray(groups.false);
groups.true = ExtensionConfigList.fromArray(groups.true);
return groups;
}
async loadExtensionsByConfig(extensionsConfig: ExtensionConfigList) {
const extensionsManifests = await this.resolveExtensions(extensionsConfig.ids);
if (extensionsManifests && extensionsManifests.length) {
await this.loadExtensions(extensionsManifests);
}
}
private async loadExtensions(extensionsManifests: ExtensionManifest[]) {
await this.harmony.set(extensionsManifests);
}
/**
* load all of bit's extensions.
* :TODO must be refactored by @gilad
*/
private async resolveExtensions(extensionsIds: string[]): Promise<ExtensionManifest[]> {
// const extensionsIds = extensionsConfig.ids;
if (!extensionsIds || !extensionsIds.length) {
return [];
}
const allRegisteredExtensionIds = this.harmony.extensionsIds;
const nonRegisteredExtensions = difference(extensionsIds, allRegisteredExtensionIds);
let extensionsComponents;
// TODO: improve this, instead of catching an error, add some api in workspace to see if something from the list is missing
try {
extensionsComponents = await this.getMany(nonRegisteredExtensions);
} catch (e) {
if (e instanceof MissingBitMapComponent) {
throw new GeneralError(
`could not find an extension "${e.id}" or a known config with this name defined in the workspace config`
);
}
}
const isolatedNetwork = await this.isolateEnv.createNetworkFromConsumer(
extensionsComponents.map(c => c.id.toString()),
this.consumer,
{ packageManager: 'yarn' }
);
const manifests = isolatedNetwork.capsules.map(({ value, id }) => {
const extPath = value.wrkDir;
// eslint-disable-next-line global-require, import/no-dynamic-require
const mod = require(extPath);
mod.name = id.toString();
return mod;
});
return manifests;
} |
<<<<<<<
=======
export { Environments, Descriptor } from './environments.extension';
>>>>>>>
export { Environments, Descriptor } from './environments.extension';
<<<<<<<
export { EnvService } from './services';
export { EnvRuntime } from './runtime/env-runtime';
export type { EnvsMain } from './environments.main.runtime';
export { EnvsAspect } from './environments.aspect';
=======
export { EnvService, ConcreteService } from './services';
export { EnvRuntime } from './runtime/env-runtime';
>>>>>>>
export { EnvService, ConcreteService } from './services';
export { EnvRuntime } from './runtime/env-runtime';
export type { EnvsMain } from './environments.main.runtime';
export { EnvsAspect } from './environments.aspect'; |
<<<<<<<
import Run from './commands/public-cmds/run-cmd';
import Capsule from './commands/public-cmds/capsule-cmd';
=======
import { CapsuleCreate, CapsuleList, CapsuleDescribe } from './commands/public-cmds/capsule-cmd';
>>>>>>>
import Run from './commands/public-cmds/run-cmd';
import Capsule from './commands/public-cmds/capsule-cmd';
import { CapsuleCreate, CapsuleList, CapsuleDescribe } from './commands/public-cmds/capsule-cmd';
<<<<<<<
new Run(),
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
new Capsule()
=======
new CapsuleCreate(),
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
new CapsuleList(),
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
new CapsuleDescribe()
>>>>>>>
new Run(),
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
new CapsuleCreate(),
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
new CapsuleList(),
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
new CapsuleDescribe() |
<<<<<<<
group: 'component',
title: 'add, modify and control components',
=======
title: 'Develop components',
>>>>>>>
group: 'component',
title: 'Develop components',
<<<<<<<
group: 'collaborate',
title: 'collaborate and share components',
=======
title: 'Collaborate on components',
>>>>>>>
group: 'collaborate',
title: 'Collaborate on components',
<<<<<<<
group: 'discover',
title: 'discover components',
=======
title: 'Explore components',
>>>>>>>
group: 'discover',
title: 'Explore components',
<<<<<<<
group: 'info',
title: 'examine component history and state',
=======
title: 'View components',
>>>>>>>
group: 'info',
title: 'View components',
<<<<<<<
group: 'general',
title: 'general commands',
=======
title: 'Workspace commands',
>>>>>>>
group: 'general',
title: 'Workspace commands', |
<<<<<<<
import { Component, Inject, OnDestroy, ViewEncapsulation } from '@angular/core';
import { Router } from '@angular/router';
import { ShareService } from '../../shared/services/share.service';
import { PatientService } from '../../shared/services/patient.service';
import { MenuController } from '@ionic/angular';
import { LeaveReasonEnum, LeaveRequestService } from '../../shared/services/leave-request.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { TestAppointmentService } from "../../shared/services/test-appointment.service";
import { Subscription } from "rxjs";
import { AppointmentType } from "../../../../../server/src/common/utils/enums";
import { LeaveRequestWithRelations } from '../../../../../app-health/src/app/shared/sdk/model/leaveRequestWithRelations';
=======
import {Component, Inject, OnDestroy, ViewEncapsulation} from '@angular/core';
import {Router} from '@angular/router';
import {ShareService} from '../../shared/services/share.service';
import {PatientService} from '../../shared/services/patient.service';
import {MenuController} from '@ionic/angular';
import {LeaveReasonEnum, LeaveRequestService} from '../../shared/services/leave-request.service';
import {InAppBrowser} from '@ionic-native/in-app-browser/ngx';
import {TestAppointmentService} from "../../shared/services/test-appointment.service";
import {Subscription} from "rxjs";
import {AppointmentType} from "../../../../../server/src/common/utils/enums";
>>>>>>>
import { Component, Inject, OnDestroy, ViewEncapsulation } from '@angular/core';
import { Router } from '@angular/router';
import { ShareService } from '../../shared/services/share.service';
import { PatientService } from '../../shared/services/patient.service';
import { MenuController } from '@ionic/angular';
import { LeaveReasonEnum, LeaveRequestService } from '../../shared/services/leave-request.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { TestAppointmentService } from "../../shared/services/test-appointment.service";
import { Subscription } from "rxjs";
import { AppointmentType } from "../../../../../server/src/common/utils/enums";
import { LeaveRequestWithRelations } from '../../../../../app-health/src/app/shared/sdk/model/leaveRequestWithRelations';
<<<<<<<
constructor(
protected router: Router,
=======
public serviceAdvertisementUUID;
constructor(protected router: Router,
>>>>>>>
public serviceAdvertisementUUID;
constructor(protected router: Router,
<<<<<<<
// this.patientService.patient.status = 2;
this.patientName = this.patientService.patient.firstName;
=======
// this.patientService.patient.status = 4;
this.patientName = this.patientService.patient.firstName + " " + this.patientService.patient.lastName;
this.serviceAdvertisementUUID = this.patientService.patient.serviceAdvertisementUUID;
>>>>>>>
this.patientName = this.patientService.patient.firstName + " " + this.patientService.patient.lastName;
this.serviceAdvertisementUUID = this.patientService.patient.serviceAdvertisementUUID; |
<<<<<<<
ACTION_ITEM_TYPE,
retrieveManyUserActionPresence,
} from "talk-server/models/action";
import {
=======
Comment,
>>>>>>>
ACTION_ITEM_TYPE,
retrieveManyUserActionPresence,
} from "talk-server/models/action";
import {
Comment, |
<<<<<<<
import { BaseModelStub } from '../models/base.model';
import { ErrorService } from './error.service';
import { BackendResource } from '../decorators/backend-resource.decorator';
import { Subject } from 'rxjs/Subject';
=======
import { BaseModelStub } from '../models';
import { BackendResource } from '../decorators';
import { ConfigService } from './config.service';
import { StorageService } from './storage.service';
import { UserService } from './user.service';
>>>>>>>
import { BaseModelStub } from '../models';
import { BackendResource } from '../decorators';
import { ConfigService } from './config.service';
import { StorageService } from './storage.service';
import { UserService } from './user.service';
import { BaseModelStub } from '../models/base.model';
import { ErrorService } from './error.service';
import { BackendResource } from '../decorators/backend-resource.decorator';
import { Subject } from 'rxjs/Subject';
<<<<<<<
this.loggedIn = new BehaviorSubject<boolean>(!!this.userId);
=======
this.loggedIn = new BehaviorSubject<string>(!!this.userId ? 'login' : 'logout');
debounce(this.refreshSession, 1000, { leading: true });
debounce(this.resetTimer, 1000, { leading: true });
Observable.forkJoin(
this.getInactivityTimeout(),
this.getSessionRefreshInterval()
)
.subscribe(([inactivityTimeout, sessionRefreshInterval]) => {
this.inactivityTimeout = inactivityTimeout;
this.sessionRefreshInterval = sessionRefreshInterval;
this.resetTimer();
this.addEventListeners();
});
}
public setInactivityTimeout(value: number): Observable<void> {
return this.userService.writeTag('sessionTimeout', value.toString())
.map(() => {
this.inactivityTimeout = value;
this.resetTimer();
});
}
public getInactivityTimeout(): Observable<number> {
if (this.inactivityTimeout) {
return Observable.of(this.inactivityTimeout);
}
return this.userService.readTag('sessionTimeout')
.switchMap(timeout => {
const convertedTimeout = +timeout;
if (Number.isNaN(convertedTimeout)) {
const newTimeout = 0;
return this.userService
.writeTag('sessionTimeout', newTimeout.toString())
.map(() => newTimeout);
} else {
return Observable.of(convertedTimeout);
}
});
>>>>>>>
this.loggedIn = new BehaviorSubject<boolean>(!!this.userId);
debounce(this.refreshSession, 1000, { leading: true });
debounce(this.resetTimer, 1000, { leading: true });
Observable.forkJoin(
this.getInactivityTimeout(),
this.getSessionRefreshInterval()
)
.subscribe(([inactivityTimeout, sessionRefreshInterval]) => {
this.inactivityTimeout = inactivityTimeout;
this.sessionRefreshInterval = sessionRefreshInterval;
this.resetTimer();
this.addEventListeners();
});
}
public setInactivityTimeout(value: number): Observable<void> {
return this.userService.writeTag('sessionTimeout', value.toString())
.map(() => {
this.inactivityTimeout = value;
this.resetTimer();
});
}
public getInactivityTimeout(): Observable<number> {
if (this.inactivityTimeout) {
return Observable.of(this.inactivityTimeout);
}
return this.userService.readTag('sessionTimeout')
.switchMap(timeout => {
const convertedTimeout = +timeout;
if (Number.isNaN(convertedTimeout)) {
const newTimeout = 0;
return this.userService
.writeTag('sessionTimeout', newTimeout.toString())
.map(() => newTimeout);
} else {
return Observable.of(convertedTimeout);
}
}); |
<<<<<<<
actionCounts: asset => decodeActionCounts(asset.action_counts),
=======
commentCounts: asset => asset.comment_counts,
>>>>>>>
actionCounts: asset => decodeActionCounts(asset.action_counts),
commentCounts: asset => asset.comment_counts, |
<<<<<<<
import { AffinityGroup } from '../../shared/models/affinity-group.model';
=======
import { Color } from '../../shared/models/color.model';
>>>>>>>
import { AffinityGroup } from '../../shared/models/affinity-group.model';
import { Color } from '../../shared/models/color.model'; |
<<<<<<<
public updateDiskOffering(offering: DiskOffering): void {
this.showRootDiskResize = offering.isCustomized;
this.selectedDiskOffering = offering;
}
=======
public ngOnInit(): void {
this.resetVmCreateData();
}
// todo
>>>>>>>
public ngOnInit(): void {
this.resetVmCreateData();
}
public updateDiskOffering(offering: DiskOffering): void {
this.showRootDiskResize = offering.isCustomized;
this.selectedDiskOffering = offering;
}
// todo
<<<<<<<
public deployVm(): void {
let notificationId: string;
=======
public deployVm(): Observable<VirtualMachine> {
>>>>>>>
public deployVm(): Observable<VirtualMachine> {
let notificationId: string;
<<<<<<<
=======
let notificationId: string;
>>>>>>>
<<<<<<<
]).switchMap(strs => {
notificationId = this.jobsNotificationService.add(strs['VM_DEPLOY_IN_PROGRESS']);
return this.securityGroupService.createWithRules(
{
name: this.utils.getUniqueId() + GROUP_POSTFIX
},
params.ingress || [],
params.egress || []
);
})
.subscribe(
securityGroup => {
params['securityGroupIds'] = securityGroup.id;
this._deploy(params, notificationId);
},
() => {
this.notifyOnDeployFailed(notificationId);
}
);
=======
])
.subscribe(strs => {
notificationId = this.jobsNotificationService.add(strs['VM_DEPLOY_IN_PROGRESS']);
});
let observable = this.securityGroupService.createWithRules(
{ name: this.utils.getUniqueId() + GROUP_POSTFIX },
params.ingress || [],
params.egress || []
)
.switchMap(securityGroup => {
params['securitygroupids'] = securityGroup.id;
return this.vmService.deploy(params);
})
.publish();
observable.connect();
observable
.switchMap(deployResponse => this.vmService.checkCommand(deployResponse.jobid))
.subscribe(job => {
this.notifyOnDeployDone(notificationId);
if (!job.jobResult.password) { return; }
this.showPassword(job.jobResult.displayName, job.jobResult.password);
});
return observable
.switchMap(deployResponse => this.vmService.get(deployResponse.id))
.map(vm => {
vm.state = 'Deploying';
return vm;
});
}
public showPassword(vmName: string, vmPassword: string): void {
this.translateService.get(
'PASSWORD_DIALOG_MESSAGE',
{ vmName, vmPassword }
)
.subscribe((passwordMessage: string) => {
this.dialogService.alert(passwordMessage);
});
>>>>>>>
])
.subscribe(strs => {
notificationId = this.jobsNotificationService.add(strs['VM_DEPLOY_IN_PROGRESS']);
});
let observable = this.securityGroupService.createWithRules(
{ name: this.utils.getUniqueId() + GROUP_POSTFIX },
params.ingress || [],
params.egress || []
)
.switchMap(securityGroup => {
params['securityGroupIds'] = securityGroup.id;
return this.vmService.deploy(params);
})
.publish();
observable.connect();
observable
.switchMap(deployResponse => this.vmService.checkCommand(deployResponse.jobid))
.subscribe(
job => {
this.notifyOnDeployDone(notificationId);
if (!job.jobResult.password) { return; }
this.showPassword(job.jobResult.displayName, job.jobResult.password);
this.vmService.updateVmInfo(job.jobResult);
},
() => {
this.notifyOnDeployFailed(notificationId);
}
);
return observable
.switchMap(deployResponse => this.vmService.get(deployResponse.id))
.map(vm => {
vm.state = 'Deploying';
return vm;
});
}
public showPassword(vmName: string, vmPassword: string): void {
this.translateService.get(
'PASSWORD_DIALOG_MESSAGE',
{ vmName, vmPassword }
)
.subscribe((passwordMessage: string) => {
this.dialogService.alert(passwordMessage);
});
<<<<<<<
public notifyOnDeployFailed(notificationId: string): void {
this.translateService.get([
'DEPLOY_FAILED'
]).subscribe(str => {
this.jobsNotificationService.add({
id: notificationId,
message: str['DEPLOY_FAILED'],
status: INotificationStatus.Failed
});
});
}
public onVmCreationSubmit(e: any): void {
e.preventDefault();
this.deployVm();
this.hide();
}
public onTemplateChange(t: BaseTemplateModel): void {
=======
public onTemplateChange(t: Template): void {
>>>>>>>
public notifyOnDeployFailed(notificationId: string): void {
this.translateService.get([
'DEPLOY_FAILED'
]).subscribe(str => {
this.jobsNotificationService.add({
id: notificationId,
message: str['DEPLOY_FAILED'],
status: INotificationStatus.Failed
});
});
}
public onTemplateChange(t: BaseTemplateModel): void {
<<<<<<<
private _deploy(params: {}, notificationId): void {
this.vmService.deploy(params)
.subscribe(
result => {
this.vmService.get(result.id)
.subscribe(
r => {
r.state = 'Deploying';
this.onCreated.next(r);
});
this.vmService.checkCommand(result.jobid)
.subscribe(
job => {
this.notifyOnDeployDone(notificationId);
if (!job.jobResult.password) {
return;
}
this.translateService.get(
'PASSWORD_DIALOG_MESSAGE',
{
vmName: job.jobResult.displayName,
vmPassword: job.jobResult.password
}
)
.subscribe(
(res: string) => {
this.dialogService.alert(res);
});
},
() => {
this.notifyOnDeployFailed(notificationId);
}
);
},
() => {
this.notifyOnDeployFailed(notificationId);
}
);
=======
public setServiceOffering(offering: string): void {
this.vmCreationData.vm.serviceOfferingId = offering;
>>>>>>>
public setServiceOffering(offering: string): void {
this.vmCreationData.vm.serviceOfferingId = offering; |
<<<<<<<
import { DialogService } from '../../dialog/dialog-module/dialog.service';
import { SgRulesComponent } from '../../security-group/sg-rules/sg-rules.component';
=======
import { Observable } from 'rxjs/Observable';
import { SgRulesComponent } from '../../security-group/sg-rules/sg-rules.component';
>>>>>>>
import { Observable } from 'rxjs/Observable';
import { SgRulesComponent } from '../../security-group/sg-rules/sg-rules.component';
<<<<<<<
import { Color, ServiceOffering, ServiceOfferingFields } from '../../shared/models';
import { ConfigService } from '../../shared/services';
import { ServiceOfferingService } from '../../shared/services/service-offering.service';
import { TagService } from '../../shared/services/tag.service';
=======
import { Color, InstanceGroup, ServiceOfferingFields, ServiceOffering } from '../../shared/models';
import { ConfigService, InstanceGroupService } from '../../shared/services';
>>>>>>>
import { Color, ServiceOfferingFields, ServiceOffering } from '../../shared/models';
import { ConfigService } from '../../shared/services'; |
<<<<<<<
=======
import { Observable } from 'rxjs/Observable';
>>>>>>> |
<<<<<<<
import { TranslateService } from 'ng2-translate';
=======
import { MdlDialogService } from 'angular2-mdl';
import { TranslateService } from '@ngx-translate/core';
>>>>>>>
import { TranslateService } from '@ngx-translate/core'; |
<<<<<<<
import { MdlDialogService } from 'angular2-mdl';
=======
import { MdlDialogService } from 'angular2-mdl';
import { TranslateService } from 'ng2-translate';
>>>>>>>
import { MdlDialogService } from 'angular2-mdl';
import { TranslateService } from 'ng2-translate';
<<<<<<<
import { SSHKeyPairService } from '../shared/services/SSHKeyPair.service';
import { TranslateService } from 'ng2-translate';
=======
import { SshKeyCreationData, SSHKeyPairService } from '../shared/services/ssh-keypair.service';
import { SShKeyCreationDialogComponent } from './ssh-key-creation/ssh-key-creation-dialog.component';
import { SshPrivateKeyDialogComponent } from './ssh-key-creation/ssh-private-key-dialog.component';
>>>>>>>
import { SshKeyCreationData, SSHKeyPairService } from '../shared/services/ssh-keypair.service';
import { SShKeyCreationDialogComponent } from './ssh-key-creation/ssh-key-creation-dialog.component';
import { SshPrivateKeyDialogComponent } from './ssh-key-creation/ssh-private-key-dialog.component';
<<<<<<<
public removeKey(name: string): void {
this.translateService.get(['REMOVE_THIS_KEY', 'YES', 'NO', 'KEY_REMOVAL_FAILED'])
.subscribe(translations => this.showRemovalDialog(name, translations));
}
private showRemovalDialog(name: string, translations: Array<string>): void {
this.dialogService.confirm(
translations['REMOVE_THIS_KEY'],
translations['NO'],
translations['YES'],
)
.onErrorResumeNext()
.switchMap(() => {
this.setLoading(name);
return this.sshKeyService.remove({ name });
})
.subscribe(
() => this.sshKeyList = this.sshKeyList.filter(key => key.name !== name),
() => {
this.setLoading(name, false);
this.dialogService.alert(translations['KEY_REMOVAL_FAILED']);
}
);
}
private setLoading(name, value = true): void {
const sshKey: SSHKeyPair = this.sshKeyList.find(key => key.name === name);
if (!sshKey) {
return;
}
sshKey['loading'] = value;
}
=======
public showCreationDialog(): void {
this.dialogService.showCustomDialog({
component: SShKeyCreationDialogComponent,
styles: { width: '400px' }
})
.switchMap(res => res.onHide())
.subscribe(data => this.createSshKey(data));
}
private createSshKey(data: SshKeyCreationData): void {
if (!data) {
return;
}
const keyCreationObs = data.publicKey ? this.sshKeyService.register(data) : this.sshKeyService.create(data);
keyCreationObs.subscribe(
(sshKey: SSHKeyPair) => {
this.sshKeyList = this.sshKeyList.concat(sshKey);
if (sshKey.privateKey) {
this.showPrivateKey(sshKey.privateKey);
}
},
(error) => this.handleError(error)
);
}
private showPrivateKey(privateKey: string): void {
this.dialogService.showCustomDialog({
component: SshPrivateKeyDialogComponent,
providers: [{ provide: 'privateKey', useValue: privateKey }],
styles: { width: '400px', 'word-break': 'break-all' }
});
}
private handleError(error): void {
const errorMap = {
'A key pair with name': 'KEYPAIR_ALREADY_EXISTS',
'Public key is invalid': 'INVALID_PUBLIC_KEY'
};
let message;
for (let key in errorMap) {
if (error.errortext.startsWith(key)) {
message = errorMap[key];
break;
}
}
if (!message) {
message = error.errortext;
}
this.translateService.get(message)
.subscribe((msg) => this.dialogService.alert(msg));
}
>>>>>>>
public showCreationDialog(): void {
this.dialogService.showCustomDialog({
component: SShKeyCreationDialogComponent,
styles: { width: '400px' }
})
.switchMap(res => res.onHide())
.subscribe(data => this.createSshKey(data));
}
public removeKey(name: string): void {
this.translateService.get(['REMOVE_THIS_KEY', 'YES', 'NO', 'KEY_REMOVAL_FAILED'])
.subscribe(translations => this.showRemovalDialog(name, translations));
}
private createSshKey(data: SshKeyCreationData): void {
if (!data) {
return;
}
const keyCreationObs = data.publicKey ? this.sshKeyService.register(data) : this.sshKeyService.create(data);
keyCreationObs.subscribe(
(sshKey: SSHKeyPair) => {
this.sshKeyList = this.sshKeyList.concat(sshKey);
if (sshKey.privateKey) {
this.showPrivateKey(sshKey.privateKey);
}
},
(error) => this.handleError(error)
);
}
private showPrivateKey(privateKey: string): void {
this.dialogService.showCustomDialog({
component: SshPrivateKeyDialogComponent,
providers: [{ provide: 'privateKey', useValue: privateKey }],
styles: { width: '400px', 'word-break': 'break-all' }
});
}
private handleError(error): void {
const errorMap = {
'A key pair with name': 'KEYPAIR_ALREADY_EXISTS',
'Public key is invalid': 'INVALID_PUBLIC_KEY'
};
let message;
for (let key in errorMap) {
if (error.errortext.startsWith(key)) {
message = errorMap[key];
break;
}
}
if (!message) {
message = error.errortext;
}
this.translateService.get(message)
.subscribe((msg) => this.dialogService.alert(msg));
}
private showRemovalDialog(name: string, translations: Array<string>): void {
this.dialogService.confirm(
translations['REMOVE_THIS_KEY'],
translations['NO'],
translations['YES'],
)
.onErrorResumeNext()
.switchMap(() => {
this.setLoading(name);
return this.sshKeyService.remove({ name });
})
.subscribe(
() => this.sshKeyList = this.sshKeyList.filter(key => key.name !== name),
() => {
this.setLoading(name, false);
this.dialogService.alert(translations['KEY_REMOVAL_FAILED']);
}
);
}
private setLoading(name, value = true): void {
const sshKey: SSHKeyPair = this.sshKeyList.find(key => key.name === name);
if (!sshKey) {
return;
}
sshKey['loading'] = value;
} |
<<<<<<<
import { ServiceOfferingDialogComponent } from './service-offering-dialog.component';
import { ServiceOfferingSelectorComponent } from './service-offering-selector.component';
import { SharedModule } from '../shared/shared.module';
=======
import { ServiceOfferingDialogComponent } from './service-offering-dialog/service-offering-dialog.component';
import { ServiceOfferingSelectorComponent } from './service-offering-selector/service-offering-selector.component';
import { CustomServiceOfferingComponent } from './custom-service-offering/custom-service-offering.component';
import { SharedModule } from '../shared/shared.module';
>>>>>>>
import { SharedModule } from '../shared/shared.module';
import { CustomServiceOfferingComponent } from './custom-service-offering/custom-service-offering.component';
import { ServiceOfferingDialogComponent } from './service-offering-dialog/service-offering-dialog.component';
import { ServiceOfferingSelectorComponent } from './service-offering-selector/service-offering-selector.component'; |
<<<<<<<
import { TranslateService } from 'ng2-translate';
=======
import { MdlDialogService } from 'angular2-mdl';
import { TranslateService } from '@ngx-translate/core';
>>>>>>>
import { TranslateService } from '@ngx-translate/core'; |
<<<<<<<
import { MdlDialogService } from 'angular2-mdl';
import { ServiceOfferingDialogComponent } from '../../service-offering/service-offering-dialog.component';
=======
import { SecurityGroup } from '../../security-group/sg.model';
import { SgRulesComponent } from '../../security-group/sg-rules/sg-rules.component';
>>>>>>>
<<<<<<<
public changeServiceOffering() {
this.dialogService.showCustomDialog({
component: ServiceOfferingDialogComponent,
providers: [{ provide: 'virtualMachine', useValue: this.vm }],
isModal: true,
styles: {
'overflow': 'visible', // so that the dialog window doesn't cut the SO dropdown
'width': '400px'
},
clickOutsideToClose: true,
enterTransitionDuration: 400,
leaveTransitionDuration: 400
});
}
=======
public showRulesDialog(securityGroup: SecurityGroup) {
this.dialogService.showCustomDialog({
component: SgRulesComponent,
providers: [{ provide: 'securityGroup', useValue: securityGroup }],
isModal: true,
styles: { 'width': '880px' },
enterTransitionDuration: 400,
leaveTransitionDuration: 400
});
}
public openConsole(): void {
window.open(
`/client/console?cmd=access&vm=${this.vm.id}`,
this.vm.displayName,
'resizable=0,width=820,height=640'
);
}
>>>>>>>
public showRulesDialog(securityGroup: SecurityGroup) {
this.dialogService.showCustomDialog({
component: SgRulesComponent,
providers: [{ provide: 'securityGroup', useValue: securityGroup }],
isModal: true,
styles: { 'width': '880px' },
enterTransitionDuration: 400,
leaveTransitionDuration: 400
});
}
public openConsole(): void {
window.open(
`/client/console?cmd=access&vm=${this.vm.id}`,
this.vm.displayName,
'resizable=0,width=820,height=640'
);
}
public changeServiceOffering() {
this.dialogService.showCustomDialog({
component: ServiceOfferingDialogComponent,
providers: [{ provide: 'virtualMachine', useValue: this.vm }],
isModal: true,
styles: {
'overflow': 'visible', // so that the dialog window doesn't cut the SO dropdown
'width': '400px'
},
clickOutsideToClose: true,
enterTransitionDuration: 400,
leaveTransitionDuration: 400
});
} |
<<<<<<<
import { Iso, IsoService, Template } from '../shared';
=======
import { Iso, IsoService, TemplateService } from '../shared';
>>>>>>>
import {
Iso,
IsoService,
Template,
TemplateService,
} from '../shared';
import { OsFamily } from '../../shared/models/os-type.model';
<<<<<<<
export class TemplateListComponent {
public isDetailOpen: boolean;
public selectedTemplate: Template | Iso;
=======
export class TemplateListComponent implements OnInit {
public showIso: boolean = false;
public query: string;
public selectedOsFamilies: Array<OsFamily>;
public selectedFilters: Array<string>;
public templateList: Array<Template>;
public isoList: Array<Iso>;
public osFamilies: Array<OsFamily> = [
'Linux',
'Windows',
'Mac OS',
'Other'
];
public filters = [
'featured',
'self'
];
public filterTranslations: {};
>>>>>>>
export class TemplateListComponent implements OnInit {
public isDetailOpen: boolean;
public selectedTemplate: Template | Iso;
public showIso: boolean = false;
public query: string;
public selectedOsFamilies: Array<OsFamily>;
public selectedFilters: Array<string>;
public templateList: Array<Template>;
public isoList: Array<Iso>;
public osFamilies: Array<OsFamily> = [
'Linux',
'Windows',
'Mac OS',
'Other'
];
public filters = [
'featured',
'self'
];
public filterTranslations: {};
<<<<<<<
) { }
public hideDetail(): void {
this.isDetailOpen = !this.isDetailOpen;
}
=======
) { }
public ngOnInit(): void {
this.selectedOsFamilies = this.osFamilies.concat();
this.selectedFilters = this.filters.concat();
this.fetchData();
this.translateService.get(
this.filters.map(filter => `TEMPLATE_${filter.toUpperCase()}`)
)
.subscribe(translations => {
const strs = {};
this.filters.forEach(filter => {
strs[filter] = translations[`TEMPLATE_${filter.toUpperCase()}`];
});
this.filterTranslations = strs;
});
}
public switchDisplayMode(): void {
this.fetchData();
}
>>>>>>>
) { }
public ngOnInit(): void {
this.selectedOsFamilies = this.osFamilies.concat();
this.selectedFilters = this.filters.concat();
this.fetchData();
this.translateService.get(
this.filters.map(filter => `TEMPLATE_${filter.toUpperCase()}`)
)
.subscribe(translations => {
const strs = {};
this.filters.forEach(filter => {
strs[filter] = translations[`TEMPLATE_${filter.toUpperCase()}`];
});
this.filterTranslations = strs;
});
}
public hideDetail(): void {
this.isDetailOpen = !this.isDetailOpen;
}
public switchDisplayMode(): void {
this.fetchData();
} |
<<<<<<<
import Assets from "./assets";
import Auth from "./auth";
=======
>>>>>>>
import Auth from "./auth";
<<<<<<<
Auth: Auth(ctx),
Assets: Assets(ctx),
=======
Stories: Stories(ctx),
>>>>>>>
Auth: Auth(ctx),
Stories: Stories(ctx), |
<<<<<<<
=======
// todo
public show(): void {
this.templateService.getDefault().subscribe(() => {
this.serviceOfferingFilterService.getAvailable(this.selectedZone)
.subscribe(() => {
this.resourceUsageService.getResourceUsage().subscribe(result => {
if (result.available.primaryStorage > this.vmCreationData.rootDiskSizeMin && result.available.instances) {
} else {
this.translateService.get('INSUFFICIENT_RESOURCES')
.subscribe(str => this.notificationService.error(str));
}
});
}, () => {
this.translateService.get('INSUFFICIENT_RESOURCES')
.subscribe(str => this.notificationService.error(str));
});
}, () => {
this.translateService.get('UNABLE_TO_RECEIVE_TEMPLATES')
.subscribe(str => this.notificationService.error(str));
});
}
>>>>>>>
<<<<<<<
this.diskStorageService.getAvailablePrimaryStorage()
.switchMap(rootDiskSizeLimit => {
if (rootDiskSizeLimit === -1) {
this.vmCreationData.rootDiskSizeLimit = MAX_ROOT_DISK_SIZE_ADMIN;
} else {
this.vmCreationData.rootDiskSizeLimit = rootDiskSizeLimit;
}
return this.templateService.getDefault(id);
})
.switchMap(defaultTemplate => {
if (defaultTemplate && this.utils.convertToGB(defaultTemplate.size) < this.vmCreationData.rootDiskSizeLimit) {
this.onTemplateChange(defaultTemplate);
} else {
throw new Error();
}
return Observable.forkJoin([
this.serviceOfferingFilterService.getAvailable({
zoneId: id,
local: this.selectedZone.localStorageEnabled
}),
this.diskOfferingService.getList({
zoneId: id,
local: this.selectedZone.localStorageEnabled,
maxSize: this.utils.convertToGB(defaultTemplate.size)
})
]);
})
.subscribe(
([serviceOfferings, diskOfferings]) => {
this.vmCreationData.serviceOfferings = serviceOfferings;
this.vmCreationData.diskOfferings = diskOfferings;
this.fetching = false;
this.enoughResources = true;
this.changeDetectorRef.detectChanges();
},
() => {
this.fetching = false;
this.enoughResources = false;
}
);
=======
Observable.forkJoin([
this.serviceOfferingFilterService.getAvailable({ zone: this.selectedZone }),
this.diskOfferingService.getList({ zone: this.selectedZone })
])
.subscribe(([serviceOfferings, diskOfferings]) => {
this.vmCreationData.serviceOfferings = serviceOfferings;
this.vmCreationData.diskOfferings = diskOfferings;
this.diskOffering = diskOfferings[0];
this.setServiceOffering(serviceOfferings[0]);
this.changeDetectorRef.detectChanges();
});
>>>>>>>
this.diskStorageService.getAvailablePrimaryStorage()
.switchMap(rootDiskSizeLimit => {
if (rootDiskSizeLimit === -1) {
this.vmCreationData.rootDiskSizeLimit = MAX_ROOT_DISK_SIZE_ADMIN;
} else {
this.vmCreationData.rootDiskSizeLimit = rootDiskSizeLimit;
}
return this.templateService.getDefault(id);
})
.switchMap(defaultTemplate => {
if (defaultTemplate && this.utils.convertToGB(defaultTemplate.size) < this.vmCreationData.rootDiskSizeLimit) {
this.onTemplateChange(defaultTemplate);
} else {
throw new Error();
}
return Observable.forkJoin([
this.serviceOfferingFilterService.getAvailable({ zone: this.selectedZone }),
this.diskOfferingService.getList({
zone: this.selectedZone,
maxSize: this.vmCreationData.rootDiskSizeLimit
})
]);
})
.subscribe(
([serviceOfferings, diskOfferings]) => {
this.fetching = false;
if (!serviceOfferings.length || !diskOfferings.length) {
this.enoughResources = false;
return;
}
this.vmCreationData.serviceOfferings = serviceOfferings;
this.vmCreationData.diskOfferings = diskOfferings;
this.diskOffering = diskOfferings[0];
this.setServiceOffering(serviceOfferings[0]);
this.enoughResources = true;
this.changeDetectorRef.detectChanges();
},
() => {
this.fetching = false;
this.enoughResources = false;
}
); |
<<<<<<<
public instanceGroups: Array<string>;
=======
public affinityGroupNames: Array<string>;
public affinityGroupTypes: Array<{ type: string }>;
public instanceGroups: Array<InstanceGroup>;
>>>>>>>
public affinityGroupNames: Array<string>;
public affinityGroupTypes: Array<{ type: string }>;
public instanceGroups: Array<string>;
<<<<<<<
@ViewChild(MdlDialogComponent) public vmCreateDialog: MdlDialogComponent;
@Output() public onCreated: EventEmitter<any> = new EventEmitter();
public fetching: boolean;
public enoughResources: boolean;
=======
public fetching = false;
>>>>>>>
public fetching: boolean;
public enoughResources: boolean;
<<<<<<<
let securityGroupObservable = this.securityGroupService.createWithRules(
=======
let shouldCreateAffinityGroup = false;
let affinityGroupName = params['affinityGroupNames'];
if (affinityGroupName) {
const ind = this.vmCreationData.affinityGroups.findIndex(ag => ag.name === affinityGroupName);
if (ind === -1) {
shouldCreateAffinityGroup = true;
}
}
this.securityGroupService.createWithRules(
>>>>>>>
let shouldCreateAffinityGroup = false;
let affinityGroupName = params['affinityGroupNames'];
if (affinityGroupName) {
const ind = this.vmCreationData.affinityGroups.findIndex(ag => ag.name === affinityGroupName);
if (ind === -1) {
shouldCreateAffinityGroup = true;
}
}
let securityGroupObservable = this.securityGroupService.createWithRules(
<<<<<<<
});
delete params['ingress'];
delete params['egress'];
let vmDeployObservable = this.vmService.deploy(params)
=======
this.sgCreationInProgress = false;
if (shouldCreateAffinityGroup) {
this.agCreationInProgress = true;
return this.affinityGroupService.create({
name: this.vmCreationData.affinityGroupName,
type: this.vmCreationData.affinityGroupTypes[0].type
})
.switchMap(affinityGroup => {
this.vmCreationData.affinityGroups.push(affinityGroup);
this.vmCreationData.affinityGroupNames.push(affinityGroup.name);
params['affinityGroupNames'] = affinityGroup.name;
this.agCreationInProgress = false;
return this.vmService.deploy(params);
});
}
return this.vmService.deploy(params);
})
>>>>>>>
});
let affinityGroupsObservable;
if (shouldCreateAffinityGroup) {
affinityGroupsObservable = this.affinityGroupService.create({
name: this.vmCreationData.affinityGroupName,
type: this.vmCreationData.affinityGroupTypes[0].type
})
.map(affinityGroup => {
this.vmCreationData.affinityGroups.push(affinityGroup);
this.vmCreationData.affinityGroupNames.push(affinityGroup.name);
params['affinityGroupNames'] = affinityGroup.name;
this.agCreationInProgress = false;
});
} else {
affinityGroupsObservable = Observable.of(null);
}
delete params['ingress'];
delete params['egress'];
let vmDeployObservable = this.vmService.deploy(params)
<<<<<<<
.switchMap(vm => {
if (this.vmCreationData.vm.instanceGroup) {
return this.instanceGroupService.add(vm, this.vmCreationData.vm.instanceGroup);
}
return Observable.of(vm);
})
.map(
vm => {
if (vm.instanceGroup) {
this.instanceGroupService.groupsUpdates.next();
}
=======
.subscribe(
vm => {
>>>>>>>
.switchMap(vm => {
if (this.vmCreationData.vm.instanceGroup) {
return this.instanceGroupService.add(vm, this.vmCreationData.vm.instanceGroup);
}
return Observable.of(vm);
})
.map(
vm => {
if (vm.instanceGroup) {
this.instanceGroupService.groupsUpdates.next();
}
<<<<<<<
this.showPassword(vm.displayName, vm.password);
this.vmService.updateVmInfo(vm);
=======
this.showPassword(vm.displayName, vm.password);
this.vmService.updateVmInfo(vm);
>>>>>>>
this.showPassword(vm.displayName, vm.password);
this.vmService.updateVmInfo(vm); |
<<<<<<<
=======
createdAt: "2018-07-06T18:24:00.000Z",
replies: { edges: [], pageInfo: { endCursor: null, hasNextPage: false } },
replyCount: 0,
editing: {
edited: false,
editableUntil: "2018-07-06T18:24:30.000Z",
},
>>>>>>>
<<<<<<<
=======
createdAt: "2018-07-06T18:20:00.000Z",
replies: { edges: [], pageInfo: { endCursor: null, hasNextPage: false } },
replyCount: 0,
editing: {
edited: false,
editableUntil: "2018-07-06T18:20:30.000Z",
},
>>>>>>>
<<<<<<<
=======
createdAt: "2018-07-06T18:14:00.000Z",
replies: { edges: [], pageInfo: { endCursor: null, hasNextPage: false } },
replyCount: 0,
editing: {
edited: false,
editableUntil: "2018-07-06T18:14:30.000Z",
},
>>>>>>>
<<<<<<<
=======
createdAt: "2018-07-06T18:14:00.000Z",
replies: { edges: [], pageInfo: { endCursor: null, hasNextPage: false } },
replyCount: 0,
editing: {
edited: false,
editableUntil: "2018-07-06T18:14:30.000Z",
},
>>>>>>>
<<<<<<<
=======
createdAt: "2018-07-06T18:14:00.000Z",
replies: { edges: [], pageInfo: { endCursor: null, hasNextPage: false } },
replyCount: 0,
editing: {
edited: false,
editableUntil: "2018-07-06T18:14:30.000Z",
},
>>>>>>>
<<<<<<<
=======
createdAt: "2018-07-06T18:14:00.000Z",
replies: { edges: [], pageInfo: { endCursor: null, hasNextPage: false } },
replyCount: 0,
editing: {
edited: false,
editableUntil: "2018-07-06T18:14:30.000Z",
},
},
];
export const assets = [
{
id: "asset-1",
url: "http://localhost/assets/asset-1",
isClosed: false,
comments: {
edges: [
{ node: comments[0], cursor: comments[0].createdAt },
{ node: comments[1], cursor: comments[1].createdAt },
],
pageInfo: {
hasNextPage: false,
},
},
>>>>>>>
<<<<<<<
=======
replyCount: 2,
editing: {
edited: false,
editableUntil: "2018-07-06T18:24:30.000Z",
},
>>>>>>>
replyCount: 2,
<<<<<<<
=======
replyCount: 2,
editing: {
edited: false,
editableUntil: "2018-07-06T18:24:30.000Z",
},
};
export const assetWithReplies = {
id: "asset-with-replies",
url: "http://localhost/assets/asset-with-replies",
isClosed: false,
comments: {
edges: [
{ node: comments[0], cursor: comments[0].createdAt },
{ node: commentWithReplies, cursor: commentWithReplies.createdAt },
],
pageInfo: {
hasNextPage: false,
},
},
};
export const assetWithDeepReplies = {
id: "asset-with-deep-replies",
url: "http://localhost/assets/asset-with-replies",
isClosed: false,
comments: {
edges: [
{ node: comments[0], cursor: comments[0].createdAt },
{
node: commentWithDeepReplies,
cursor: commentWithDeepReplies.createdAt,
},
],
pageInfo: {
hasNextPage: false,
},
},
>>>>>>>
replyCount: 2, |
<<<<<<<
import { PasswordDialogComponent } from './vm/password-dialog';
import { VmCreateComponent } from './vm/vm-create.component';
import { VmCreationTemplateComponent } from './vm/vm-creation-template/vm-creation-template.component';
import { VmCreationTemplateDialogComponent } from './vm/vm-creation-template/vm-creation-template-dialog.component';
import {
VmCreationTemplateDialogListElementComponent
} from './vm/vm-creation-template/vm-creation-template-dialog-list-element.component';
import { VmListComponent } from './vm/vm-list.component';
import { VmListItemComponent } from './vm/vm-list-item.component';
import { VmStatisticsComponent } from './vm/vm-statistics.component';
import { VmDetailComponent } from './vm/vm-detail.component';
=======
>>>>>>>
<<<<<<<
PasswordDialogComponent,
VmCreateComponent,
VmCreationTemplateComponent,
VmCreationTemplateDialogComponent,
VmCreationTemplateDialogListElementComponent,
VmListComponent,
VmDetailComponent,
VmListItemComponent,
VmStatisticsComponent,
=======
>>>>>>> |
<<<<<<<
import { EventsModule } from './events/events.module';
=======
import { SpareDriveModule } from './spare-drive/spare-drive.module';
>>>>>>>
import { EventsModule } from './events/events.module';
import { SpareDriveModule } from './spare-drive/spare-drive.module'; |
<<<<<<<
=======
// tslint:disable-next-line
import { SpareDriveAttachmentDetailComponent } from './vm-sidebar/storage-detail/spare-drive-attachment/spare-drive-attachment-detail/spare-drive-attachment-detail.component';
// tslint:disable-next-line
import { SpareDriveAttachmentDialogComponent } from './vm-sidebar/storage-detail/spare-drive-attachment/spare-drive-attchment-dialog/spare-drive-attachment-dialog.component';
import { routes } from '../app.routing';
import { InstanceGroupComponent } from './vm-sidebar/instance-group/instance-group.component';
import { InstanceGroupSelectorComponent } from './vm-sidebar/instance-group-selector/instance-group-selector.component';
import { SnapshotsComponent } from './vm-sidebar/storage-detail/volume/snapshot/snapshots.component';
import { VolumeDetailsComponent } from './vm-sidebar/storage-detail/volume/volume-details/volume-details.component';
import { SshKeypairResetComponent } from './vm-sidebar/ssh/ssh-keypair-reset.component';
import { AffinityGroupSelectorComponent } from './vm-sidebar/affinity-group-selector/affinity-group-selector.component';
>>>>>>>
<<<<<<<
AffinityGroupDialogComponent,
KeyboardsComponent,
=======
AffinityGroupSelectorComponent,
>>>>>>>
AffinityGroupSelectorComponent,
KeyboardsComponent, |
<<<<<<<
const regex = /^org\.apache\.cloudstack\.api\.command\.user\.vm\.(\w*)Cmd$/;
=======
const regex = /^org\.apache\.cloudstack\.api\.command\.user\.vm\.(\w*)VMCmd$/;
if (!this.cmd) {
this.cmd = '';
}
>>>>>>>
const regex = /^org\.apache\.cloudstack\.api\.command\.user\.vm\.(\w*)Cmd$/;
if (!this.cmd) {
this.cmd = '';
} |
<<<<<<<
import { ApiInfoComponent } from './api-info/api-info.component';
=======
import { InactivityTimeoutComponent } from './inactivity-timeout/inactivity-timeout.component';
>>>>>>>
import { ApiInfoComponent } from './api-info/api-info.component';
import { InactivityTimeoutComponent } from './inactivity-timeout/inactivity-timeout.component';
<<<<<<<
ApiInfoComponent,
=======
InactivityTimeoutComponent,
>>>>>>>
ApiInfoComponent,
InactivityTimeoutComponent, |
<<<<<<<
private vmService: VmService
) {}
=======
) { }
public hideDetail(): void {
this.isDetailOpen = !this.isDetailOpen;
}
>>>>>>>
private vmService: VmService
) {}
public hideDetail(): void {
this.isDetailOpen = !this.isDetailOpen;
} |
<<<<<<<
public create(data: VolumeCreationData): Observable<Volume> {
return this.sendCommand('create', data)
.switchMap(job => this.asyncJobService.register(job.jobid, this.entity, this.entityModel))
.map(job => job.jobResult);
}
=======
public detach(id: string): Observable<null> {
return this.sendCommand('detach', { id })
.switchMap(job => this.asyncJobService.register(job, this.entity, this.entityModel));
}
>>>>>>>
public create(data: VolumeCreationData): Observable<Volume> {
return this.sendCommand('create', data)
.switchMap(job => this.asyncJobService.register(job.jobid, this.entity, this.entityModel))
.map(job => job.jobResult);
}
public detach(id: string): Observable<null> {
return this.sendCommand('detach', { id })
.switchMap(job => this.asyncJobService.register(job, this.entity, this.entityModel));
} |
<<<<<<<
import { TagsModule } from '../tags/tags.module';
import { VmTagsComponent } from './vm-sidebar/tags/vm-tags.component';
=======
import { AffinityGroupSelectorComponent } from './vm-sidebar/affinity-group-selector/affinity-group-selector.component';
>>>>>>>
import { TagsModule } from '../tags/tags.module';
import { VmTagsComponent } from './vm-sidebar/tags/vm-tags.component';
import { AffinityGroupSelectorComponent } from './vm-sidebar/affinity-group-selector/affinity-group-selector.component'; |
<<<<<<<
import { Component, Input, OnChanges, OnInit } from '@angular/core';
import {
AffinityGroupSelectorComponent
} from 'app/vm/vm-sidebar/affinity-group-selector/affinity-group-selector.component';
=======
import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core';
>>>>>>>
import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core';
import {
AffinityGroupSelectorComponent
} from 'app/vm/vm-sidebar/affinity-group-selector/affinity-group-selector.component';
<<<<<<<
import { DialogService } from '../../dialog/dialog-module/dialog.service';
=======
import { Subject } from 'rxjs/Subject';
>>>>>>>
import { Subject } from 'rxjs/Subject';
import { DialogService } from '../../dialog/dialog-module/dialog.service'; |
<<<<<<<
=======
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
>>>>>>>
<<<<<<<
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import {
FormsModule,
ReactiveFormsModule
} from '@angular/forms';
import { RouterModule } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';
import { routes } from '../app.routing';
=======
import { TranslateModule } from '@ngx-translate/core';
>>>>>>>
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import {
FormsModule,
ReactiveFormsModule
} from '@angular/forms';
import { RouterModule } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';
import { routes } from '../app.routing';
import { TranslateModule } from '@ngx-translate/core';
<<<<<<<
import { VmFormService } from './vm-creation/form/vm-form.service';
import { VmDeploymentService } from './vm-creation/vm-deployment.service';
import { TestComponent } from './vm-creation/test/test.component';
=======
// tslint:disable-next-line
import { SpareDriveAttachmentDetailComponent } from './vm-sidebar/storage-detail/spare-drive-attachment/spare-drive-attachment-detail/spare-drive-attachment-detail.component';
// tslint:disable-next-line
import { SpareDriveAttachmentDialogComponent } from './vm-sidebar/storage-detail/spare-drive-attachment/spare-drive-attchment-dialog/spare-drive-attachment-dialog.component';
import { routes } from '../app.routing';
import { InstanceGroupComponent } from './vm-sidebar/instance-group/instance-group.component';
import { InstanceGroupSelectorComponent } from './vm-sidebar/instance-group-selector/instance-group-selector.component';
import { SnapshotsComponent } from './vm-sidebar/storage-detail/volume/snapshot/snapshots.component';
import { VolumeDetailsComponent } from './vm-sidebar/storage-detail/volume/volume-details/volume-details.component';
import { AffinityGroupDialogComponent } from './vm-sidebar/affinity-group-dialog.component';
import { SshKeypairResetComponent } from './vm-sidebar/ssh/ssh-keypair-reset.component';
>>>>>>>
// tslint:disable-next-line
import { SpareDriveAttachmentDetailComponent } from './vm-sidebar/storage-detail/spare-drive-attachment/spare-drive-attachment-detail/spare-drive-attachment-detail.component';
// tslint:disable-next-line
import { SpareDriveAttachmentDialogComponent } from './vm-sidebar/storage-detail/spare-drive-attachment/spare-drive-attchment-dialog/spare-drive-attachment-dialog.component';
import { routes } from '../app.routing';
import { InstanceGroupComponent } from './vm-sidebar/instance-group/instance-group.component';
import { InstanceGroupSelectorComponent } from './vm-sidebar/instance-group-selector/instance-group-selector.component';
import { SnapshotsComponent } from './vm-sidebar/storage-detail/volume/snapshot/snapshots.component';
import { VolumeDetailsComponent } from './vm-sidebar/storage-detail/volume/volume-details/volume-details.component';
import { AffinityGroupDialogComponent } from './vm-sidebar/affinity-group-dialog.component';
import { SshKeypairResetComponent } from './vm-sidebar/ssh/ssh-keypair-reset.component';
import { VmFormService } from './vm-creation/form/vm-form.service';
import { VmDeploymentService } from './vm-creation/vm-deployment.service';
import { TestComponent } from './vm-creation/test/test.component';
<<<<<<<
TestComponent,
=======
SshKeypairResetComponent,
>>>>>>>
SshKeypairResetComponent,
TestComponent, |
<<<<<<<
export * from './base-backend.service';
export * from './service-locator';
export * from './root-disk-size.service';
=======
export * from './base-backend.service';
export * from './affinity-group.service';
>>>>>>>
export * from './base-backend.service';
export * from './service-locator';
export * from './root-disk-size.service';
export * from './affinity-group.service'; |
<<<<<<<
import { Http, URLSearchParams } from '@angular/http';
import { Observable } from 'rxjs';
=======
import { Observable, Subject } from 'rxjs';
>>>>>>>
import { Http, URLSearchParams } from '@angular/http';
import { Observable, Subject } from 'rxjs';
<<<<<<<
=======
public vmUpdateObservable: Subject<VirtualMachine>;
>>>>>>>
public vmUpdateObservable: Subject<VirtualMachine>; |
<<<<<<<
export * from './resource-limit.service';
export * from './resource-usage.service';
export * from './disk-storage.service';
=======
export * from './resource-limit.service';
export * from './root-disk-size.service';
>>>>>>>
export * from './resource-limit.service';
export * from './resource-limit.service';
export * from './resource-usage.service';
export * from './disk-storage.service';
<<<<<<<
export * from './snapshot.service';
=======
export * from './SSHKeyPair.service';
>>>>>>>
export * from './SSHKeyPair.service';
export * from './snapshot.service'; |
<<<<<<<
import { ReloadComponent } from './components/reload/reload.component';
=======
import {
CharacterCountTextfieldComponent
} from './components/character-count-textfield/character-count-textfield.component';
>>>>>>>
import { ReloadComponent } from './components/reload/reload.component';
import {
CharacterCountTextfieldComponent
} from './components/character-count-textfield/character-count-textfield.component'; |
<<<<<<<
clickClose() {
element(by.css('.backdrop.ng-star-inserted')).click();
}
findDiskSize(diskname) {
return element(
by.xpath(
`//span[text()="${diskname}"]/ancestor::mat-card//div[@class="entity-card-data-line"][1]`,
),
).getText();
}
=======
>>>>>>>
findDiskSize(diskname) {
return element(
by.xpath(
`//span[text()="${diskname}"]/ancestor::mat-card//div[@class="entity-card-data-line"][1]`,
),
).getText();
} |
<<<<<<<
import { VmCreateComponent } from "./vm-create.component";
=======
import {
JobsNotificationService,
INotificationStatus
} from '../shared/services/jobs-notification.service';
>>>>>>>
import { VmCreateComponent } from "./vm-create.component";
import {
JobsNotificationService,
INotificationStatus
} from '../shared/services/jobs-notification.service';
<<<<<<<
public onVmAction(e: IVmAction) {
switch (e.action) {
case 'start':
this.translateService.get(['CONFIRM_VM_START', 'NO', 'YES']).subscribe(strs => {
this.dialogService.confirm(strs.CONFIRM_VM_START, strs.NO, strs.YES)
.toPromise() // hack to fix incorrect component behavior
.then(r => {
this.vmService.startVM(e.id)
.subscribe(res => {
this.update();
});
})
.catch(() => {});
});
break;
case 'stop':
this.translateService.get(['CONFIRM_VM_STOP', 'NO', 'YES']).subscribe(strs => {
this.dialogService.confirm(strs.CONFIRM_VM_STOP, strs.NO, strs.YES)
.toPromise()
.then(r => {
this.vmService.stopVM(e.id)
.subscribe(res => {
this.update();
});
})
.catch(() => {});
});
break;
case 'reboot':
this.translateService.get(['CONFIRM_VM_REBOOT', 'NO', 'YES']).subscribe(strs => {
this.dialogService.confirm(strs.CONFIRM_VM_RESTART, strs.NO, strs.YES)
.toPromise()
.then(r => {
this.vmService.rebootVM(e.id)
.subscribe(res => {
this.update();
});
})
.catch(() => {});
});
break;
case 'restore':
this.translateService.get(['CONFIRM_VM_RESTORE', 'NO', 'YES']).subscribe(strs => {
this.dialogService.confirm(strs.CONFIRM_VM_RESTORE, strs.NO, strs.YES)
.toPromise()
.then(r => {
this.vmService.restoreVM(e.id, e.templateId)
.subscribe(res => {
this.update();
});
})
.catch(() => {});
});
break;
case 'destroy':
this.translateService.get(['CONFIRM_VM_DESTROY', 'NO', 'YES']).subscribe(strs => {
this.dialogService.confirm(strs.CONFIRM_VM_DESTROY, strs.NO, strs.YES)
.toPromise()
.then(r => {
this.vmService.destroyVM(e.id)
.subscribe(res => {
this.update();
});
})
.catch(() => {});
});
break;
}
}
public deployVm() {
this.vmCreationForm.deployVm()
.then(result => console.log(result));
}
private showDialog(translations): void {
this.dialogService.showDialog({
message: translations['WOULD_YOU_LIKE_TO_CREATE_VM'],
actions: [
{
handler: () => {
console.log('show vm create dialog'); // temporary
},
text: translations['YES']
},
{
handler: () => { },
text: translations['NO']
},
{
handler: () => {
this.storageService.write('askToCreateVm', 'false');
},
text: translations['NO_DONT_ASK']
}
],
fullWidthAction: true,
isModal: true,
clickOutsideToClose: true,
styles: { 'width': '320px' }
});
}
=======
private showDialog(translations): void {
this.dialogService.showDialog({
message: translations['WOULD_YOU_LIKE_TO_CREATE_VM'],
actions: [
{
handler: () => {
console.log('show vm create dialog'); // temporary
},
text: translations['YES']
},
{
handler: () => { },
text: translations['NO']
},
{
handler: () => {
this.storageService.write('askToCreateVm', 'false');
},
text: translations['NO_DONT_ASK']
}
],
fullWidthAction: true,
isModal: true,
clickOutsideToClose: true,
styles: { 'width': '320px' }
});
}
>>>>>>>
private showDialog(translations): void {
this.dialogService.showDialog({
message: translations['WOULD_YOU_LIKE_TO_CREATE_VM'],
actions: [
{
handler: () => {
console.log('show vm create dialog'); // temporary
},
text: translations['YES']
},
{
handler: () => { },
text: translations['NO']
},
{
handler: () => {
this.storageService.write('askToCreateVm', 'false');
},
text: translations['NO_DONT_ASK']
}
],
fullWidthAction: true,
isModal: true,
clickOutsideToClose: true,
styles: { 'width': '320px' }
});
} |
<<<<<<<
public create(volumeId: string, name?: string): Observable<AsyncJob> {
=======
public createSnapshot(volumeId: string, name?: string): Observable<AsyncJob> {
this.invalidateCache();
>>>>>>>
public create(volumeId: string, name?: string): Observable<AsyncJob> {
this.invalidateCache(); |
<<<<<<<
public removeRule(type: NetworkRuleType, data): Observable<null> {
=======
public removeRule(type: NetworkRuleType, data) {
this.invalidateCache();
>>>>>>>
public removeRule(type: NetworkRuleType, data): Observable<null> {
this.invalidateCache(); |
<<<<<<<
protected handleCommandError(error): Observable<any> {
return Observable.throw(ErrorService.parseError(this.getResponse(error)));
}
=======
protected formatGetListResponse(response: any): Array<M> {
let entity = this.entity.toLowerCase();
if (entity === 'asyncjob') { // only if list?
entity += 's';
}
const result = response[entity];
if (!result) {
return [];
}
return result.map(m => this.prepareModel(m)) as Array<M>;
}
private makeGetListObservable(params?: {}, customApiFormat?: ApiFormat): Observable<Array<M>> {
const command = customApiFormat && customApiFormat.command || 'list;s';
const entity = customApiFormat && customApiFormat.entity;
return this.sendCommand(command, params, entity)
.map(response => this.formatGetListResponse(response))
.share();
}
>>>>>>>
protected handleCommandError(error): Observable<any> {
return Observable.throw(ErrorService.parseError(this.getResponse(error)));
}
protected formatGetListResponse(response: any): Array<M> {
let entity = this.entity.toLowerCase();
if (entity === 'asyncjob') { // only if list?
entity += 's';
}
const result = response[entity];
if (!result) {
return [];
}
return result.map(m => this.prepareModel(m)) as Array<M>;
}
private makeGetListObservable(params?: {}, customApiFormat?: ApiFormat): Observable<Array<M>> {
const command = customApiFormat && customApiFormat.command || 'list;s';
const entity = customApiFormat && customApiFormat.entity;
return this.sendCommand(command, params, entity)
.map(response => this.formatGetListResponse(response))
.share();
}
<<<<<<<
=======
private handleCommandError(error): Observable<any> {
return Observable.throw(ErrorService.parseError(this.getResponse(error)));
}
private initRequestCache(): void {
const cacheTag = `${this.entity}RequestCache`;
this.requestCache = ServiceLocator.injector
.get(CacheService)
.get<Observable<Array<M>>>(cacheTag);
}
>>>>>>>
private initRequestCache(): void {
const cacheTag = `${this.entity}RequestCache`;
this.requestCache = ServiceLocator.injector
.get(CacheService)
.get<Observable<Array<M>>>(cacheTag);
} |
<<<<<<<
=======
AlertService,
ConfigService,
>>>>>>>
<<<<<<<
=======
ConfigService,
>>>>>>> |
<<<<<<<
@Output() public onDelete = new EventEmitter();
=======
@Output() public onVolumeAttached = new EventEmitter<VolumeAttachmentData>();
>>>>>>>
@Output() public onVolumeAttached = new EventEmitter<VolumeAttachmentData>();
@Output() public onDelete = new EventEmitter(); |
<<<<<<<
import { MdlTextAreaAutoresizeDirective } from './directives/mdl-textarea-autoresize.directive';
=======
import { RouterUtilsService } from './services/router-utils.service';
import { SnapshotService } from './services/snapshot.service';
import { StorageService } from './services/storage.service';
import { TagService } from './services/tag.service';
import { UserService } from './services/user.service';
import { UtilsService } from './services/utils.service';
import { VolumeService } from './services/volume.service';
>>>>>>>
import { RouterUtilsService } from './services/router-utils.service';
import { SnapshotService } from './services/snapshot.service';
import { StorageService } from './services/storage.service';
import { TagService } from './services/tag.service';
import { UserService } from './services/user.service';
import { UtilsService } from './services/utils.service';
import { VolumeService } from './services/volume.service';
import { MdlTextAreaAutoresizeDirective } from './directives/mdl-textarea-autoresize.directive'; |
<<<<<<<
import { Color } from '../models/color.model';
=======
import { Subject } from 'rxjs/Subject';
import { StorageService } from './storage.service';
import { Color } from '../models';
>>>>>>>
import { Color } from '../models';
<<<<<<<
import { Subject, Observable } from 'rxjs';
import { UserService } from './user.service';
=======
>>>>>>>
import { Subject, Observable } from 'rxjs';
import { UserService } from './user.service'; |
<<<<<<<
import { Component, Inject, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
=======
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
>>>>>>>
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
<<<<<<<
@Inject('INotificationService') private notification: INotificationService,
private route: ActivatedRoute,
=======
private notification: NotificationService,
>>>>>>>
private notification: NotificationService,
private route: ActivatedRoute, |
<<<<<<<
export * from './vm.module';
export * from './vm.model';
export * from './vm.service';
=======
export * from './shared/vm.service';
export * from './shared/vm.model';
>>>>>>>
export * from './vm.module';
export * from './shared/vm.model';
export * from './shared/vm.service'; |
<<<<<<<
.subscribe(securityGroup => {
params['securityGroupIds'] = securityGroup.id;
this._deploy(params, id);
});
=======
.subscribe(
securityGroup => {
params['securitygroupids'] = securityGroup.id;
this._deploy(params, notificationId);
},
() => {
this.notifyOnDeployFailed(notificationId);
}
);
>>>>>>>
.subscribe(
securityGroup => {
params['securityGroupIds'] = securityGroup.id;
this._deploy(params, notificationId);
},
() => {
this.notifyOnDeployFailed(notificationId);
}
);
<<<<<<<
if (this.vmCreationData.rootDiskSize >= 10) {
params['rootDiskSize'] = this.vmCreationData.rootDiskSize;
=======
if (this.selectedDiskOffering) {
params['diskofferingid'] = this.selectedDiskOffering.id;
params['hypervisor'] = 'KVM';
}
if (this.showRootDiskResize && this.vmCreationData.rootDiskSize >= 10) {
params['size'] = this.vmCreationData.rootDiskSize;
>>>>>>>
if (this.selectedDiskOffering) {
params['diskofferingid'] = this.selectedDiskOffering.id;
params['hypervisor'] = 'KVM';
}
if (this.showRootDiskResize && this.vmCreationData.rootDiskSize >= 10) {
params['size'] = this.vmCreationData.rootDiskSize; |
<<<<<<<
name: 'tenant-profile.tenant-profiles',
type: 'link',
path: '/tenantProfiles',
icon: 'mdi:alpha-t-box',
isMdiIcon: true
},
{
=======
id: guid(),
>>>>>>>
id: guid(),
name: 'tenant-profile.tenant-profiles',
type: 'link',
path: '/tenantProfiles',
icon: 'mdi:alpha-t-box',
isMdiIcon: true
},
{
id: guid(),
<<<<<<<
name: 'device-profile.device-profiles',
type: 'link',
path: '/deviceProfiles',
icon: 'mdi:alpha-d-box',
isMdiIcon: true
},
{
=======
id: guid(),
>>>>>>>
id: guid(),
name: 'device-profile.device-profiles',
type: 'link',
path: '/deviceProfiles',
icon: 'mdi:alpha-d-box',
isMdiIcon: true
},
{
id: guid(), |
<<<<<<<
import { StyleService } from './shared/services/style.service';
=======
import { StorageService } from './shared/services/storage.service';
import { ZoneService } from './shared/services/zone.service';
>>>>>>>
import { StyleService } from './shared/services/style.service';
import { ZoneService } from './shared/services/zone.service';
<<<<<<<
private styleService: StyleService
=======
private storage: StorageService,
private zoneService: ZoneService
>>>>>>>
private styleService: StyleService,
private zoneService: ZoneService
<<<<<<<
this.languageService.applyLanguage();
this.styleService.loadPalette();
=======
this.setLanguage();
this.zoneService.areAllZonesBasic()
.subscribe(basic => this.disableSecurityGroups = basic);
}
// todo: remove
public changeLanguage(): void {
let lang = this.storage.read('lang');
if (lang === 'ru') {
this.storage.write('lang', 'en');
}
if (lang === 'en') {
this.storage.write('lang', 'ru');
}
this.setLanguage();
}
public setLanguage(): void {
let lang = this.storage.read('lang');
if (!lang) {
this.storage.write('lang', 'en');
this.translate.use('en');
return;
}
this.translate.use(lang);
>>>>>>>
this.languageService.applyLanguage();
this.styleService.loadPalette();
this.zoneService.areAllZonesBasic()
.subscribe(basic => this.disableSecurityGroups = basic); |
<<<<<<<
=======
AsyncJobService,
StorageService,
>>>>>>>
AsyncJobService,
StorageService,
<<<<<<<
AuthGuard,
=======
AsyncJobService,
>>>>>>>
AuthGuard,
AsyncJobService,
<<<<<<<
VmService,
VolumeService,
OsTypeService,
{provide: 'IStorageService', useClass: StorageService}
=======
{provide: 'IStorageService', useClass: StorageService},
VmService
>>>>>>>
VmService,
VolumeService,
OsTypeService,
{provide: 'IStorageService', useClass: StorageService},
VmService |
<<<<<<<
import { SecurityGroupService, GROUP_POSTFIX } from '../../shared/services/security-group.service';
import { Observable } from 'rxjs/Rx';
=======
import { SecurityGroupService } from '../../shared/services/security-group.service';
import { UtilsService } from '../../shared/services/utils.service';
>>>>>>>
import { SecurityGroupService, GROUP_POSTFIX } from '../../shared/services/security-group.service';
import { UtilsService } from '../../shared/services/utils.service';
import { Observable } from 'rxjs/Rx';
<<<<<<<
{ name: UUID.v4() + GROUP_POSTFIX },
=======
{
name: this.utils.getUniqueId()
},
>>>>>>>
{
name: this.utils.getUniqueId() + GROUP_POSTFIX
}, |
<<<<<<<
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
=======
import { MdTooltipModule } from '@angular/material';
>>>>>>>
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { MdTooltipModule } from '@angular/material';
<<<<<<<
=======
ServiceOfferingModule,
MdTooltipModule,
>>>>>>>
ServiceOfferingModule,
MdTooltipModule, |
<<<<<<<
=======
import { TranslateModule } from '@ngx-translate/core';
import { MdlModule } from 'angular2-mdl';
>>>>>>>
import { TranslateModule } from '@ngx-translate/core';
import { MdlModule } from 'angular2-mdl';
<<<<<<<
import { SnapshotModalComponent } from './vm-sidebar/storage-detail/volume/snapshot/snapshot-modal.component';
import { VolumeComponent } from './vm-sidebar/storage-detail/volume/volume.component';
import { VmDetailComponent } from './vm-sidebar/vm-detail.component';
import { VmSidebarComponent } from './vm-sidebar/vm-sidebar.component';
import { VolumeResizeComponent } from './vm-sidebar/volume-resize.component';
import { vmRouting } from './vm.routing';
=======
// tslint:disable-next-line
import { SpareDriveAttachmentDetailComponent } from './vm-sidebar/storage-detail/spare-drive-attachment/spare-drive-attachment-detail/spare-drive-attachment-detail.component';
// tslint:disable-next-line
import { SpareDriveAttachmentDialogComponent } from './vm-sidebar/storage-detail/spare-drive-attachment/spare-drive-attchment-dialog/spare-drive-attachment-dialog.component';
import { routes } from '../app.routing';
import { RouterModule } from '@angular/router';
>>>>>>>
import { SnapshotModalComponent } from './vm-sidebar/storage-detail/volume/snapshot/snapshot-modal.component';
import { VolumeComponent } from './vm-sidebar/storage-detail/volume/volume.component';
import { VmDetailComponent } from './vm-sidebar/vm-detail.component';
import { VmSidebarComponent } from './vm-sidebar/vm-sidebar.component';
import { VolumeResizeComponent } from './vm-sidebar/volume-resize.component';
import { vmRouting } from './vm.routing';
// tslint:disable-next-line
import { SpareDriveAttachmentDetailComponent } from './vm-sidebar/storage-detail/spare-drive-attachment/spare-drive-attachment-detail/spare-drive-attachment-detail.component';
// tslint:disable-next-line
import { SpareDriveAttachmentDialogComponent } from './vm-sidebar/storage-detail/spare-drive-attachment/spare-drive-attchment-dialog/spare-drive-attachment-dialog.component';
import { routes } from '../app.routing';
import { RouterModule } from '@angular/router';
<<<<<<<
TranslateModule,
vmRouting,
=======
TranslateModule,
RouterModule.forRoot(routes)
>>>>>>>
TranslateModule,
vmRouting,
TranslateModule,
RouterModule.forRoot(routes) |
<<<<<<<
import { MdlDialogService } from 'angular2-mdl';
import { VolumeCreationComponent } from '../volume-creation/volume-creation.component';
import { NotificationService } from '../../shared/services/notification.service';
import { JobsNotificationService, INotificationStatus } from '../../shared/services/jobs-notification.service';
import { TranslateService } from 'ng2-translate';
=======
import { TranslateService } from 'ng2-translate';
import { MdlDialogService } from 'angular2-mdl';
import { JobsNotificationService, INotificationStatus } from '../../shared/services/jobs-notification.service';
import { NotificationService } from '../../shared/services/notification.service';
>>>>>>>
import { TranslateService } from 'ng2-translate';
import { MdlDialogService } from 'angular2-mdl';
import { JobsNotificationService, INotificationStatus } from '../../shared/services/jobs-notification.service';
import { NotificationService } from '../../shared/services/notification.service';
import { MdlDialogService } from 'angular2-mdl';
import { VolumeCreationComponent } from '../volume-creation/volume-creation.component';
import { NotificationService } from '../../shared/services/notification.service';
import { JobsNotificationService, INotificationStatus } from '../../shared/services/jobs-notification.service';
import { TranslateService } from 'ng2-translate';
<<<<<<<
public showCreationDialog(): void {
this.dialogService.showCustomDialog({
component: VolumeCreationComponent,
classes: 'volume-creation-dialog'
})
.switchMap(res => res.onHide())
.subscribe((data: any) => {
if (!data) {
return;
}
this.createVolume(data);
}, () => {});
}
public createVolume(volumeCreationData: VolumeCreationData): void {
let notificationId;
let translatedStrings;
this.translateService.get([
'VOLUME_CREATE_IN_PROGRESS',
'VOLUME_CREATE_DONE',
'VOLUME_CREATE_FAILED'
])
.switchMap(strs => {
translatedStrings = strs;
notificationId = this.jobsNotificationService.add(translatedStrings['VOLUME_CREATE_IN_PROGRESS']);
return this.volumeService.create(volumeCreationData);
})
.subscribe(
volume => {
if (volume.id) {
this.diskOfferingService.get(volume.diskOfferingId)
.subscribe(diskOffering => {
volume.diskOffering = diskOffering;
this.volumes.push(volume);
});
}
this.jobsNotificationService.add({
id: notificationId,
message: translatedStrings['VOLUME_CREATE_DONE'],
status: INotificationStatus.Finished
});
},
error => {
// todo: CS-3168
this.notificationService.error(error.json().createvolumeresponse.errortext);
this.jobsNotificationService.add({
id: notificationId,
message: translatedStrings['VOLUME_CREATE_FAILED'],
status: INotificationStatus.Failed
});
}
);
}
=======
public showRemoveDialog(volume: Volume): void {
this.translateService.get([
'YES',
'NO',
'CONFIRM_DELETE_VOLUME',
'VOLUME_DELETE_DONE',
'VOLUME_DELETE_FAILED'
])
.switchMap(translatedStrings => {
return this.dialogService.confirm(
translatedStrings['CONFIRM_DELETE_VOLUME'],
translatedStrings['NO'],
translatedStrings['YES']
);
})
.onErrorResumeNext()
.subscribe(() => this.remove(volume));
}
public remove(volume: Volume): void {
let notificationId;
let translatedStrings;
this.translateService.get([
'VOLUME_DELETE_DONE',
'VOLUME_DELETE_FAILED'
])
.switchMap(strs => {
translatedStrings = strs;
return this.volumeService.remove(volume.id);
})
.subscribe(
() => {
this.volumes = this.volumes.filter(listVolume => {
return listVolume.id !== volume.id;
});
if (this.selectedVolume && this.selectedVolume.id === volume.id) {
this.isDetailOpen = false;
}
this.jobsNotificationService.add({
id: notificationId,
message: translatedStrings['VOLUME_DELETE_DONE'],
status: INotificationStatus.Finished
});
},
error => {
this.notificationService.error(error);
this.jobsNotificationService.add({
id: notificationId,
message: translatedStrings['VOLUME_DELETE_FAILED'],
status: INotificationStatus.Failed
});
}
);
}
>>>>>>>
public showRemoveDialog(volume: Volume): void {
this.translateService.get([
'YES',
'NO',
'CONFIRM_DELETE_VOLUME',
'VOLUME_DELETE_DONE',
'VOLUME_DELETE_FAILED'
])
.switchMap(translatedStrings => {
return this.dialogService.confirm(
translatedStrings['CONFIRM_DELETE_VOLUME'],
translatedStrings['NO'],
translatedStrings['YES']
);
})
.onErrorResumeNext()
.subscribe(() => this.remove(volume));
}
public remove(volume: Volume): void {
let notificationId;
let translatedStrings;
this.translateService.get([
'VOLUME_DELETE_DONE',
'VOLUME_DELETE_FAILED'
])
.switchMap(strs => {
translatedStrings = strs;
return this.volumeService.remove(volume.id);
})
.subscribe(
() => {
this.volumes = this.volumes.filter(listVolume => {
return listVolume.id !== volume.id;
});
if (this.selectedVolume && this.selectedVolume.id === volume.id) {
this.isDetailOpen = false;
}
this.jobsNotificationService.add({
id: notificationId,
message: translatedStrings['VOLUME_DELETE_DONE'],
status: INotificationStatus.Finished
});
},
error => {
this.notificationService.error(error);
this.jobsNotificationService.add({
id: notificationId,
message: translatedStrings['VOLUME_DELETE_FAILED'],
status: INotificationStatus.Failed
});
}
);
}
public showCreationDialog(): void {
this.dialogService.showCustomDialog({
component: VolumeCreationComponent,
classes: 'volume-creation-dialog'
})
.switchMap(res => res.onHide())
.subscribe((data: any) => {
if (!data) {
return;
}
this.createVolume(data);
}, () => {});
}
public createVolume(volumeCreationData: VolumeCreationData): void {
let notificationId;
let translatedStrings;
this.translateService.get([
'VOLUME_CREATE_IN_PROGRESS',
'VOLUME_CREATE_DONE',
'VOLUME_CREATE_FAILED'
])
.switchMap(strs => {
translatedStrings = strs;
notificationId = this.jobsNotificationService.add(translatedStrings['VOLUME_CREATE_IN_PROGRESS']);
return this.volumeService.create(volumeCreationData);
})
.subscribe(
volume => {
if (volume.id) {
this.diskOfferingService.get(volume.diskOfferingId)
.subscribe(diskOffering => {
volume.diskOffering = diskOffering;
this.volumes.push(volume);
});
}
this.jobsNotificationService.add({
id: notificationId,
message: translatedStrings['VOLUME_CREATE_DONE'],
status: INotificationStatus.Finished
});
},
error => {
// todo: CS-3168
this.notificationService.error(error.json().createvolumeresponse.errortext);
this.jobsNotificationService.add({
id: notificationId,
message: translatedStrings['VOLUME_CREATE_FAILED'],
status: INotificationStatus.Failed
});
}
);
} |
<<<<<<<
export const ResourceTypes = {
USER: 'User'
};
=======
export const DeletionMark = {
TAG: 'status',
VALUE: 'removed'
};
>>>>>>>
export const ResourceTypes = {
USER: 'User'
};
export const DeletionMark = {
TAG: 'status',
VALUE: 'removed'
}; |
<<<<<<<
export * from './base.model';
export * from './affinity-group.model';
=======
export * from './base.model';
export * from './template.model';
>>>>>>>
export * from './base.model';
export * from './affinity-group.model';
export * from './template.model'; |
<<<<<<<
=======
import { MdlDefaultTableModel } from 'angular2-mdl';
import { Observable } from 'rxjs/Observable';
>>>>>>>
import { MdlDefaultTableModel } from 'angular2-mdl';
import { Observable } from 'rxjs/Observable';
<<<<<<<
import { FilterService } from '../shared';
import moment = require('moment');
import { Observable } from 'rxjs/Observable';
=======
import { LanguageService } from '../shared/services';
import { Event } from './event.model';
import { EventService } from './event.service';
>>>>>>>
import { FilterService } from '../shared';
import { LanguageService } from '../shared/services';
import { Event } from './event.model';
import { EventService } from './event.service';
import moment = require('moment');
<<<<<<<
this.initFilters();
=======
this.languageService.getFirstDayOfWeek()
.subscribe(day => this.firstDayOfWeek = day);
>>>>>>>
this.initFilters();
this.languageService.getFirstDayOfWeek()
.subscribe(day => this.firstDayOfWeek = day); |
<<<<<<<
import { Observable } from 'rxjs/Observable';
=======
import { VolumeAttachmentData, VolumeService } from '../shared/services/volume.service';
import { DialogService, JobsNotificationService } from '../shared/services';
>>>>>>>
import { Observable } from 'rxjs/Observable';
import { VolumeAttachmentData, VolumeService } from '../shared/services/volume.service';
import { JobsNotificationService } from '../shared/services'; |
<<<<<<<
export * from './base-backend.service';
export * from './service-locator';
export * from './root-disk-size.service';
export * from './affinity-group.service';
=======
export * from './base-backend.service';
export * from './template.service';
>>>>>>>
export * from './base-backend.service';
export * from './service-locator';
export * from './root-disk-size.service';
export * from './affinity-group.service';
export * from './template.service'; |
<<<<<<<
import { Http, RequestOptions, XHRBackend } from '@angular/http';
=======
import { CustomSimpleDialogComponent } from './services/dialog/custom-dialog.component';
import { FancySelectComponent } from './components/fancy-select/fancy-select.component';
>>>>>>>
import { Http, RequestOptions, XHRBackend } from '@angular/http';
import { CustomSimpleDialogComponent } from './services/dialog/custom-dialog.component';
import { FancySelectComponent } from './components/fancy-select/fancy-select.component'; |
<<<<<<<
describe('encodeStringToBase64', () => {
it('should return valid encoded string', () => {
const data = 'some data';
const expected = btoa(data);
expect(Utils.encodeStringToBase64(data)).toEqual(expected);
});
it('should return null for no data', () => {
expect(Utils.encodeStringToBase64('')).toBeNull();
});
});
describe('decodeStringFromBase64', () => {
it('should return valid data', () => {
const data = 'some data';
expect(Utils.decodeStringFromBase64(btoa(data))).toEqual(data);
});
it('should return null for no data', () => {
expect(Utils.decodeStringFromBase64('')).toBeNull();
});
});
describe('sizeOfBase64String', () => {
it('should return 0 for empty string', () => {
expect(Utils.sizeOfBase64String('')).toEqual(0);
});
it('should return size of base64 string', () => {
expect(Utils.sizeOfBase64String(Utils.encodeStringToBase64('some string'))).toEqual(23);
});
});
=======
describe('getMomentLongDateFormat', () => {
it('should return format for ru + hour12', () => {
expect(Utils.getMomentLongDateFormat(Language.ru, TimeFormat.hour12)).toEqual({
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY г.',
LLL: 'D MMMM YYYY г., LT',
LLLL: 'dddd, D MMMM YYYY г., LT',
});
});
it('should return format for ru + hour24', () => {
expect(Utils.getMomentLongDateFormat(Language.ru, TimeFormat.hour24)).toEqual({
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY г.',
LLL: 'D MMMM YYYY г., LT',
LLLL: 'dddd, D MMMM YYYY г., LT',
});
});
it('should return format for ru + auto', () => {
expect(Utils.getMomentLongDateFormat(Language.ru, TimeFormat.AUTO)).toEqual({
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY г.',
LLL: 'D MMMM YYYY г., LT',
LLLL: 'dddd, D MMMM YYYY г., LT',
});
});
it('should return format for en + hour12', () => {
expect(Utils.getMomentLongDateFormat(Language.en, TimeFormat.hour12)).toEqual({
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'MM/DD/YYYY',
LL: 'MMMM Do YYYY',
LLL: 'MMMM Do YYYY LT',
LLLL: 'dddd, MMMM Do YYYY LT',
});
});
it('should return format for en + hour24', () => {
expect(Utils.getMomentLongDateFormat(Language.en, TimeFormat.hour24)).toEqual({
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'MM/DD/YYYY',
LL: 'MMMM Do YYYY',
LLL: 'MMMM Do YYYY LT',
LLLL: 'dddd, MMMM Do YYYY LT',
});
});
it('should return format for en + auto', () => {
expect(Utils.getMomentLongDateFormat(Language.en, TimeFormat.AUTO)).toEqual({
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'MM/DD/YYYY',
LL: 'MMMM Do YYYY',
LLL: 'MMMM Do YYYY LT',
LLLL: 'dddd, MMMM Do YYYY LT',
});
});
});
>>>>>>>
describe('getMomentLongDateFormat', () => {
it('should return format for ru + hour12', () => {
expect(Utils.getMomentLongDateFormat(Language.ru, TimeFormat.hour12)).toEqual({
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY г.',
LLL: 'D MMMM YYYY г., LT',
LLLL: 'dddd, D MMMM YYYY г., LT',
});
});
it('should return format for ru + hour24', () => {
expect(Utils.getMomentLongDateFormat(Language.ru, TimeFormat.hour24)).toEqual({
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY г.',
LLL: 'D MMMM YYYY г., LT',
LLLL: 'dddd, D MMMM YYYY г., LT',
});
});
it('should return format for ru + auto', () => {
expect(Utils.getMomentLongDateFormat(Language.ru, TimeFormat.AUTO)).toEqual({
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY г.',
LLL: 'D MMMM YYYY г., LT',
LLLL: 'dddd, D MMMM YYYY г., LT',
});
});
it('should return format for en + hour12', () => {
expect(Utils.getMomentLongDateFormat(Language.en, TimeFormat.hour12)).toEqual({
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'MM/DD/YYYY',
LL: 'MMMM Do YYYY',
LLL: 'MMMM Do YYYY LT',
LLLL: 'dddd, MMMM Do YYYY LT',
});
});
it('should return format for en + hour24', () => {
expect(Utils.getMomentLongDateFormat(Language.en, TimeFormat.hour24)).toEqual({
LT: 'H:mm',
LTS: 'H:mm:ss',
L: 'MM/DD/YYYY',
LL: 'MMMM Do YYYY',
LLL: 'MMMM Do YYYY LT',
LLLL: 'dddd, MMMM Do YYYY LT',
});
});
it('should return format for en + auto', () => {
expect(Utils.getMomentLongDateFormat(Language.en, TimeFormat.AUTO)).toEqual({
LT: 'h:mm A',
LTS: 'h:mm:ss A',
L: 'MM/DD/YYYY',
LL: 'MMMM Do YYYY',
LLL: 'MMMM Do YYYY LT',
LLLL: 'dddd, MMMM Do YYYY LT',
});
});
});
describe('encodeStringToBase64', () => {
it('should return valid encoded string', () => {
const data = 'some data';
const expected = btoa(data);
expect(Utils.encodeStringToBase64(data)).toEqual(expected);
});
it('should return null for no data', () => {
expect(Utils.encodeStringToBase64('')).toBeNull();
});
});
describe('decodeStringFromBase64', () => {
it('should return valid data', () => {
const data = 'some data';
expect(Utils.decodeStringFromBase64(btoa(data))).toEqual(data);
});
it('should return null for no data', () => {
expect(Utils.decodeStringFromBase64('')).toBeNull();
});
});
describe('sizeOfBase64String', () => {
it('should return 0 for empty string', () => {
expect(Utils.sizeOfBase64String('')).toEqual(0);
});
it('should return size of base64 string', () => {
expect(Utils.sizeOfBase64String(Utils.encodeStringToBase64('some string'))).toEqual(23);
});
}); |
<<<<<<<
import {App} from "./app";
=======
import {Http, Headers, URLSearchParams} from "@angular/http";
import "rxjs/Rx";
import {ISubscription} from "rxjs/Subscription";
>>>>>>>
import {App} from "./app";
import {Http, Headers, URLSearchParams} from "@angular/http";
import "rxjs/Rx";
import {ISubscription} from "rxjs/Subscription"; |
<<<<<<<
import {RoutingService} from "./routing.service";
import {LoginService} from "./login.service";
=======
>>>>>>>
import {LoginService} from "./login.service";
<<<<<<<
constructor(private routingService: RoutingService, private renderer: Renderer, private translate: TranslateService, private loginService: LoginService) {
=======
constructor( private renderer: Renderer, private translate: TranslateService) {
>>>>>>>
constructor(private renderer: Renderer, private translate: TranslateService, private loginService: LoginService) { |
<<<<<<<
editablePolygon: boolean;
initCallback?: () => any;
=======
>>>>>>>
editablePolygon: boolean; |
<<<<<<<
import { Road } from './roads'
=======
import { Weather } from '../src/weather'
>>>>>>>
import { Road } from './roads'
import { Weather } from '../src/weather' |
<<<<<<<
import { uploadProtoAction, UPLOAD_PROTO, SET_MESSAGE, setMessageAction } from '../actions'
=======
import { uploadProtoAction, UPLOAD_PROTO, UPLOAD_PROTO_SUCCESSFUL, SEND_PROTO } from '../actions'
>>>>>>>
import { uploadProtoAction, UPLOAD_PROTO, SET_MESSAGE, UPLOAD_PROTO_SUCCESSFUL, SEND_PROTO } from '../actions'
<<<<<<<
export interface initialStateType {
proto: any
messageInput: string
=======
export interface initialProtoStateType {
proto: any;
parsedProtosObj: object
>>>>>>>
export interface initialProtoStateType {
proto: any
messageInput: string
parsedProtosObj: object
<<<<<<<
case SET_MESSAGE: {
return { ...state, messageInput: action.payload }
}
=======
case UPLOAD_PROTO_SUCCESSFUL: {
//need to add in functionality to push multiple protoobj to state
return setIn(state, ["parsedProtosObj"], action.payload)
}
>>>>>>>
case SET_MESSAGE: {
return { ...state, messageInput: action.payload }
}
case UPLOAD_PROTO_SUCCESSFUL: {
//need to add in functionality to push multiple protoobj to state
return setIn(state, ["parsedProtosObj"], action.payload)
}
<<<<<<<
export const protoSelector: (state: RootState) => object = (state) => state.uploadProto.proto
export const messageSelector: (state: RootState) => string = (state) => state.uploadProto.messageInput
=======
//makes the proto state and parsedProtosObj state available to connected components
export const protoSelector: (state: RootState) => object = (state) => state.uploadProto.proto
export const protoObjSelector: (state: RootState) => object = (state) => state.uploadProto.parsedProtosObj
>>>>>>>
//makes the proto state and parsedProtosObj state available to connected components
export const protoSelector: (state: RootState) => object = (state) => state.uploadProto.proto
export const messageSelector: (state: RootState) => string = (state) => state.uploadProto.messageInput
export const protoObjSelector: (state: RootState) => object = (state) => state.uploadProto.parsedProtosObj |
<<<<<<<
QPlainTextEdit,
QTabWidget,
QGridLayout
=======
QPlainTextEdit,
QScrollArea,
QPixmap,
CursorShape,
WindowState,
QTextOptionWrapMode,
QApplication,
QClipboardMode,
QCheckBoxEvents
>>>>>>>
QPlainTextEdit,
QTabWidget,
QGridLayout,
QScrollArea,
QPixmap,
CursorShape,
WindowState,
QTextOptionWrapMode,
QApplication,
QClipboardMode,
QCheckBoxEvents
<<<<<<<
import { QScrollArea } from "./lib/QtWidgets/QScrollArea";
import { QPixmap } from "./lib/QtGui/QPixmap";
import { CursorShape, WindowState } from "./lib/QtEnums"
import { QTabWidgetEvents } from "./lib/QtWidgets/QTabWidget";
=======
>>>>>>>
import { QTabWidgetEvents } from "./lib/QtWidgets/QTabWidget"; |
<<<<<<<
import {Browser, Internals, TCompMetadata} from 'remotion';
import {openBrowser} from '.';
=======
import puppeteer from 'puppeteer';
import {TCompMetadata} from 'remotion';
import {serveStatic} from './serve-static';
>>>>>>>
import {Browser, Internals, TCompMetadata} from 'remotion';
import {openBrowser} from '.';
import {serveStatic} from './serve-static';
<<<<<<<
const browserInstance = await openBrowser(browser);
const page = await browserInstance.newPage();
await page.goto(`file://${webpackBundle}/index.html?evaluation=true`);
=======
const browser = await puppeteer.launch({
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
],
});
const page = await browser.newPage();
const {port, close} = await serveStatic(webpackBundle);
await page.goto(`http://localhost:${port}/index.html?evaluation=true`);
>>>>>>>
const browserInstance = await openBrowser(browser);
const page = await browserInstance.newPage();
const {port, close} = await serveStatic(webpackBundle);
await page.goto(`http://localhost:${port}/index.html?evaluation=true`); |
<<<<<<<
import { ActivatedRoute, Router } from '@angular/router';
=======
import * as moment from 'moment-timezone';
>>>>>>>
import * as moment from 'moment-timezone';
import { ActivatedRoute, Router } from '@angular/router';
<<<<<<<
selectedTabQueryParams: string;
=======
invoices: Invoice[];
>>>>>>>
selectedTabQueryParams: string;
invoices: Invoice[]; |
<<<<<<<
StarMailSuccess, UndoDeleteMail, UndoDeleteMailSuccess
=======
StarMailSuccess, UploadAttachment, UploadAttachmentProgress, UploadAttachmentSuccess
>>>>>>>
StarMailSuccess, UploadAttachment, UploadAttachmentProgress, UploadAttachmentSuccess,
UndoDeleteMail, UndoDeleteMailSuccess
<<<<<<<
GetMailboxes, GetMailboxesSuccess, SnackPush } from '../actions';
=======
GetMailboxes, GetMailboxesSuccess
} from '../actions';
import { map } from 'rxjs/operators/map';
>>>>>>>
GetMailboxes, GetMailboxesSuccess, SnackPush
} from '../actions';
import { map } from 'rxjs/operators/map';
<<<<<<<
@Effect()
undoDeleteDraftMailEffect: Observable<any> = this.actions
.ofType(MailActionTypes.UNDO_DELETE_MAIL)
.map((action: UndoDeleteMail) => action.payload)
.switchMap(payload => {
return this.mailService.moveMail(payload.ids, payload.sourceFolder)
.pipe(
switchMap(res => {
return [
new UndoDeleteMailSuccess(payload)
];
}),
catchError(err => [new SnackErrorPush({ message: `Failed to move mail to ${payload.folder}.` })]),
);
});
=======
@Effect()
uploadAttachmentEffect: Observable<any> = this.actions
.ofType(MailActionTypes.UPLOAD_ATTACHMENT)
.map((action: UploadAttachment) => action.payload)
.switchMap(payload => {
return Observable.create(observer => {
this.mailService.uploadFile(payload)
.finally(() => observer.complete())
.subscribe((event: any) => {
if (event.type === HttpEventType.UploadProgress) {
const progress = Math.round(100 * event.loaded / event.total);
observer.next(new UploadAttachmentProgress({ ...payload, progress }));
} else if (event instanceof HttpResponse) {
observer.next(new UploadAttachmentSuccess(event.body));
}
},
err => observer.next(new SnackErrorPush({ message: 'Failed to upload attachment.' })));
});
});
>>>>>>>
@Effect()
uploadAttachmentEffect: Observable<any> = this.actions
.ofType(MailActionTypes.UPLOAD_ATTACHMENT)
.map((action: UploadAttachment) => action.payload)
.switchMap(payload => {
return Observable.create(observer => {
this.mailService.uploadFile(payload)
.finally(() => observer.complete())
.subscribe((event: any) => {
if (event.type === HttpEventType.UploadProgress) {
const progress = Math.round(100 * event.loaded / event.total);
observer.next(new UploadAttachmentProgress({ ...payload, progress }));
} else if (event instanceof HttpResponse) {
observer.next(new UploadAttachmentSuccess(event.body));
}
},
err => observer.next(new SnackErrorPush({ message: 'Failed to upload attachment.' })));
});
});
@Effect()
undoDeleteDraftMailEffect: Observable<any> = this.actions
.ofType(MailActionTypes.UNDO_DELETE_MAIL)
.map((action: UndoDeleteMail) => action.payload)
.switchMap(payload => {
return this.mailService.moveMail(payload.ids, payload.sourceFolder)
.pipe(
switchMap(res => {
return [
new UndoDeleteMailSuccess(payload)
];
}),
catchError(err => [new SnackErrorPush({ message: `Failed to move mail to ${payload.folder}.` })]),
);
}); |
<<<<<<<
ReadMailSuccess, SetFolders,
StarMailSuccess, UploadAttachment, UploadAttachmentProgress, UploadAttachmentSuccess
=======
ReadMailSuccess,
StarMailSuccess, UploadAttachment, UploadAttachmentProgress, UploadAttachmentSuccess,
UndoDeleteMail, UndoDeleteMailSuccess
>>>>>>>
ReadMailSuccess, SetFolders,
StarMailSuccess, UploadAttachment, UploadAttachmentProgress, UploadAttachmentSuccess,
UndoDeleteMail, UndoDeleteMailSuccess
<<<<<<<
@Effect()
createFolderEffect: Observable<any> = this.actions
.ofType(MailActionTypes.CREATE_FOLDER)
.map((action: CreateFolder) => action.payload)
.switchMap(payload => {
return this.mailService.createFolder(payload)
.pipe(
switchMap(res => {
return [
new CreateFolderSuccess(res.folders),
];
}),
catchError(err => [new SnackErrorPush({ message: 'Failed to create folder.' })]),
);
});
=======
@Effect()
undoDeleteDraftMailEffect: Observable<any> = this.actions
.ofType(MailActionTypes.UNDO_DELETE_MAIL)
.map((action: UndoDeleteMail) => action.payload)
.switchMap(payload => {
return this.mailService.moveMail(payload.ids, payload.sourceFolder)
.pipe(
switchMap(res => {
return [
new UndoDeleteMailSuccess(payload)
];
}),
catchError(err => [new SnackErrorPush({ message: `Failed to move mail to ${payload.folder}.` })]),
);
});
>>>>>>>
@Effect()
createFolderEffect: Observable<any> = this.actions
.ofType(MailActionTypes.CREATE_FOLDER)
.map((action: CreateFolder) => action.payload)
.switchMap(payload => {
return this.mailService.createFolder(payload)
.pipe(
switchMap(res => {
return [
new CreateFolderSuccess(res.folders),
];
}),
catchError(err => [new SnackErrorPush({ message: 'Failed to create folder.' })]),
);
});
@Effect()
undoDeleteDraftMailEffect: Observable<any> = this.actions
.ofType(MailActionTypes.UNDO_DELETE_MAIL)
.map((action: UndoDeleteMail) => action.payload)
.switchMap(payload => {
return this.mailService.moveMail(payload.ids, payload.sourceFolder)
.pipe(
switchMap(res => {
return [
new UndoDeleteMailSuccess(payload)
];
}),
catchError(err => [new SnackErrorPush({ message: `Failed to move mail to ${payload.folder}.` })]),
);
}); |
<<<<<<<
import {
AfterViewInit,
ChangeDetectorRef,
Component,
ElementRef,
Inject,
OnDestroy,
OnInit,
ViewChild
} from '@angular/core';
import { NgbDropdownConfig } from '@ng-bootstrap/ng-bootstrap';
import { AppState, AuthState, MailBoxesState, MailState, PlanType, UserState } from '../../store/datatypes';
=======
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, Inject, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { NgbDropdownConfig, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { AppState, MailBoxesState, MailState, PlanType, UserState } from '../../store/datatypes';
>>>>>>>
import {
AfterViewInit,
ChangeDetectorRef,
Component,
ElementRef,
Inject,
OnDestroy,
OnInit,
ViewChild
} from '@angular/core';
import { NgbDropdownConfig, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { AppState, MailBoxesState, MailState, PlanType, UserState } from '../../store/datatypes';
<<<<<<<
/**
* Disconnect websocket if not authenticated
*/
this.store
.select(state => state.auth)
.pipe(untilDestroyed(this))
.subscribe((authState: AuthState) => {
if (!authState.isAuthenticated) {
this.websocketService.disconnect();
this.store.dispatch(new ClearMailsOnLogout());
}
});
=======
>>>>>>> |
<<<<<<<
import { Component, OnInit, ViewChild } from '@angular/core';
import { NgbModal, NgbDropdownConfig, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { AppState, MailBoxesState, Settings, UserState, MailState } from '../../store/datatypes';
=======
import { Component, ComponentFactoryResolver, ComponentRef, OnInit, ViewChild, ViewContainerRef } from '@angular/core';
import { NgbDropdownConfig, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { AppState, MailBoxesState, MailState, Settings, UserState } from '../../store/datatypes';
>>>>>>>
import { Component, ComponentFactoryResolver, ComponentRef, OnInit, ViewChild, ViewContainerRef } from '@angular/core';
import { NgbDropdownConfig, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { AppState, MailBoxesState, MailState, Settings, UserState } from '../../store/datatypes';
<<<<<<<
import { MailFolderType, Mail } from '../../store/models/mail.model';
import { MoveMail, UpdateFolder } from '../../store/actions/mail.actions';
=======
import { ComposeMailDialogComponent } from './compose-mail-dialog/compose-mail-dialog.component';
import { Mail, MailFolderType } from '../../store/models/mail.model';
>>>>>>>
import { Mail, MailFolderType } from '../../store/models/mail.model';
import { MoveMail, UpdateFolder } from '../../store/actions/mail.actions';
import { ComposeMailDialogComponent } from './compose-mail-dialog/compose-mail-dialog.component'; |
<<<<<<<
UNDO_DELETE_MAIL = '[Mail] UNDO DELETE DRAFT MAIL',
UNDO_DELETE_MAIL_SUCCESS = '[Mail] UNDO DELETE DRAFT MAIL SUCCESS',
=======
UPLOAD_ATTACHMENT = '[Attachment] UPLOAD_ATTACHMENT',
UPLOAD_ATTACHMENT_PROGRESS = '[Attachment] UPLOAD_ATTACHMENT_PROGRESS',
UPLOAD_ATTACHMENT_SUCCESS = '[Attachment] UPLOAD_ATTACHMENT_SUCCESS',
>>>>>>>
UNDO_DELETE_MAIL = '[Mail] UNDO DELETE DRAFT MAIL',
UNDO_DELETE_MAIL_SUCCESS = '[Mail] UNDO DELETE DRAFT MAIL SUCCESS',
UPLOAD_ATTACHMENT = '[Attachment] UPLOAD_ATTACHMENT',
UPLOAD_ATTACHMENT_PROGRESS = '[Attachment] UPLOAD_ATTACHMENT_PROGRESS',
UPLOAD_ATTACHMENT_SUCCESS = '[Attachment] UPLOAD_ATTACHMENT_SUCCESS',
<<<<<<<
export class UndoDeleteMail implements Action {
readonly type = MailActionTypes.UNDO_DELETE_MAIL;
constructor(public payload?: any) {}
}
export class UndoDeleteMailSuccess implements Action {
readonly type = MailActionTypes.UNDO_DELETE_MAIL_SUCCESS;
constructor(public payload?: any) {}
}
=======
export class UploadAttachment implements Action {
readonly type = MailActionTypes.UPLOAD_ATTACHMENT;
constructor(public payload: any) {}
}
export class UploadAttachmentProgress implements Action {
readonly type = MailActionTypes.UPLOAD_ATTACHMENT_PROGRESS;
constructor(public payload: any) {}
}
export class UploadAttachmentSuccess implements Action {
readonly type = MailActionTypes.UPLOAD_ATTACHMENT_SUCCESS;
constructor(public payload?: any) {}
}
>>>>>>>
export class UndoDeleteMail implements Action {
readonly type = MailActionTypes.UNDO_DELETE_MAIL;
constructor(public payload?: any) {}
}
export class UndoDeleteMailSuccess implements Action {
readonly type = MailActionTypes.UNDO_DELETE_MAIL_SUCCESS;
constructor(public payload?: any) {}
}
export class UploadAttachment implements Action {
readonly type = MailActionTypes.UPLOAD_ATTACHMENT;
constructor(public payload: any) {}
}
export class UploadAttachmentProgress implements Action {
readonly type = MailActionTypes.UPLOAD_ATTACHMENT_PROGRESS;
constructor(public payload: any) {}
}
export class UploadAttachmentSuccess implements Action {
readonly type = MailActionTypes.UPLOAD_ATTACHMENT_SUCCESS;
constructor(public payload?: any) {}
}
<<<<<<<
| UpdatePGPContent
| UndoDeleteMail
| UndoDeleteMailSuccess;
=======
| UpdatePGPContent
| UploadAttachment
| UploadAttachmentProgress
| UploadAttachmentSuccess;
>>>>>>>
| UpdatePGPContent
| UndoDeleteMail
| UndoDeleteMailSuccess
| UploadAttachment
| UploadAttachmentProgress
| UploadAttachmentSuccess; |
<<<<<<<
moveMail(ids: string, folder: string, withChildren: boolean = true, fromTrash: boolean = false): Observable<any[]> {
return this.http.patch<any>(`${apiUrl}emails/messages/?id__in=${ids}`, { folder: folder, with_children: withChildren, from_trash: fromTrash });
=======
moveMail(ids: string, folder: string, sourceFolder: string): Observable<any[]> {
if (ids === 'all') {
return this.http.patch<any>(`${apiUrl}emails/messages/?folder=${sourceFolder}`, { folder: folder });
} else {
return this.http.patch<any>(`${apiUrl}emails/messages/?id__in=${ids}`, { folder: folder });
}
// return this.http.patch<any>(`${apiUrl}emails/messages/?id__in=${ids}&folder=${sourceFolder}`, { folder: folder });
>>>>>>>
moveMail(ids: string, folder: string, sourceFolder: string, withChildren: boolean = true, fromTrash: boolean = false): Observable<any[]> {
if (ids === 'all') {
return this.http.patch<any>(`${apiUrl}emails/messages/?folder=${sourceFolder}`, { folder: folder, with_children: withChildren, from_trash: fromTrash });
} else {
return this.http.patch<any>(`${apiUrl}emails/messages/?id__in=${ids}`, { folder: folder, with_children: withChildren, from_trash: fromTrash });
} |
<<<<<<<
this.store.dispatch(new GetMails({ limit: this.LIMIT, offset: this.OFFSET, folder: this.mailFolder, read: false }));
=======
this.store.dispatch(new GetMails({ limit: 1000, offset: 0, folder: this.mailFolder, read: false, seconds: 30 }));
>>>>>>>
this.store.dispatch(new GetMails({ limit: this.LIMIT, offset: this.OFFSET, folder: this.mailFolder, read: false, seconds: 30 })); |
<<<<<<<
import { Component, ComponentFactoryResolver, ComponentRef, OnInit, ViewChild, ViewContainerRef } from '@angular/core';
import { NgbDropdownConfig, NgbModal } from '@ng-bootstrap/ng-bootstrap';
=======
import { Component, OnInit } from '@angular/core';
import { NgbModal, NgbDropdownConfig } from '@ng-bootstrap/ng-bootstrap';
import { AppState, MailBoxesState, Settings, UserState, MailState } from '../../store/datatypes';
>>>>>>>
import { Component, ComponentFactoryResolver, ComponentRef, OnInit, ViewChild, ViewContainerRef } from '@angular/core';
import { NgbDropdownConfig, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { AppState, MailBoxesState, MailState, Settings, UserState } from '../../store/datatypes';
<<<<<<<
import { ComposeMailDialogComponent } from './compose-mail-dialog/compose-mail-dialog.component';
=======
import { MailFolderType, Mail } from '../../store/models/mail.model';
>>>>>>>
import { ComposeMailDialogComponent } from './compose-mail-dialog/compose-mail-dialog.component';
import { Mail, MailFolderType } from '../../store/models/mail.model';
<<<<<<<
private componentRefList: Array<ComponentRef<ComposeMailDialogComponent>> = [];
=======
draftCount: number = 0;
inboxUnreadCount: number = 0;
>>>>>>>
private componentRefList: Array<ComponentRef<ComposeMailDialogComponent>> = [];
draftCount: number = 0;
inboxUnreadCount: number = 0; |
<<<<<<<
import Invocation from "./Invocation";
import Application from './Application';
=======
import Job from "./Job";
>>>>>>>
import Job from "./Job";
import Application from './Application';
<<<<<<<
clear: (invocation: Invocation, args: string[]): void => {
setTimeout(() => invocation.terminal.clearInvocations(), 0);
},
exit: (invocation: Invocation, args: Array<string>): void => {
var application = Application.instance;
application
.removeTerminal(application.activeTerminal)
.activateTerminal(_.last(application.terminals));
=======
clear: (job: Job, args: string[]): void => {
setTimeout(() => job.terminal.clearJobs(), 0);
>>>>>>>
clear: (job: Job, args: string[]): void => {
setTimeout(() => job.terminal.clearJobs(), 0);
},
exit: (job: Job, args: string[]): void => {
var application = Application.instance;
application
.removeTerminal(application.activeTerminal)
.activateTerminal(_.last(application.terminals)); |
<<<<<<<
indexNumber = 1;
=======
exampleConfig = { slidesPerView: 3 };
>>>>>>>
indexNumber = 1;
exampleConfig = { slidesPerView: 3 }; |
<<<<<<<
@Input()
set index(index: number) {
this.setIndex(index);
}
=======
@Input()
set config(val: SwiperOptions) {
this.updateSwiper(val);
const { params } = getParams(val);
Object.assign(this, params);
}
>>>>>>>
@Input()
set index(index: number) {
this.setIndex(index);
}
@Input()
set config(val: SwiperOptions) {
this.updateSwiper(val);
const { params } = getParams(val);
Object.assign(this, params);
} |
<<<<<<<
import { Directive, Input, TemplateRef } from '@angular/core';
=======
import { Directive, Input, Optional, TemplateRef } from '@angular/core';
import { coerceBooleanProperty } from './utils/utils';
>>>>>>>
import { Directive, Input, TemplateRef } from '@angular/core';
import { coerceBooleanProperty } from './utils/utils'; |
<<<<<<<
this.zone.runOutsideAngular(() => {
new Swiper(this.elementRef.nativeElement, swiperParams);
});
=======
swiperParams.observer = true;
new Swiper(this.elementRef.nativeElement, swiperParams);
>>>>>>>
swiperParams.observer = true;
this.zone.runOutsideAngular(() => {
new Swiper(this.elementRef.nativeElement, swiperParams);
}); |
<<<<<<<
/**
* Static method to invoke a cordova command. Used to invoke the 'platform' or 'plugin' command
*
* @param {string} The name of the cordova command to be invoked
* @param {string} The version of the cordova CLI to use
* @param {ICordovaCommandParameters} The cordova command parameters
*
* @return {Q.Promise<any>} An empty promise
*/
public static invokeCommand(command: string, cordovaCliVersion: string, platformCmdParameters: cordovaHelper.ICordovaCommandParameters): Q.Promise<any> {
return packageLoader.lazyRequire(CordovaWrapper.CordovaNpmPackageName, CordovaWrapper.CordovaNpmPackageName + "@" + cordovaCliVersion)
.then(function (cordova: Cordova.ICordova): Q.Promise<any> {
if (command === "platform") {
return cordova.raw.platform(platformCmdParameters.subCommand, platformCmdParameters.targets.join(" "), platformCmdParameters.downloadOptions);
} else if (command === "plugin") {
return cordova.raw.plugin(platformCmdParameters.subCommand, platformCmdParameters.targets.join(" "), platformCmdParameters.downloadOptions);
} else {
return Q.reject(errorHelper.get(TacoErrorCodes.CordovaCmdNotFound));
}
});
}
=======
public static getCordovaVersion(): Q.Promise<string> {
return projectHelper.getProjectInfo().then(function (projectInfo: projectHelper.IProjectInfo): Q.Promise<string> {
if (projectInfo.cordovaCliVersion) {
return Q.resolve(projectInfo.cordovaCliVersion);
} else {
return CordovaWrapper.cli(["-v"], true).then(function (output: string): string {
return output.split("\n")[0];
});
}
});
}
>>>>>>>
public static getCordovaVersion(): Q.Promise<string> {
return projectHelper.getProjectInfo().then(function (projectInfo: projectHelper.IProjectInfo): Q.Promise<string> {
if (projectInfo.cordovaCliVersion) {
return Q.resolve(projectInfo.cordovaCliVersion);
} else {
return CordovaWrapper.cli(["-v"], true).then(function (output: string): string {
return output.split("\n")[0];
});
}
});
}
/**
* Static method to invoke a cordova command. Used to invoke the 'platform' or 'plugin' command
*
* @param {string} The name of the cordova command to be invoked
* @param {string} The version of the cordova CLI to use
* @param {ICordovaCommandParameters} The cordova command parameters
*
* @return {Q.Promise<any>} An empty promise
*/
public static invokeCommand(command: string, cordovaCliVersion: string, platformCmdParameters: cordovaHelper.ICordovaCommandParameters): Q.Promise<any> {
return packageLoader.lazyRequire(CordovaWrapper.CordovaNpmPackageName, CordovaWrapper.CordovaNpmPackageName + "@" + cordovaCliVersion)
.then(function (cordova: Cordova.ICordova): Q.Promise<any> {
if (command === "platform") {
return cordova.raw.platform(platformCmdParameters.subCommand, platformCmdParameters.targets.join(" "), platformCmdParameters.downloadOptions);
} else if (command === "plugin") {
return cordova.raw.plugin(platformCmdParameters.subCommand, platformCmdParameters.targets.join(" "), platformCmdParameters.downloadOptions);
} else {
return Q.reject(errorHelper.get(TacoErrorCodes.CordovaCmdNotFound));
}
});
} |
<<<<<<<
list.args = argList;
var maxKeyLength: number = 0;
if (list.args) {
list.args.forEach(nvp => {
if (nvp.name.length > maxKeyLength) {
maxKeyLength = nvp.name.length;
}
});
}
if (list.options) {
list.options.forEach(nvp => {
if ((nvp.name.length + LoggerHelper.DefaultIndent) > maxKeyLength) {
maxKeyLength = nvp.name.length + LoggerHelper.DefaultIndent;
}
});
}
=======
var longestArgsLength: number = LoggerHelper.getLongestNameLength(list.args);
var longestOptionsLength: number = LoggerHelper.getLongestNameLength(list.options);
var longestKeyLength: number = Math.max(longestArgsLength, longestOptionsLength + LoggerHelper.DefaultIndent);
var indent2 = LoggerHelper.getDescriptionColumnIndent(longestKeyLength);
>>>>>>>
list.args = argList;
var longestArgsLength: number = LoggerHelper.getLongestNameLength(list.args);
var longestOptionsLength: number = LoggerHelper.getLongestNameLength(list.options);
var longestKeyLength: number = Math.max(longestArgsLength, longestOptionsLength + LoggerHelper.DefaultIndent);
var indent2 = LoggerHelper.getDescriptionColumnIndent(longestKeyLength);
<<<<<<<
private static printCommandTable(nameValuePairs: INameDescription[], indent1?: number, indent2?: number): void {
nameValuePairs.forEach(item => {
item.description = Help.getDescriptionString(item.description);
=======
private static printCommandTable(nameDescriptionPairs: INameDescription[], indent1?: number, indent2?: number): void {
nameDescriptionPairs.forEach(function (nvp: INameDescription): void {
nvp.description = Help.getDescriptionString(nvp.description);
>>>>>>>
private static printCommandTable(nameDescriptionPairs: INameDescription[], indent1?: number, indent2?: number): void {
nameDescriptionPairs.forEach(function (nvp: INameDescription): void {
nvp.description = Help.getDescriptionString(nvp.description); |
<<<<<<<
import platformModule = require ("./platform");
import pluginModule = require ("./plugin");
=======
import kitHelper = require ("./utils/kitHelper");
>>>>>>>
import kitHelper = require ("./utils/kitHelper");
import platformModule = require ("./platform");
import pluginModule = require ("./plugin");
<<<<<<<
return kitHelper.getKitInfo(kitId).then(function (kitInfo: tacoKits.IKitInfo): void {
var indent = LoggerHelper.getDescriptionColumnIndent(Kit.getLongestPlatformPluginLength(Object.keys(kitInfo.platforms), Object.keys(kitInfo.plugins)));
=======
return kitHelper.getKitInfo(kitId).then(function (kitInfo: TacoKits.IKitInfo): void {
var indent2 = LoggerHelper.getDescriptionColumnIndent(Kit.getLongestPlatformPluginLength(kitInfo));
>>>>>>>
return kitHelper.getKitInfo(kitId).then(function (kitInfo: TacoKits.IKitInfo): void {
var indent = LoggerHelper.getDescriptionColumnIndent(Kit.getLongestPlatformPluginLength(Object.keys(kitInfo.platforms), Object.keys(kitInfo.plugins)));
<<<<<<<
private static getLongestPlatformPluginLength(platforms: string[], plugins: string[]): number {
=======
private static getLongestPlatformPluginLength(kitInfo: TacoKits.IKitInfo): number {
>>>>>>>
private static getLongestPlatformPluginLength(platforms: string[], plugins: string[]): number { |
<<<<<<<
res.status(err.code || 400).send({ status: self.resources.getStringForLanguage(req, "InvalidBuildRequest"), errors: err.toString() });
=======
res.status(err.code || 400).send({ status: self.resources.getStringForLanguage(req, "invalidBuildRequest"), errors: err });
>>>>>>>
res.status(err.code || 400).send({ status: self.resources.getStringForLanguage(req, "invalidBuildRequest"), errors: err.toString() }); |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.