From 0f00949df73a1dedb1a777a9514a41f2ca84b454 Mon Sep 17 00:00:00 2001 From: Boris Voropaev Date: Thu, 8 Feb 2024 16:49:36 +0300 Subject: [PATCH] regestery tk023 --- src/environments/tk023.env.dev.ts | 2 +- .../slider-menu/slider-menu.component.html | 3 +- .../entry-properties.component.html | 29 ++++++++++--------- .../properties/entry-properties.component.ts | 18 ++++++++++-- .../entry/registry-entry.component.html | 4 +-- .../entries/entry/registry-entry.component.ts | 9 +----- src/tk023/css/_registry.scss | 5 ++++ 7 files changed, 41 insertions(+), 29 deletions(-) diff --git a/src/environments/tk023.env.dev.ts b/src/environments/tk023.env.dev.ts index 6fcaef2..f0d5ccd 100644 --- a/src/environments/tk023.env.dev.ts +++ b/src/environments/tk023.env.dev.ts @@ -6,7 +6,7 @@ export const environment = { production: false, apiUrl: 'http://api.neftegaz.lc', clientId: 2, - clientSecret: 'B7alelPwCZJfVG8AjM21ByNAekSDv8wUqooiXnH1', + clientSecret: 'RmvjxrgGIQQ3JXZ4gvCSRLMuXPopPDsiYua6Xvlc', project: null, licence: 'POUFLO4YW7SU', defaultLocale: 'ru' diff --git a/src/tk023/component/pages/menu/slider-menu/slider-menu.component.html b/src/tk023/component/pages/menu/slider-menu/slider-menu.component.html index 7fbbb95..000041a 100644 --- a/src/tk023/component/pages/menu/slider-menu/slider-menu.component.html +++ b/src/tk023/component/pages/menu/slider-menu/slider-menu.component.html @@ -19,8 +19,7 @@
- {{rootPage.name}} - + {{rootPage.name}}
diff --git a/src/tk023/component/registries/registry/entries/entry/properties/entry-properties.component.html b/src/tk023/component/registries/registry/entries/entry/properties/entry-properties.component.html index 1bb8aa1..3807970 100644 --- a/src/tk023/component/registries/registry/entries/entry/properties/entry-properties.component.html +++ b/src/tk023/component/registries/registry/entries/entry/properties/entry-properties.component.html @@ -1,14 +1,17 @@ - - - - - + + +
{{field.title}} -
-
- +
+ + + + - - -
{{field.title}} + - - {{getValue(field)}}
+
{{getValue(field)}}
+ + + diff --git a/src/tk023/component/registries/registry/entries/entry/properties/entry-properties.component.ts b/src/tk023/component/registries/registry/entries/entry/properties/entry-properties.component.ts index 34fd00e..00a2cca 100644 --- a/src/tk023/component/registries/registry/entries/entry/properties/entry-properties.component.ts +++ b/src/tk023/component/registries/registry/entries/entry/properties/entry-properties.component.ts @@ -11,7 +11,9 @@ import {DatePipe} from "@angular/common"; export class EntryPropertiesComponent { @Input() entry: any; @Input() bar: number; - @Input() expande: boolean; + expande = false; + private fieldsLength:number; + constructor(private entriesService: RegistryEntriesService, private objectsService: ObjectsService, private datePipe: DatePipe) { } @@ -19,8 +21,13 @@ export class EntryPropertiesComponent { get fields() { let fields = this.objectsService.parsedFields(this.entry.properties?.data) .filter(field => {return field.value?.length || field.value?.id}); - if (!this.expande) fields = fields.slice(0,this.bar) - return fields + this.fieldsLength = fields.length + if (this.expande) return fields + return fields.slice(0,this.bar) + } + + get expandeble(){ + return this.bar < this.fieldsLength } ngOnInit() { @@ -43,4 +50,9 @@ export class EntryPropertiesComponent { }).join('; '); } + toggle() { + this.expande = !this.expande; + } + + } diff --git a/src/tk023/component/registries/registry/entries/entry/registry-entry.component.html b/src/tk023/component/registries/registry/entries/entry/registry-entry.component.html index 7801e3e..bca04e7 100644 --- a/src/tk023/component/registries/registry/entries/entry/registry-entry.component.html +++ b/src/tk023/component/registries/registry/entries/entry/registry-entry.component.html @@ -9,7 +9,7 @@ {{title}} - +
{{entry.state?.title}}
@@ -31,7 +31,7 @@
- +
diff --git a/src/tk023/component/registries/registry/entries/entry/registry-entry.component.ts b/src/tk023/component/registries/registry/entries/entry/registry-entry.component.ts index 26cc349..81c9225 100644 --- a/src/tk023/component/registries/registry/entries/entry/registry-entry.component.ts +++ b/src/tk023/component/registries/registry/entries/entry/registry-entry.component.ts @@ -14,8 +14,6 @@ export class RegistryEntryComponent { @Input() entry: any; @Input() editMode: boolean; - public isExpanded = false; - constructor(private entriesService: RegistryEntriesService, private formsService: FormsService, private listsService: ListsService, private datePipe: DatePipe) { } @@ -53,6 +51,7 @@ export class RegistryEntryComponent { get bar(){ switch(this.registry.type.name){ case 'notice': return 2; + case 'standards': return 4; } return 2 } @@ -65,7 +64,6 @@ export class RegistryEntryComponent { add() { - if (this.isExpandable) this.isExpanded = true; this.formsService.createModel('entryOperation', {extraProps: {entry: this.entry.id}}, this.operationsListId); } @@ -81,11 +79,6 @@ export class RegistryEntryComponent { } } - - toggle() { - this.isExpanded = !this.isExpanded; - } - get withToggle(){ return this.registry.type.name !== 'workshops' } diff --git a/src/tk023/css/_registry.scss b/src/tk023/css/_registry.scss index 989ec98..114218d 100644 --- a/src/tk023/css/_registry.scss +++ b/src/tk023/css/_registry.scss @@ -214,6 +214,11 @@ registry-entry { } +.entry-prop{ + display: flex; + align-items: center; +} + pagination{ display: block; &:first-child {