Skip to content

Commit

Permalink
Updated api and locals
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafamat committed Oct 23, 2023
1 parent bf20c83 commit 68612e4
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 34 deletions.
18 changes: 9 additions & 9 deletions _templates/delivery.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"description": "Account Name",
"minLength": 1,
"maxLength": 128,
"permanent": true
"readonly": true
},
"dnn_odi_no": {
"bsonType": "string",
Expand All @@ -68,7 +68,7 @@
"minLength": 1,
"maxLength": 20,
"caseType": "uppercase",
"permanent": true
"readonly": true
},
"dnn_odi_sub_no": {
"bsonType": "string",
Expand All @@ -78,15 +78,15 @@
"minLength": 1,
"maxLength": 20,
"caseType": "uppercase",
"permanent": true
"readonly": true
},
"dnn_man_no": {
"bsonType": "string",
"title": "Manifest No",
"description": "Manifest number",
"minLength": 1,
"maxLength": 32,
"permanent": true
"readonly": true
},
"dnn_ship_type": {
"bsonType": "string",
Expand Down Expand Up @@ -264,7 +264,7 @@
"minLength": 0,
"maxLength": 16,
"pattern": "^[A-Za-z-]{0,16}$",
"permanent": true,
"readonly": true,
"enum": ["OK", "OK-Labeled", "OK-Skipped"]
},
"dnn_wayb_id": {
Expand Down Expand Up @@ -420,12 +420,12 @@
{
"key": "man_odi_no",
"op": "eq",
"value": "dnn_odi_no"
"value": "176-89477080"
},
{
"key": "man_odi_sub_no",
"op": "eq",
"value": "dnn_odi_sub_no"
"value": "B293242"
}
],
"get": ["man_no", "man_opening_date"],
Expand Down Expand Up @@ -574,7 +574,7 @@
},
{
"id": "shiptype",
"title": "Shipment Type",
"title": "Ship Type",
"enabled": true,
"match": [
{
Expand All @@ -590,7 +590,7 @@
}
],
"one_click": true,
"icon": "boat-outline",
"icon": "boat",
"uniqueness": false,
"unique": [],
"_tags": ["#Managers", "#Administrators", "#Logistics", "#Operations", "#Touchpoint", "#Technoplatz"]
Expand Down
6 changes: 5 additions & 1 deletion backend/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2675,6 +2675,7 @@ def savequery_f(self, obj_):
query_ = Mongo().db_["_query"].find_one({"que_id": que_id_})
if not query_:
raise APIError("query not found")
que_type_ = query_["que_type"] if "que_type" in query_ else "query"

que_collection_id_ = query_["que_collection_id"] if "que_collection_id" in query_ and query_["que_collection_id"] is not None else None
if not que_collection_id_:
Expand All @@ -2689,7 +2690,10 @@ def savequery_f(self, obj_):
raise AuthError("user not found")
usr_tags_ = user_["_tags"] if "_tags" in user_ and len(user_["_tags"]) > 0 else []

if not (Auth().is_manager_f(user_) or Auth().is_admin_f(user_)):
if not Auth().is_admin_f(user_) and que_type_ != "query":
raise AuthError("no permission to save job")

if not Auth().is_manager_f(user_):
permission_ = Mongo().db_["_permission"].find_one({"per_collection_id": que_collection_id_, "per_is_active": True, "per_tag": {"$in": usr_tags_}, "per_query": True})
if not permission_:
raise AuthError("no permission to save query")
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.4.9",
"version": "4.5.1",
"author": "Mustafa Mat, Technoplatz IT Solutions GmbH",
"homepage": "https://bi.technoplatz.com",
"scripts": {
Expand Down
11 changes: 6 additions & 5 deletions pwa/src/app/pages/collection/collection.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h3>{{ subheader | titlecase | translate }}&nbsp;</h3>
{{ 'Please Wait' | translate }}
</div>
<div *ngIf="filter_ && filter_.length>0" (click)="doClearFilter()" class="data-sq-button">
<ion-icon name="close-circle-sharp"></ion-icon>
<ion-icon name="close"></ion-icon>
<br />
<span>{{ 'Clear Filter' | translate }}</span>
</div>
Expand Down Expand Up @@ -99,14 +99,15 @@ <h3>{{ subheader | titlecase | translate }}&nbsp;</h3>
<ion-row>
<ion-col size="12">
<ion-button *ngIf="!is_saving" (click)="save_json_f()">
<span>{{ 'Save Schema' | translate }}</span>
<ion-icon name="save-outline"></ion-icon>
<span>{{ 'Save' | translate }}</span>
</ion-button>
<ion-button *ngIf="is_saving">
<ion-spinner name="dots"></ion-spinner>&nbsp;
<span>{{ 'Saving' | translate }}</span>
</ion-button>
<ion-button color="light" (click)="set_editor(false)">
<ion-icon name="close-circle-sharp"></ion-icon>
<ion-button (click)="set_editor(false)" color="medium">
<ion-icon name="close"></ion-icon>
{{ 'Close' | translate }}
</ion-button>
</ion-col>
Expand Down Expand Up @@ -229,7 +230,7 @@ <h3>{{ subheader | titlecase | translate }}&nbsp;</h3>
<ion-icon name="search"></ion-icon>
{{ 'Search' | translate }}
</ion-button>
<ion-button color="light" size="small" (click)="doResetSearchItem(item.key)">
<ion-button size="small" (click)="doResetSearchItem(item.key)" color="medium">
<ion-icon name="close"></ion-icon>
{{ 'Cancel' | translate }}
</ion-button>
Expand Down
12 changes: 6 additions & 6 deletions pwa/src/app/pages/crud/crud.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{{ 'Upload' | translate }}
</ion-button>
<ion-button (click)="doDismissModal({ modified: false, filter: [] })" color="medium">
<ion-icon name="close-circle-sharp"></ion-icon>
<ion-icon name="close"></ion-icon>
{{ 'Cancel' |
translate }} </ion-button>
<ion-button *ngIf="op=='update' && user?.perma" color="danger" (click)="doRemove()"
Expand All @@ -75,7 +75,7 @@
<ion-col size="12">
<ion-button> {{ 'Confirm' | translate }} </ion-button>
<ion-button (click)="goTab('data')" color="medium">
<ion-icon name="arrow-back-circle-sharp"></ion-icon>
<ion-icon name="arrow-back"></ion-icon>
{{ 'Back' | translate }} </ion-button>
</ion-col>
</ion-row>
Expand All @@ -88,7 +88,7 @@
</ng-template>
</ion-button>
<ion-button (click)="goTab('data')" color="medium">
<ion-icon name="arrow-back-circle-sharp"></ion-icon>
<ion-icon name="arrow-back"></ion-icon>
{{ 'Back' | translate }} </ion-button>
</ion-col>
</ion-row>
Expand Down Expand Up @@ -187,7 +187,7 @@ <h5>{{ 'Please click RUN button' | translate }}.</h5>
<div class="ion-margin-top full-flex ion-margin-bottom">
<ion-button *ngFor="let item of links" (click)="doGoLink(item)" color="dark" size="default"
slot="end">
<ion-icon name="link-sharp"></ion-icon> {{ item.btntext ? item.btntext :
<ion-icon name="attach-sharp"></ion-icon> {{ item.btntext ? item.btntext :
item.collection | translate }}
</ion-button>
</div>
Expand Down Expand Up @@ -288,8 +288,8 @@ <h5>{{ 'Please click RUN button' | translate }}.</h5>
</ion-modal>
<ion-button *ngIf="op=='insert' || (!field.readonly && !field.disabled)"
(click)="doCancelDate(field.name)" fill="clear"
class="ion-no-padding datetime-clear-button" size="default">
<ion-icon name="close-sharp"></ion-icon>
class="ion-no-padding datetime-clear-button" size="default" color="medium">
<ion-icon name="close"></ion-icon>
</ion-button>
</div>
<ng-template #nodatevalue>
Expand Down
8 changes: 5 additions & 3 deletions pwa/src/app/pages/query/query.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,17 @@ <h3>{{ subheader }}</h3>
<ion-row>
<ion-col size="12">
<ion-button (click)="save_json_f(false)">
<span *ngIf="!_saving">{{ 'Save Query' | translate }}</span>
<ion-icon name="save-outline"></ion-icon>
<span *ngIf="!_saving">{{ 'Save' | translate }}</span>
<span *ngIf="_saving">{{ 'In Progress' | translate }}...</span>
</ion-button>
<ion-button *ngIf="perma_" (click)="save_json_f(true)">
<ion-icon name="checkmark-circle-outline"></ion-icon>
<span *ngIf="!_saving">{{ 'Approve' | translate }} & {{ 'Save' | translate }}</span>
<span *ngIf="_saving">{{ 'In Progress' | translate }}...</span>
</ion-button>
<ion-button color="light" (click)="set_editor(false)">
<ion-icon name="close-circle-sharp"></ion-icon>
<ion-button (click)="set_editor(false)" color="medium">
<ion-icon name="close"></ion-icon>
{{ 'Close' | translate }}
</ion-button>
</ion-col>
Expand Down
4 changes: 2 additions & 2 deletions pwa/src/app/pages/query/query.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ export class QueryPage implements OnInit {
}
if (res.err) {
this.misc.doMessage(res.err, "error");
} else {
this.type_ !== "query" ? this.misc.doMessage(`${res.count > 0 ? res.count : 'no'} records affected`, "success") : null;
reject();
}
}).catch((res: any) => {
this.misc.doMessage(res, "error");
reject();
}).finally(() => {
this.running_ = false;
});
Expand Down
2 changes: 1 addition & 1 deletion pwa/src/assets/css/shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ ion-note {
.linked-data {
margin-top: 16px;
font-family: consolas, monospace, menlo, monaco, Ubuntu Mono;
font-size: 14px;
font-size: 13px;
border-top: 1px solid var(--ion-color-light);
}

Expand Down
7 changes: 4 additions & 3 deletions pwa/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"50-OnTheTouchpoint": "50-aufDepode",
"60-ReadyToBeDelivered": "60-BereitZuLiefern",
"70-Delivered": "70-Zustellbar",
"ACCOUNT": "BENUTZERKONTO",
"ACCOUNT": "KONTO",
"ADMINISTRATION": "ADMINISTRATION",
"ANNOUNCEMENTS": "ANKÜNDIGUNGEN",
"API-Tokens": "API-Schlüssel",
"Account": "Benutzerkonto",
"Account": "Konto",
"Account Settings": "Kontoeinstellungen",
"Accounts": "Konten",
"Administration": "Verwaltung",
Expand Down Expand Up @@ -63,6 +63,7 @@
"Don't have an account?": "Noch kein Konto?",
"Download": "Herunterladen",
"E-Mail": "E-Mail",
"E-Waybill": "E-Frachtbrief",
"Edit Aggregation": "Abfrage bearbeiten",
"Edit Query": "Abfrage bearbeiten",
"Edit Schema": "Schema bearbeiten",
Expand Down Expand Up @@ -197,4 +198,4 @@
"records are displayed": "Datensatz wird angezeigt",
"records were filtered": "Datensätze wurden gefiltert",
"test": "Test"
}
}
7 changes: 4 additions & 3 deletions pwa/src/assets/i18n/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"50-OnTheTouchpoint": "50-Depoda",
"60-ReadyToBeDelivered": "60-TeslimeHazır",
"70-Delivered": "70-SevkEdildi",
"ACCOUNT": "KULLANICI HESABI",
"ACCOUNT": "HESAP",
"ADMINISTRATION": "YÖNETİM",
"ANNOUNCEMENTS": "DUYURULAR",
"API Tokens": "API Anahtarları",
"Account": "Kullanıcı Hesabı",
"Account": "Hesap",
"Account Settings": "Hesap Ayarları",
"Accounts": "Hesaplar",
"Administration": "Yönetim",
Expand Down Expand Up @@ -62,6 +62,7 @@
"Disabled": "Pasif",
"Don't have an account?": "Hesabın yok mu?",
"Download": "İndir",
"E-Waybill": "E-İrsaliye",
"E-mail": "E-Posta",
"Edit Aggregation": "Sorguyu Düzenle",
"Edit Query": "Sorguyu Düzenle",
Expand Down Expand Up @@ -197,4 +198,4 @@
"records are displayed": "kayıt gösterilmektedir",
"records were filtered": "kayıt filtrelendi",
"test": "Test"
}
}

0 comments on commit 68612e4

Please sign in to comment.