Skip to content

Commit

Permalink
Fixes logins
Browse files Browse the repository at this point in the history
  • Loading branch information
chedim committed May 28, 2024
1 parent fb092ba commit 7781ce8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ tasks {
}

patchPluginXml {
sinceBuild.set("233.*")
sinceBuild.set("232.10227.8")
untilBuild.set("246.*")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public CapellaOrganizationList getOnlyIqEnabledOrgs() {
.filter(org -> org.getData() != null)
.filter(org -> org.getData().getIq() != null)
.filter(org -> org.getData().getIq().isEnabled())
.filter(org -> org.getData().getIq().getOther() != null)
.filter(org -> org.getData().getIq().getOther().getIsTermsAcceptedForOrg())
.collect(Collectors.toList())
);
return filteredList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ public void onOrgSelected(CapellaOrganization organization) {

if (!credentials.checkIqIsEnabled(organization.getId())) {
Notifications.Bus.notify(new Notification(ChatGptBundle.message("group.id"), "Unable to use this organization", "Capella iQ is not enabled for this organization.", NotificationType.ERROR));
onLogout(null);
if (chatPanel == null) {
onLogout(null);
}
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;

import static com.couchbase.intellij.workbench.CustomSqlFileEditor.NO_QUERY_CONTEXT_SELECTED;

Expand Down Expand Up @@ -204,10 +205,11 @@ public void actionPerformed(@NotNull AnActionEvent e) {
private JPanel createSettingsPanel(CapellaOrganizationList organizationList, ChatPanel.LogoutListener logoutListener) {
JPanel panel = new NonOpaquePanel(new GridLayout(0, 1));
JPanel orgPanel = new NonOpaquePanel(new BorderLayout());


orgSelector = new ComboBox<>(organizationList.getData().stream()
.map(org -> org.getData())
.filter(data -> data.getIq() != null && data.getIq().isEnabled())
.map(data -> data.getName())
.map(CapellaOrganizationList.Entry::getData)
.map(CapellaOrganization::getName)
.toArray(String[]::new));

orgSelector.setSelectedIndex(organizationList.indexOf(organization));
Expand Down

0 comments on commit 7781ce8

Please sign in to comment.