Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Merge pull request #282 from CampusDual/develop
Browse files Browse the repository at this point in the history
menu and routes
  • Loading branch information
juanjo-alvarez authored Jan 20, 2025
2 parents 249ed5d + 490f4ff commit bf6dbb0
Show file tree
Hide file tree
Showing 33 changed files with 503 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
import java.util.List;
import java.util.Map;

/**
* The interface Permissions service.
*/
public interface IPermissionsService {
/**
* Permission query entity result.
*
* @param keyMap the key map
* @param attrList the attr list
* @return the entity result
* @throws OntimizeJEERuntimeException the ontimize jee runtime exception
*/
public EntityResult permissionQuery(Map<String, Object> keyMap, List<String> attrList)
throws OntimizeJEERuntimeException;

public EntityResult permissionQuery(Map<String, Object> keyMap, List<String> attrList) throws OntimizeJEERuntimeException;

public EntityResult menuQuery(Map<String, Object> keyMap, List<String> attrList) throws OntimizeJEERuntimeException;
public EntityResult menuInsert(Map<String, Object> attrMap) throws OntimizeJEERuntimeException;
public EntityResult menuUpdate(Map<String, Object> attrMap, Map<String, Object> keyMap) throws OntimizeJEERuntimeException;
public EntityResult menuDelete(Map<String, Object> keyMap) throws OntimizeJEERuntimeException;

public EntityResult routeQuery(Map<String, Object> keyMap, List<String> attrList) throws OntimizeJEERuntimeException;
public EntityResult routeInsert(Map<String, Object> attrMap) throws OntimizeJEERuntimeException;
public EntityResult routeUpdate(Map<String, Object> attrMap, Map<String, Object> keyMap) throws OntimizeJEERuntimeException;
public EntityResult routeDelete(Map<String, Object> keyMap) throws OntimizeJEERuntimeException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { Routes, RouterModule } from '@angular/router';

const routes: Routes = [
{ path: 'roles', loadChildren: () => import('./roles/roles.module').then(m => m.RolesModule) },
{ path: 'users', loadChildren: () => import('./users/users.module').then(m => m.UsersModule) }
{ path: 'users', loadChildren: () => import('./users/users.module').then(m => m.UsersModule) },
{ path: 'routes', loadChildren: () => import('./routes/routes.module').then(m => m.RoutesModule) },
{ path: 'menus', loadChildren: () => import('./menu/menu.module').then(m => m.MenuModule) }
];

@NgModule({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.adminform {
display: grid;
gap: 50px;
width: 100%;
margin-top: 40px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<o-form #formmenu service="contentpermissions" entity="menu" editable-detail="yes" show-header="no" confirm-exit="false"
undo-button="false" label-header-align="center" keys="id">
<o-text-input attr="id" sql-type="INTEGER" enabled="no" hidden="true"> </o-text-input>
<div class="adminform">
<div class="rol">
<label for="rol">{{'ROL*' | oTranslate}}</label>
<o-combo attr="id_rolename" label="ROL" required="yes" translate="yes" null-selection="false"
read-only="false" service="users" entity="role" keys="rol_id" columns="rol_id;rol_name;rol_notes"
value-column="rol_id" description-columns="rol_name;rol_notes" query-on-init="true">
</o-combo>
</div>
<div class="attr">
<label for="attr">{{'ATTR*'| oTranslate}}</label>
<o-text-input type="text" attr="attr" required="yes" max-length="250"></o-text-input>
</div>
<div class="visible">
<o-slide-toggle attr="visible" label="{{'VISIBLE' | oTranslate}}" read-only="no"
tooltip="{{'POPUP_VISIBLE' | oTranslate}}"></o-slide-toggle>
</div>
<div class="enabled">
<o-slide-toggle attr="enabled" label="{{'enabled' | oTranslate}}" read-only="no"
tooltip="{{'POPUP_ENABLED' | oTranslate}}"></o-slide-toggle>
</div>
<div fxLayout="row" fxLayoutGap="16px" fxLayoutWrap style="margin-top: 10px;">
<o-button attr="editbutton" id="edit" type="RAISED" label="Save" color="primary"
(onClick)="updateMenu()"></o-button>
</div>
</div>
</o-form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, ViewChild } from '@angular/core';
import { OFormComponent } from 'ontimize-web-ngx';

@Component({
selector: 'app-menu-edit',
templateUrl: './menu-edit.component.html',
styleUrls: ['./menu-edit.component.css']
})
export class MenuEditComponent {
@ViewChild('formmenu') formenu:OFormComponent;
updateMenu(){
this.formenu.update();
this.formenu.closeDetail();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.adminform {
display: grid;
gap: 50px;
width: 100%;
margin-top: 40px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<o-form #formenu service="contentpermissions" entity="menu" editable-detail="yes" show-header="no" confirm-exit="false"
undo-button="false" label-header-align="center" keys="id">
<div class="adminform">
<div class="rol">
<label for="rol">{{'ROL*' | oTranslate}}</label>
<o-combo attr="id_rolename" label="ROL*" required="yes" translate="yes" null-selection="false"
read-only="false" service="users" entity="role" keys="rol_id" columns="rol_id;rol_name;rol_notes"
value-column="rol_id" description-columns="rol_name;rol_notes" query-on-init="true">
</o-combo>
</div>
<div class="attr">
<label for="attr">{{'ATTR*'| oTranslate}}</label>
<o-text-input type="text" attr="attr" required="yes" max-length="250"></o-text-input>
</div>
<div class="visible">
<o-slide-toggle attr="visible" label="{{'VISIBLE' | oTranslate}}" read-only="no"
tooltip="{{'POPUP_VISIBLE' | oTranslate}}"></o-slide-toggle>
</div>
<div class="enabled">
<o-slide-toggle attr="enabled" label="{{'enabled' | oTranslate}}" read-only="no"
tooltip="{{'POPUP_ENABLED' | oTranslate}}"></o-slide-toggle>
</div>
<div fxLayout="row" fxLayoutGap="16px" fxLayoutWrap style="margin-top: 10px;">
<o-button attr="editbutton" id="edit" type="RAISED" label="Save" color="primary"
(onClick)="insertMenu()"></o-button>
</div>
</div>
</o-form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, ViewChild } from '@angular/core';
import { OFormComponent } from 'ontimize-web-ngx';

@Component({
selector: 'app-menu-new',
templateUrl: './menu-new.component.html',
styleUrls: ['./menu-new.component.css']
})
export class MenuNewComponent {
@ViewChild('formenu') formenu:OFormComponent;
insertMenu(){
this.formenu.insert();
this.formenu.closeDetail();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MenuhomeComponent } from './menuhome/menuhome.component';
import { MenuNewComponent } from './menu-new/menu-new.component';
import { MenuEditComponent } from './menu-edit/menu-edit.component';

const routes: Routes = [
{ path: '', component: MenuhomeComponent },
{ path: 'new', component: MenuNewComponent },
{ path: ':id', component: MenuEditComponent }
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class MenuRoutingModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { MenuRoutingModule } from './menu-routing.module';
import { MenuhomeComponent } from './menuhome/menuhome.component';
import { SharedModule } from 'src/app/shared/shared.module';
import { OntimizeWebModule } from 'ontimize-web-ngx';
import { MenuEditComponent } from './menu-edit/menu-edit.component';
import { MenuNewComponent } from './menu-new/menu-new.component';


@NgModule({
declarations: [
MenuhomeComponent,
MenuEditComponent,
MenuNewComponent
],
imports: [
CommonModule,
SharedModule,
OntimizeWebModule,
MenuRoutingModule
]
})
export class MenuModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<o-form-layout-manager mode="dialog" store-state="no" title="Menus" label-columns="attr" attr="o-form-layout-menus-home"
title-data-origin="menus_form_edit" fxFill>
<o-form-layout-dialog-options height="70%" width="60%"></o-form-layout-dialog-options>
<o-form show-header="no" query-on-init="no" fxFill>
<o-table attr="menus" service="contentpermissions" entity="menu" keys="id"
columns="id;attr;visible;enabled;id_rolename;rol_name"
visible-columns="attr;visible;enabled;rol_name"
sort-columns="attr" query-on-init="yes"
insert-button="yes" delete-button="yes" refresh-button="no"
select-all-checkbox-visible="yes" fixed-header="yes" query-rows="25" class="home-table" fxFlex export-mode="local">
<o-table-column attr="visible" title="visible" type="boolean"
render-true-value="check_circle" render-false-value="block" render-type="icon" boolean-type="boolean"></o-table-column>
<o-table-column attr="enabled" title="enabled" type="boolean"
render-true-value="check_circle" render-false-value="block" render-type="icon" boolean-type="boolean"></o-table-column>
</o-table>
</o-form>
</o-form-layout-manager>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-menuhome',
templateUrl: './menuhome.component.html',
styleUrls: ['./menuhome.component.css']
})
export class MenuhomeComponent {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.adminform {
display: grid;
gap: 50px;
width: 100%;
margin-top: 40px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<o-form #formroute service="contentpermissions" entity="route" editable-detail="yes" show-header="no"
confirm-exit="false" undo-button="false" label-header-align="center" keys="id">
<o-text-input attr="id" sql-type="INTEGER" enabled="no" hidden="true"> </o-text-input>
<div class="adminform">
<div class="rol">
<label for="rol">{{'ROL' | oTranslate}}</label>
<o-combo attr="id_rolename" label="ROL*" required="yes" translate="yes" null-selection="false"
read-only="false" service="users" entity="role" keys="rol_id" columns="rol_id;rol_name;rol_notes"
value-column="rol_id" description-columns="rol_name;rol_notes" query-on-init="true">
</o-combo>
</div>
<div class="permissionid">
<label for="permissionid">{{'PERMISSIONID*'| oTranslate}}</label>
<o-text-input type="text" attr="permissionid" required="yes" max-length="250"></o-text-input>
</div>
<div class="enabled">
<o-slide-toggle attr="enabled" label="{{'enabled' | oTranslate}}" read-only="no"
tooltip="{{'POPUP_ENABLED' | oTranslate}}"></o-slide-toggle>
</div>
<div fxLayout="row" fxLayoutGap="16px" fxLayoutWrap style="margin-top: 10px;">
<o-button attr="editbutton" id="edit" type="RAISED" label="Save" color="primary"
(onClick)="updateRoute()"></o-button>
</div>
</div>
</o-form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, ViewChild } from '@angular/core';
import { OFormComponent } from 'ontimize-web-ngx';

@Component({
selector: 'app-routes-edit',
templateUrl: './routes-edit.component.html',
styleUrls: ['./routes-edit.component.css']
})
export class RoutesEditComponent {
@ViewChild('formroute') formroute:OFormComponent;
updateRoute(){
this.formroute.update();
this.formroute.closeDetail();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.adminform {
display: grid;
gap: 50px;
width: 100%;
margin-top: 40px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<o-form #formroute service="contentpermissions" entity="route" editable-detail="yes" show-header="no"
confirm-exit="false" undo-button="false" label-header-align="center" keys="id">
<div class="adminform">
<div class="rol">
<label for="rol">{{'ROL*' | oTranslate}}</label>
<o-combo attr="id_rolename" label="ROL" required="yes" translate="yes" null-selection="false"
read-only="false" service="users" entity="role" keys="rol_id" columns="rol_id;rol_name;rol_notes"
value-column="rol_id" description-columns="rol_name;rol_notes" query-on-init="true">
</o-combo>
</div>
<div class="permissionid">
<label for="permissionid">{{'PERMISSIONID*'| oTranslate}}</label>
<o-text-input type="text" attr="permissionid" required="yes" max-length="250"></o-text-input>
</div>
<div class="enabled">
<o-slide-toggle attr="enabled" label="{{'enabled' | oTranslate}}" read-only="no"
tooltip="{{'POPUP_ENABLED' | oTranslate}}"></o-slide-toggle>
</div>
<div fxLayout="row" fxLayoutGap="16px" fxLayoutWrap style="margin-top: 10px;">
<o-button attr="editbutton" id="edit" type="RAISED" label="Save" color="primary"
(onClick)="insertRoute()"></o-button>
</div>
</div>
</o-form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, ViewChild } from '@angular/core';
import { OFormComponent } from 'ontimize-web-ngx';

@Component({
selector: 'app-routes-new',
templateUrl: './routes-new.component.html',
styleUrls: ['./routes-new.component.css']
})
export class RoutesNewComponent {
@ViewChild('formroute') formroute:OFormComponent;
insertRoute(){
this.formroute.insert();
this.formroute.closeDetail();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { RouteshomeComponent } from './routeshome/routeshome.component';
import { RoutesNewComponent } from './routes-new/routes-new.component';
import { RoutesEditComponent } from './routes-edit/routes-edit.component';

const routes: Routes = [
{ path: '', component: RouteshomeComponent },
{ path: 'new', component: RoutesNewComponent },
{ path: ':id', component: RoutesEditComponent }
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class RoutesRoutingModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { RoutesRoutingModule } from './routes-routing.module';
import { RouteshomeComponent } from './routeshome/routeshome.component';
import { SharedModule } from 'src/app/shared/shared.module';
import { OntimizeWebModule } from 'ontimize-web-ngx';
import { RoutesEditComponent } from './routes-edit/routes-edit.component';
import { RoutesNewComponent } from './routes-new/routes-new.component';


@NgModule({
declarations: [
RouteshomeComponent,
RoutesEditComponent,
RoutesNewComponent
],
imports: [
CommonModule,
SharedModule,
OntimizeWebModule,
RoutesRoutingModule
]
})
export class RoutesModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<o-form-layout-manager mode="dialog" store-state="no" title="Routes" label-columns="permissionid" attr="o-form-layout-routes-home"
title-data-origin="routes_form_edit" fxFill>
<o-form-layout-dialog-options height="60%" width="60%"></o-form-layout-dialog-options>
<o-form show-header="no" query-on-init="no" fxFill>
<o-table attr="routes" service="contentpermissions" entity="route" keys="id"
columns="id;permissionid;enabled;id_rolename;rol_name"
visible-columns="permissionid;enabled;rol_name"
sort-columns="permissionid" query-on-init="yes"
insert-button="yes" delete-button="yes" refresh-button="no"
select-all-checkbox-visible="yes" fixed-header="yes" query-rows="25" class="home-table" fxFlex export-mode="local">
<o-table-column attr="enabled" title="enabled" type="boolean"
render-true-value="check_circle" render-false-value="block" render-type="icon" boolean-type="boolean"></o-table-column>
</o-table>
</o-form>
</o-form-layout-manager>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-routeshome',
templateUrl: './routeshome.component.html',
styleUrls: ['./routeshome.component.css']
})
export class RouteshomeComponent {

}
Loading

0 comments on commit bf6dbb0

Please sign in to comment.