Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled status at top of Treeview #51

Merged
merged 34 commits into from
Dec 11, 2020
Merged

Enabled status at top of Treeview #51

merged 34 commits into from
Dec 11, 2020

Conversation

InTheCloudDan
Copy link
Collaborator

@InTheCloudDan InTheCloudDan commented Oct 16, 2020

Moving the status of the flag to the top so you do not need to expand to see it.

Also started cleaning up the complicated Treeview generation.

image

This PR also includes a slight change to #49 in that if a variation is changed then it will still retrieve the flag as soon as the plugin receives notice. This is because Variations are the only part of the global data model that can affect environment specific targeting so for future functionality those should also be in sync.

@atrakh atrakh changed the base branch from master to storeRedo October 22, 2020 22:40
src/flagStore.ts Outdated
const flags = await this.api.getFeatureFlags(this.config.project, this.config.env);
const getFlags = await this.api.getFeatureFlags(this.config.project, this.config.env);
const flags = getFlags.map(flag => {
flag.variationLength = flag.variations.length;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Any reason why we can't always reference flag.variations.length instead of copying the length to a new field?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think that should be doable I'll make the change and test it

@@ -146,10 +165,11 @@ export class FlagStore {
}

private ldConfig(): Record<string, number | string | boolean | LaunchDarkly.LDFeatureStore> {
const streamUri = this.config.baseUri.replace('app', 'stream');
Copy link
Contributor

@atrakh atrakh Oct 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you recommending we remove the streamUri config option? I'm not sure this replace always be accurate in a development environment.

}
});
});
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this new block? Were updates not being made when the number of variations changed before?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as of right now(before PR this one is based one) every time there's a flag update we get the latest flag via API. Per our conversation I changed it so the control plane data only updates on the refreshRate.

What this changes is so that it only updates on refreshRate except when there's a variation change. Because variations span the global flag config and environment targeting where almost nothing else does.

@@ -470,17 +466,12 @@ export class FlagNode extends vscode.TreeItem {
this.conditionalIcon(ctx, this.contextValue, this.label);
}

private conditionalIcon(ctx: vscode.ExtensionContext, contextValue: string, label: string) {
private conditionalIcon(ctx: vscode.ExtensionContext, contextValue: string, label: string, enabled?: boolean) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new param appears to be unused in conditionalIcon

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without it the Interface does not work, it says the signatures do not match. I'm not sure how to approach it better.

dark: ctx.asAbsolutePath(path.join('resources', 'dark', fileName + '.svg')),
});
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the methods in this new class identical to the ones above? Do we need both?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the methods are the same currently as this is step 1. The logic within the methods is getting cleaned up also. I'm also trimming down the number of properties per class and in the future will move additional nodes like variations to their own class so it's less of a tangle of procedural code.

@InTheCloudDan InTheCloudDan changed the base branch from storeRedo to v3 December 11, 2020 22:41
@InTheCloudDan InTheCloudDan merged commit 9174f88 into v3 Dec 11, 2020
rmanalan added a commit that referenced this pull request Feb 4, 2021
* Store Refactor - Redo (#49)

* only update global flag metadata based on refresh rate

treeview gets all info from flagstore

add refresh rate config options

* lint

* remove console

* remove unused imports

disable events

* make event readonly

* make metadata private

remove console logs

* fixes to work for initial install

* remove console

* remove unused property and function

* remove unused function

* remove console log

* named import for lodash

remove commented lines

* remove unneeded window message

change comparison

* fix promises

* remove unused function

* Update src/extension.ts

Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* Update src/extension.ts

Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* fixes

* remove console log

Co-authored-by: Dan O'Brien <dobrien@launchdarkly.com>
Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* User Agent (#52)

* update User-Agent
* fix error message

* Enabled status at top of Treeview (#51)

* move enabled icon to top level

* handle changes in variations

* add basic interface between classes

* Using Code References to Power Aliases (#50)

* Check coderefs version

* remove console logs

* set timeout on child process

* lint

* remove unused taskDefinition

* check coderefs path is set

* lint

* add search ability

* add icons for searching aliases

* add list of keys as property

* remove unused statusbar command

* update to list of map keys

* API Interactions (#55)

* basic API changes working

* clean up implementation

* update icons and names

* error handling

* Add Basic CodeLens functionality (#59)

* add key to flag lens

* stringify values

* remove unused api property

* Code Lens Hover (#53)

* update hover

* updated hover

right click flag toggle poc

* context menu changes

* check for coderefs yaml

* remove duplicate identifier

* fix getMap in flag lens

* fix offlining when not in focus

* Updated tree node UI (#57)

* only update global flag metadata based on refresh rate

treeview gets all info from flagstore

add refresh rate config options

* lint

* remove console

* remove unused imports

disable events

* make event readonly

* make metadata private

remove console logs

* fixes to work for initial install

* remove console

* remove unused property and function

* remove unused function

* remove console log

* named import for lodash

remove commented lines

* remove unneeded window message

change comparison

* fix promises

* remove unused function

* Update src/extension.ts

Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* Update src/extension.ts

Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* fixes

* remove console log

* start cleaning up flagview

move enabled icon to top level

* handle changes in variations

* add basic interface between classes

* lint

* fix off variation

* add context check back

* lint

* add basic test

* fix missing paranthesis

* test fixes

* update enabled icons

* remove variation length property

* update model

* update changelog

* initial code refs

* Alias Treeview

Alias Tree search

* lint

* add config

* remove console log

* Check coderefs version

remove console logs

set timeout on child process

* lint

* remove unused taskDefinition

check coderefs path is set

* lint

* add search ability

add icons for searching aliases

* add list of keys as property

remove unused statusbar command

* update to list of map keys

* rename getter

* basic API changes working

* clean up implementation

* update icons and names

* error handling

* not working

* lens resolving

add configuration option

* show variations served

* handle no default

* codelens on aliases basic support

* eslint ignore

remove console.log

* add key to flag lens

stringify values

* remove console log

* only Stringify object

* fix rebase

* remove unused api property

* update for rebase

* check if keys is defined

* codelens on aliases basic support

* update hover

* updated hover

right click flag toggle poc

* context menu changes

* check for coderefs yaml

rebase cleanup

* fix getKeys when aliases do not exist

* lint

* Updated tree node UI

* Fix for test

* Fix for test

* Updated toggle icons

* New popover UI

Co-authored-by: Dan O'Brien <dobrien@launchdarkly.com>
Co-authored-by: Dan O'Brien <dobrien.nj@gmail.com>
Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* Fix tests

* Prettier updates

* Add GH action to publish to registry

* Change name of publisher

* Updated version and icon

* Change name to LaunchDarkly Beta

* Fix version

* Change ver to 3.0.0

* Coderefs download (#60)

* initial download of code refs

* update config check to run coderefs

* fix aliases section showing in treeview if no aliases

* platform agnostic path for coderefs

* Fix test

* updated dependencies (#61)

* prettier fixes

* eslint and type updates

* more prettier fixes

* Automate version and name change for beta build

* Change version format

* One more to conform to version specs

* Don't create a beta release unless it's on the beta branch

* Only publish on v3 branch

* No need to check branch separately

* Added snapshot testing, resized hover icons

* Fix prettier issue

* Publish beta under launchdarkly-beta id

* Publish to OpenVSX

* s/v3/beta

* Fix prettier

* Color theme is in the wrong case

* ignore coderefs dir

handle high contrast theme

* fix error interpolation

remove codelens array private var

null check on flag variation

* Activation add Ignore for this workspace [ch98567] (#62)

* Activation Add configure buttons to sidebar [ch98569] (#63)

* Activation add Ignore for this workspace [ch98567]

* Activation Add configure buttons to sidebar [ch98569]

* Remove .vscode/settings.json

* check aliases for hover

* move flag search to parent node

* prettier fixes

* Icon color changes, turn off codelens on prod, use yarn for build

* Updated docs

* Change formatting

* move hover provider to own file

implement fix for auto-complete

* update test

* Config Hide advanced config settings like [ch98573] (#64)

There are also a few other things included in this commit: change version # pattern for beta, updated config descriptions, and turn off all other extensions when in debug mode.

* Reverting back to previous versioning scheme

Even though vsce says that it supports semver, it turns out that the Marketplace doesn't support prereleases (microsoft/vscode-vsce#415 (comment))

* Change default name to LaunchDarkly

* do not show error when SDK handles it

Co-authored-by: Dan O'Brien <dobrien.nj@gmail.com>
Co-authored-by: Dan O'Brien <dobrien@launchdarkly.com>
Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>
@InTheCloudDan InTheCloudDan deleted the enabledStatus branch February 17, 2021 13:49
InTheCloudDan added a commit that referenced this pull request Jan 25, 2024
* Store Refactor - Redo (#49)

* only update global flag metadata based on refresh rate

treeview gets all info from flagstore

add refresh rate config options

* lint

* remove console

* remove unused imports

disable events

* make event readonly

* make metadata private

remove console logs

* fixes to work for initial install

* remove console

* remove unused property and function

* remove unused function

* remove console log

* named import for lodash

remove commented lines

* remove unneeded window message

change comparison

* fix promises

* remove unused function

* Update src/extension.ts

Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* Update src/extension.ts

Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* fixes

* remove console log

Co-authored-by: Dan O'Brien <dobrien@launchdarkly.com>
Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* User Agent (#52)

* update User-Agent
* fix error message

* Enabled status at top of Treeview (#51)

* move enabled icon to top level

* handle changes in variations

* add basic interface between classes

* Using Code References to Power Aliases (#50)

* Check coderefs version

* remove console logs

* set timeout on child process

* lint

* remove unused taskDefinition

* check coderefs path is set

* lint

* add search ability

* add icons for searching aliases

* add list of keys as property

* remove unused statusbar command

* update to list of map keys

* API Interactions (#55)

* basic API changes working

* clean up implementation

* update icons and names

* error handling

* Add Basic CodeLens functionality (#59)

* add key to flag lens

* stringify values

* remove unused api property

* Code Lens Hover (#53)

* update hover

* updated hover

right click flag toggle poc

* context menu changes

* check for coderefs yaml

* remove duplicate identifier

* fix getMap in flag lens

* fix offlining when not in focus

* Updated tree node UI (#57)

* only update global flag metadata based on refresh rate

treeview gets all info from flagstore

add refresh rate config options

* lint

* remove console

* remove unused imports

disable events

* make event readonly

* make metadata private

remove console logs

* fixes to work for initial install

* remove console

* remove unused property and function

* remove unused function

* remove console log

* named import for lodash

remove commented lines

* remove unneeded window message

change comparison

* fix promises

* remove unused function

* Update src/extension.ts

Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* Update src/extension.ts

Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* fixes

* remove console log

* start cleaning up flagview

move enabled icon to top level

* handle changes in variations

* add basic interface between classes

* lint

* fix off variation

* add context check back

* lint

* add basic test

* fix missing paranthesis

* test fixes

* update enabled icons

* remove variation length property

* update model

* update changelog

* initial code refs

* Alias Treeview

Alias Tree search

* lint

* add config

* remove console log

* Check coderefs version

remove console logs

set timeout on child process

* lint

* remove unused taskDefinition

check coderefs path is set

* lint

* add search ability

add icons for searching aliases

* add list of keys as property

remove unused statusbar command

* update to list of map keys

* rename getter

* basic API changes working

* clean up implementation

* update icons and names

* error handling

* not working

* lens resolving

add configuration option

* show variations served

* handle no default

* codelens on aliases basic support

* eslint ignore

remove console.log

* add key to flag lens

stringify values

* remove console log

* only Stringify object

* fix rebase

* remove unused api property

* update for rebase

* check if keys is defined

* codelens on aliases basic support

* update hover

* updated hover

right click flag toggle poc

* context menu changes

* check for coderefs yaml

rebase cleanup

* fix getKeys when aliases do not exist

* lint

* Updated tree node UI

* Fix for test

* Fix for test

* Updated toggle icons

* New popover UI

Co-authored-by: Dan O'Brien <dobrien@launchdarkly.com>
Co-authored-by: Dan O'Brien <dobrien.nj@gmail.com>
Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>

* Fix tests

* Prettier updates

* Add GH action to publish to registry

* Change name of publisher

* Updated version and icon

* Change name to LaunchDarkly Beta

* Fix version

* Change ver to 3.0.0

* Coderefs download (#60)

* initial download of code refs

* update config check to run coderefs

* fix aliases section showing in treeview if no aliases

* platform agnostic path for coderefs

* Fix test

* updated dependencies (#61)

* prettier fixes

* eslint and type updates

* more prettier fixes

* Automate version and name change for beta build

* Change version format

* One more to conform to version specs

* Don't create a beta release unless it's on the beta branch

* Only publish on v3 branch

* No need to check branch separately

* Added snapshot testing, resized hover icons

* Fix prettier issue

* Publish beta under launchdarkly-beta id

* Publish to OpenVSX

* s/v3/beta

* Fix prettier

* Color theme is in the wrong case

* ignore coderefs dir

handle high contrast theme

* fix error interpolation

remove codelens array private var

null check on flag variation

* Activation add Ignore for this workspace [ch98567] (#62)

* Activation Add configure buttons to sidebar [ch98569] (#63)

* Activation add Ignore for this workspace [ch98567]

* Activation Add configure buttons to sidebar [ch98569]

* Remove .vscode/settings.json

* check aliases for hover

* move flag search to parent node

* prettier fixes

* Icon color changes, turn off codelens on prod, use yarn for build

* Updated docs

* Change formatting

* move hover provider to own file

implement fix for auto-complete

* update test

* Config Hide advanced config settings like [ch98573] (#64)

There are also a few other things included in this commit: change version # pattern for beta, updated config descriptions, and turn off all other extensions when in debug mode.

* Reverting back to previous versioning scheme

Even though vsce says that it supports semver, it turns out that the Marketplace doesn't support prereleases (microsoft/vscode-vsce#415 (comment))

* Change default name to LaunchDarkly

* do not show error when SDK handles it

Co-authored-by: Dan O'Brien <dobrien.nj@gmail.com>
Co-authored-by: Dan O'Brien <dobrien@launchdarkly.com>
Co-authored-by: Arnold Trakhtenberg <arnold@launchdarkly.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants