Skip to content
This repository was archived by the owner on Mar 8, 2024. It is now read-only.

Commit fa18264

Browse files
FelixKirschJWittmeyerlumburovskalinaJWittmeyerdependabot[bot]
authored
Release v1.2.0 - Second PR (#53)
* Update LICENSE * Documentation link on tokenizer fixed * Links to public repos * Removes retry from http failure * Adds check for demo application * Changes logic slightly admins * Adds demo banner * Discord link and icon on sidebar menu * Saving forever fix and opacity tooltip fixed * Long embedding names that break modal for zero-shot fixed * Heuristic statuses shared component * Removed function on name click on heuristics * Zero shot module renamed and tooltips fixed on zero-shot page * Renamed items to records on heuristics page * Condition for continue project based on a new state for sample projects * Removes user check on information source websocket update * Adds badge & call to action * Removed unused code * 3/5 changed to 4/5, wrong percentage * Refactor heuristic statuses component * Navigation link on record IDE fixed * Modal configuration fixes * Reduced margin-top between icons on sidebar menu for smaller devices * Changed onInit to onChanges * Changed public links * Transfers import options to backend * Bump eventsource from 1.1.0 to 1.1.2 Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.2. - [Release notes](https://github.com/EventSource/eventsource/releases) - [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md) - [Commits](EventSource/eventsource@v1.1.0...v1.1.2) --- updated-dependencies: - dependency-name: eventsource dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Adds .github - dependabot yml * Bump minimist from 1.2.5 to 1.2.6 Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump nanoid from 3.1.30 to 3.3.4 Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.3.4. - [Release notes](https://github.com/ai/nanoid/releases) - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md) - [Commits](ai/nanoid@3.1.30...3.3.4) --- updated-dependencies: - dependency-name: nanoid dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump async from 2.6.3 to 2.6.4 Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4. - [Release notes](https://github.com/caolan/async/releases) - [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md) - [Commits](caolan/async@v2.6.3...v2.6.4) --- updated-dependencies: - dependency-name: async dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Small yml change * Bump async from 2.6.3 to 2.6.4 Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4. - [Release notes](https://github.com/caolan/async/releases) - [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md) - [Commits](caolan/async@v2.6.3...v2.6.4) --- updated-dependencies: - dependency-name: async dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump url-parse from 1.5.3 to 1.5.10 Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.3 to 1.5.10. - [Release notes](https://github.com/unshiftio/url-parse/releases) - [Commits](unshiftio/url-parse@1.5.3...1.5.10) --- updated-dependencies: - dependency-name: url-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump karma from 6.3.6 to 6.4.0 Bumps [karma](https://github.com/karma-runner/karma) from 6.3.6 to 6.4.0. - [Release notes](https://github.com/karma-runner/karma/releases) - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) - [Commits](karma-runner/karma@v6.3.6...v6.4.0) --- updated-dependencies: - dependency-name: karma dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump karma from 6.3.6 to 6.4.0 Bumps [karma](https://github.com/karma-runner/karma) from 6.3.6 to 6.4.0. - [Release notes](https://github.com/karma-runner/karma/releases) - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) - [Commits](karma-runner/karma@v6.3.6...v6.4.0) --- updated-dependencies: - dependency-name: karma dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump follow-redirects from 1.14.5 to 1.15.1 Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.5 to 1.15.1. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.14.5...v1.15.1) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Shared component dropdown (#10) * Kern dropdowns refactor * Add checkboxes option to kern dropdown * Remove unused code * Removed unused code * Kern dropdown improvements for disabled buttons * Removed unused code * Remove commented code * Adds first (unfinished) version of iteration * With icon option * Adds checkbox logic * Replaced dropdown with one component * Removed unused code * Removed unused code * Renamed existing component to kern dropdown * Reverted change * Removed dummy code * Removed commented code * Header zindex over sticky header on heuristics and lookup lists * Console log removed * Improvements on dropdown shared component * Prefilled heuristics * Updated dropdown options * More flexible dropdown * Updated helped with more explanations * Adds differnt logic for color generation * Remove debug values * Width changes * Small fixes on dropdown * Function name changed Co-authored-by: JWittmeyer <jens.wittmeyer@onetask.ai> Co-authored-by: JWittmeyer <91723236+JWittmeyer@users.noreply.github.com> * Upgrade Angular 13 (#32) * Upgrade Angular 13 * Consistency improvements * Added home icon on header * Adds notification center data tip * Demo user restrictions on front end (#33) * Demo user restrictions on front end * Demo user check fix * Removes trigger for testing * Bump node version to 16.10.5 * Updates lock file * Removes unused drone trigger * Fixes Bugs in the record ide (#36) * runs record ide for next or prev record * pr comment * changes notification center icon (#37) * sets version number to v1.1 (#38) * Readd mixed results (#39) * Adds hotfix (#40) * Demo changes (#42) * Checks for demo flag for local org creation * Adds timeout for databrowser alert * Adds chrome check * Adds star button with call to action * Fixes no label AND filter bug * increases version to v1.1.1 * Fix typo in browser check * Removed console log Co-authored-by: felix0496 <felix.kirsch@kern.ai> Co-authored-by: Felix Kirsch <40427105+FelixKirsch@users.noreply.github.com> Co-authored-by: Lina <lina.lumburovska@kern.ai> * Model download page (#44) * Downloaded models page start * Queries and mutations * Model download mutations and queries * Model providers page improvements * Seconds to milliseconds * Model name parameter changed * Model name changes * Changes modelname * Model download page improvements * Sizes changed * changes method and api names * adds status to model provider info query * Typo downaloded fixed * Changed select option bar * Spinner, refetch added * Invalid date fix * Icons for downaloded models added * Console error fix * Green color when the models are downloaded * Align icons and disable add when duplicate is added * Added green color to the downloaded models as part of the kern dropdown component * Comments from PR * Delete model modal and moved the right page to pages * Parce date and combine requests added * Optimized code * applies api changes in the gateway, global notifications * Added button disabled for OS version * Aligned icons * Separator for models, and types with icon instead of column * Added info on hover * Adds config manager error on request before init * PR comments * Update config check * Align elements on project settings * Global changes for the modal center alignment Co-authored-by: felix0496 <felix.kirsch@kern.ai> Co-authored-by: JWittmeyer <jens.wittmeyer@onetask.ai> * Update logic start (#47) * Update logic start * Modal for version overview and added navigation to modal for steps update * Renamed checked version to remote version and added tabs for OS * Steps for update added * Added new fields for checking updates * Sorted array,align left and scrollable modal body * Added tooltips for tabs on how to update * Request called only once * Improvements on query for has updates and tooltip green on steps * Added statis variable for calling function only once * Modal sizes fixed * Icons alignment and data-tip changed to Version overview * Returned untentionally removed tooltip * Removed commented code * Dropdown for models on smaller sizes Co-authored-by: JWittmeyer <jens.wittmeyer@onetask.ai> * Release version changed to 1.2.0 (#48) * Release verion changed to 1.2.0 * Removed margins for Close button * Go back on downloaded models page * Fixed config manager not initialized Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: JWittmeyer <91723236+JWittmeyer@users.noreply.github.com> Co-authored-by: Lina <lina.lumburovska@kern.ai> Co-authored-by: JWittmeyer <jens.wittmeyer@onetask.ai> Co-authored-by: lumburovskalina <104008550+lumburovskalina@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 06f5261 commit fa18264

File tree

10 files changed

+1089
-684
lines changed

10 files changed

+1089
-684
lines changed

src/app/base/components/sidebar-pm/sidebar-pm.component.html

Lines changed: 213 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,18 @@
199199
</button>
200200
</div>
201201
<div class="flex-shrink-0 flex py-6 justify-center">
202-
<a data-tip="Changelog" target="_blank" rel="noopener noreferrer"
203-
class="z-50 tooltip tooltip-right cursor-pointer select-none text-white"
204-
href="https://docs.kern.ai/changelog">v1.1.1</a>
202+
<label data-tip="Version overview" for="version-overview" (click)="requestVersionOverview()"
203+
class="z-50 tooltip tooltip-right cursor-pointer select-none text-white flex items-center">v1.2.0
204+
<svg *ngIf="hasUpdates" xmlns="http://www.w3.org/2000/svg" data-tip="Newer version available"
205+
class="icon icon-tabler icon-tabler-alert-circle inline-block text-yellow-700 tooltip tooltip-right align-top ml-1 mt-px"
206+
width="16" height="16" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"
207+
fill="none" stroke-linecap="round" stroke-linejoin="round">
208+
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
209+
<circle cx="12" cy="12" r="9"></circle>
210+
<line x1="12" y1="8" x2="12" y2="12"></line>
211+
<line x1="12" y1="16" x2="12.01" y2="16"></line>
212+
</svg>
213+
</label>
205214
</div>
206215
</div>
207216
</div>
@@ -213,4 +222,205 @@
213222
<path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" />
214223
</svg>
215224
</div>
225+
</div>
226+
227+
<input #versionOverviewModal type="checkbox" id="version-overview" class="modal-toggle">
228+
<div class="modal">
229+
<div class="modal-box text-black bg-white justify-center modal-configuration text-center">
230+
<div class="inline-block justify-center text-lg leading-6 text-gray-900 font-medium">
231+
Version overview
232+
233+
<a class="text-green-800 text-base font-medium ml-3" href="https://docs.kern.ai/changelog" target="_blank">
234+
<span class="leading-5">Changelog</span>
235+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 inline-block" fill="none" viewBox="0 0 24 24"
236+
stroke="currentColor" stroke-width="2">
237+
<path stroke-linecap="round" stroke-linejoin="round" d="M13 7l5 5m0 0l-5 5m5-5H6" />
238+
</svg>
239+
</a>
240+
</div>
241+
242+
<div class="inline-block min-w-full align-middle mt-3" *ngIf="versionOverview">
243+
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg scrollable-size">
244+
<table class="min-w-full divide-y divide-gray-300">
245+
<thead class="bg-gray-50">
246+
<tr>
247+
<th scope="col"
248+
class="px-3 py-2 text-left text-xs font-medium uppercase tracking-wide text-gray-500">
249+
Service</th>
250+
<th scope="col"
251+
class="px-3 py-2 text-center text-xs font-medium uppercase tracking-wide text-gray-500">
252+
Installed version</th>
253+
<th scope="col"
254+
class="px-3 py-2 text-center text-xs font-medium uppercase tracking-wide text-gray-500">
255+
Remote version</th>
256+
<th scope="col"
257+
class="px-3 py-2 text-center text-xs font-medium uppercase tracking-wide text-gray-500">
258+
Last checked</th>
259+
<th scope="col"
260+
class="px-3 py-2 text-center text-xs font-medium uppercase tracking-wide text-gray-500">
261+
Link</th>
262+
</tr>
263+
</thead>
264+
<tbody class="divide-y divide-gray-200">
265+
<tr *ngFor="let service of versionOverview">
266+
<td class="text-left px-3 py-2 text-sm text-gray-500">
267+
{{service.service}}
268+
</td>
269+
<td class="text-center px-3 py-2 text-sm text-gray-500">
270+
{{service.installedVersion}}
271+
</td>
272+
<td class="text-center px-3 py-2 text-sm text-gray-500">
273+
<div class="flex flex-row items-center justify-center">
274+
<div class="mr-2">{{service.remoteVersion}}</div>
275+
<div *ngIf="service.remoteHasNewer" class="tooltip tooltip-right"
276+
data-tip="Newer version available">
277+
<svg xmlns="http://www.w3.org/2000/svg"
278+
class="icon icon-tabler icon-tabler-alert-circle inline-block text-yellow-700 align-top"
279+
width="20" height="20" viewBox="0 0 24 24" stroke-width="2"
280+
stroke="currentColor" fill="none" stroke-linecap="round"
281+
stroke-linejoin="round">
282+
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
283+
<circle cx="12" cy="12" r="9"></circle>
284+
<line x1="12" y1="8" x2="12" y2="12"></line>
285+
<line x1="12" y1="16" x2="12.01" y2="16"></line>
286+
</svg>
287+
</div>
288+
</div>
289+
</td>
290+
<td class="text-center px-3 py-2 text-sm text-gray-500">
291+
{{service.parseDate}}
292+
</td>
293+
<td class="text-center px-3 py-2 text-sm text-gray-500">
294+
<a [href]="service.link" target="_blank" class="h4 w-4 m-auto block"
295+
style="padding:0px"><svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 m-auto"
296+
fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
297+
<path stroke-linecap="round" stroke-linejoin="round"
298+
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
299+
</svg></a>
300+
</td>
301+
</tr>
302+
</tbody>
303+
</table>
304+
</div>
305+
</div>
306+
307+
<kern-loading *ngIf="versionOverview == null" color="yellow" class="mt-3"></kern-loading>
308+
309+
<div class="modal-action">
310+
<label (click)="howToUpdate()" *ngIf="!isManaged"
311+
class="mr-2 bg-green-100 text-green-700 border border-green-400 text-xs font-semibold px-4 py-2 rounded-md cursor-pointer hover:bg-green-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">How
312+
to update</label>
313+
<label for="version-overview"
314+
class="bg-white text-gray-700 text-xs font-semibold px-4 py-2 rounded border border-gray-300 cursor-pointer hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 inline-block">Close</label>
315+
</div>
316+
</div>
317+
</div>
318+
319+
<input #stepsUpdate type="checkbox" id="steps-update" class="modal-toggle">
320+
<div class="modal">
321+
<div class="modal-box text-black bg-white justify-center modal-sizes">
322+
<div class="text-center justify-center text-lg leading-6 text-gray-900 font-medium">
323+
How to update
324+
</div>
325+
326+
<div class="flex border-b-2 border-b-gray-200 max-w-full text-center overflow-visible">
327+
<div (click)="toggleTabs(0)" [ngClass]="openTab == 0 ? 'text-indigo-700 border-bottom' : 'text-gray-500' "
328+
class="text-sm leading-5 font-medium mr-10 cursor-help py-3">
329+
<span class="tooltip tooltip-bottom tooltip-margin border-dotted" data-tip="Linux/Mac">Bash users</span>
330+
</div>
331+
<div (click)="toggleTabs(1)" [ngClass]="openTab == 1 ? 'text-indigo-700 border-bottom' : 'text-gray-500' "
332+
class="text-sm leading-5 font-medium mr-10 cursor-help py-3">
333+
<span class="tooltip tooltip-bottom border-dotted" data-tip="Installed refinery with pip">CLI
334+
users</span>
335+
</div>
336+
<div (click)="toggleTabs(2)" [ngClass]="openTab == 2 ? 'text-indigo-700 border-bottom' : 'text-gray-500' "
337+
class="text-sm leading-5 font-medium mr-10 cursor-help py-3">
338+
<span class="tooltip tooltip-bottom border-dotted" data-tip="Windows terminal">cmd</span>
339+
</div>
340+
<div (click)="toggleTabs(3)" [ngClass]="openTab == 3 ? 'text-indigo-700 border-bottom' : 'text-gray-500' "
341+
class="text-sm leading-5 font-medium mr-10 cursor-help py-3">
342+
<span class="tooltip tooltip-bottom border-dotted" data-tip="Windows from File Explorer">Executing from
343+
explorer</span>
344+
</div>
345+
</div>
346+
347+
<div class="mt-3 px-5 h-40">
348+
<ng-container [ngSwitch]="openTab">
349+
<ng-template [ngSwitchCase]="0">
350+
<ol class="font-dmMono">
351+
<li>Open a Terminal</li>
352+
<li>Change to refinery directory (using cd) -
353+
<span class="bg-gray-200 text-red-700 rounded-md p-1 whitespace-nowrap">$ cd
354+
/path/to/refinery</span>
355+
</li>
356+
<li>Run the update script -
357+
<span class="bg-gray-200 text-red-700 rounded-md p-1 whitespace-nowrap">$
358+
<span class="cursor-pointer tooltip tooltip-top" data-tip="Click to copy"
359+
(click)="copyToClipboard('./update')">./update</span>
360+
</span>
361+
</li>
362+
</ol>
363+
</ng-template>
364+
<ng-template [ngSwitchCase]="1">
365+
<ol class="font-dmMono">
366+
<li>Open a Terminal</li>
367+
<li>Change to refinery directory
368+
<ol class="list-letters px-8">
369+
<li>Linux/Mac -
370+
<span class="bg-gray-200 text-red-700 rounded-md p-1 whitespace-nowrap">$ cd
371+
path/to/refinery</span>
372+
</li>
373+
<li>Windows -
374+
<span class="bg-gray-200 text-red-700 rounded-md p-1 whitespace-nowrap">cd
375+
path\to\refinery</span>
376+
</li>
377+
</ol>
378+
</li>
379+
<li>
380+
Run the CLI update command
381+
<span class="bg-gray-200 text-red-700 rounded-md p-1 whitespace-nowrap">$
382+
<span class="cursor-pointer tooltip tooltip-top" data-tip="Click to copy"
383+
(click)="copyToClipboard('refinery update')">refinery update</span>
384+
</span>
385+
</li>
386+
</ol>
387+
</ng-template>
388+
<ng-template [ngSwitchCase]="2">
389+
<ol class="font-dmMono">
390+
<li>Open a Terminal</li>
391+
<li>Change to refinery directory
392+
<span class="bg-gray-200 text-red-700 rounded-md p-1 whitespace-nowrap">cd
393+
path\to\refinery</span>
394+
</li>
395+
<li>Run the update script -
396+
<span class="bg-gray-200 text-red-700 rounded-md p-1 whitespace-nowrap">
397+
<span class="cursor-pointer tooltip tooltip-top" data-tip="Click to copy"
398+
(click)="copyToClipboard('update.bat')">update.bat</span>
399+
</span>
400+
</li>
401+
</ol>
402+
</ng-template>
403+
<ng-template [ngSwitchCase]="3">
404+
<ol class="font-dmMono">
405+
<li>Open the File Explorer</li>
406+
<li>Navigate to the refinery directory</li>
407+
<li>Launch the update script by double-clicking
408+
<span class="bg-gray-200 text-red-700 rounded-md p-1 whitespace-nowrap">
409+
<span class="cursor-pointer tooltip tooltip-top" data-tip="Click to copy"
410+
(click)="copyToClipboard('update.bat')">update.bat</span>
411+
</span>
412+
</li>
413+
</ol>
414+
</ng-template>
415+
</ng-container>
416+
</div>
417+
418+
<div class="modal-action">
419+
<label (click)="back()"
420+
class="bg-white text-gray-700 text-xs font-semibold mr-2 px-4 py-2 rounded border border-gray-300 cursor-pointer hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 inline-block">Go
421+
back</label>
422+
<label for="steps-update"
423+
class="bg-white text-gray-700 text-xs font-semibold px-4 py-2 rounded border border-gray-300 cursor-pointer hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 inline-block">Close</label>
424+
</div>
425+
</div>
216426
</div>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
11
.overflow-initial {
22
overflow: initial;
33
}
4+
5+
.border-bottom {
6+
border-bottom: 1px solid #4F46E5;
7+
}
8+
9+
ol {
10+
list-style: decimal;
11+
li {
12+
margin-top: 8px;
13+
}
14+
}
15+
16+
ol.list-letters {
17+
list-style-type: lower-alpha !important;
18+
}
19+
20+
.scrollable-size {
21+
max-height: calc(100vh - 230px);
22+
overflow-y: auto;
23+
}
24+
25+
.tooltip-margin::before {
26+
margin-left: 8px;
27+
}
28+
29+
.border-dotted {
30+
border-bottom: 2px dotted #22c55e;
31+
}
32+
33+
.modal-sizes {
34+
min-width: 750px;
35+
}
36+
37+
@media (max-width: 1024px) {
38+
.modal-sizes {
39+
min-width: 400px;
40+
}
41+
}

src/app/base/components/sidebar-pm/sidebar-pm.component.ts

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@ import {
55
transition,
66
trigger,
77
} from '@angular/animations';
8-
import { Component, Inject, EventEmitter, OnInit, Output, Input, HostListener } from '@angular/core';
8+
import { Component, Inject, EventEmitter, OnInit, Output, Input, HostListener, ViewChild, ElementRef } from '@angular/core';
99
import { ActivatedRoute } from '@angular/router';
10-
import { Observable, Subscription } from 'rxjs';
11-
import { tap } from 'rxjs/operators';
10+
import { Observable, Subscription, timer } from 'rxjs';
11+
import { first, tap } from 'rxjs/operators';
1212
import { AuthApiService } from '../../services/auth-api.service';
1313
import { OrganizationApolloService } from '../../services/organization/organization-apollo.service';
1414
import { RouteService } from '../../services/route.service';
1515
import { DOCUMENT } from '@angular/common';
1616
import { ProjectApolloService } from '../../services/project/project-apollo.service';
17+
import { ConfigApolloService } from '../../services/config/config-apollo.service';
18+
import { dateAsUTCDate } from 'src/app/util/helper-functions';
19+
import { ConfigManager } from '../../services/config-service';
20+
import { ConfigService } from 'aws-sdk';
1721

1822

1923
@Component({
@@ -60,13 +64,21 @@ export class SidebarPmComponent implements OnInit {
6064
isFullscreen: boolean = false;
6165
@Output() firstName = new EventEmitter<Observable<any>>();
6266
toggleClass = 'ft-maximize';
67+
versionOverview: any[] = [];
68+
@ViewChild('versionOverviewModal', { read: ElementRef }) versionOverviewModal: ElementRef;
69+
@ViewChild('stepsUpdate', { read: ElementRef }) stepsUpdate: ElementRef;
70+
openTab: number = 0;
71+
isManaged: boolean = true;
72+
hasUpdates: boolean;
73+
private static initialConfigRequest: boolean = false;
6374

6475
constructor(
6576
private organizationService: OrganizationApolloService,
6677
private routeService: RouteService,
6778
private activatedRoute: ActivatedRoute,
6879
private auth: AuthApiService,
6980
private projectApolloService: ProjectApolloService,
81+
private configService: ConfigApolloService,
7082
@Inject(DOCUMENT) private document: any
7183
) { }
7284

@@ -89,6 +101,30 @@ export class SidebarPmComponent implements OnInit {
89101
})
90102
)
91103
.subscribe());
104+
105+
if(!SidebarPmComponent.initialConfigRequest) {
106+
this.requestVersionOverview();
107+
SidebarPmComponent.initialConfigRequest = true;
108+
}
109+
this.checkIfManagedVersion();
110+
}
111+
112+
requestVersionOverview() {
113+
this.versionOverview = null;
114+
this.configService
115+
.getVersionOverview()
116+
.pipe(first())
117+
.subscribe((versionOverview) => {
118+
this.versionOverview = versionOverview;
119+
this.versionOverview.forEach((version)=> {
120+
version.parseDate = this.parseUTC(version.lastChecked);
121+
});
122+
this.versionOverview.sort((a, b) => a.service.localeCompare(b.service));
123+
this.configService
124+
.hasUpdates()
125+
.pipe(first())
126+
.subscribe((hasUpdates) => this.hasUpdates = hasUpdates);
127+
});
92128
}
93129

94130
onDestroy() {
@@ -161,4 +197,35 @@ export class SidebarPmComponent implements OnInit {
161197

162198
}
163199
}
200+
201+
parseUTC(utc: string) {
202+
const utcDate = dateAsUTCDate(new Date(utc));
203+
return utcDate.toLocaleString();
204+
}
205+
206+
howToUpdate() {
207+
this.versionOverviewModal.nativeElement.checked = false;
208+
this.stepsUpdate.nativeElement.checked = true;
209+
}
210+
211+
back() {
212+
this.stepsUpdate.nativeElement.checked = false;
213+
this.versionOverviewModal.nativeElement.checked = true;
214+
}
215+
216+
toggleTabs(index: number) {
217+
this.openTab = index;
218+
}
219+
220+
copyToClipboard(textToCopy) {
221+
navigator.clipboard.writeText(textToCopy);
222+
}
223+
224+
checkIfManagedVersion() {
225+
if (!ConfigManager.isInit()) {
226+
timer(250).subscribe(() => this.checkIfManagedVersion());
227+
return;
228+
}
229+
this.isManaged = ConfigManager.getIsManaged();
230+
}
164231
}

0 commit comments

Comments
 (0)