Skip to content

Commit

Permalink
adds enable_visibility to togle package visibility settings ui
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Wrock <[email protected]>
  • Loading branch information
mwrock committed Jul 19, 2024
1 parent f8cbee3 commit b36c602
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ habitatConfig({
demo_app_url: "{{cfg.demo_app_url}}",
docs_url: "{{cfg.docs_url}}",
enable_builder: {{cfg.enable_builder}},
enable_visibility: {{cfg.enable_visibility}},
enable_publisher_amazon: {{cfg.enable_publisher_amazon}},
enable_publisher_azure: {{cfg.enable_publisher_azure}},
enable_publisher_docker: {{cfg.enable_publisher_docker}},
Expand Down
1 change: 1 addition & 0 deletions components/builder-api-proxy/habitat/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ enable_publisher_amazon = false
enable_publisher_azure = false
enable_publisher_docker = false
enable_builder = false
enable_visibility = false
environment = "production"
hosted = false
source_code_url = "https://github.com/habitat-sh/habitat"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h2>origin</h2>
routerLinkActive
#settings="routerLinkActive"
[active]="settings.isActive"
*ngIf="memberOfOrigin">Settings</a>
*ngIf="visibilityEnabled && memberOfOrigin">Settings</a>
<a mat-tab-link
routerLink="integrations"
routerLinkActive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export class OriginPageComponent implements OnInit, OnDestroy {
return this.store.getState().features.builder;
}

get visibilityEnabled() {
return this.store.getState().features.visibility;
}

get origin() {
const current = this.store.getState().origins.current;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h2>{{ subheading }}
Manifest
</a>
<a
*ngIf="builderEnabled && isOriginMember"
*ngIf="visibilityEnabled && isOriginMember"
mat-tab-link
[routerLink]="['./', version, release, 'settings']"
routerLinkActive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ export class PackageComponent implements OnInit, OnDestroy {
return this.store.getState().features.builder;
}

get visibilityEnabled() {
return this.store.getState().features.visibility;
}

get activePackage() {
return this.store.getState().packages.current;
}
Expand Down
1 change: 1 addition & 0 deletions components/builder-web/app/reducers/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default function builds(state = initialState['features'], action) {
.setIn(['publishers', 'azure'], !!config['enable_publisher_azure'])
.setIn(['publishers', 'docker'], !!config['enable_publisher_docker'])
.set('builder', !!config['enable_builder'])
.set('visibility', !!config['enable_visibility'])
.set('events', !!config['enable_builder_events'])
.set('saasEvents', !!config['enable_builder_events_saas']);
default:
Expand Down
3 changes: 3 additions & 0 deletions components/builder-web/habitat.conf.sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ habitatConfig({
// Enable Builder-specific features
enable_builder: true,

// Enable ability to set project visibility
enable_visibility: true,

// Enable supported container-registry integrations
enable_publisher_amazon: false,
enable_publisher_azure: false,
Expand Down

0 comments on commit b36c602

Please sign in to comment.