Skip to content

Commit

Permalink
Updated structures and locales
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafamat committed Oct 24, 2023
1 parent 0d5c609 commit b1d3e1a
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 73 deletions.
34 changes: 32 additions & 2 deletions _templates/product.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@
"XSP",
"OTH"
]
},
"prd_cpu": {
"bsonType": "string",
"title": "CPU",
"description": "CPU",
"minLength": 0,
"maxLength": 16,
"pattern": "^[A-Za-z0-9]{0,16}$"
}
},
"required": ["prd_no", "prd_description", "prd_group"],
Expand All @@ -76,10 +84,32 @@
"_modified_at": -1
},
"parents": [],
"actions": [],
"actions": [
{
"id": "cpu",
"title": "CPU Assign",
"enabled": true,
"match": [],
"set": [
{
"key": "prd_cpu",
"value": null
}
],
"one_click": true,
"icon": "hardware-chip-sharp",
"uniqueness": false,
"unique": [],
"_tags": ["#Managers", "#Administrators", "#Technoplatz"]
}
],
"links": [],
"triggers": [],
"views": {},
"fetchers": [],
"import": {}
"import": {
"enabled": true,
"upsertable": true,
"upsertables": ["prd_cpu"]
}
}
19 changes: 9 additions & 10 deletions _templates/shipment.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"bsonType": "string",
"title": "Account No",
"description": "Account No",
"placeholder": "Please select an account",
"minLength": 10,
"maxLength": 11,
"pattern": "^[A-Z0-9-]{10,11}$",
Expand All @@ -23,22 +24,21 @@
"shp_date": {
"bsonType": "date",
"title": "Ship Date",
"description": "Shipment Date",
"description": "Shipment date",
"dateOnly": false
},
"shp_carrier_name": {
"bsonType": "string",
"title": "Carrier Name",
"description": "Carrier name or driver name surname",
"placeholder": "Carrier or driver Name",
"placeholder": "Carrier company or driver name",
"minLength": 2,
"maxLength": 32
},
"shp_carrier_id": {
"bsonType": "string",
"title": "Carrier Tax/ID No",
"description": "Carrier tax no or driver id",
"placeholder": "Carrier Tax/Id No",
"description": "Carrier tax no or driver ID",
"minLength": 10,
"maxLength": 12,
"pattern": "^[0-9]{10,12}$"
Expand All @@ -47,7 +47,6 @@
"bsonType": "string",
"title": "Vehicle Plate",
"description": "Vehicle plate number",
"placeholder": "Vehicle plate number",
"minLength": 6,
"maxLength": 16,
"pattern": "^[A-Za-z0-9 ]{6,16}$",
Expand All @@ -56,16 +55,15 @@
"shp_notes": {
"bsonType": "string",
"title": "Shipment Notes",
"description": "Shipment notes to carrier or customer",
"placeholder": "Shipment Notes",
"description": "Shipment notes",
"minLength": 0,
"maxLength": 512
},
"shp_wayb_no": {
"bsonType": "string",
"title": "Waybill No",
"description": "Waybill serial number",
"placeholder": "Waybill No",
"placeholder": "Automatically assigned",
"pattern": "^[A-Z0-9-]{16,18}$",
"minLength": 0,
"maxLength": 18,
Expand All @@ -74,14 +72,15 @@
"shp_wayb_date": {
"bsonType": "date",
"title": "Waybill Date",
"description": "Waybill generated date",
"description": "Waybill issue date",
"placeholder": "Automatically assigned",
"readonly": true
},
"shp_wayb_ettn": {
"bsonType": "string",
"title": "Waybill ETTN",
"description": "Waybill ETTN",
"placeholder": "ETTN",
"placeholder": "Automatically assigned",
"pattern": "^[a-z0-9-]{32,40}$",
"minLength": 32,
"maxLength": 40,
Expand Down
2 changes: 1 addition & 1 deletion pwa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "technoplatz-bi-pwa",
"version": "4.6.1",
"version": "4.6.2",
"author": "Mustafa Mat, Technoplatz IT Solutions GmbH",
"homepage": "https://bi.technoplatz.com",
"scripts": {
Expand Down
32 changes: 16 additions & 16 deletions pwa/src/app/pages/collection/collection.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,46 +181,46 @@ <h3>{{ subheader | titlecase | translate }}&nbsp;</h3>
<br />
<div *ngIf="item.value.bsonType!='bool'" class="search-ops">
<ion-button [color]="searched[item.key].op == 'contains' ? 'primary' : 'light'" size="small"
(click)="set_searchItemOp(item.key, 'contains')">
(click)="set_search_item(item.key, 'contains')">
{{ 'in' | translate }}
</ion-button>
<ion-button [color]="searched[item.key].op == 'eq' ? 'primary' : 'light'" size="small"
(click)="set_searchItemOp(item.key, 'eq')">
(click)="set_search_item(item.key, 'eq')">
=
</ion-button>
<ion-button [color]="searched[item.key].op == 'ne' ? 'primary' : 'light'" size="small"
(click)="set_searchItemOp(item.key, 'ne')">
(click)="set_search_item(item.key, 'ne')">
&ne;
</ion-button>
<ion-button [color]="searched[item.key].op == 'gte' ? 'primary' : 'light'" size="small"
(click)="set_searchItemOp(item.key, 'gte')">
(click)="set_search_item(item.key, 'gte')">
&ge;
</ion-button>
<ion-button [color]="searched[item.key].op == 'lte' ? 'primary' : 'light'" size="small"
(click)="set_searchItemOp(item.key, 'lte')">
(click)="set_search_item(item.key, 'lte')">
&le;
</ion-button>
<ion-button [color]="searched[item.key].op == 'null' ? 'primary' : 'light'" size="small"
(click)="set_searchItemOp(item.key, 'null')">
(click)="set_search_item(item.key, 'null')">
&#9723;
</ion-button>
<ion-button [color]="searched[item.key].op == 'nnull' ? 'primary' : 'light'" size="small"
(click)="set_searchItemOp(item.key, 'nnull')">
(click)="set_search_item(item.key, 'nnull')">
&#9724;
</ion-button>
</div>
<div *ngIf="item.value.bsonType=='bool'">
<ion-button [color]="searched[item.key].op == 'true' ? 'primary' : 'light'" size="small"
(click)="set_searchItemOp(item.key, 'true')">
(click)="set_search_item(item.key, 'true')">
{{ 'True' | translate }}
</ion-button>
<ion-button [color]="searched[item.key].op == 'false' ? 'primary' : 'light'" size="small"
(click)="set_searchItemOp(item.key, 'false')">
(click)="set_search_item(item.key, 'false')">
{{ 'False' | translate }}
</ion-button>
</div>
<div>
<ion-input *ngIf="item.value.bsonType!='bool'"
<ion-input #searchfocus *ngIf="item.value.bsonType!='bool'"
[type]="item.value.bsonType!='string' ? item.value.bsonType : 'text'" size="32"
[(ngModel)]="searched[item.key].kw" [ngModelOptions]="{standalone: true}"
class="ion-no-padding search-input" placeholder="{{ 'Search' | translate }}" disabled="false">
Expand All @@ -238,27 +238,27 @@ <h3>{{ subheader | titlecase | translate }}&nbsp;</h3>
</th>
<th *ngIf="id==='_query'">
{{ 'Approved' | translate }}<br />
<ion-text color="primary">{{ '_approved' }}</ion-text>
<ion-button size="small" class="unfiltered-btn">{{'_approved'}}</ion-button>
</th>
<th>
{{ 'Created At' | translate }}<br />
<ion-text color="primary">{{ '_created_at' }}</ion-text>
<ion-button size="small" class="unfiltered-btn">{{'_created_at'}}</ion-button>
</th>
<th>
{{ 'Created By' | translate }}<br />
<ion-text color="primary">{{ '_created_by' }}</ion-text>
<ion-button size="small" class="unfiltered-btn">{{'_created_by'}}</ion-button>
</th>
<th>
{{ 'Modified At' | translate }}<br />
<ion-text color="primary">{{ '_modified_at' }}</ion-text>
<ion-button size="small" class="unfiltered-btn">{{'_modified_at'}}</ion-button>
</th>
<th>
{{ 'Modified By' | translate }}<br />
<ion-text color="primary">{{ '_modified_by' }}</ion-text>
<ion-button size="small" class="unfiltered-btn">{{'_modified_by'}}</ion-button>
</th>
<th>
{{ 'Record ID' | translate }}<br />
<ion-text color="primary">{{ '_id' }}</ion-text>
<ion-button size="small" class="unfiltered-btn">{{'_id'}}</ion-button>
</th>
</tr>
<tr *ngFor="let record of data; let i = index"
Expand Down
22 changes: 13 additions & 9 deletions pwa/src/app/pages/collection/collection.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ For more information on this, and how to apply and follow the GNU AGPL, see
https://www.gnu.org/licenses.
*/

import { Component, OnInit, ViewChild } from "@angular/core";
import { Component, OnInit, ViewChild, ChangeDetectorRef } from "@angular/core";
import { ModalController, AlertController } from "@ionic/angular";
import { Router } from "@angular/router";
import { Storage } from "@ionic/storage";
Expand All @@ -39,7 +39,7 @@ import { Auth } from "../../classes/auth";
import { Miscellaneous } from "../../classes/misc";
import { environment } from "../../../environments/environment";
import { CrudPage } from "../crud/crud.page";
import { JsonEditorOptions, JsonEditorComponent } from "ang-jsoneditor";
import { JsonEditorOptions } from "ang-jsoneditor";

@Component({
selector: "app-collection",
Expand All @@ -48,6 +48,7 @@ import { JsonEditorOptions, JsonEditorComponent } from "ang-jsoneditor";
})

export class CollectionPage implements OnInit {
@ViewChild("searchfocus", { static: false }) searchfocus: any = [];
public jeoptions: JsonEditorOptions = new JsonEditorOptions();
public default_width: number = environment.misc.defaultColumnWidth;
public header: string = "Collections";
Expand Down Expand Up @@ -123,7 +124,8 @@ export class CollectionPage implements OnInit {
private modal: ModalController,
private alert: AlertController,
private router: Router,
public misc: Miscellaneous
public misc: Miscellaneous,
private cd: ChangeDetectorRef
) {
this.crud.views.subscribe((res: any) => {
this.flashcards_ = res ? res.filter((obj: any) => obj.collection === this.id && obj.view.flashcard === true) : [];
Expand Down Expand Up @@ -369,11 +371,13 @@ export class CollectionPage implements OnInit {
this.refresh_data(0);
}

set_search(k: string) {
this.searched[k].setmode = false;
let i = 0;
set_search(k_: string) {
setTimeout(() => {
this.searchfocus?.setFocus();
}, 1000);
this.searched[k_].setmode = false;
for (let key_ in this.structure_.properties) {
this.searched[key_].actived = k === key_ ? true : false;
this.searched[key_].actived = k_ === key_ ? true : false;
}
}

Expand Down Expand Up @@ -484,8 +488,8 @@ export class CollectionPage implements OnInit {
}
}

set_searchItemOp(k: string, op: string) {
this.searched[k].op = op;
set_search_item(key_: string, op: string) {
this.searched[key_].op = op;
}

json_editor_init() {
Expand Down
Loading

0 comments on commit b1d3e1a

Please sign in to comment.