"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tabby-plugin-manager/src/components/pluginsSettingsTab.component.ts" between
tabby-1.0.181.tar.gz and tabby-1.0.183.tar.gz

About: Tabby is a modern cross-platform terminal emulator, SSH and serial client.

pluginsSettingsTab.component.ts  (tabby-1.0.181):pluginsSettingsTab.component.ts  (tabby-1.0.183)
skipping to change at line 26 skipping to change at line 26
/** @hidden */ /** @hidden */
@Component({ @Component({
template: require('./pluginsSettingsTab.component.pug'), template: require('./pluginsSettingsTab.component.pug'),
styles: [require('./pluginsSettingsTab.component.scss')], styles: [require('./pluginsSettingsTab.component.scss')],
}) })
export class PluginsSettingsTabComponent { export class PluginsSettingsTabComponent {
BusyState = BusyState BusyState = BusyState
@Input() availablePlugins$: Observable<PluginInfo[]> @Input() availablePlugins$: Observable<PluginInfo[]>
@Input() availablePluginsQuery$ = new BehaviorSubject<string>('') @Input() availablePluginsQuery$ = new BehaviorSubject<string>('')
@Input() availablePluginsReady = false @Input() availablePluginsReady = false
@Input() installedPluginsQuery$ = new BehaviorSubject<string>('')
@Input() knownUpgrades: Record<string, PluginInfo|null> = {} @Input() knownUpgrades: Record<string, PluginInfo|null> = {}
@Input() busy = new Map<string, BusyState>() @Input() busy = new Map<string, BusyState>()
@Input() erroredPlugin: string @Input() erroredPlugin: string
@Input() errorMessage: string @Input() errorMessage: string
@HostBinding('class.content-box') true @HostBinding('class.content-box') true
installedPlugins$: PluginInfo[] = []
constructor ( constructor (
private config: ConfigService, private config: ConfigService,
private platform: PlatformService, private platform: PlatformService,
public pluginManager: PluginManagerService public pluginManager: PluginManagerService
) { ) {
} }
ngOnInit () { ngOnInit () {
this.availablePlugins$ = this.availablePluginsQuery$ this.availablePlugins$ = this.availablePluginsQuery$
.asObservable() .asObservable()
skipping to change at line 61 skipping to change at line 64
}) })
) )
this.availablePlugins$.pipe(first(), map((plugins: PluginInfo[]) => { this.availablePlugins$.pipe(first(), map((plugins: PluginInfo[]) => {
plugins.sort((a, b) => a.name > b.name ? 1 : -1) plugins.sort((a, b) => a.name > b.name ? 1 : -1)
return plugins return plugins
})).subscribe(available => { })).subscribe(available => {
for (const plugin of this.pluginManager.installedPlugins) { for (const plugin of this.pluginManager.installedPlugins) {
this.knownUpgrades[plugin.name] = available.find(x => x.name === plugin.name && semverGt(x.version, plugin.version)) ?? null this.knownUpgrades[plugin.name] = available.find(x => x.name === plugin.name && semverGt(x.version, plugin.version)) ?? null
} }
}) })
this.installedPluginsQuery$
.asObservable()
.pipe(
debounceTime(200),
distinctUntilChanged(),
flatMap(query => {
return this.pluginManager.listInstalled(query)
})
).subscribe(plugin => {
this.installedPlugins$ = plugin
})
} }
openPluginsFolder (): void { openPluginsFolder (): void {
this.platform.openPath(this.pluginManager.userPluginsPath) this.platform.openPath(this.pluginManager.userPluginsPath)
} }
searchAvailable (query: string) { searchAvailable (query: string) {
this.availablePluginsQuery$.next(query) this.availablePluginsQuery$.next(query)
} }
searchInstalled (query: string) {
this.installedPluginsQuery$.next(query)
}
isAlreadyInstalled (plugin: PluginInfo): boolean { isAlreadyInstalled (plugin: PluginInfo): boolean {
return this.pluginManager.installedPlugins.some(x => x.name === plugin.n ame) return this.pluginManager.installedPlugins.some(x => x.name === plugin.n ame)
} }
async installPlugin (plugin: PluginInfo): Promise<void> { async installPlugin (plugin: PluginInfo): Promise<void> {
this.busy.set(plugin.name, BusyState.Installing) this.busy.set(plugin.name, BusyState.Installing)
try { try {
await this.pluginManager.installPlugin(plugin) await this.pluginManager.installPlugin(plugin)
this.busy.delete(plugin.name) this.busy.delete(plugin.name)
this.config.requestRestart() this.config.requestRestart()
 End of changes. 4 change blocks. 
0 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)