Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
addProject = (project) => {
if (isEmpty(project) || this.projects.has(project)) return false;
this.projects.add(project);
return true
};
loadEnvironments(environments => {
if (isEmpty(environments)) {
registry.projectConfiguration.store.environments = new Set();
registry.projectConfiguration.store.servers = new Set();
registry.projectConfiguration.store.project.module.availableEnvironments = [];
registry.projectConfiguration.store.project.module.availableServers = [];
registry.projectConfiguration.store.apply();
return
}
registry.projectConfiguration.store.environments = new Set(environments);
const newAvailableEnvironments = [];
registry.projectConfiguration.store.project.module.availableEnvironments.forEach(environment => {
if (contain(environments, environment)) {
newAvailableEnvironments.push(environment);
}
});
registry.projectConfiguration.store.project.module.availableEnvironments = newAvailableEnvironments;
loadServersByEnvironments(environments, servers => {
loadProjectGroups(application, groups => {
if (isEmpty(groups)) {
registry.notificationsTab.store.projectGroups = [];
registry.notificationsTab.store.projects = [];
registry.notificationsTab.store.selectedProject = null;
registry.notificationsTab.store.selectedProjectGroup = null;
registry.notificationsTab.store.apply();
return
}
registry.notificationsTab.store.projectGroups = new Set(groups);
registry.notificationsTab.store.apply()
})
});
deleteApplication = (application) => {
if (isEmpty(application) || !this.applications.has(application)) return false;
this.applications.delete(application);
return true
};
loadServersByEnvironments(environments, servers => {
if (isEmpty(servers)) {
registry.projectConfiguration.store.project.module.availableServers = [];
registry.projectConfiguration.store.apply();
return
}
const newAvailableServers = [];
registry.projectConfiguration.store.project.module.availableServers.forEach(server => {
if (contain(servers, server)) {
newAvailableServers.push(server);
}
});
registry.projectConfiguration.store.project.module.availableServers = newAvailableServers;
registry.projectConfiguration.store.servers = new Set(servers);
registry.projectConfiguration.store.apply()
})
},
loadProjectGroups(application, groups => {
if (isEmpty(groups)) {
registry.applicationsTab.store.projectGroups = new Set();
registry.applicationsTab.store.projects = new Set();
registry.applicationsTab.store.apply();
return;
}
registry.applicationsTab.store.projectGroups = new Set(groups);
registry.applicationsTab.store.selectedProjectGroup = groups[0];
loadProjects(application, groups[0], projects => {
if (isEmpty(projects)) {
registry.applicationsTab.store.projects = new Set();
registry.applicationsTab.store.apply();
return;
}
registry.applicationsTab.store.projects = new Set(projects);
registry.applicationsTab.store.selectedProject = projects[0];
if (registry.projectConfiguration) {
createProjectNotificationsView = () => isEmpty(this.state.selectedProject) ? EMPTY_TAG :
<div>
<header color="{PRIMARY_COLOR}">
Нотификации для Проекта {registry.notificationsTab.store.selectedProject}
</header>
{this.state.selectedProjectNotifications.map((notification, index) => this.createNotificationView(notification, index, reactors.onProjectNotificationPropertyInput, () => reactors.onDeleteProjectNotification(index)))}
{this.createAddNotificationButton(reactors.onAddProjectNotification)}
</div>;
loadClusters(environment, clusters => {
if (isEmpty(clusters)) {
registry.environmentsTab.store.apply();
return
}
registry.environmentsTab.store.clusters = new Set(clusters);
registry.environmentsTab.store.selectedCluster = clusters[0];
loadServers(environment, clusters[0], servers => {
if (isEmpty(servers)) {
registry.environmentsTab.store.apply();
return;
}
registry.environmentsTab.store.servers = new Set(servers);
registry.environmentsTab.store.selectedServer = servers[0];
if (registry.serverConfiguration) {
registry.serverConfiguration.controller.loadServerConfiguration(environment, clusters[0], servers[0]);
}
registry.environmentsTab.store.apply();
loadProject(application, group, project, project => {
if (isEmpty(project)) {
registry.projectConfiguration.store.project = {};
registry.projectConfiguration.store.apply();
return
}
registry.projectConfiguration.store.project = project;
loadEnvironments(environments => {
if (isEmpty(environments)) {
registry.projectConfiguration.store.environments = new Set();
registry.projectConfiguration.store.servers = new Set();
registry.projectConfiguration.store.project.module.availableEnvironments = [];
registry.projectConfiguration.store.project.module.availableServers = [];
registry.projectConfiguration.store.apply();
return
}
registry.projectConfiguration.store.environments = new Set(environments);
const newAvailableEnvironments = [];
createProjectSelector = () => isEmpty(this.state.selectedProjectGroup) ? EMPTY_TAG :
<div>
<header color="{PRIMARY_COLOR}">Выберите проект:</header>
reactors.onSelectProject(fromSelectOption(option))}/>
reactors.onInputNewProject(input.value)}/>
</div>